2009-01-18 21:10:08 -05:00
USING: alien help.markup help.syntax io kernel math quotations
2009-07-14 13:00:37 -04:00
opengl.gl assocs vocabs.loader sequences accessors colors words ;
2007-09-20 18:09:08 -04:00
IN: opengl
HELP: gl-color
2009-01-18 21:10:08 -05:00
{ $values { "color" color } }
2009-01-30 04:37:20 -05:00
{ $description "Wrapper for " { $link glColor4d } " taking an instance of " { $link color } "." }
{ $notes "See " { $link "colors" } "." } ;
2007-09-20 18:09:08 -04:00
HELP: gl-error
2009-07-14 13:00:37 -04:00
{ $description "If the most recent OpenGL call resulted in an error, throw a " { $snippet "gl-error" } " instance reporting the error." } ;
2007-09-20 18:09:08 -04:00
HELP: do-enabled
{ $values { "what" integer } { "quot" quotation } }
{ $description "Wraps a quotation in " { $link glEnable } "/" { $link glDisable } " calls." } ;
HELP: do-matrix
2009-04-04 21:03:30 -04:00
{ $values { "quot" quotation } }
{ $description "Saves and restores the current matrix before and after calling the quotation." } ;
2007-09-20 18:09:08 -04:00
HELP: gl-line
{ $values { "a" "a pair of integers" } { "b" "a pair of integers" } }
{ $description "Draws a line between two points." } ;
HELP: gl-fill-rect
2009-03-27 19:31:25 -04:00
{ $values { "loc" "a pair of integers" } { "dim" "a pair of integers" } }
2008-11-11 09:53:11 -05:00
{ $description "Draws a filled rectangle with the top-left corner at the origin and the given dimensions." } ;
2007-09-20 18:09:08 -04:00
HELP: gl-rect
2009-03-27 19:31:25 -04:00
{ $values { "loc" "a pair of integers" } { "dim" "a pair of integers" } }
2008-11-11 09:53:11 -05:00
{ $description "Draws the outline of a rectangle with the top-left corner at the origin and the given dimensions." } ;
2007-09-20 18:09:08 -04:00
2008-01-31 23:24:08 -05:00
HELP: gen-gl-buffer
2008-01-27 01:37:28 -05:00
{ $values { "id" integer } }
{ $description "Wrapper for " { $link glGenBuffers } " to handle the common case of generating a single buffer ID." } ;
2008-01-31 23:24:08 -05:00
HELP: delete-gl-buffer
2008-01-27 01:37:28 -05:00
{ $values { "id" integer } }
{ $description "Wrapper for " { $link glDeleteBuffers } " to handle the common case of deleting a single buffer ID." } ;
2008-01-31 23:24:08 -05:00
{ gen-gl-buffer delete-gl-buffer } related-words
2008-01-27 01:37:28 -05:00
HELP: bind-texture-unit
{ $values { "id" "The id of a texture object." } { "target" "The texture target (e.g., " { $snippet "GL_TEXTURE_2D" } ")" } { "unit" "The texture unit to bind (e.g., " { $snippet "GL_TEXTURE0" } ")" } }
{ $description "Binds texture " { $snippet "id" } " to texture target " { $snippet "target" } " of texture unit " { $snippet "unit" } ". Equivalent to " { $snippet "unit glActiveTexture target id glBindTexture" } "." } ;
HELP: set-draw-buffers
2009-06-24 18:59:25 -04:00
{ $values { "buffers" "A sequence of buffer words (e.g. " { $snippet "GL_BACK" } ", " { $snippet "GL_COLOR_ATTACHMENT0" } ")" } }
2008-01-27 01:37:28 -05:00
{ $description "Wrapper for " { $link glDrawBuffers } ". Sets up the buffers named in the sequence for simultaneous drawing." } ;
2007-09-20 18:09:08 -04:00
HELP: do-attribs
{ $values { "bits" integer } { "quot" quotation } }
{ $description "Wraps a quotation in " { $link glPushAttrib } "/" { $link glPopAttrib } " calls." } ;
HELP: gen-dlist
{ $values { "id" integer } }
{ $description "Wrapper for " { $link glGenLists } " to handle the common case of generating a single display list ID." } ;
HELP: make-dlist
{ $values { "type" "one of " { $link GL_COMPILE } " or " { $link GL_COMPILE_AND_EXECUTE } } { "quot" quotation } { "id" "an OpenGL texture ID" } }
{ $description "Compiles the results of calling the quotation into a new OpenGL display list." } ;
HELP: gl-translate
{ $values { "point" "a pair of integers" } }
{ $description "Wrapper for " { $link glTranslated } " taking a point object." } ;
HELP: with-translation
{ $values { "loc" "a pair of integers" } { "quot" quotation } }
{ $description "Calls the quotation with a translation by " { $snippet "loc" } " pixels applied to the current " { $link GL_MODELVIEW } " matrix, restoring the matrix when the quotation is done." } ;
ARTICLE: "gl-utilities" "OpenGL utility words"
2008-07-03 02:39:45 -04:00
"The " { $vocab-link "opengl" } " vocabulary implements some utility words to give OpenGL a more Factor-like feel."
2007-09-20 18:09:08 -04:00
$nl
2008-07-03 02:39:45 -04:00
"The " { $vocab-link "opengl.gl" } " and " { $vocab-link "opengl.glu" } " vocabularies have the actual OpenGL bindings."
{ $subsection "opengl-low-level" }
2009-07-14 13:00:37 -04:00
"Error reporting:"
{ $subsection gl-error }
2007-09-20 18:09:08 -04:00
"Wrappers:"
{ $subsection gl-color }
{ $subsection gl-translate }
2008-01-27 01:37:28 -05:00
{ $subsection bind-texture-unit }
2007-09-20 18:09:08 -04:00
"Combinators:"
{ $subsection do-enabled }
{ $subsection do-attribs }
{ $subsection do-matrix }
{ $subsection with-translation }
{ $subsection make-dlist }
"Rendering geometric shapes:"
{ $subsection gl-line }
{ $subsection gl-fill-rect }
{ $subsection gl-rect }
2008-01-14 01:58:11 -05:00
;
2007-09-20 18:09:08 -04:00
ABOUT: "gl-utilities"