Suddenly my OpenGL has stopped rendering...I cant figure out why.. :confused:
I have included the 3 files im using..
Printable View
Suddenly my OpenGL has stopped rendering...I cant figure out why.. :confused:
I have included the 3 files im using..
Which line does it fail on?
(use a debugger and watch the app run or add a messageboxes to tell you where the app is up to)
Debugging is a skill you need to develop.
If using MSVC then click the cursor on the first line of your WM_CREATE and press F9. A dot (red) should appear before the line (a break point). Run and the app should pause at this line. You can then press F10 to move one line at a time.
When using InvalidateRect it is a good idea to follow with UpdateWindow(). This bypasses the OS message que and posts the paint message directly to your message loop.
The code as posted is very hard to read due to lack of formatting. IMHO this will reduce your chance of getting much more help.
Can you attach a zip with the files in it?
I dont think I can use a debugger in this case.
This isnt a syntax error, and OpenGL doesent FAIL at some point...
It is a logical failure, that I think only can be discoverd by going thorugh the whole code.
I havent found it yet though... Maybe I have forgotten a OpenGL command or something.
I solved the problem...finally... After scanning my Initializing code for the 6th time. :D
xSize=LOWORD(lParam);
ySize=HIWORD(lParam);
glViewport(0,0,cxClient,cyClient);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0, cxClient, 0.0, cyClient);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glDisable(GL_CULL_FACE);
glEnable(GL_TEXTURE_2D);
glDisable(GL_DEPTH_TEST);
glDisable(GL_ALPHA_TEST);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable(GL_FOG);
I needed to insert "xSize" and "ySize" instead of "cxClient" and "cyClient". Noobish :D