Jump to content
  • Advertisement

Archived

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

mdfmKoRn

Cnotrols in DX8 window

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

Advertisement
MFC fog on the sdk does it in a window, not sure about a combo box in full screen but you can pop up a dialog box

Share this post


Link to post
Share on other sites
Look up Combo box in the SDK docs
(just kidding...)

There are a couple of different meanings to your question - can you draw GUI elements within your 3D scene (like a HUD), or can you draw GUI elements next to your viewport (like MFCFog). The latter is easy, the former is usually very difficult because GUI objects have no notion of a D3D back buffer, depth buffer, etc. Something like a dialog box works, but I personally find that clumsy and ugly whenever I see it. A couple of options in fullscreen mode:

1. build your own GUI components in the D3D world. At the beginning it''s a pain, but it''s not a killer and it''s ultimately very flexible for different styles, transparency, etc.

2. Don''t use fullscreen mode. Instead, change the screen resolution in the app and make your windowed app as big as that new resolution. Then, use MFCFog as an example. When the app ends, make sure you set the resolution back.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster


How does GDI+ enable rendering of controls to a D3D environment?

I looked it up and all it seems to enable is a "class based" approach to using GDI in the first place? Lines, pens, brushes, fonts, etc..

Did i not look at it deep enough?

Just curious, because the question of controls in a 2D/3D environment comes up quite a bit. To me, it seems as if we ought to be able to either a) create a control (listbox, edit, etc) and parent it to the window we use for our rendering and have it draw itself correctly. or b) use the controls, but owner draw them into a 3d context.

The best approach I have encountered so far is Mason''s articles on building a user interface or to use linux and open gl/sdl and one of the widget toolkits?

Share this post


Link to post
Share on other sites
Hrm... GDI+ is looking like more than just a class based approach. At first I thought it was just a WinXP thing, I think I might be wrong. I''ll have to look at it some more.

CrazedGenius, I''m trying to do the former. I''m trying to draw GUI elements within a 3d scene. I agree, popping up a dialog box would be really sloppy. I''m not even considering that. I''m looking for a good (possibly cheap way to get user input in my D3D app. Kinda like an edit control. I would make my own but I''ve been having nothing but trouble with the dreaded font drawing methods for D3D. ID3DX sux, it''s too slow. CD3DFont is driving me crazy. It works fine when I compile Microsoft''s code. I put it in mine and I get access violations everywhere.



----
Herb M. (mdfmKoRn)
www.sky-meyg.com
s3202@attbi.com

Share this post


Link to post
Share on other sites
About CD3DFont -

My guess is that you are not calling RestoreDeviceObject (I think that''s what it''s called) and the other SDK framework specific calls. Look carefully at how the samples use it. You need to make sure you call these functions at the right time in the right order.

Share this post


Link to post
Share on other sites
Sorry - didn''t have the code and meant that as a "for instance". Are you calling InitDeviceObjects?

If you''re crashing, step through in the debugger. I''m *guessing* that you will find that you are trying to use a font that was not fully created. Hence, the calls to something like InitDeviceObjects (for instance). Just a hunch...

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!