]> gitweb.factorcode.org Git - factor.git/blob - extra/gpu/gpu-docs.factor
interpolate: split out format into a hook
[factor.git] / extra / gpu / gpu-docs.factor
1 ! Copyright (C) 2009 Joe Groff.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: gpu.private help.markup help.syntax ui.gadgets.worlds ;
4 IN: gpu
5
6 HELP: finish-gpu
7 { $description "Waits for all outstanding GPU commands in the current graphics context to complete." } ;
8
9 HELP: flush-gpu
10 { $description "Forces the execution of all outstanding GPU commands in the current graphics context." }
11 { $notes { $snippet "flush-gpu" } " does not wait for execution to finish. For that, use " { $link finish-gpu } "." } ;
12
13 { finish-gpu flush-gpu } related-words
14
15 HELP: gpu-object
16 { $class-description "Parent class of all GPU resources." } ;
17
18 HELP: has-vertex-array-objects?
19 { $var-description "Whether the opengl version supports Vertex Array Objects or not." } ;
20
21 HELP: init-gpu
22 { $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." } ;
23
24 HELP: reset-gpu
25 { $description "Clears all framebuffer, GPU buffer, shader, and vertex array bindings. Call this before directly calling OpenGL functions after using " { $snippet "gpu" } " functions." } ;
26
27 ARTICLE: "gpu" "Graphics context management"
28 "Preparing the GPU library:"
29 { $subsections init-gpu }
30 "Forcing execution of queued commands:"
31 { $subsections
32     flush-gpu
33     finish-gpu
34 }
35 "Resetting OpenGL state:"
36 { $subsections reset-gpu } ;
37
38 ARTICLE: "gpu-summary" "GPU-accelerated rendering"
39 "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."
40 { $subsections
41     "gpu"
42     "gpu.state"
43     "gpu.buffers"
44     "gpu.textures"
45     "gpu.framebuffers"
46     "gpu.shaders"
47     "gpu.render"
48 }
49 "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 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." ;
50
51 ABOUT: "gpu-summary"