gpu.*: docs

factor-shell
Björn Lindqvist 2018-01-27 22:43:36 +01:00
parent 88e1f091b9
commit 26b6a378ac
5 changed files with 44 additions and 9 deletions

View 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." } ;

View 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:

View File

@ -0,0 +1,5 @@
USING: help.markup help.syntax ;
IN: gpu.util
HELP: window-vertex-format
{ $class-description "A vertex format for screen coordinates." } ;

View File

@ -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." } ;

View File

@ -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." } ;