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

Re: [pygame] win32ui?



Luke Paireepinart wrote:

[snip code]



Or rather, I can tell it's building a set of 96 drawing lists using a font, but it's using this mysterious win32ui module to get the "drawing context," which apparently has to be of type "long." It doesn't accept pygame or the screen-surface or a Pygame-loaded font object as the "drawing context," so it's opaque to me.

I'm able to get OpenGL to draw rectangles on the screen in ortho mode, but can't get text to display since I can't load a font in the manner that seems to be needed.

Kris

You could try installing the pythonwin module to see if that helps,

Yes, Mark Hammond's Win32 Extensions (http://www.python.net/crew/mhammond/win32/Downloads.html) includes the win32ui module.


but it seems (to me, though I have no pyOpenGL experience) that you shouldn't need to use win32ui to do this.

Kris is using WGL to build font bitmaps, which is the Windows/OpenGL "glue". On Linux this is GLX and on Mac it's AGL. Minor changes would be required to use these in place of WGL on these platforms.


Otherwise, how are all those linuxers getting OpenGL fonts? :D

Certainly not by getting the OS to draw font bitmaps. The standard technique is to render the characters you need to a texture (using pygame.font or SDL_ttf, for example), and rendering screen-aligned quads of the textures. pyglyph (http://www.partiallydisassembled.net/pyglyph/) is a module that does exactly this.


Alex.