Handmade Network»Forums
Oliver Marsh
193 posts / 1 project
Best libraries to learn for C/C++
Edited by Oliver Marsh on Reason: Initial post
Hi, I am going to make a youtube video about the best general libraries to learn as a C/C++ programmer (handmade style or not) that make the general programming experience easier, and was wondering what people would say their top 5 libraries would be?

I've got:

1. Dear IMGUI
2. bgfx graphics library
3. SDL
4. Sean's Barret's stb_image & truetype
5. Freetype
511 posts
Best libraries to learn for C/C++
Some of the Boost modules, or at least how to extract useful things from them for when you don't want to rebuild that wheel.

Mārtiņš Možeiko
2570 posts / 2 projects
Best libraries to learn for C/C++
Edited by Mārtiņš Možeiko on
Definitely not freetype in top 5. Not that freetype is bad, it is useful, but it has not so easy-to-use API and is a bit unfriendly.

I would consider glfw instead of SDL, as it is much smaller and doing only one thing, but does it good. SDL tries to cover a lot (windowing, joysticks, audio, graphics, 2d renderer, etc...

And as alternative to bgfx I would consider looking at sokol_gfx.h from https://github.com/floooh/sokol. Differences is that sokol is much smaller (so easier to understand), real single-header file library (not automagic concatenate all the files) and C, not C++ implementation, which may or may not matter. Does not cover all platforms bgfx does, but still is pretty usable.
131 posts / 4 projects
Best libraries to learn for C/C++
I think you should prefer SDL over GLFW unless you have a very specific reason to do otherwise. It covers all the functionality that GLFW covers, but it also has an audio backend and supports more platforms than GLFW does. And it has a proper event loop for handling input, which is nicer to use than GLFW's system of callbacks. Yes, there are some features you probably won't use, like the 2D renderer, but the overhead from these is just not that serious. The current SDL2.dll is only 1.3 megabytes, and initialization in SDL is modular, so you don't pay the startup cost for the subsystems you don't use.
Michael Dodis
16 posts
Best libraries to learn for C/C++
Oh man, a video like this would've helped me so much in the beginning!

I haven't used SDL's audio subsystem, but maybe FMOD would make for a good standalone (and relatively high level) audio library?

Nevertheless, I like all of your choices, especially the first 4!