2D and 3D combined

I’m using GLX and want to render accelerated 3D in one part of an X window, and draw 2D
using Xlib independently in the other part.
I’ve tried to restrict 3D rendering using
glViewPort with an area smaller than the window. The actual rendering is then confined
into this smaller area, but glClear/glXSwapBuffers() still clear the
whole window… Why?

I’d be very grateful for any suggestions how
to make this work…

/Lars

I think that in Windows can you only combine OpenGL and GDI in a single buffer. Perhaps do you have to do the same on linux?

try glScissor instead of glViewport

I haven’t yet tried glScissors, but in case someone wants to know, I just figured out another way to fix it. Just create a subwindow inside the main window (with the
main window as parent) and attach glX to the subwindow. Works just fine and there’s no way to tell there’s actually two separate
windows.

/Lars

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.