]> gitweb.factorcode.org Git - factor.git/blob - extra/gpu/gpu-docs.factor
Update some copyright headers to follow the current convention
[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: 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: init-gpu
19 { $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." } ;
20
21 HELP: reset-gpu
22 { $description "Clears all framebuffer, GPU buffer, shader, and vertex array bindings. Call this before directly calling OpenGL functions after using " { $snippet "gpu" } " functions." } ;
23
24 ARTICLE: "gpu" "Graphics context management"
25 "Preparing the GPU library:"
26 { $subsections init-gpu }
27 "Forcing execution of queued commands:"
28 { $subsections
29     flush-gpu
30     finish-gpu
31 }
32 "Resetting OpenGL state:"
33 { $subsections reset-gpu } ;
34
35 ARTICLE: "gpu-summary" "GPU-accelerated rendering"
36 "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."
37 { $subsections
38     "gpu"
39     "gpu.state"
40     "gpu.buffers"
41     "gpu.textures"
42     "gpu.framebuffers"
43     "gpu.shaders"
44     "gpu.render"
45 }
46 "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." ;
47
48 ABOUT: "gpu-summary"