Sign in to follow this  

Help on creating a basic C++ GUI

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

Firstly to describe what my program does: I'm doing a uni project which involves testing AI using personality types and emotive responses depending on the stimulus around them. Using opengl and currently just have a white background a spheres to simulate the agents. I'm not looking for anything fancy so I'm not bothered about how basic it looks. So what I need is a side menu. On the top half (or bottom half it makes no difference) I have a user control to select the stimulus i want or to set a user controlled agent. On the bottom half or vice versa I'd need a status display of each agent (This can be simply done by pressing a number or scrolling through or whatever) and it's personality type and a numbers/gauge to show how "emotionally" affected it is by the stimulus near it's position. I looked around and thought that a modeless Dialog box could work, was thinking of using the progress bar as a gauge and maybe the edit boxes for numbers? Problem is I've never used it before and couldn't get it to display. My knowledge when it comes to coding is ok, not great just passable to code basic and maybe post basic programs/games. I'm not even sure if modeless dialog box is even suitable for what I'm doing or know how to edit the controls. I have a progress bar, how do I edit that? I search online all I'm told is how to show it on screen which I don't completely understand. Copy and paste is just asking for trouble. I need a tutorial on dialog boxes or either that someone tell me a more efficient way of doing what I need if dialog boxes isn't the answer. Thanks in advance for anyone willing to help ^^

Share this post


Link to post
Share on other sites
Quote:
Original post by speciesUnknown
I'm currently doing it from scratch as a learning process, in 40 hours of work I've got as far as clickable buttons, and draggable windows. I did it using STL containers and c++ classes.


You don't need anything for a so basic interface !
Done in 2 minutes in C + win32 api

Share this post


Link to post
Share on other sites
Quote:
Original post by george135
You don't need anything for a so basic interface !
Done in 2 minutes in C + win32 api


That's true; but as GLGunblade stated, he's having troubles getting them to display in conjunction with his OpenGL program. Unfortunately, I don't know what could be the problem. :P

I have a suggestion:
Use a standard OpenGL window with either a console window to spew out status and handle input or implement a simple console class to handle rendering text output onto the OpenGL window, then use an escape key (such as '~') to activate console-mode, and have the user key in simple expressions such as "ai_variable_thinking = 20" to set specific variables.

Hope this helps :)
_fastcall

Share this post


Link to post
Share on other sites
Currently looking at CEGUI. don't know if I'll get it to work properly but I'll check it out.
The problem with trying to display it is I have no idea how what the code is for displaying it :/
I tried copying and pasting and gave me a cannot convert type error. Unfortunately since i have no idea what is what there's no way i'm fixing it.
I'm sure the code for displaying the box goes here:

LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
-->?
}

LRESULT? CALLBACK? HWND? etc... I have no clue what they mean. All I know is they're there to make it work.

Also is the progress bar suitable for a gauge of sorts if i did get this to work at all?

Share this post


Link to post
Share on other sites
Hey,

When I was learning Direct3D and found I had to go and learn a bunch of Win32 as well, I fond the following tutorial extremely useful:

http://www.two-kings.de/tutorials/dxgraphics/dxgraphics01.html

Its obviously about Direct3D, but the first section of that tutorial is all about getting the most basic win32 window up and running, the WndProc and main program loop, etc. Very handy.

Share this post


Link to post
Share on other sites

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