Archived

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

SkyNet_ITA

Text Rendering

Recommended Posts

What function should i use for rendering a text in a DirectX Window?? i have tried "DrawText" but the compiler gives me this error: "unresolved external symbol". What can i do? Thanks

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
RTFM
ahem RTFMSDN
;-)
and it''s a linker error not a compiler error...

cheers

Share this post


Link to post
Share on other sites
DrawText is a GDI function anyway so you probably dont want to use it in a DX app.



/* Ignorance is bliss, then you go and spoil it by learning stuff */

Share this post


Link to post
Share on other sites
Look at the way I use it in my DirectDraw wrapper, in this page of my site. Sure it''s very slow compared to the usual blittings, as you need to lock the memory for using GDI functions (it''s done automatically when you use GetDC), but if you keep updating your text just once every some frames, it''s ok.

The next update of that wrapper (that''s coming soon, if you want to be notified by mail when it''s ready just join my site''s newsletter) will include a very interesting console class I''m developing for my current game proyect, and after testing it a lot I can tell you GDI works real well and doesn''t lower your game''s speed unless you use it very heavily (for example, once or twice a frame). In that console code, it''s only used when a new key is pressed, for updating the latest line of the scrolling text.

Some time ago I worked for a big commercial proyect which used GDI text APIs for making animated texts with special effects, and it was real worth the loss of speed.

Take a try, and if you see it''s not as fast as you''d want, go make your own fonts classes (isn''t hard, but takes a lot of time to do, and time is never enough, you know it).

Best regards,

--DK
--H. Hernán Moraldo
http://www.hhm.com.ar/
Sign up to the HHM''s developers'' newsletter.

Share this post


Link to post
Share on other sites