PDA

View Full Version : Error on 3.2 or newer context.



Zyx_2000
10-21-2010, 06:08 AM
I have a problem using GLFW and GLEW. When I ask for a 3.3 or 3.2 context, I get an GL_INVALID_ENUM error after calling glewInit(). However when I ask for a 3.1 or 3.0 context I don't get any error. I am using the latest version of GLEW, and the latest catalyst drivers.
int main() {
int err;

if (glfwInit() != GL_TRUE) {
glfwTerminate();
return 1;
}

glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 3);


if (glfwOpenWindow(640, 480, 8, 8, 8, 0, 0, 0, GLFW_WINDOW) != GL_TRUE) {
glfwTerminate();
return 1;
}

err = glewInit();
if (GLEW_OK != err)
{
glfwTerminate();
return 1;
}

err = glGetError(); // Here I get GL_INVALID_ENUM

// Output some info to console
std::cout << glGetString(GL_VERSION);
err = glGetError();

Zyx_2000
10-23-2010, 09:45 AM
I found the cause of the problem. GLEW was calling glGetString() with GL_EXTENTIONS as argument, which is deprecated. I replaced those calls, and the error message went away.

Avithohol
11-07-2010, 03:50 AM
Thanks for revealing the solution for your own issue :)
I do also use GLFW (gl 2.1 context yet) but i manage the extensions with my own extension library.

cheers