v/vlib/sdl
prime31 75c01dec30 cleanup SDL event system 2019-12-14 03:31:07 +03:00
..
examples cleanup SDL event system 2019-12-14 03:31:07 +03:00
image sdl: separate sdl module into multiple, dependent submodules 2019-12-08 23:30:38 +03:00
mixer sdl: separate sdl module into multiple, dependent submodules 2019-12-08 23:30:38 +03:00
ttf sdl: separate sdl module into multiple, dependent submodules 2019-12-08 23:30:38 +03:00
LICENSE vlib: sdl module + tVintris example 2019-12-05 11:25:55 +03:00
README.md update brew instructions for sdl dependencies 2019-12-09 03:18:08 +03:00
events.v cleanup SDL event system 2019-12-14 03:31:07 +03:00
sdl.v cleanup SDL event system 2019-12-14 03:31:07 +03:00

README.md

sdl

SDL2 V module -- libSDL2 wrapper

Current APIs available/tested in examples :

  • basic graphics (2D drawing)
  • Image
  • TTF font (text rendering)
  • input handling (keyboard/joystick events)
  • sounds (WAV mixing)
  • music (MOD mixing)
  • more to come.. (networking ?)

Support

sdl is supported on :

  • linux (major distros)
  • MacOS (brew)
  • windows (msys2/mingw64 only for now)

Examples

tVintris

tVintris screenshot

You can run the tVintris example from the V root folder like this :

v run vlib/sdl/examples/tvintris/tvintris.v

Dependencies

Linux

Fedora : $ sudo dnf install SDL2-devel SDL2_ttf-devel SDL2_mixer-devel SDL2_image-devel

Ubuntu : $ sudo apt install libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev

ClearLinux : $ sudo swupd bundle-add devpkg-SDL2_ttf devpkg-SDL2_mixer devpkg-SDL2_image

MacOS

Brew : $ brew install sdl2 sdl2_gfx sdl2_ttf sdl2_mixer sdl2_image sdl2_net

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

Windows

Windows/MSYS2 : $ pacman -S mingw-w64-x86_64-SDL2_ttf mingw-w64-x86_64-SDL2_mixer mingw-w64-x86_64-SDL2_image

Contributions

nsauzede spytheman adlesh