This is a simple SDL2 example that allows a user to move a sprite using arrow keys. This is meant to be used as a convenient single-file starting point for more complex projects.
Here is a screenshot of what the program looks like when it runs:
Linker settings (in Code::Blocks under Project->Build Options...)
-lmingw32 -lSDL2main -lSDL2
Download the SDL2 DMG file and add the SDL2.framework into your Linker settings