Qt & OpenGL OS X: GLSL shader version only 120 on Mountain Lion

无人久伴 提交于 2019-12-06 13:35:27

So:

QGLFormat glFormat;
glFormat.setVersion(3, 2);
glFormat.setProfile(QGLFormat::CoreProfile);

// Set the default GL format to OpenGL 3.2 Core
QGLFormat::setDefaultFormat(glFormat);

That's what's needed for it to work, which is helpfully not obvious in the documentation. That'll give you 150. If you changed the glFormat.setVersion(3, 2) to 3, 3 it seems to give version 330 but I have no idea how reliable this will be until I've done some more work.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!