summaryrefslogtreecommitdiff
path: root/sdl2/bindings.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-06-06 04:43:38 +0200
committerDavid Thompson <dthompson2@worcester.edu>2019-06-06 11:00:12 -0400
commit779de2fcdca7943a4abf4426cb282a9ce9bc4621 (patch)
tree191034daa18fe16840e0829c7997862b5fc09e92 /sdl2/bindings.scm
parent895180d78f951d92b7888f134da426ad606d043d (diff)
render: Add SDL_SetRenderTarget bindings.
* sdl2/bindings.scm (SDL_TEXTUREACCESS_STATIC, SDL_TEXTUREACCESS_STREAMING, SDL_TEXTUREACCESS_TARGET): New variables. (sdl-create-texture, sdl-set-render-target, sdl-get-render-target): New procedures. * sdl2/render.scm (symbol->sdl-access-format, make-texture, set-render-target!, get-render-target): New procedures. * doc/api.texi: Document new procedures.
Diffstat (limited to 'sdl2/bindings.scm')
-rw-r--r--sdl2/bindings.scm13
1 files changed, 13 insertions, 0 deletions
diff --git a/sdl2/bindings.scm b/sdl2/bindings.scm
index ae7f0d0..2ebc2ed 100644
--- a/sdl2/bindings.scm
+++ b/sdl2/bindings.scm
@@ -240,6 +240,19 @@ RETURN-TYPE and accept arguments of ARG-TYPES."
(define-foreign sdl-render-copy-ex
int "SDL_RenderCopyEx" (list '* '* '* '* double '* int))
+(define-public SDL_TEXTUREACCESS_STATIC 0)
+(define-public SDL_TEXTUREACCESS_STREAMING 1)
+(define-public SDL_TEXTUREACCESS_TARGET 2)
+
+(define-foreign sdl-create-texture
+ '* "SDL_CreateTexture" (list '* uint32 int int int))
+
+(define-foreign sdl-set-render-target
+ int "SDL_SetRenderTarget" '(* *))
+
+(define-foreign sdl-get-render-target
+ '* "SDL_GetRenderTarget" '(*))
+
(define-foreign sdl-create-texture-from-surface
'* "SDL_CreateTextureFromSurface" '(* *))