简体   繁体   English

使用Qt5加载OpenGL扩展

[英]Loading OpenGL extensions with Qt5

I've followed this article on using OpenGL extensions in Qt5 ( reference ) and following the example code, I get the following error messages: undefined reference to 我已经关注了这篇关于在Qt5中使用OpenGL扩展的文章( 参考 ),并按照示例代码进行操作,我收到以下错误消息:undefined reference to

QOpenGLExtension_ARB_instanced_arrays::QOpenGLExtension_ARB_instanced_arrays()'
undefined reference to `QOpenGLExtension_ARB_instanced_arrays::initializeOpenGLFunctions()'

I've made sure that I have said extension through m_context->hasExtension(..) 我已经确保通过m_context-> hasExtension(..)说了扩展名

Here's my code block (very similar to the article code): 这是我的代码块(与文章代码非常相似):

assert(m_context->hasExtension(QByteArrayLiteral("GL_ARB_instanced_arrays")));
QOpenGLExtension_ARB_instanced_arrays* m_instanceFuncs = new QOpenGLExtension_ARB_instanced_arrays();
m_instanceFuncs->initializeOpenGLFunctions();
qDebug("extension loaded");

I'd assume the article would have mentioned other necessary steps.. I'm using Qt 5.3 on Windows 7 with a 4.3 Core context. 我以为这篇文章会提到其他必要的步骤。我正在Windows 7上使用Qt 5.3并具有4.3核心上下文。

QOpenGLExtensions驻留在opengl之外的另一个子模块中,因此我必须在pro文件中启用它,如下所示:

QT += openglextensions

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM