how to draw graphics / make a GUI ?

hi,
so I just started learning c++ and I'm getting a bit tired of my console applications
I want to make a GUI and draw graphics on to it.

I already know a bit of Java where its pretty easy to make a GUI, you just extend from a "Frame" class and use some of its methods such as setsize, settitle and setlocation....

sooo, idk if its that simple in c++ too? or if there is more to it?

also, iv never been a big fan of libraries or any kind of "pre-made-code"
I would like to make my own from scratch :)
(if that's not too hard - I obviously don't want to spend months learning how to do it from scratch if I can just learn opengl or something like that instead)
The C++ standard library doesn't include anything for making GUIs. I recommend you use a library such as Qt or wxWidgets.

http://www.qt.io/
https://www.wxwidgets.org/

OpenGL is only for graphics. You could use it to build your own GUI but then you would need to use other libraries for things like input.

There are also more game-oriented libraries like Allegro, SDL and SFML.

http://alleg.sourceforge.net/
https://www.libsdl.org/
http://www.sfml-dev.org/

They contain functionality for setting up a window, drawing graphics, playing sounds, mouse/keyboard/gamepad input, and many other things that are useful in games. No GUI framework though, but enough functionality to allow you to create your own GUI if that is what you want.
Last edited on

also, iv never been a big fan of libraries or any kind of "pre-made-code"
I would like to make my own from scratch :)
(if that's not too hard - I obviously don't want to spend months learning how to do it from scratch if I can just learn opengl or something like that instead)


Its really satisfying to me creating GUIs in C++ (or PowerBASIC) which don't rely on libraries of external code (other than core Windows Libraries), but it does take a fairly long time to learn. I'd say spend 3 - 6 months on console programming, then allow another 6 months learning the Windows Api. The other options are as Peter87 above posted.
Topic archived. No new replies allowed.