[英]Qt and GLEW: The program exited with code -1073741515
I an working with Qt and I am trying to switch from OpenGL 1.0 to a newer OpenGL by using GLEW. 我在Qt上工作,并且尝试使用GLEW从OpenGL 1.0切换到较新的OpenGL。 I have a GUi which uses a subclass of QGLWidget to process OpenGL stuff. 我有一个使用QGLWidget的子类来处理OpenGL东西的GUi。 At the beginning of initializeGL
I do the statement GLenum err = glewInit();
在initializeGL
的开头,我执行语句GLenum err = glewInit();
and this causes the following: 这会导致以下情况:
program.exe exited with code -1073741515
Some more details: libs: 更多详细信息:libs:
LIBS += -L"C:/Program Files/Microsoft SDKs/Kinect/v1.7/lib/amd64/" -lKinect10
LIBS += -lOpenGL32
LIBS += -lglew32
LIBS += -lglu32
Headers: 标头:
#include <windows.h>
#include <gl/glew.h>
#include <QByteArray>
#include <QGLWidget>
#include <memory>
#include <algorithm>
Full initializeGL() function: 完整的initializeGL()函数:
void OpenGLWidget::initializeGL(){
GLenum err = glewInit();
if (GLEW_OK != err)
{
/* Problem: glewInit failed, something is seriously wrong. */
}
glEnable(GL_TEXTURE_2D); //Enables the drawing of 2D textures
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width(), height(), 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, (GLvoid*) NULL);
glBindTexture(GL_TEXTURE_2D, textureId); //Binds the GL_TEXTURE_2D to the textureId
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width(), height(), 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, (GLvoid*) blackScreen); //Strart the program off with a black screen
glBindTexture(GL_TEXTURE_2D, textureId); //Binds the GL_TEXTURE_2D to the textureId
glClearColor(0,0,0,0);
glClearDepth(1.0f);
}
What am I doing wrong? 我究竟做错了什么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.