• Advertisement

Archived

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

Text in dDraw - how to?

This topic is 6000 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
Advertisement
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.


-Goku
SANE Productions Homepage

Share this post


Link to post
Share on other sites

  • Advertisement