]> gitweb.factorcode.org Git - factor.git/blob - extra/gpu/gpu-docs.factor
3c0c24e97eeeab05bb821ad51438db350f390a42
[factor.git] / extra / gpu / gpu-docs.factor
1 ! (c)2009 Joe Groff bsd license
2 USING: help.markup help.syntax ui.gadgets.worlds ;
3 IN: gpu
4
5 HELP: finish-gpu
6 { $description "Waits for all outstanding GPU commands in the current graphics context to complete." } ;
7
8 HELP: flush-gpu
9 { $description "Forces the execution of all outstanding GPU commands in the current graphics context." }
10 { $notes { $snippet "flush-gpu" } " does not wait for execution to finish. For that, use " { $link finish-gpu } "." } ;
11
12 { finish-gpu flush-gpu } related-words
13
14 HELP: gpu-object
15 { $class-description "Parent class of all GPU resources." } ;
16
17 HELP: init-gpu
18 { $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." } ;
19
20 HELP: reset-gpu
21 { $description "Clears all framebuffer, GPU buffer, shader, and vertex array bindings. Call this before directly calling OpenGL functions after using " { $snippet "gpu" } " functions." } ;
22
23 ARTICLE: "gpu" "Graphics context management"
24 "Preparing the GPU library:"
25 { $subsections init-gpu }
26 "Forcing execution of queued commands:"
27 { $subsections
28     flush-gpu
29     finish-gpu
30 }
31 "Resetting OpenGL state:"
32 { $subsections reset-gpu } ;
33
34 ARTICLE: "gpu-summary" "GPU-accelerated rendering"
35 "The " { $vocab-link "gpu" } " library is a set of vocabularies that work together to provide a convenient interface to creating, managing, and using GPU resources."
36 { $subsections
37     "gpu"
38     "gpu.state"
39     "gpu.buffers"
40     "gpu.textures"
41     "gpu.framebuffers"
42     "gpu.shaders"
43     "gpu.render"
44 }
45 "The library is built on top of the OpenGL API, but it aims to be complete enough that raw OpenGL calls are never needed. OpenGL 2.0 with the vertex array object extension (" { $snippet "GL_APPLE_vertex_array_object" } " or " { $snippet "GL_ARB_vertex_array_object" } ") is required. Some features require later OpenGL versions or additional extensions; these requirements are documented alongside individual words. To make full use of the library, an OpenGL 3.1 or later implementation is recommended." ;
46
47 ABOUT: "gpu-summary"