I am trying to write a 3D model editor in MASM32 and have manged to hit a road block right off the bat (go figure). I have two windows at this point, one is the main app window and the other is to be an overlay of buttons that resides in a small section on top of that. Each of these windows is its own class and has its won opengl context. So at this point the main app window is set to clear to black the overlay window is designed get the current hdc and GLRC in open gl, push them on the stack, set its own dc and glrc as current clears the background to red (just so I could see it) then restores the previous contect and dc. WELL.... it doesn't work. After taking out the code to paint the main window I found out the overlay window is clearing to black (so I can't see it if the main window is painted too). There are no glerrors at any point during the drawing operation (or at any other time) and just simply don't know what to do now. Here is the code for paiting the overlay window TB3DPaintToolBar proc lhdc:DWORD LOCAL oldDC:HDC LOCAL oldctx:DWORD ; save the current context and dc call wglGetCurrentDC mov oldDC,eax call wglGetCurrentContext mov oldctx,eax ;############################################################## ;make the opengl context current ;############################################################## invoke wglMakeCurrent, lhdc, gTB3DTBhGLRC ; clear the tool bar invoke glClearColor, 1,0,0,0 call TB3DCheckOpenGLError invoke glClear, GL_COLOR_BUFFER_BIT call TB3DCheckOpenGLError invoke SwapBuffers, lhdc call TB3DCheckOpenGLError call glFlush call TB3DCheckOpenGLError ; restore the original dc and current context invoke wglMakeCurrent, oldDC, oldctx call TB3DCheckOpenGLError ret TB3DPaintToolBar endp mind that the calls to call TB3DCheckOpenGLError are just a desperate attempt to figure out what is wrong.
Posted on 2001-06-18 18:31:00 by [=CC=]AMBUSH