diff options
Diffstat (limited to 'doc/api.texi')
-rw-r--r-- | doc/api.texi | 177 |
1 files changed, 171 insertions, 6 deletions
diff --git a/doc/api.texi b/doc/api.texi index 4ea97fb..1524acc 100644 --- a/doc/api.texi +++ b/doc/api.texi @@ -193,36 +193,185 @@ the text that was entered. @end defvr @defvr {Scheme Variable} mouse-press-hook -A hook that is run when a mouse button is pressed. +A hook that is run when a mouse button is pressed. This hook is run +with four arguments: + +@enumerate + +@item +@var{button}: The symbolic name of the button that was pressed, such +as @code{left}, @code{middle}, or @code{right}. + +@item +@var{clicks}: The number of times the button has been clicked in a row. + +@item +@var{x}: The x coordinate of the mouse cursor. + +@item +@var{y}: The y coordinate of the mouse cursor. + +@end enumerate + @end defvr @defvr {Scheme Variable} mouse-release-hook -A hook that is run when a mouse button is released. +A hook that is run when a mouse button is released. This hook is run +with three arguments: + +@enumerate + +@item +@var{button}: The symbolic name of the button that was released. + +@item +@var{x}: The x coordinate of the mouse cursor. + +@item +@var{y}: The y coordinate of the mouse cursor. + +@end enumerate + @end defvr @defvr {Scheme Variable} mouse-move-hook -A hook that is run when the mouse is moved. +A hook that is run when the mouse is moved. This hook is run with +five arguments: + +@enumerate + +@item +@var{x}: The x coordinate of the mouse cursor. + +@item +@var{y}: The y coordinate of the mouse cursor. + +@item +@var{dx}: The amount the mouse has moved along the x axis since the +last mouse move event. + +@item +@var{dy}: The amount the mouse has moved along the y axis since the +last mouse move event. + +@item +@var{buttons}: A list of the buttons that were pressed down when the +mouse was moved. + +@end enumerate + @end defvr @defvr {Scheme Variable} controller-add-hook -A hook that is run when a game controller is connected. +A hook that is run when a game controller is connected. This hook is +run with a single argument, @var{controller}, the controller that was +connected. @end defvr @defvr {Scheme Variable} controller-remove-hook -A hook that is run when a game controller is disconnected. +A hook that is run when a game controller is disconnected. This hook +is run with a single argument, @var{controller}, the controller that +was disconnected. @end defvr @defvr {Scheme Variable} controller-press-hook A hook that is run when a button on a game controller is pressed. +This hook is run with two arguments: + +@enumerate + +@item +@var{controller}: The controller that triggered the event. + +@item +@var{button}: The symbolic name of the button that was pressed. +Possible buttons are: + +@itemize +@item +@code{a} +@item +@code{b} +@item +@code{x} +@item +@code{y} +@item +@code{back} +@item +@code{guide} +@item +@code{start} +@item +@code{left-stick} +@item +@code{right-stick} +@item +@code{left-shoulder} +@item +@code{right-shoulder} +@item +@code{dpad-up} +@item +@code{dpad-down} +@item +@code{dpad-left} +@item +@code{dpad-right} + +@end itemize + +@end enumerate + @end defvr @defvr {Scheme Variable} controller-release-hook A hook that is run when a button on a game controller is released. + +This hook is run with two arguments: + +@enumerate + +@item +@var{controller}: The controller that triggered the event. + +@item +@var{button}: The symbolic name of the button that was released. + +@end enumerate + @end defvr @defvr {Scheme Variable} controller-move-hook A hook that is run when an analog stick or trigger on a game -controller is moved. +controller is moved. This hook is run with three arguments + +@enumerate + +@item +@var{controller}: The controller that triggered the event. + +@item +@var{axis}: The symbolic name of the axis that was moved. Possible +values are: + +@itemize +@item +@code{left-x} +@item +@code{left-y} +@item +@code{right-x} +@item +@code{right-y} +@item +@code{trigger-left} +@item +@code{trigger-right} +@end itemize + +@end enumerate + @end defvr @node Input @@ -374,6 +523,22 @@ Evaluate @var{body} with the current projection matrix bound to @node Textures @subsection Textures +@deffn {Scheme Procedure} load-image @var{file} [#:min-filter nearest] + [#:mag-filter nearest] [#:wrap-s repeat] [#:wrap-t repeat] + +Load the image data from @var{file} and return a new texture object. + +@var{min-filter} and @var{mag-filter} describe the method that should +be used for minification and magnification when rendering, +respectively. Possible values are @code{nearest} and @code{linear}. + +@var{wrap-s} and @var{wrap-t} describe how to interpret texture +coordinates that are greater than @code{1.0}. Possible values are +@code{repeat}, @code{clamp}, @code{clamp-to-border}, and +@code{clamp-to-edge}. + +@end deffn + @node Blending and Depth Testing @subsection Blending and Depth Testing |