Archived

This topic is now archived and is closed to further replies.

Trouble with fonts

This topic is 5534 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''ve made a font class wich is avaivable at www.databakeriet.no/eirikhm/cfont.h and www.databakeriet.no/eirikhm/cfont.cpp Can anyone give me a hint on what I''m doing wrong?

Share this post


Link to post
Share on other sites
NeHe has an excellent tutorial on it which will solve your problems. Once you get it working, then make changes. You have a huge block of remmed code with no indication that it worked before you tried to modify it.

I recommend taking a look at the DX 8.1 D3DFont.cpp and porting it''s font creation routine to OpenGL. You just need some basic knowledge of Win32 to get the font surface the routine creates to an OpenGL texture. I used GetPixel and manually wrote the pixels with the alpha value to the data array to remove the background color and then created the surface using the data.

With NeHe''s (what you''re doing as well) method it dropped my framerate 100fps or more when even just a few lines of text were put on the screen. It rendered my app unplayable on my 400Mhz not so craptop.

Using DX 8.1''s font routine as a guide you can get the same results (user specificed font variables) but by using a texture instead which causes a drop of only 10fps or less with the same amount of text on the screen. It''s now playable at 150fps on the not so craptop and only drops to ~30fps when it''s loaded up with primitives in game making it quite playable.

Ben


IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting | Tiberian Merchandise!!!! | GameShot ]

Share this post


Link to post
Share on other sites