Solved

Text input/output in DirectX

Posted on 1998-03-17
1
461 Views
Last Modified: 2013-11-19
Hi all,
What I want to do is input and output some text to a fullscreen DirectX application.  Now, I'm not looking for miracles here, but I know there has to be a way to do this without too much pain - I'd hate to have to go convert a font from its font format into individual graphic files for each letter of the alphabet.  I know there has to be a way to drawtext to the DirectX screen, or background buffer - but I haven't found any reference for it, and I've assumed since using DirectX bypasses the normal Windows paint method that I couldn't use textout.

I want to use some standard system font (ie: Arial) and display it on my screen for things like score counters, highscore lists, etc.

I know there has to be a way to do it.  Diablo does it in their multiplayer chat, and draws text during the game using their own font (which I do believe is a font, and not a set of graphic images).  

Any and all help would be appreciated.
0
Comment
Question by:navigator010897
1 Comment
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 150 total points
ID: 1317044
Actually, a DirectX program can use GDI functions. The only draw back is that it is slower. However, there's nothing preventing you from doing that.

Once you have a surface, you can use GetDC() to retrieve the device context. Then you can use any of the GDI functions on that device context.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Adapt this command to show who installed 29 102
Separate into files by filename 12 67
lucky13 challenge 11 112
Thin secure Windows 10 5 49
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now