C++ is one of the strongest and popular programming languages. Every day hundreds of applications are written on it, often using the GUI. However, working with graphics is not always convenient for the programmer — in this case, we use ready-made graphic libraries. They will make the development of the front-end part of applications as quick and convenient as possible.

SFML

SFML (Simple and Fast Multimedia Library) is one of the most convenient and fast graphics libraries for 2D graphics.

Its indisputable advantage is the minimum requirements for the level of knowledge of the language and ease of development: in just a few days, you can write quite a full-fledged program. For example, the first graphic application, “SFML works!” can be written in just a minute.

Another undeniable advantage is cross-platform: SFML runs on Windows, Linux (only X11, but not Wayland), and Mac, and soon will be launched on Android.

The SFML library is used primarily by small startups and programmers for whom creating games is a hobby. SFML is popular among small teams because it does not require writing large amounts of code. You can also complete the initial course.

Qt

Qt is a whole set of tools for quick and easy GUI design. Of course, you can write games here too — why not? — but Qt attracts programmers mainly because it is fast, convenient, flexible, and cross-platform.

In many ways, Qt has overtaken even SFML: the library is available on both Windows, Linux, and Mac, on mobile platforms — Windows Mobile, Android, and iOS.

Qt extends C++ using the IOC (Meta-Object Compiler) and provides additional functions (for example, signals and slots). Also, it has a paid support service (as well as a paid license).

For Qt, there is a large selection of IDE: QtDesigner, QtCreator, QDevelop, Edyuk, and integration with Visual Studio, Eclipse, and Xcode is also available. You can also take a complete course on this library.

Cairo

Cairo is a library for drawing vector images under Linux, Windows, and Mac OS. For example, such a large project as Mozilla uses Cairo in the browser engine Gecko.

Cairo also underlies some operating systems (MorphOS, AmigaOS) and applications (InkScape, Synfig, Graphite). Cairo can interact with the OpenGL backend with GPU support, which, of course, opens up a whole list of useful features.

Cocos (ex. Cocos2D-X)

The cocos2D-X cross-platform library was designed to simplify the development of mobile games.

It supports all the same platforms as Qt. Of the advantages worth noting are the availability, ease of use, and the creation of a separate game designer based on the library of Cocos Creator. In the list of games based on the engine, there is the world-famous BADLAND, running on all available platforms.

If you need to work with graphics and animation in large volumes when creating a game, it is better to use Unity instead of Cocos2D-X.

Unity can seamlessly integrate with tools such as Photoshop, Maya, or Blender. In Cocos2D-X, all graphics are added externally and referenced from the code. There is an excellent course from the developers.

Juce

Juce is a cross-platform framework designed for creating applications and plug-ins in C++. There is a lot of documentation on Juce.

Therefore, you can download the book “Programming in C++ with JUCE 4.2.x: Creating cross-platform multimedia applications using the JUCE library with simple examples”.

Juce is more popular among audio software developers due to a set of wrapper interfaces for building audio plug-ins.

wxWidgets

wxWidgets is one of the oldest but at the same time the most well-known graphic libraries for drawing GUI. Its main advantage is performance.

If QT uses a low-level code only for elements such as buttons and scroll bars, then wxWidgets has its method for each system, and thanks to this, all items are displayed as close as possible to the system style.

A significant feature of wxWidgets is to use the “native” graphical elements of the operating system interface wherever possible. It is a crucial advantage for many users, as they get used to working in a specific environment, and changes to the program interface often cause difficulties in their work. The web has a lesson on working with the library from its developers.

SDL 2.0

SDL is a cross-platform 2D library designed for writing applications (primarily games).

Windows, Linux, Mac OS, and Android, Windows Mobile, and iOS are supported. The advantages of the library are speed, reliability, and ease of operation. Also in the library are implemented professional tools for working with sound — this is a big plus when developing large projects. It combines with wxWidgets and integrates well with OpenGL.

GTK+

GTK+ is one of the most famous graphic libraries. GTK+ is a graphical framework widely used in many systems.

Initially, it was conceived as a component of GIMP, but for 20 years after the release of the first stable version, it found application in hundreds of other applications. Now GTK+ is a full-fledged graphical framework, not inferior to the same QT.

It supports various programming languages ​​and continues to evolve. GTK+ is one of the few frameworks that support the C language.

The library is cross-platform, but there is an opinion that programs on Linux look more native than on Windows or Mac (GTK+ is well supported even on KDE). Interestingly, due to some cross-platform issues, Wireshark has moved to Qt.

Conclusion

The above are the most popular technologies for working with GUIs, not only in C++ but sometimes in other languages (for example, Qt and GTK+).

However, you should always take into account the features of a technology. Write down the list of functions of your application, once again read the descriptions of all libraries and frameworks, and only after that choose what is best for the project.

Blog