Making a new frame/child/whatever window

Started by
2 comments, last by DarkAnima 15 years, 8 months ago
Time for another random question from Richard the Noob (kinda'). I'm trying to learn some new, somewhat more complex tricks to put into the code for my game that I've been working on. I've had a firm grip on the basics of C++ for a while and can usually find resources to teach me advanced techniques and code when the need arises, however I've been struggling to find code that will allow me to create new windows to display constantly needed data (i.e. a status pane that displays character HP/MP and other panes to help not only a player but also a debugger). The help for VC++ is horrible when it comes to the more complicated functions in C++, and I've found absolutely nothing that works for my program here in the forums and in other online resources. I'd love to find a tutorial, or something, but I don't see any out there. If anyone can give me advice as to how to begin creating new windows, I'd be very happy. Thank you ^_^
Advertisement
If you mean a child window that doesn't prevent the program from continuing to run, then look for 'non modal window' or modaleless (I don't even know if this is word).

For example, when you create a form in WinForm you have two options, Show() and ShowDialog(). The first creates a non modal window, while the second stops the program until the user closes the child window...
It's unclear from your post what level of information your looking for here, but here goes...

How you display windows depends very much on which kind of game/application your making.

If your making a Windows game that is not 3D you can use the standard Win32 API. CreateWindowEx is a good place to start your research. However, coding pure Win32 is a nightmare, so it's almost only used when creating a single window, e.g. for hosting Direct3D.

A bit higher level is MFC, which is a wrapper around Win32. You should be able to find a lot of tutorials on MFC. If you want cross platform you can use Qt or wxWidgets.

If your using Direct3D or OpenGL you have to draw your own windows. Creating a GUI system is a large and complex task, but for simple windows it's not too bad. Alternativly you can find ready made GUI systems that works with Direct3D/OpenGL. CEGUI is a widely used free system.
Okay, I'm trying to create either a modal window or a separate frame in my main window for displaying information that I will need to see updated regularly, in my case health and character status information. I tried playing with MFC and the wizards provided with my copy of VC++ 6, but that was like trying to learn swimming in the deep end of a shark pool.

I've played with OpenGL a bit, but right now I'm trying to avoid graphics at all costs because I run into walls when I try to do that (specifically with collision detection). While MFC seems to be the best place to start, most of the tutorials I've seen want me to use the wizard and then heavily modify the code that it gives me. I'm willing to learn to do that, but it would be much simpler to simply be able to create a window and put text in it, which none of the tutorials seem to want to teach me to do (although the one that shows up everywhere shows me how to do everything but that: painting with the mouse, popping up both modal and non modal dialog boxes, etc).

I have a feeling that I wouldn't use the typical 'cout << ' function for one of these windows. The tutorials tell me how to make the windows, but how do I output dynamically changing text to one?

This topic is closed to new replies.

Advertisement