https://github.com/alex11br/c-sdl-sample
https://github.com/alex11br/c-sdl-sample
c cmake emscripten emscripten-game makefile sample sdl2 sdl2-image template vcpkg
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/alex11br/c-sdl-sample
- Owner: ALEX11BR
- License: unlicense
- Created: 2022-11-07T22:14:06.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-10T06:22:18.000Z (8 months ago)
- Last Synced: 2024-09-11T03:14:03.250Z (7 months ago)
- Topics: c, cmake, emscripten, emscripten-game, makefile, sample, sdl2, sdl2-image, template, vcpkg
- Language: C
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# A sample C SDL2 application
This is a sample SDL2 application that can compile to many targets (web and native) and has set up some necessary things.
The `assets` folder has, well, assets; the source code sits in the root.
We have setup a build system with CMake (and optionally vcpkg) for the app's compilation:
- Compile with `cmake --preset debug ; cmake --build --preset debug` for Linux or Windows-MinGW-w64 (make sure you have installed SDL2, SDL2_image, pkg-config).
- Compile with `vcpkg install ; cmake --preset debug-vcpkg ; cmake --build --preset debug-vcpkg` for Windows-VisualStudio (probably other operating systems too, I haven't tested) with vcpkg.
- Compile with `docker run --rm -v $(pwd):/src docker.io/emscripten/emsdk bash -c 'cmake --preset emscripten ; cmake --build --preset emscripten'` for web using the emscripten docker container.Outputs are in `out/build/`.
We also have a `Makefile` build system for Linux, Emscripten or Windows-MinGW-w64.