Jump to content

  • Log In with Google      Sign In   
  • Create Account

Making GUIs for C++, where to start?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Kelicant   Members   -  Reputation: 101

Like
0Likes
Like

Posted 20 February 2012 - 09:50 PM

I am experimenting with C++, and trying to learn how to make some basic games and applications. I know swing is used a lot for the GUIs in Java, and qt is pretty popular for C++ development. However, would qt also provide the graphics representation for the games themselves?

My wording may have been a bit poor, my project I'd like to work towards (by creating other small applications and games to learn the necessary skills) is something like the OpenSteer project(http://opensteer.sourceforge.net/). I want to have triangle characters that I will program to navigate and steer themselves towards certain goals. I know that qt can make the window for the game, but would it also handle drawing the triangles and simple graphics?

What tools (like qt or swing) are available for making game graphics? Could they be carried over to 3d graphic projects (not necessary by any means, just curious)?

Sponsor:

#2 wicked357   Members   -  Reputation: 1165

Like
2Likes
Like

Posted 20 February 2012 - 10:38 PM

You typically use a GUI on top of an existing graphics API such as DirectX or OpenGL. For example you would write a game using the SFML library which is based off OpenGL and they have supported the use of qt and many others to be used. I think I understood your question so I hope this answered a little bit for you, but maybe someone else could give a more detailed explanation.

#3 Kelicant   Members   -  Reputation: 101

Like
0Likes
Like

Posted 20 February 2012 - 11:03 PM

Thanks wicked357,
That does help. I guess I should look into graphic APIs and libraries that use them.

#4 Black-Rook   Members   -  Reputation: 1563

Like
0Likes
Like

Posted 21 February 2012 - 04:48 AM

I just program my own GUI's while using the graphics API to display graphics, ect... Much easier when you've done some programs with your own GUI due to the re-usable code. Just add in your class "Button" or "Text Box" when needed, and modify the code as needed. :)
GameDev Journal: http://www.gamedev.n...-rooks-journal/

OpenChess - 1.0 done!

Classic RPG #1 - Task 9 -> January 1st 2013

#5 Tispe   Members   -  Reputation: 1034

Like
0Likes
Like

Posted 22 February 2012 - 02:30 AM

I too program my own GUI in a very crude way. I have a Class which handles "windows", each window is a struct which holds information such as position, width, height, sprites and texts. Each "text" has its own RECT, and each sprite has position and so fourth. I have a "parent position" in the struct and the sprites and texts positions are relative to the parent window, so if the window moves I recalculate the sprite and texts positions, ex: txt1pos = ParentPos + Txt1RelPos.

The harder part is getting input from the user, for example entering text to a field and hitting enter and submitting that string to a function which handles it. Or clicking a button or changing the color of the button if you hover over it. Which windows are currently visible, and which is "active" for input etc... all these things I just manually hammer out with spaghetti code :D




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS