Re: [GtkGLExt] How to mix OpenGL and non-OpenGL drawing commands in the same window?



> I'm trying to render an OpenGL scene on a GtkGLExt window (to 
> be precise I'm using gtkglextmm) and then to draw over it 
> with plain Gtk+ drawing commands (that is, Gdk or Cairo).
> 
> Specifically, I want to draw some text in the same font used 
> by the other widgets in my gtkglmm application.
                             ^^^^^^^
                             (that should've been gtkmm)

Just to let you know that I found a way to do that. Example attached.

In short, I copy a region from the OpenGL back buffer to an off-screen pixmap, draw over it (in this example it's text but you can draw anything) using Cairo, and copy the modified image back. Then swap buffers and everything is displayed with no flashing.

Gerardo

Attachment: text.cc
Description: text.cc



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]