Added readme.
This commit is contained in:
parent
e9ddad2dfb
commit
4f6cc4dded
48
README.md
Normal file
48
README.md
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
# sdl_gpu_test
|
||||||
|
Just a little sandbox for me to try out [SDL3](https://github.com/libsdl-org/SDL/)'s SDL_gpu.h. Feel free to do with it whatever you want. Note however that the included assets have their own licenses.
|
||||||
|
|
||||||
|
## Compiling
|
||||||
|
This project uses [SCons](https://scons.org/) and my personal extension "[SCons++](https://git.mewin.de/mewin/scons-plus-plus)" for compilation. After installing SCons it should work out of the box on Linux and Windows 10, anything else hasn't been tested.
|
||||||
|
|
||||||
|
On Linux you should be able to get SCons from your repository on any major distribution. On Windows you can either download it from their website (https://scons.org/) or (my recommendation) install it via [Scoop](https://scoop.sh/).
|
||||||
|
|
||||||
|
Just make sure to initialise the git submodule for SCons++. Either by cloning recursively:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git clone --recurse-submodules https://git.mewin.de/mewin/sdl_gpu_test.git
|
||||||
|
```
|
||||||
|
|
||||||
|
or by updating it after cloning:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git submodule init
|
||||||
|
git submodule update
|
||||||
|
```
|
||||||
|
|
||||||
|
After that you can compile the project using SCons:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
scons -j<jobs>
|
||||||
|
```
|
||||||
|
|
||||||
|
This will automatically fetch and build dependencies (stored in `~/.cache/spp_cache` on Linux and `%LocalAppData%\spp_cache` on Windows).
|
||||||
|
|
||||||
|
Note that as of now the SDL repository needs to be patched in order for the build to work. You first have to run SCons once to update the repo and let the build fail, then apply the patch from `external/scons-plus-plus/recipes/SDL/fix_sdl3_from_worktree.patch`:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
cd <spp_cache_dir>/cloned/git\SDL/b70daef4eb57
|
||||||
|
git apply <path to fix_sdl3_from_worktree.patch>
|
||||||
|
```
|
||||||
|
|
||||||
|
After that run the build again and everything should work just fine.
|
||||||
|
|
||||||
|
## Running
|
||||||
|
After compiling you can find the executable in `bin/sdl_gpu_test[.exe]`. You can either run it without any arguments to execute the latest iteration of my test application or pass the `--app` parameter to chose another one.
|
||||||
|
|
||||||
|
## Further Reading
|
||||||
|
If you want to learn more about SDL_gpu.h, try the following:
|
||||||
|
|
||||||
|
* read the long comment at the beginning of SDL_gpu.h itself: https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_gpu.h
|
||||||
|
* look at the examples provided here: https://github.com/TheSpydog/SDL_gpu_examples
|
||||||
|
* read this blog entry about why there is no unified way for distributing shaders: https://moonside.games/posts/layers-all-the-way-down/
|
||||||
|
* look at this little helper for compiling your shaders for SDL_gpu.h: https://github.com/libsdl-org/SDL_gpu_shadercross (I haven't tested it myself yet)
|
Loading…
x
Reference in New Issue
Block a user