summaryrefslogtreecommitdiff
path: root/doc/api.texi
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 /doc/api.texi
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 'doc/api.texi')
-rw-r--r--doc/api.texi23
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/api.texi b/doc/api.texi
index 44d6506..53a3e09 100644
--- a/doc/api.texi
+++ b/doc/api.texi
@@ -1098,6 +1098,29 @@ Fill @var{rectangle} onto @var{renderer}.
Fill the list @var{rectangles} onto @var{renderer}.
@end deffn
+@deffn {Procedure} set-render-target! renderer texture
+Sets the render target for @var{renderer} to @var{texture}, making all
+comming draw requests redirect to @var{texture}.
+
+Pass @code{#f} to reset it to the default target.
+@end deffn
+
+@deffn {Procedure} get-render-target renderer
+Returns the current render target of @var{renderer} or @code{#f} if
+it's a texture.
+@end deffn
+
+@deffn {Procedure} make-texture format access width height
+Returns a new texture for @var{renderer} with pixel @var{format}.
+@var{access} is one of the symbols:
+
+@itemize
+@item static, changes rarely, not lockable
+@item streaming, changes frequently, lockable
+@item target, can be used as a render target
+requires that renderer was created with the @code{texture} flag.
+@end itemize
+@end deffn
@deffn {Procedure} surface->texture renderer surface
Convert @var{surface} to a texture suitable for @var{renderer}.