Damn lack of PyOpenGL feedback.....
So, I have a 'font' texture that Ive made and loaded and it seems to be working fine on constant text. ExcellentLets make an FPS counter. Ill just make a draw method that actually draws the texture, rather than makes a display list. Easy, right?
Ok, code that up. Put it in my scene graph.. excellent. Seems ok.
So, lets put it on the HUD..
All my fonts turn into opaque squares. Huh? Weird.
Um. Well I did some changes to allow render time displaying (rather than making a scenegraph model), maybe I didnt turn something on. Nope. That code all looks fine. Um....
So, _Lots_ of code checking later... I finally discover that the glGenTextures call is returning a texture_id for the font of 24837324 (or something huge). Hmmm. Ok, thats before Ive loaded the font image... Um.
My _other_ textures still work fine (and have numbers like 1, 2, 3, 4).
Ok, so what if I call glGenTextures ore than once... 24837324, 0, 0. Hmmm.
3 Hours later... It seems that I initialised my textpage class _BEFORE_ calling mygame init, so opengl cant render a texture.
Augh!
I think thats my problem. Its not that I consentrate on graphics too much, its that I cant let bugs go without working out _why_ they dont work. And it just so happens that my newbieness to opengl translates into lots of bugs. :)
(log in to comment)
Had another bug I needed to trace, but I cant blame opengl for that... it was a '-' instead of a '+'.
Eeep. 1am here... looks like an all nighter... :-/
Comments
korg on 2006/04/01 06:56:
And before you all comment, yes, I should have been checking the textureid for being zero (although the weird inital value confused me.... but in hind sight maybe thats just its way of saying "Im not initalised yet, loser")