opengl bitmap font question: switching to fullscreen - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: opengl bitmap font question: switching to fullscreen (/thread-4111.html)
opengl bitmap font question: switching to fullscreen - moon_magic - Jul 7, 2006 06:56 PM
i've got a nehe display list going in my game. no problems drawing the font, moving it around, etc. except that when i switch to fullscreen mode, all the alignment that i was doing with glRasterPos2f is messed up. is there a good way to center text using a display list? how do i implement a fullscreen mode that keeps my text where i want it? also, i'm using a non-standard font; how do i include that with my game when i finish it? i'm using cocoa, and i used interface builder to set the size of my window to 640 by 480. when i switch to fullscreen, i use this:
also, here's my reshape method:
i guess i just don't know enough about what's going on when i switch to fullscreen. i understand that it creates a new window, sets some arguments and whatnot, but i don't really know what's going on with the nib stuff, or if i should have coded it myself or what.
to sum up, i'm looking for a good way to align text and i want to make sure that what i draw on the screen stays the same when i switch to fullscreen mode.
opengl bitmap font question: switching to fullscreen - Jones - Jul 8, 2006 10:39 AM
I think, (and I'm not sure - I'm new to fonts, and only have a basic grasp of OpenGL projection), that if you stick a glOrtho command like this:
Into your reshape function, it might help.
Just a semi wide guess though. I've never used Cocoa with OpenGL, only GLUT and SDL.
opengl bitmap font question: switching to fullscreen - OneSadCookie - Jul 8, 2006 03:39 PM
If you're drawing your fonts with bitmaps, you're going to have immense problems coping with more than one resolution. I'd highly recommend drawing them as textures instead, in which case Jones' suggestion of using glOrtho to specify a particular "virtual" screen size will work just fine.