Hi again guys, it's me again Ok, there's a question: how to render text on OpenGL scene? Blitting text surface doesn't work. Has anyone got any tutorials or examples how to do it?
Hi again guys, it's me again Ok, there's a question: how to render text on OpenGL scene? Blitting text surface doesn't work. Has anyone got any tutorials or examples how to do it?
take a look at http://www.nitrogen.za.org/
you can find the bitmap font generator and the engine
From brazil (:
Pascal pownz!
Well, I use SDL_TTF to load fonts, so bitmap fonts are out...
I think you can't use them in opengl :?Originally Posted by Loodziek
From brazil (:
Pascal pownz!
There are tutorials on the NeHe website that can show you how to use TTF via OpenGL it's self. I doubt that you can use the SDL font functions in OpenGL.
Ok, I left TTF and start learning how to use Bitmap fonts But there's another question: how to do this without WinAPI? At NeHe I have found Delphi OpenGL demo how to use bitmap fonts, but there's problem. Demo author use HFONT to do this. I work with Freepascal and Lazarus, so I can't do it this way. What's "crossplatform" HFONT equivalent?
-Edit-
I have found how to do it in GLUT. Thanks a lot guys
-Edit-
Erm... I still don't know to load bitmap fonts from *.bmp file generated for e.g. with Font Studio 4. Is there any example?
i writed a png exporter for fontstudioOriginally Posted by Loodziek
http://www.freeshells.ch/~arthurpr/PNGEXPORT.rar
From brazil (:
Pascal pownz!
I have thinked about it, and it's my idea. We render text on PSDL_Surface, right? So, why don't this surface using glBitmap or glDrawPixels? I'm trying to do that, but I get errors. Is there something wrong? Can you tell my what should I do?
Here you can find code to render text in OpenGL using sdl_ttf library.
Ok if you are using SDL and you are using OpenGL for graphics, NONE of your SDL graphics commands can be used. Period. The graphics functions and surfaces for SDL and OpenGL are generally not compatible with each other.
That said... the use of both TTF (or other formats) and bitmap/raster fonts are both doable, but have different advantages so decide which you want based on what you think your program needs most and what works best for you.
Bookmarks