0
\$\begingroup\$

I've been programming in C it's been some time, now I want to get into game development but I'm not sure which GUI library should I use between SDL or GTK? Is it worth sticking up with C or should I switch to C++ (taking out the learning time barrier) ? What will C++ give me that C won't when developing simple 2D games. I am not willing to switch to any other language such as "Java, python, etc" for I still want to use the low level memory management capabilities that C and C++ give. I am also not willing to use a Game Engine to learn game development.

\$\endgroup\$
2
  • 4
    \$\begingroup\$ -1 Which-tech-should-I-use-questions are only answerable by you. The C vs C++ debate has been had a million times on the web: Just pick whichever has the features you want. SDL vs GTK should be obvious from checking their feature lists: Again, pick that which features match your desires. We can't tell you what you want to use. \$\endgroup\$ – Anko May 22 '14 at 20:01
  • \$\begingroup\$ +1 I have been trying to find an answer for this question for ever \$\endgroup\$ – user124114 Aug 20 '19 at 0:19
4
\$\begingroup\$

Answer

First, I think you might be mixing up some terms. For games you want a game-engine such as SDL or unity (list on wikipedia). For graphical user interfaces (GUI) you want something like Qt, GTK, wx (list on wikipedia).

You CAN use a GUI library to make games, it depends on the game type. But if you want high performance game specific features such as realtime 3d graphics and asset management then you should definitely look for a game engine.

Second, the ideals in C++ are very different from the ideals in C. You CAN (and many people do) mix C++ and C. That is in my book a good feature of C++, that you can program like you are used to in C using a C++ compiler, and learn new C++ features as you go. C++ has many many features that can benefit you, especially if you want to write more high-level code. Some game engines and GUI libraries rely on C++ and are not available for pure C programs (for example Qt).

\$\endgroup\$
2
  • 3
    \$\begingroup\$ SDL is not a game engine. From their website: "Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games [..]" A game engine does much more than that. In fact, a game engine might use SDL. \$\endgroup\$ – bogglez May 22 '14 at 20:54
  • \$\begingroup\$ Good point. I guess classifying libraries, engines and frameworks is futile. But In my mind SDL is more game engine than GTK is, and it is most definitely not a GUI library. \$\endgroup\$ – Lennart Rolland May 22 '14 at 22:40
1
\$\begingroup\$

SDL and GTK are quite different in the sense that SDL just tries to provide you with a drawing surface and device inputs. GTK provides you with a user interface toolkit, that is, it provides you with user interface elements such as scrollbars, push buttons and so on. GTK is also quite complex compared to SDL. So I'd definitely go with SDL here. C or C++.. That's a can of worms I'm not going to open.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.