Hi. Ive written a quick test app that sets up an ortho window then draws a traingle and a quad.
The problem is, when I resize or minimize the app, both objects disappear and will not return.
Here is the resize function
SUB mgeWindow_Resize(Width:INT, Height:INT) ' Prevent divide by zero IF Height = 0 Height = 1 ENDIF ' Set the viewport glViewport(0, 0, Width, Height) glMatrixMode(GL_PROJECTION) glLoadIdentity() ' Setup ortho projection glOrtho(-0.375, (Width - 0.375), (Height - 0.375), -0.375, -1.0, 1.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity()
And the message callback is a simple
CASE WM_SIZE ' Resize the OpenGL viewport to match the new client area mgeWindow_Resize(mgeHelper_LoWord(lParam), mgeHelper_HiWord(lParam)) RETURN 0
I cannot understand why this is happening or how to fix it. Any ideas (apologies if the code formatting is iffy).