summaryrefslogtreecommitdiff
path: root/sdl2/bindings.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2015-12-13 15:34:33 -0500
committerDavid Thompson <dthompson2@worcester.edu>2015-12-13 22:50:05 -0500
commitd4824b20c811ae859541de72ac971b070cf9f9d2 (patch)
tree3c3634fd5fb955830dcf80d3622d7527eedccd5a /sdl2/bindings.scm
parente0c2201c2fb811b498eba347ea9389621d92226a (diff)
Add renderer bindings.
* sdl2/bindings.scm (SDL_RENDERER_SOFTWARE, SDL_RENDERER_ACCELERATED, SDL_RENDERER_PRESENTVSYNC, SDL_RENDERER_TARGETTEXTURE): New variables. (sdl-create-renderer, sdl-destroy-renderer, sdl-render-clear, sdl-render-present, sdl-render-copy, sdl-create-texture-from-surface): New procedures. * sdl2/render.scm: New file. * Makefile.am (SOURCES): Add it.
Diffstat (limited to 'sdl2/bindings.scm')
-rw-r--r--sdl2/bindings.scm30
1 files changed, 29 insertions, 1 deletions
diff --git a/sdl2/bindings.scm b/sdl2/bindings.scm
index 25b3576..8925e6f 100644
--- a/sdl2/bindings.scm
+++ b/sdl2/bindings.scm
@@ -50,7 +50,12 @@
SDL_WINDOW_FULLSCREEN_DESKTOP
SDL_WINDOW_FOREIGN
SDL_WINDOW_ALLOW_HIGHDPI
- SDL_WINDOW_MOUSE_CAPTURE))
+ SDL_WINDOW_MOUSE_CAPTURE
+
+ SDL_RENDERER_SOFTWARE
+ SDL_RENDERER_ACCELERATED
+ SDL_RENDERER_PRESENTVSYNC
+ SDL_RENDERER_TARGETTEXTURE))
(define sdl-func
(let ((lib (dynamic-link %libsdl2)))
@@ -193,6 +198,29 @@ RETURN-TYPE and accept arguments of ARG-TYPES."
(define-foreign sdl-gl-swap-window
void "SDL_GL_SwapWindow" '(*))
+(define SDL_RENDERER_SOFTWARE #x00000001)
+(define SDL_RENDERER_ACCELERATED #x00000002)
+(define SDL_RENDERER_PRESENTVSYNC #x00000004)
+(define SDL_RENDERER_TARGETTEXTURE #x00000008)
+
+(define-foreign sdl-create-renderer
+ '* "SDL_CreateRenderer" (list '* int uint32))
+
+(define-foreign sdl-destroy-renderer
+ void "SDL_DestroyRenderer" '(*))
+
+(define-foreign sdl-render-clear
+ int "SDL_RenderClear" '(*))
+
+(define-foreign sdl-render-present
+ void "SDL_RenderPresent" '(*))
+
+(define-foreign sdl-render-copy
+ int "SDL_RenderCopy" '(* * * *))
+
+(define-foreign sdl-create-texture-from-surface
+ '* "SDL_CreateTextureFromSurface" '(* *))
+
;;;
;;; Timer