Hi guys,
actually i try to get an OpenGL 3+ context to work. I ve downloaded the tutorials from swiftless and compiled them. Compilation worked fine but all i got to see is a white screen. I figured out, that it seems to be a problem with the creation of the new context:
The following Code is from swiftless. I didn't change anything, just deleted the comments in this post:
int attributes[] = {
WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
WGL_CONTEXT_MINOR_VERSION_ARB, 2,
WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
0
};
if (wglewIsSupported("WGL_ARB_create_context") == 1) {
hrc = wglCreateContextAttribsARB(hdc, NULL, attributes);
wglMakeCurrent(NULL, NULL);
wglDeleteContext(tempOpenGLContext);
wglMakeCurrent(hdc, hrc);
}
else {
hrc = tempOpenGLContext;
}
const GLubyte *glVersionString = glGetString(GL_VERSION);
int glVersion[2] = {-1, -1};
glGetIntegerv(GL_MAJOR_VERSION, &glVersion[0]);
glGetIntegerv(GL_MINOR_VERSION, &glVersion[1]);
If I set a holding point in Visual Studio10 I can read the version Numbers contained in glVersion. It says -1,-1. I guess that means the context creation has failed, but why? I also get the Version Number of the temporary context. Its 3.0. I exspected 2.0. If I am using the temporary context, everything works fine, i can render objects the old way, but the new context shows just a blank white screen. When resizing the window to a larger size, the new areas are black, the old still white.
I ve Got a Nvidea GeForce 540M. Actual drivers are installed. As mentioned I am using VS2010 with GLEW 1.9.
Hope you can help me getting this to work.
Der Troll
PS: Sorry for my bad english...