OpenGL + GraphicsContext = Flicker

Hello all-
I have an OpenGL canvas that I am drawing to, and I want to use a
wx.GraphicsContext to draw an overlay on top of it (particularly,
because drawing text in OpenGL is always a bit of a chore). I was able
to get it to work, however, there is some pretty unacceptable flicker
caused when I update the underlying OpenGL canvas.

I have disabled the screen erasing (by binding a trivial method to
wx.EVT_ERASE_BACKGROUND), but of course, the canvas is erased during
OpenGL drawing. Does anyone have any idea how to eliminate this
flicker? Or have a nice, cross-platform method to draw decent looking
text (i.e. in system fonts) on top of an OpenGL canvas?

Thanks,
matt

Matteo wrote:

Or have a nice, cross-platform method to draw decent looking
text (i.e. in system fonts) on top of an OpenGL canvas?

Can you draw the text to a transparent bitmap with DC or Graphicscontext, then put that bitmap onto OpenGL as a texture?

This is working for us in a limited case, but we hope to do more with it.

For instance, you can use wxHTML to render to an off-screen bitmap, then put that in OPenGL as a texture, giving you a way to render formated text.

I'm hoping something similar can be done with wxRichTextCtrl, but I'm not sure it can be used with only an off-screen bitmap.

-Chris

ยทยทยท

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov