I just ported my 3D engine from OpenGL on Windows to OpenGL on Linux. But now that I have the core running, I have a couple problems I do not understand. Here is one of them.
When I grab the boundary of the graphics window with the mouse and resize it to a larger size, the area inside the window that is cleared (each frame) does not change size from the original size. The newly exposed area inside the expanded frame is transparent (the desktop is visible). Presumably this means XWindows is (appropriately) not clearing the window, but the OpenGL glClear() continues to clear only the original window dimensions - not the resized/expanded dimensions.
The objects in the window do get larger as the window is resized larger (and printf() statements in the code confirm the viewport and projection matrices are being recomputed and installed correctly (by glViewport() and glLoadMatrixd() calls) every time XWindows sees the window size change). When I resize the window smaller again, some of the window along the top is not drawn - as if the viewport is offset downward (but not rightward).
I do not understand in any significant way what the distinction between the XWindow and GLXWindow are. When my code creates a window, it first calls XCreateWindow() to create an XWindow, then calls glXCreateWindow() to create (and associate) a corresponding GLXWindow. That’s what the GLX sample code that I found seems to want. Not sure whether perhaps the XWindow is being resized but not the GLXWindow - but I do not see any GLX resize functions. Furthermore, when I try to resize the GLXWindow with xlib functions, my applications blows up (and XWindows prints a nasty error message). So that doesn’t seem to be how this should be handled.
Any ideas?
video card = nvidia 8600GT + 512MB. The nvidia drivers are up to date.