git clone --recursive https://github.com/blackedout01/sdl-gl-template.git
or if already cloned without --recursive
:
git submodule update --init
git submodule update --remote --merge
It's best to not always update to latest commits, since these might not be stable.
Instead, you can check out release commits of your library. In SDL (and other libraries probably) they are tagged. To check them out, run the following commands inside the submodule repository:
git tag
git checkout <insert tag name here>
Finally your submodule changes can be added and committed in the base repository.
Install your build tools
Open terminal and navigate to repository
Build all libraries once: sh buildlibs.sh
Now there are 3 new files: libSDL2main.a
, libSDL2.a
and glad.a
Build project: sh build.sh
Run project: ./a.out
Install Visual Studio Build Tools https://visualstudio.microsoft.com/de/downloads/?q=build+tools (at the bottom of the page)
Open "x64 Native Tools Command Prompt for VS 2022" and navigate to repository
Build all libraries once: buildlibs.bat
Now there are 4 new files: SDL2main.lib
, SDL2.lib
, glad.lib
and SDL2.dll
(I don't understand how to build static SDL)
Build project: build.bat
(not sure about that warning either)
Run project: main.exe
Open terminal and navigate to repository
Build all libraries once: sh buildlibs.sh
Now there are 3 new files: libSDL2main.a
, libSDL2.a
and glad.a
Build project: sh build.sh
Run project: ./a.out