Suddenly my OpenGL has stopped rendering...I cant figure out why..
I have included the 3 files im using..
Suddenly my OpenGL has stopped rendering...I cant figure out why..
I have included the 3 files im using..
http://livebad.com/nuka
Da-Nuka
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?
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
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.
http://livebad.com/nuka
Da-Nuka
I solved the problem...finally... After scanning my Initializing code for the 6th time.
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
http://livebad.com/nuka
Da-Nuka