Solved

Text input/output in DirectX

Posted on 1998-03-17
1
463 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
move a line in eclipse 3 104
lucky13 challenge 11 147
x-bar in Google Sheets 2 55
"Black Box" Testing of Control System Software 2 53
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.

821 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