Hi, I'm in the process of making an editor for an engine I'm working on. Just a learning experience really.
Anyway, my call to glewInit() fails.
Here is the relevant code...
class Renderer : public QGLWidget
{
public:
Renderer();
void addMeshNode(MeshNode *aMeshNode);
void setCamera(Camera *aCamera);
void initializeGL();
void resizeGL(int aWidth, int aHeight);
void paintGL();
private:
std::vector<MeshNode *> fMeshNodes;
Camera *fCamera;
int fWidth;
int fHeight;
};
void Renderer::initializeGL()
{
std::cout << this << " Renderer::initializeGL()\n";
GLenum err = glewInit();
if (GLEW_OK != err)
{
std::cout << "error: glewInit() failed\n";
}
glShadeModel(GL_SMOOTH);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
}
I thought the only way it would fail, was if the OpenGL context hadn't been created yet, but I'm calling it after my QGLWidget has been created.
Any help would be appreciated, I couldn't get glee to work either.
I'm on Linux, using the latest QT Creator.
Thanks in advance
[Edited by - bensmith87 on July 21, 2009 5:36:50 PM]