I'm trying to figure out a quick way to render text using wxFonts on a wxGLCanvas. This is proving to be sort of hard.
First, I draw the text to a wxMemoryDC. Then I convert the wxMemoryDC to a wxBitmap. Then I convert the wxBitmap to a wxImage. THEN I use wxImage::GetData() to make an OpenGL texture.
This is really inefficient and slow. Is there a faster way? The only thing I can think of is using a separate library for font rendering (one of the many OpenGL wrappers around freetype).
Fast wxFont rendering on a wxGLCanvas
- Ryan Norton
- wxWorld Domination!
- Posts: 1319
- Joined: Mon Aug 30, 2004 6:01 pm
Re: Fast wxFont rendering on a wxGLCanvas
wxGLCanvas is a pretty light wrapper... for fonts you'll have to get down to platform-specific gl calls like the windows version atJengu wrote:I'm trying to figure out a quick way to render text using wxFonts on a wxGLCanvas. This is proving to be sort of hard.
First, I draw the text to a wxMemoryDC. Then I convert the wxMemoryDC to a wxBitmap. Then I convert the wxBitmap to a wxImage. THEN I use wxImage::GetData() to make an OpenGL texture.
This is really inefficient and slow. Is there a faster way? The only thing I can think of is using a separate library for font rendering (one of the many OpenGL wrappers around freetype).
http://msdn.microsoft.com/library/defau ... o_1h6f.asp
[Mostly retired moderator, still check in to clean up some stuff]