From d8e8fb253ac04d5dd524db1c2ae416f749baba96 Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Sat, 15 Mar 2008 15:07:53 -0600 Subject: [PATCH] Add docs for OpenGL Geometric primitives --- extra/opengl/gl/gl-docs.factor | 23 +++++++++++++++++++++++ extra/opengl/opengl-docs.factor | 6 +++++- extra/opengl/opengl.factor | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 extra/opengl/gl/gl-docs.factor diff --git a/extra/opengl/gl/gl-docs.factor b/extra/opengl/gl/gl-docs.factor new file mode 100644 index 0000000000..6efe865ddd --- /dev/null +++ b/extra/opengl/gl/gl-docs.factor @@ -0,0 +1,23 @@ + +USING: help.syntax help.markup ; + +IN: opengl.gl + +ARTICLE: "opengl-geometric-primitives" "OpenGL Geometric Primitives" + + { $table { { $link GL_POINTS } "individual points" } + { { $link GL_LINES } "pairs of vertices interpreted as indivisual line segments" } + { { $link GL_LINE_STRIP } "series of connected line segments" } + { { $link GL_LINE_LOOP } "same as above, with a segment added between last and first vertices" } + { { $link GL_TRIANGLES } "triples of vertices interpreted as triangles" } + { { $link GL_TRIANGLE_STRIP } "linked strip of triangles" } + { { $link GL_TRIANGLE_FAN } "linked fan of triangles" } + { { $link GL_QUADS } "quadruples of vertices interpreted as four-sided polygons" } + { { $link GL_QUAD_STRIP } "linked strip of quadrilaterals" } + { { $link GL_POLYGON } "boundary of a simple, convex polygon" } } + +; + +HELP: glBegin + { $values { "mode" + { "One of the " { $link "opengl-geometric-primitives" } } } } ; \ No newline at end of file diff --git a/extra/opengl/opengl-docs.factor b/extra/opengl/opengl-docs.factor index 97120237ec..5b1ee0d565 100644 --- a/extra/opengl/opengl-docs.factor +++ b/extra/opengl/opengl-docs.factor @@ -10,7 +10,11 @@ HELP: gl-error { $description "If the most recent OpenGL call resulted in an error, print the error to the " { $link stdio } " stream." } ; HELP: do-state -{ $values { "what" integer } { "quot" quotation } } + { + $values + { "mode" { "One of the " { $link "opengl-geometric-primitives" } } } + { "quot" quotation } + } { $description "Wraps a quotation in " { $link glBegin } "/" { $link glEnd } " calls." } ; HELP: do-enabled diff --git a/extra/opengl/opengl.factor b/extra/opengl/opengl.factor index 5afb6ef070..08e3cb204b 100755 --- a/extra/opengl/opengl.factor +++ b/extra/opengl/opengl.factor @@ -25,7 +25,7 @@ IN: opengl "GL error: " over gluErrorString append throw ] unless drop ; -: do-state ( what quot -- ) +: do-state ( mode quot -- ) swap glBegin call glEnd ; inline : do-enabled ( what quot -- )