Skip to main content
GameDev.net gamedev.net
🔒 Locked

The best GUI

Started by Muhammad Sabry Feb 27, 2012 at 1:35 PM 22 replies 15.4k views
Original Post
Muhammad Sabry
Muhammad Sabry
Hello everybody...

I'm a beginner C++, I've been already coding for console,but now I think it's the time to move to window application,
So my question is What is best GUI and why?
i've been searching on the web and I found (MFC, QT, wxWidgets), but I really don't know which one to choose.
So HELP ME PLEASE.sad.png

Note:
I'm for sure wanna be a games programmer at the end.


Thanks
SimonForsman
SimonForsman
best GUI for what ?

What platform(s) ?
Game or Desktop Application ?

Both QT and wxWidgets are good Desktop GUI APIs (QT is also good for Symbian/Meego mobile apps), i personally prefer QT but you're likely to find alot of people here who prefer wxWidgets aswell, look at some example code for them and pick the one that seems easiest to start with. (Switching API is fairly trivial anyway)

I'd recommend against MFC as it is:
1) Crap
2) Not included with the express edition of Visual Studio
3) Crap

If you are going to make games rather than GUI applications then something like SFML or SDL will be a better option.

You can also use plain old Win32 if you restrict yourself to the Windows platform, its good enough for simple stuff or you can go the .Net route and use WinForms (Which is pretty darn awesome but you probably want to swtich to C# then)
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
Muhammad Sabry
Muhammad Sabry
Ok I've done alot of codes in console and still doing, but I'm not gonna stuck all my life with console rolleyes.gif
So any advice from you "Telastyn".
kunos
kunos

[font=arial,helvetica,sans-serif]There is no good answer to this question.

QT is pretty awesome, but, it extends C++ with some custom keyword and constructs.
MFC causes brain damage, avoid at all costs.[/font]

[font=arial,helvetica,sans-serif][color=#282828]wxWidgets I am not very familiar with.. but they should be more C++like.. the other options I can suggest are:[/font]




[font=arial,helvetica,sans-serif][color=#282828]GTK+. Never used it, can't comment.[/font]


[font=arial,helvetica,sans-serif][color=#282828]Microsoft CLI/C++ managed c++ however they call it. I did use an it is not that bad.[/font]


[font=arial,helvetica,sans-serif][color=#282828]But seriously, for GUI application you should stick to C# .NET/MONO and, if you really want, your logic in C++.[/font]

Muhammad Sabry
Muhammad Sabry

best GUI for what ?

What platform(s) ?
Game or Desktop Application ?


1- best GUI for window programming. if I understood your quesition.
2- I know that mfc is for MS windows, and eather qt or wxWidget is a cross plateform, which make them in higher position than mfc.
3- Desktop Applications, but sooner or later I will start programming for games.
Thanks
ApochPiQ
ApochPiQ
C++ is a terrible language for GUI design and implementation.

I second C#. The WinForms editor is stupid easy to learn and gives you a lot of power with minimal investment. C# is not hard to learn and is also easy to bind to C++ if you need the raw speed. (Hint: you may think you do, but you don't.)

There's also Java which has a similar flavor to C#, but Java is a meh language at best, and the UI toolkits are a nightmare to work with for nontrivial designs. Unless you need Java or can use something like Android's UI toolkit, I wouldn't bother.

If you're on a Mac, the Interface Builder/Cocoa combination is about as close as you'll get to WinForms. Almost as good but not quite, and you have to use Objective C and Xcode, which are not exactly great (well, Xcode is more the problem than Objective C, frankly).


Just in case the basic trend hasn't become apparent: don't use C++ for UI implementation if you can possibly avoid it.
nitro404
nitro404
I would also second Qt, I think it's fantastic. There is also an extensive library available at your disposal. See: http://doc.qt.nokia.com/5.0-snapshot/qtcore.html Qt is perfectly fine for desktop programs, you will want to look into QtCreator as well if you choose to use it.
Promit
Promit
Go with wxWidgets or Qt. Definitely not MFC or the other fringe options.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
ApochPiQ
ApochPiQ
Muhammad: I have merged your two threads into a single discussion (previously there was one copy in Game Programming and one in General Programming). In the future, please do not post multiple copies of the same topic in different forums.

Thanks!
Muhammad Sabry
Muhammad Sabry

Muhammad: I have merged your two threads into a single discussion (previously there was one copy in Game Programming and one in General Programming). In the future, please do not post multiple copies of the same topic in different forums.

Thanks!


I'm sorry for doing that, it's just I didn't see the General programming section at the first. So I'm sorry again,and thanks for the merging.
Malc0lm
Malc0lm
I never coded a single bit of C# in my life, however I do have quite some experience with GUI coding (in C++) using wxWidgets, which I think totally rocks. But since I can't compare from own experience: what makes coding GUIs in C# a better choice over C++ with wxWidgets?
kunos
kunos

I never coded a single bit of C# in my life, however I do have quite some experience with GUI coding (in C++) using wxWidgets, which I think totally rocks. But since I can't compare from own experience: what makes coding GUIs in C# a better choice over C++ with wxWidgets?


the simple fact that you can use a language that has the constructs needed for nice event handling built in the language itself (ie. delegates) as opposed to a language where these constructs have to be simulated using preprocessing hacks (QT) or some other convoluted system simply to use a member function as a callback.
Also the built in reflection and metadata in C# makes it much easier to build a visual gui editor.
But the real answer to your question is 3 clicks and 15 minutes of coding away.. that is.. download Visual C# and see yourself... it really just takes 10 minutes and a simple 1 button application (WinForm) to convince yourself there is no real comparison.
Malc0lm
Malc0lm
Would a C# project also work (i.e. be compilable) for other platforms than Windows? And more specifically, does it give native controls (i.e. Windows look & feel on Windows, OS X look & feel on OS X, etc) on the supported platforms?
swiftcoder
swiftcoder

the simple fact that you can use a language that has the constructs needed for nice event handling built in the language itself (ie. delegates) as opposed to a language where these constructs have to be simulated using preprocessing hacks (QT) or some other convoluted system simply to use a member function as a callback.
Also the built in reflection and metadata in C# makes it much easier to build a visual gui editor.

The same goes for Objective-C/Cocoa, or Python/Kivy. Of course, all these options place certain limitations on portability.
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
kunos
kunos

Would a C# project also work (i.e. be compilable) for other platforms than Windows? And more specifically, does it give native controls (i.e. Windows look & feel on Windows, OS X look & feel on OS X, etc) on the supported platforms?


a simple WinForm application will run, without recompiling, under Mono on lots of different platforms.

Having said that, I dont see the issue of portability raised by the OP. The typical usage of a GUI application in the game development industry is for tools, and who really cares about portability of a tool? Hardly a show stopper for these kind of applications where the main discriminant is productivity and robustness, and rightly so.
d000hg
d000hg
I've used wx quite a lot and it's pretty good, but it will look businessy and not 'cool'. If you're making games, you maybe don't need to use a standard GUI framework at all - you might do all your GUI in-game.

A note on MFC; it sure is ugly under the hood but I actually quite like developing with it and apps will look nicer than with wx since you can access the fancy Windwos-only controls. Of course if you want to go cross-platform, not an option.
WillPash
WillPash
I agree, for beginners C# forms is the way to learn. For C++ QT is very good, and it supported by all major platofrms; even mobiles. GTK+ is quite good, but more lower level and harder to understand at the beginning. With these GUI APIs you can create some really useful tools, which will aid you in the future when you develop games (making your own game editors, etc).

Get to grips with raw C++; bare in mind as ApochPiQ mentioned isn't GUI development friendly. So write some console apps, and when you are ready and you have covered not only C++ programming; you have also learned the structure of a program. Once you get to writing GUI applications, knowing about message queueing, events, input, GUI interaction will come with patience and most importantly persistance.

Agree with the previous posts MFC is absolutely terrible, do not bother. I've heard good things about WX as well. To be honest, there are plenty of alternatives; These GUI's are good bases to learn when you are ready. Just to add, a lot of in-game menus (HUDs) and GUI are usually done with Crazy Eddie's GUI, which not only uses C++, but also easier languages like C#, Python, and many more . Look at the video demos for now, once you get more acclimatised to more graphical programming, remember it and give the code examples a try.
Dave 'Kit' Wilson - Reliant Code
DividedByZero
DividedByZero
IMO, the best GUI is one you roll for yourself.

I have a GUI system in place for my own app that I am working on. Rolled it in less than a day. There is nothing that I can't do with it. So, it is good for what I want (currently games programming).
Hannesnisula
Hannesnisula
I love the C++ Win32 API. Straight forward and intuitive as well.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.