From dbc5984dc1360944f4dd15f9d846829fab99f04d Mon Sep 17 00:00:00 2001 From: Leo Prikler Date: Fri, 15 Jan 2021 21:05:43 +0100 Subject: Add support for hints. * sdl2/bindings.scm (SDL_HINT_DEFAULT, SDL_HINT_NORMAL, SDL_HINT_OVERRIDE) (sdl-set-hint-with-priority, sdl-get-hint): New variables. * sdl2/hints.scm: New file. * doc/api.texi: Add Hints. --- doc/api.texi | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'doc') diff --git a/doc/api.texi b/doc/api.texi index 3c4e645..288d0a6 100644 --- a/doc/api.texi +++ b/doc/api.texi @@ -10,6 +10,7 @@ * Images:: Loading and saving images. * Sound:: Sound effects and music. * Fonts:: Truetype and bitmap font rendering. +* Hints:: Getting and setting configuration hints. @end menu @node Basics @@ -1648,3 +1649,26 @@ Render @var{text}, a UTF-8 encoded string, using @var{font} and @var{color}, the foreground color, and return a high-quality alpha-blended surface containing the results. @end deffn + +@node Hints +@section Hints + +@example +(use-modules (sdl2 hints)) +@end example + +@deffn {Procedure} get-hint hint +Get the string value of @var{hint} or @code{#f} if if @var{hint} is unset. +@end deffn + +@deffn {Procedure} set-hint! hint value [priority] +Set @var{hint} to @var{value} at priority level @var{priority}. +@var{priority} can be one of the symbols @code{default}, @code{normal} or +@code{override} and defaults to @code{normal}. +@var{value} will automatically be converted to a string if it is a boolean +or a number. +@end deffn + +Inside SDL2, the macro @code{SDL_HINT_SOME_HINT} corresponds to the +environment variable @env{SDL_SOME_HINT}. In Guile-SDL2, this hint would be +represented by the symbol @code{some-symbol.} -- cgit v1.2.3