I am trying to use SDL2 in C language compiled with GCC in CodeBlocks but the events don’t work, for example, I can’t close the window with SDL_QUIT. Is anything wrong on the code, please ?
Nope, SDL_QUIT is sent when all windows are closed, so that should work
as-is. Also, the window events are strange, you’d actually have to check
for this for your approach:
It was in the build option in my project, I apparently needed to put -lSDL2 in the linker option and now it works well, all kind of events.
It was not on the tutorial I saw to install SDL2, but on an other one. It propose to add “-lmingw32 -lSDL2main -lSDL2” too, but I don’t really know what does it mean. Should I add all of them ?