https://github.com/ullaskunder3/sdl2-setup-linux-system
started learning SDL2 c++ for game development
https://github.com/ullaskunder3/sdl2-setup-linux-system
automation boilerplate config cpp demo fedora linux scratch sdl2 task vscode
Last synced: 25 days ago
JSON representation
started learning SDL2 c++ for game development
- Host: GitHub
- URL: https://github.com/ullaskunder3/sdl2-setup-linux-system
- Owner: ullaskunder3
- Created: 2023-04-21T10:29:31.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-21T11:08:40.000Z (about 2 years ago)
- Last Synced: 2025-02-08T22:25:22.158Z (3 months ago)
- Topics: automation, boilerplate, config, cpp, demo, fedora, linux, scratch, sdl2, task, vscode
- Homepage:
- Size: 27.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sdl2-setup-linux-system
## Installation
To install SDL2 in Fedora, you can use the following command in your terminal:
```bash
sudo dnf install SDL2-devel```
## Automate the step of running the output file


### This tasks.json file defines two tasks: Build C++ program with SDL2 and Run C++ program with SDL2
`Build C++ program with SDL2` is a `cppbuild` task which uses the `g++ compiler` to build the C++ program. It takes the following arguments:
- `-g` specifies to include debugging information in the binary
- `-o` specifies the output file path, which is build/${fileBasenameNoExtension}.out. ${fileBasenameNoExtension} is the name of the current file being built (without its extension).
- `${file}` specifies the path of the current file being built.
- `sdl2-config --cflags --libs` includes the compiler flags and linker flags needed for the SDL2 library.
- `"cwd": "${fileDirname}"` sets the current working directory to the directory of the current file being built.The group option specifies that this task is a build task and is the default task for this project.
The `Run C++ program with SDL2` task is a `shell` task which runs the binary built by the `Build C++ program with SDL2` task. It takes the following arguments:
- `${workspaceFolder}/build/${fileBasenameNoExtension}.out` specifies the path of the binary file to run.
- The `group` option specifies that this task is a test task and is the default task for this group.
- The `dependsOn` option specifies that this task depends on the `Build C++` program with SDL2 task, meaning that the build task will always be executed before the run task.So when you run the `Run C++ program with SDL2` task, it will first build the C++ program using the `Build C++ program with SDL2` task, and then run the built binary using the `shell` task.