This repository contains the template for a SDL2 project which does the following things:
- Implements Game loop for 60 fps
- Creates window
- Sets window icon and title
- Creates and Renders background texture
- Creates and Renders sprite
- Handles keypress events
- MinGW toolkit (g++) (required)
- Python (>=3.8.x) (optional)
- SDL2
- SDL_image
-
Install and Extract
- SDL2 development libraries from https://libsdl.org/download-2.0.php
- Compiler specific development libraries of SDL_image from https://www.libsdl.org/projects/SDL_image/
-
Copy
- SDL2/bin/* to bin/debug/ and bin/release/
- SDL2/include/* to include/
- SDL2/lib/* to lib/
- SDL_image/bin/* to bin/debug/ and bin/release/
- SDL_image/include/* to include/
- SDL_image/lib/* to lib/
-
make res make run # to build and run debug executable # or make release # to build release executable
-
(Optional) You can make changes to generate_sprite.py files to make changes to sprite
python generate_sprite.py make res
-
Feel free to open an issue in this repo if you get any error