From efb13bfd786b58179713e81f70497e0c01a498e1 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Mon, 9 Nov 2015 22:16:21 -0500 Subject: Update documentation a bit. --- doc/api/rendering.texi | 57 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 44 insertions(+), 13 deletions(-) (limited to 'doc/api/rendering.texi') diff --git a/doc/api/rendering.texi b/doc/api/rendering.texi index 364d09c..236863d 100644 --- a/doc/api/rendering.texi +++ b/doc/api/rendering.texi @@ -1,8 +1,14 @@ @node Rendering @section Rendering +Keeping with the theme of declarative and functional code, Sly's +rendering module provide a purely functional interface to the +imperative world of OpenGL. An abstraction on top of OpenGL known as +``render combinators'' provide a convenient way to describe and +compose rendering pipelines. + @menu -* Scene Graph:: Declarative rendering. +* Render Combinators:: Purely functional rendering API. * Sprites:: 2D textured rectangles. * Textures:: Pixel arrays. * Fonts:: Font loading and text rendering. @@ -10,25 +16,47 @@ * Cameras:: Defining a viewpoint. * Colors:: Pretty colors. * Framebuffers:: Offscreen rendering. +* Shaders:: Programs that run on the GPU. @end menu -@node Scene Graph -@subsection Scene Graph - -@menu -* Models:: Renderable objects. -* Groups:: Transformation hierarchy. -@end menu - -@node Models -@subsubsection Models +@node Render Combinators +@subsection Render Combinators -@node Groups -@subsubsection Groups +Render combinators provide a purely functional interface to the OpenGL +state machine. @node Sprites @subsection Sprites +@deffn {Scheme Procedure} make-sprite @var{texture} [#:anchor] +Create a sprite that displays the image in @var{texture}. The size of +the mesh is the size of @var{texture} in pixels. @var{anchor} defines +the origin of the sprite. By default, the anchor is @code{center}, +which puts the origin in the middle of the sprite. See +'anchor-texture' for more anchoring options. +@end deffn + +@deffn {Scheme Procedure} load-sprite @var{file} [#:anchor] +Create a sprite from the texture in @var{file} whose origin is defined +by @var{anchor}. The default anchor is @code{center}. +@end deffn + +@deffn {Scheme Syntax} sprite? @var{obj} +Return @code{#t} if @var{obj} is a sprite. +@end deffn + +@deffn {Scheme Syntax} sprite-texture @var{sprite} +Return the texture for @var{sprite}. +@end deffn + +@deffn {Scheme Syntax} sprite-mesh @var{mesh} +Return the mesh for @var{sprite}. +@end deffn + +@deffn {Scheme Procedure} render-sprite @var{sprite} +Create a renderer for @var{sprite}. +@end deffn + @node Textures @subsection Textures @@ -46,3 +74,6 @@ @node Framebuffers @subsection Framebuffers + +@node Shaders +@subsection Shaders -- cgit v1.2.3