Working on a Mac 10 years ago, I built a project using SDL2 and several of its subcomponents:
sdl2_image, sdl2_mixer, sdl2_ttf. Each of these were installed on my Mac as frameworks. The correct include pattern was then:
#include <SDL2/SDL.h>
#include <SDL2/SDL2_gfxPrimitives.h>
#include <SDL2_image/SDL_image.h>
#include <SDL2_mixer/SDL_mixer.h>
#include <SDL2_ttf/SDL_ttf.h>
But now I have installed on a newer machine using homebrew. And I don’t find directories like SDL2_image, but I do find /opt/homebrew/include/SDL2 which does in fact contain SDL_image.h, SDL_mixer.h, etc. This leads to a different include pattern:
#include <SDL2/SDL.h>
#include <SDL2/SDL2_gfxPrimitives.h>
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_mixer.h>
#include <SDL2/SDL_ttf.h>
Please help me understand: which of these is the “more correct” way of doing things? Which will be more portable to Linux, and to Windows?