Skip to content

aiffc/cl-sdl3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SDL3

CFFI bindings for SDL3

Usage

for windows

(push #P"/path/to/cl-sdl3" asdf:*central-registry*)
(ql:quickload :sdl3)

for linux & darwin

# no need to do cp under darwin
git clone https://github.com/libsdl-org/SDL.git
cd SDL
cmake -S . -B build
make -C build && make -C build install
cp -rf build/libSDL3.so* /usr/lib/x86_64-linux-gnu/

git clone https://github.com/libsdl-org/SDL_ttf.git
cd SDL_ttf
cmake -S . -B build
make -C build && make -C build install
cp -rf build/libSDL3_ttf.so* /usr/lib/x86_64-linux-gnu/

git clone https://github.com/libsdl-org/SDL_image.git
cd SDL_image
cmake -S . -B build
make -C build && make -C build install
cp -rf build/libSDL3_image.so.* /usr/lib/x86_64-linux-gnu/

git clone https://github.com/libsdl-org/SDL_mixer.git
cd SDL_mixer
cmake -S . -B build
make -C build && make -C build install
cp -rf build/libSDL3_mixer.so.* /usr/lib/x86_64-linux-gnu/

on lisp

(push #P"/path/to/cl-sdl3" asdf:*central-registry*)
(ql:quickload :sdl3)

runtest

(ql:quickload :sdl3/tests)
;; do render test
;; demo from https://examples.libsdl.org/SDL3/renderer/01-clear/
(sdl3.render.test::do-clear-demo)
;; demo from https://examples.libsdl.org/SDL3/renderer/02-primitives/
(sdl3.render.test::do-primitives-demo)
;; demo from https://examples.libsdl.org/SDL3/renderer/03-lines/
(sdl3.render.test::do-lines-demo)
;; demo from https://examples.libsdl.org/SDL3/renderer/04-points/
(sdl3.render.test::do-points-demo)
;; demo from https://examples.libsdl.org/SDL3/renderer/05-rectangles/
(sdl3.render.test::do-rectangles-demo)
;; demo from https://examples.libsdl.org/SDL3/renderer/06-textures/
(sdl3.render.test::do-texture-demo)
;; demo from https://examples.libsdl.org/SDL3/renderer/07-streaming-textures/
(sdl3.render.test::do-stream-texture-demo)
;; demo from https://examples.libsdl.org/SDL3/renderer/08-rotating-textures/
(sdl3.render.test::do-rotating-texture-demo)
;; demo from https://examples.libsdl.org/SDL3/renderer/09-scaling-textures/
(sdl3.render.test::do-scaling-texture-demo)
;; demo from https://examples.libsdl.org/SDL3/renderer/10-geometry/
(sdl3.render.test::do-geometry-demo)
;; demo from https://examples.libsdl.org/SDL3/renderer/11-color-mods/
(sdl3.render.test::do-color-mode-demo)
;; demo from https://examples.libsdl.org/SDL3/renderer/14-viewport/
(sdl3.render.test::do-viewport-demo)
;; demo from https://examples.libsdl.org/SDL3/renderer/15-cliprect/
(sdl3.render.test::do-cliprect-demo)
;; demo from https://examples.libsdl.org/SDL3/renderer/17-read-pixels/
(sdl3.render.test::do-read-pixel-demo)
;; demo from https://examples.libsdl.org/SDL3/renderer/18-debug-text/
(sdl3.render.test::do-debug-text-demo)
;; do audio demo
;; demo from https://examples.libsdl.org/SDL3/audio/01-simple-playback/
(sdl3.demo.audio::do-simple-playback-demo)
;; demo from https://examples.libsdl.org/SDL3/audio/02-simple-playback-callback/
(sdl3.demo.audio::do-simple-playback-callback-demo)
;; demo from https://examples.libsdl.org/SDL3/audio/03-load-wav/
(sdl3.demo.audio::do-load-wav-demo)
;; do offical demo
;; demo from https://examples.libsdl.org/SDL3/demo/01-snake/
(sdl3.demo:do-snake-demo)  ;; old style
(sdl3.demo:do-snake-demo2) ;; use callback
;; do event test
(sdl3.event.test::do-keyboard-demo)
(sdl3.event.test::do-mouse-demo)
;; do gpu demo use vulkan driver
;; compile shader 
;; glslc test/gpu/shaders/triangle/triangle.vert -o test/gpu/shaders/triangle/vert.spv
;; glslc test/gpu/shaders/triangle/triangle.frag -o test/gpu/shaders/triangle/frag.spv
(sdl3.gpu::do-triangle-demo)

Documentation

Documentation from the original SDL3 header files is available with respective function and symbols. Slime/SLY show the documentation during completion automatically. Otherwise you can also get the documentation by using describe function.

If you want to build without documentation (probably to decrease image size during deployment) push :sdl3-nodoc to *features* before loading sdl3. You may need to clear the old complied bytecode files (e.g. *.fasl at ~/.cache/common-lisp/ in case of SBCL).

(push :sdl3-nodoc *features*)

add more test and demo

About

cffi bind sdl3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •