Jump to content
  • Advertisement


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


Text in dDraw - how to?

This topic is 6261 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 want to draw text in my dDraw application, and i figured that i wasnt the first one to do that, so i just wanted to hear if any of u have a fast function for writing text in directDraw? ------------- E-)mil http://eej.dk - Just another crazy dane

Share this post

Link to post
Share on other sites
Well, it ain''t fast but you can use GDI to draw text.

Just do this (assuming lpDDSurf is the surface you''re drawing the text to):

HDC dc;
lpDDSurf->GetDC (&dc);
TextOut (...); // check MSDN for parameters, I forget them
lpDDSurf->ReleaseDC (dc);

That''s probably the slowest way to do it but it''s the easiest. Also, unless you load another font into the DC (a rather daunting and somewhat counter-intuitive task), you''re stuck using the default console font (looks like Courier).

You could also make your own routines for drawing bitmapped fonts and it would probably be quicker. I believe there''s a tutorial here on that.

SANE Productions Homepage

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!