Sign in to follow this  

DirectDraw game and UI

This topic is 4841 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

HI, i was wondering if any of you kind souls know of an easy way of implemeting a UI into my DirectDraw game. Do i have to modify my message callback routine to catch mouse clicks on a certain area or can i create a real 'menu' with buttons?

Share this post


Link to post
Share on other sites
You're probably gonna hate to hear this, but avoid DDraw like the plague. Most hardware doesn't accelerate DDraw anymore in my experience. Even cheap integrated 3D chips will offer better performance in D3D or OGL over DDraw. I think DirectGraphics will do what you want, or there's an excelent book on making 2D games in Direct3D. Oddly enough its called "Focus on 2D in Direct3D" and it'll cost you about 30 bucks retail.

DDraw isn't really any easier than D3D unless you know it already.

Share this post


Link to post
Share on other sites
I was thinking about rewriting my 'renderer' for OGL. But i have a hard time coming to grips with the idea of using a 3d api for a 2d game. It seems like such a waste? But even so i lean towards OGL for its muliplatform capabilities.

[edit] But to stay on topic do you know anything about creating an 'in-game' UI using windows elements?

Share this post


Link to post
Share on other sites
The most recent version of the DirectX SDK comes with a basic gui system built in.

As for using a 3D api for 2D, after about 20 lines of code, you end up just making calls to your 2D wrappers anyways...

Share this post


Link to post
Share on other sites
Its really easy to do. Essentially you just set your projection matrix to Ortho mode and ignore the Z, just set it to 0. Make all graphics out of 2 textured triangles. As a bonus, using a 3D api makes it super easy to support any available resolution, you just have to make sure things stay readable at super-low resolutions.

If you know OGL or are willing to learn it, everything in the book I suggested can be applied.

Share this post


Link to post
Share on other sites

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this