Skip to main content
gamedev.net
🔒 Locked

Draw Debug Information

Started by raylee 3 replies 650+ views
Original Post
raylee
raylee
Hi all, How can I draw debug information on Directx screen?? For example, - Draw 2D rectangle or circle on the screen As I know that, under direct graphic, it seems it doesn't have any simple code to draw such debug information.
Muhammad Haggag
Muhammad Haggag
If by debug information you mean arbitrary information you record, you can easily do that using ID3DXFont. If you mean the 'debug spew' you get from Direct3D, then there's no easy way to do that, AFAIK.

raylee
raylee
Thank you for your reply!

Other than "String", if I wanna draw a rectangle, circle, or line on a directx handled screen, what can I do?
jollyjeffers
jollyjeffers
Quote:
Original post by raylee
Other than "String", if I wanna draw a rectangle, circle, or line on a directx handled screen, what can I do?

You might well have to handle this yourself - I don't think D3DX will help you with 2D primitives (it does have some stock 3D ones though). If you create a list of 4 verticies as a "line list" you can draw a square/rectangle. Circles are similar, but require a bit more work using trig functions..

One other idea that I use a fair bit in my engine... If you mostly need text output rather than "integrated" graphical debug then you can stream it to a secondary window.. When you want to debug your game/engine, run it in windowed mode and with some suitable resizing you can watch whats happening in the other window. This also works a charm in a dual-monitor setup.

hth
Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |
DrunkenHyena
DrunkenHyena
Quote:
Original post by jollyjeffers
Circles are similar, but require a bit more work using trig functions..

Since quality isn't a high priority in a case like this, a simple circle sprite should work well. Just scale it as needed.
Stay Casual,KenDrunken Hyena</FON

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.