dialog window with opengl window?

Started by
3 comments, last by pandabear114 21 years, 8 months ago
can somone please give me sample code or explain how to open a dialog in a window next to the opengl window using win32 api? i tried making new window handle etc but it was getting all crazy and the nehe opengl window is really confusing to me since it like defines structures in the header file and then defines the handles there and stuff instead of just in the main c++ file even having it open the dialog box and then having a button that closes the dialog box and then opens the gl window would be of use i just cant get the dialog box to work when i am in a project with the nehe opengl window also thanks in advance
Advertisement
Sounds like a job for MFC, especially if you''re making a tool.

[twitter]warrenm[/twitter]

well i was thinking of expanding on the zelda game at nehe and turning it into an rpg
i wanted a screen when you open to just be a little dialog box and have buttons for new game / save game / etc and then new game would idealy open up another little dialog box on the side next to the opengl window that would have current hitpoints etc because i was thinking it would be easiest to just display all that there, rather than trying to do all of that in the opengl window

am i mistaken and i should just do hp and stuff in game? i still would like a little opening screen first though with the buttons :\
hehe

would it be easier to learn mfc and put the opengl window within another window? (you can do that, right?)

it still would be good to know how to do what i originally asked just for knowledge''s sake, but if you could do both windows in the same window could you please tell me where to learn how?

thanks
Okay, so you want to have a menu/HUD of sorts within a game.

I would definitely recommend learning how to make your own GUI, as it''ll be flexible, and it''ll mesh well with the rest of the game. There are an infinite number of ways to do that; it all boils down to keeping track of input and applying it to your interface to get information about gamestate, etc.

There is a way to do it with the way you suggested. Basically you''d just use CreateWindow (or there may be another method) to create a number of "controls", which the user can then interact with.

MFC is still an alternative, and it''s not too hard to learn, but it might not be worth it, and there are people who cringe at the thought of having anything MFC in a game (though it will ultimately save time and it''s not that slow). The only problem is that it''ll be much more challenging to make it "pretty,"; that is, you can''t customize the way MFC controls look, they''ll just be bland Windowz buttons, etc.

If you want a window that gives you configuration options on startup, look into Dialogs. They''re easy (especially with the Visual C++ Dialog Editor), and they require very little code to integrate.

Anyhow, that''s the way I see it. Feel free to ask questions.

Later,
ZE.



//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links

[twitter]warrenm[/twitter]

On my new site i got a source for combining OpenGL and a MFC Dialog!!!

Just check under Code Snippets!

http://home.no.net/cybertux

- -- ---[XaOs]--- -- -

[ project fy ]
- -- ---[XaOs]--- -- -[ Project fy ||| CyberTux ]

This topic is closed to new replies.

Advertisement