]> gitweb.factorcode.org Git - factor.git/commitdiff
gpu.*: docs
authorBjörn Lindqvist <bjourne@gmail.com>
Sat, 27 Jan 2018 21:43:36 +0000 (22:43 +0100)
committerBjörn Lindqvist <bjourne@gmail.com>
Sat, 27 Jan 2018 21:44:26 +0000 (22:44 +0100)
extra/gpu/gpu-docs.factor
extra/gpu/shaders/shaders-docs.factor
extra/gpu/util/util-docs.factor [new file with mode: 0644]
extra/gpu/util/wasd/wasd-docs.factor [new file with mode: 0644]
extra/opengl/demo-support/demo-support-docs.factor [new file with mode: 0644]

index c92e878119db1e30f1161d2339e98bf9d98e1054..6933ba1979f69cbd0b9f0fc9e932dcd6bd58078e 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2009 Joe Groff.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: help.markup help.syntax ui.gadgets.worlds ;
+USING: gpu.private help.markup help.syntax ui.gadgets.worlds ;
 IN: gpu
 
 HELP: finish-gpu
@@ -15,6 +15,9 @@ HELP: flush-gpu
 HELP: gpu-object
 { $class-description "Parent class of all GPU resources." } ;
 
+HELP: has-vertex-array-objects?
+{ $var-description "Whether the opengl version supports Vertex Array Objects or not." } ;
+
 HELP: init-gpu
 { $description "Initializes the current graphics context for use with the " { $snippet "gpu" } " library. This should be the first thing called in a world's " { $link begin-world } " method." } ;
 
index ea202dae82fe4dc9b1e195108fab35eb9e1bb5d3..e00defe6260423c0cb43269c058cdf6927c7e7a7 100644 (file)
@@ -1,9 +1,17 @@
 ! Copyright (C) 2009 Joe Groff.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: classes classes.struct gpu.buffers help.markup help.syntax
-images kernel math multiline quotations sequences strings words ;
+USING: classes classes.struct gpu.buffers gpu.shaders.private
+help.markup help.syntax images math sequences strings words ;
 IN: gpu.shaders
 
+HELP: <multi-vertex-array>
+{ $values
+    { "vertex-formats" "a list of " { $link buffer-ptr } "/" { $link vertex-format } " pairs" }
+    { "program-instance" program-instance }
+    { "vertex-array" vertex-array }
+}
+{ $description "Creates a new " { $link vertex-array } " to feed data to " { $snippet "program-instance" } " from the set of " { $link buffer } "s specified in " { $snippet "vertex-formats" } ". The first element of each pair in " { $snippet "vertex-formats" } " can be either a " { $link buffer-ptr } " or a " { $link buffer } "; in the latter case, vertex data in the associated format is read from the beginning of the buffer." } ;
+
 HELP: <program-instance>
 { $values
     { "program" program }
@@ -18,13 +26,13 @@ HELP: <shader-instance>
 }
 { $description "Compiles an instance of " { $snippet "shader" } " for the current graphics context. If an instance already exists for " { $snippet "shader" } " in the current context, it is reused." } ;
 
-HELP: <multi-vertex-array>
+HELP: <vertex-array-object>
 { $values
-    { "vertex-formats" "a list of " { $link buffer-ptr } "/" { $link vertex-format } " pairs" }
-    { "program-instance" program-instance }
-    { "vertex-array" vertex-array }
+  { "vertex-buffer" "a vertex buffer" }
+  { "program-instance" program-instance }
+  { "format" vertex-format }
 }
-{ $description "Creates a new " { $link vertex-array } " to feed data to " { $snippet "program-instance" } " from the set of " { $link buffer } "s specified in " { $snippet "vertex-formats" } ". The first element of each pair in " { $snippet "vertex-formats" } " can be either a " { $link buffer-ptr } " or a " { $link buffer } "; in the latter case, vertex data in the associated format is read from the beginning of the buffer." } ;
+{ $description "Creates a new vertex array object." } ;
 
 HELP: feedback-format:
 { $syntax "feedback-format: vertex-format" }
@@ -32,7 +40,7 @@ HELP: feedback-format:
 
 HELP: GLSL-PROGRAM:
 { $syntax "GLSL-PROGRAM: program-name shader shader ... [vertex-format vertex-format ...] [feedback-format: vertex-format] ;" }
-{ $description "Defines a new " { $link program } " named " { $snippet "program-name" } ". When the program is instantiated with " { $link <program-instance> } ", it will link together instances of all of the specified " { $link shader } "s to create the program instance. If any " { $link vertex-format } "s are specified, their attributes will be pre-assigned attribute indexes at link time, to ensure that their indexes remain constant if the program is refreshed with " { $link refresh-program } ". A transform feedback vertex format may optionally be specified with " { $link POSTPONE: feedback-format: } "; if the program is used to collect transform feedback, the given vertex format will be used for the output." }
+{ $description "Defines a new shader " { $link program } " named " { $snippet "program-name" } ". When the program is instantiated with " { $link <program-instance> } ", it will link together instances of all of the specified " { $link shader } "s to create the program instance. If any " { $link vertex-format } "s are specified, their attributes will be pre-assigned attribute indexes at link time, to ensure that their indexes remain constant if the program is refreshed with " { $link refresh-program } ". A transform feedback vertex format may optionally be specified with " { $link POSTPONE: feedback-format: } "; if the program is used to collect transform feedback, the given vertex format will be used for the output." }
 { $notes "Transform feedback requires OpenGL 3.0 or one of the " { $snippet "GL_EXT_transform_feedback" } " or " { $snippet "GL_ARB_transform_feedback" } " extensions." } ;
 
 HELP: GLSL-SHADER-FILE:
diff --git a/extra/gpu/util/util-docs.factor b/extra/gpu/util/util-docs.factor
new file mode 100644 (file)
index 0000000..dc8521a
--- /dev/null
@@ -0,0 +1,5 @@
+USING: help.markup help.syntax ;
+IN: gpu.util
+
+HELP: window-vertex-format
+{ $class-description "A vertex format for screen coordinates." } ;
diff --git a/extra/gpu/util/wasd/wasd-docs.factor b/extra/gpu/util/wasd/wasd-docs.factor
new file mode 100644 (file)
index 0000000..0627e11
--- /dev/null
@@ -0,0 +1,11 @@
+USING: help.markup help.syntax math ;
+IN: gpu.util.wasd
+
+HELP: wasd-world
+{ $class-description "A wasd-world is a 3d world in which the camera can move using the keybindings 'w', 'a', 's' and 'd' and the view can rotate using the camera." } ;
+
+HELP: wasd-near-plane
+{ $values
+  { "world" wasd-world }
+  { "near-plane" float }
+} { $description "Near plane of the 3d world." } ;
diff --git a/extra/opengl/demo-support/demo-support-docs.factor b/extra/opengl/demo-support/demo-support-docs.factor
new file mode 100644 (file)
index 0000000..3798a88
--- /dev/null
@@ -0,0 +1,8 @@
+USING: help.markup help.syntax opengl.gl quotations ;
+IN: opengl.demo-support
+
+HELP: do-state
+{ $values
+  { "mode" GLenum }
+  { "quot" quotation }
+} { $description "Runs the quotation wrapped in a " { $link glBegin } "/" { $link glEnd } " block." } ;