handmade.network » Forums » Best libraries to learn for C/C++
OliverMarsh
Oliver
126 posts / 2 projects

A budding game developer and programmer

#20638 Best libraries to learn for C/C++
2 months, 2 weeks ago Edited by Oliver on March 5, 2019, 12:02 a.m. 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
ratchetfreak
446 posts
#20639 Best libraries to learn for C/C++
2 months, 2 weeks ago

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.

mmozeiko
Mārtiņš Možeiko
1923 posts / 1 project
#20640 Best libraries to learn for C/C++
2 months, 2 weeks ago Edited by Mārtiņš Možeiko on March 5, 2019, 2:03 a.m.

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.
notnullnotvoid
Miles
29 posts / 2 projects
#20641 Best libraries to learn for C/C++
2 months, 2 weeks ago

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.
miked
Michael Dodis
12 posts / 1 project
#20642 Best libraries to learn for C/C++
2 months, 2 weeks ago

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!