sdl: update readme

pull/3947/head
Alexey 2020-03-06 22:43:33 +03:00 committed by GitHub
parent 8a711a8376
commit 06df6d25a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 22 deletions

View File

@ -1,7 +1,8 @@
# sdl # sdl
SDL2 V module -- libSDL2 wrapper
Current APIs available/tested in examples : SDL2 V module -- libSDL2 wrapper.
Current APIs available/tested in examples:
- basic graphics (2D drawing) - basic graphics (2D drawing)
- [Image](image/README.md) - [Image](image/README.md)
- TTF font (text rendering) - TTF font (text rendering)
@ -10,48 +11,50 @@ Current APIs available/tested in examples :
- music (MOD mixing) - music (MOD mixing)
- more to come.. (networking ?) - more to come.. (networking ?)
# Support ## Support
sdl is supported on : sdl is supported on:
- linux (major distros) - Linux (major distros)
- MacOS (brew) - MacOS (brew)
- windows (msys2/mingw64 only for now) - Windows
# Examples ## Examples
[tVintris](examples/tvintris) [tVintris](examples/tvintris)
![tVintris screenshot](examples/tvintris/images/tvintris.png) ![tVintris screenshot](/examples/sdl/tvintris/images/tvintris.png)
You can run the tVintris example from the V root folder like this : You can run the tVintris example from the V root folder like this :
``` ```
v run vlib/sdl/examples/tvintris/tvintris.v v run vlib/sdl/examples/tvintris/tvintris.v
``` ```
# Dependencies ## Dependencies
## Linux ### Linux
Fedora :
#### Fedora
`$ sudo dnf install SDL2-devel SDL2_ttf-devel SDL2_mixer-devel SDL2_image-devel` `$ sudo dnf install SDL2-devel SDL2_ttf-devel SDL2_mixer-devel SDL2_image-devel`
Ubuntu : #### Ubuntu
`$ sudo apt install libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev` `$ sudo apt install libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev`
ClearLinux : #### ClearLinux
`$ sudo swupd bundle-add devpkg-SDL2_ttf devpkg-SDL2_mixer devpkg-SDL2_image` `$ sudo swupd bundle-add devpkg-SDL2_ttf devpkg-SDL2_mixer devpkg-SDL2_image`
## MacOS ### MacOS
Brew :
#### Brew
`$ brew install sdl2 sdl2_gfx sdl2_ttf sdl2_mixer sdl2_image sdl2_net` `$ brew install sdl2 sdl2_gfx sdl2_ttf sdl2_mixer sdl2_image sdl2_net`
If you get no music with the above, try: If you get no music with the above, try:
`$ brew reinstall --build-from-source --force sdl2 sdl2_gfx sdl2_image sdl2_mixer sdl2_net sdl2_ttf webp libtiff libmodplug libogg` `$ brew reinstall --build-from-source --force sdl2 sdl2_gfx sdl2_image sdl2_mixer sdl2_net sdl2_ttf webp libtiff libmodplug libogg`
## Windows ### Windows
Windows/MSYS2 :
`$ pacman -S mingw-w64-x86_64-SDL2_ttf mingw-w64-x86_64-SDL2_mixer mingw-w64-x86_64-SDL2_image`
# Contributions `$ .github\workflows\windows-install-sdl.bat`
nsauzede ## Contributions
spytheman
adlesh - nsauzede
- spytheman
- adlesh