OpenGL stopped working in my application today
I updated my drivers from ATI yesterday. And my windows-application won't show any graphic anymore.
I downloaded a NeHe demo, and it works fine. Although I cannot see the difference to my program.
Calls to wglCreateContext and wglMakeCurrent works fine. And glGetError returns 0 on every call. The pixelformat is set without problems.
How can I debug my program? All seems fine, but nothing works. WM_PAINT messages are received, so the graphics _should_ show up...
I understand that this might be a complex problem. But the code has worked for months, and I checked it with SourceSafe and I didn't change any code after the driverupdate.
Therefore there must be a bug in my program, but I just can't find it.
Any ideas of where to start looking for the bug?
Post the code for the initialization of OpenGL in your window as well as your render function. Are you calling SwapBuffers at the end of each frame ?
Pixelformat:
sizeof(PIXELFORMATDESCRIPTOR),
1,
PFD_DOUBLEBUFFER | PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW | PFD_DRAW_TO_BITMAP,
PFD_TYPE_RGBA,
32,
8,
16,
8,
8,
8,
0,
0,
0,
64,
16,
16,
16,
16,
32,
8,
0,
0,
0,
0,
0,
0 };
Before render:
wglMakeCurrent(m_hdc, m_hGLContext )
glLoadIdentity();
glViewport(0,0, 300, 300 );
glOrtho(0, 300, 0, 300, 1.0, -1.0);
Render:
I'm just trying to draw a line...
glBegin(GL_LINES);
glVertex2d(0, 0);
glVertex2d(100, 1000);
glEnd();
After render:
glFlush();
glFinish();
::SwapBuffers(m_hdc);
Anything else?
I noticed that you are using PFD_DRAW_TO_BITMAP AND PFD_DRAW_TO_WINDOW. I do not think that will work correctly. I looked it up in NeHe's code and he has this:
So try only using the PFD_DRAW_TO_WINDOW and see if that works correctly.
- Drew
static PIXELFORMATDESCRIPTOR pfd= // pfd Tells Windows How We Want Things To Be { sizeof(PIXELFORMATDESCRIPTOR), // Size Of This Pixel Format Descriptor 1, // Version Number PFD_DRAW_TO_WINDOW | // Format Must Support Window PFD_SUPPORT_OPENGL | // Format Must Support OpenGL PFD_DOUBLEBUFFER, // Must Support Double Buffering PFD_TYPE_RGBA, // Request An RGBA Format bits, // Select Our Color Depth 0, 0, 0, 0, 0, 0, // Color Bits Ignored 0, // No Alpha Buffer 0, // Shift Bit Ignored 0, // No Accumulation Buffer 0, 0, 0, 0, // Accumulation Bits Ignored 16, // 16Bit Z-Buffer (Depth Buffer) 0, // No Stencil Buffer 0, // No Auxiliary Buffer PFD_MAIN_PLANE, // Main Drawing Layer 0, // Reserved 0, 0, 0 // Layer Masks Ignored };
So try only using the PFD_DRAW_TO_WINDOW and see if that works correctly.
- Drew
Quote:Original post by oconnellseanm
That's your entire code for OpenGL Initialization ?
I'm not following. Is more code required?
Quote:Original post by Drew_Benton
I noticed that you are using PFD_DRAW_TO_BITMAP AND PFD_DRAW_TO_WINDOW. I do not think that will work correctly. I looked it up in NeHe's code and he has this:
*** Source Snippet Removed ***
So try only using the PFD_DRAW_TO_WINDOW and see if that works correctly.
- Drew
No, it didn't change anything.
Maybe calling glClear or something like that helps? Setting the color to glClearColor( 0,0,0,0 ) and then calling the clear each frame, just after the wglSetCurrent call.
Quote:Original post by jeroenb
Maybe calling glClear or something like that helps? Setting the color to glClearColor( 0,0,0,0 ) and then calling the clear each frame, just after the wglSetCurrent call.
No, still nothing. And glGetError only reports 0.
paste your full source code with [_source_] [_/source_] tags (without underscores)
try setting clear color to red, is your screen red then? If so its a drawing problem
hope that helps
-Dan
try setting clear color to red, is your screen red then? If so its a drawing problem
hope that helps
-Dan
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement