]> gitweb.factorcode.org Git - factor.git/blob - extra/gpu/textures/textures-docs.factor
Update some copyright headers to follow the current convention
[factor.git] / extra / gpu / textures / textures-docs.factor
1 ! Copyright (C) 2009 Joe Groff.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien byte-arrays classes gpu.buffers help.markup help.syntax
4 images kernel math ;
5 IN: gpu.textures
6
7 HELP: +X
8 { $class-description "This " { $link cube-map-axis } " references the positive X face of a " { $link texture-cube-map } "." } ;
9
10 HELP: +Y
11 { $class-description "This " { $link cube-map-axis } " references the positive Y face of a " { $link texture-cube-map } "." } ;
12
13 HELP: +Z
14 { $class-description "This " { $link cube-map-axis } " references the positive Z face of a " { $link texture-cube-map } "." } ;
15
16 HELP: -X
17 { $class-description "This " { $link cube-map-axis } " references the negative X face of a " { $link texture-cube-map } "." } ;
18
19 HELP: -Y
20 { $class-description "This " { $link cube-map-axis } " references the negative Y face of a " { $link texture-cube-map } "." } ;
21
22 HELP: -Z
23 { $class-description "This " { $link cube-map-axis } " references the negative Z face of a " { $link texture-cube-map } "." } ;
24
25 HELP: <cube-map-face>
26 { $values
27     { "texture" texture-cube-map } { "axis" cube-map-axis }
28     { "cube-map-face" cube-map-face }
29 }
30 { $description "Constructs a new " { $link cube-map-face } " reference." } ;
31
32 HELP: <texture-1d-array>
33 { $values
34     { "component-order" component-order } { "component-type" component-type } { "parameters" texture-parameters }
35     { "texture" texture-1d-array }
36 }
37 { $description "Creates a new one-dimensional array texture. The new texture starts out with no image data; " { $link allocate-texture } " or " { $link allocate-texture-image } " must be used to allocate memory for the required levels of detail of the texture." }
38 { $notes "Array textures require OpenGL 3.0 or the " { $snippet "GL_EXT_texture_array" } " extension." } ;
39
40 HELP: <texture-1d>
41 { $values
42     { "component-order" component-order } { "component-type" component-type } { "parameters" texture-parameters }
43     { "texture" texture-1d }
44 }
45 { $description "Creates a new one-dimensional texture. The new texture starts out with no image data; " { $link allocate-texture } " or " { $link allocate-texture-image } " must be used to allocate memory for the required levels of detail of the texture." } ;
46
47 HELP: <texture-2d-array>
48 { $values
49     { "component-order" component-order } { "component-type" component-type } { "parameters" texture-parameters }
50     { "texture" texture-2d-array }
51 }
52 { $description "Creates a new two-dimensional array texture. The new texture starts out with no image data; " { $link allocate-texture } " or " { $link allocate-texture-image } " must be used to allocate memory for the required levels of detail of the texture." }
53 { $notes "Array textures require OpenGL 3.0 or the " { $snippet "GL_EXT_texture_array" } " extension." } ;
54
55 HELP: <texture-2d>
56 { $values
57     { "component-order" component-order } { "component-type" component-type } { "parameters" texture-parameters }
58     { "texture" texture-2d }
59 }
60 { $description "Creates a new two-dimensional texture. The new texture starts out with no image data; " { $link allocate-texture } " or " { $link allocate-texture-image } " must be used to allocate memory for the required levels of detail of the texture." } ;
61
62 HELP: <texture-3d>
63 { $values
64     { "component-order" component-order } { "component-type" component-type } { "parameters" texture-parameters }
65     { "texture" texture-3d }
66 }
67 { $description "Creates a new three-dimensional texture. The new texture starts out with no image data; " { $link allocate-texture } " or " { $link allocate-texture-image } " must be used to allocate memory for the required levels of detail of the texture." } ;
68
69 HELP: <texture-cube-map>
70 { $values
71     { "component-order" component-order } { "component-type" component-type } { "parameters" texture-parameters }
72     { "texture" texture-cube-map }
73 }
74 { $description "Creates a new cube map texture. The new texture starts out with no image data; " { $link allocate-texture } " or " { $link allocate-texture-image } " must be used to allocate memory for the required levels of detail of each " { $link cube-map-face } " of the new texture." } ;
75
76 HELP: <texture-data>
77 { $values
78     { "ptr" gpu-data-ptr } { "component-order" component-order } { "component-type" component-type }
79     { "texture-data" texture-data }
80 }
81 { $description "Constructs a new " { $link texture-data } " tuple." }
82 { $notes "Using a " { $link buffer-ptr } " as the " { $snippet "ptr" } " of a " { $snippet "texture-data" } " object requires OpenGL 2.1 or later or the " { $snippet "GL_ARB_pixel_buffer_object" } " extension." } ;
83
84 HELP: <texture-rectangle>
85 { $values
86     { "component-order" component-order } { "component-type" component-type } { "parameters" texture-parameters }
87     { "texture" texture-rectangle }
88 }
89 { $description "Creates a new rectangle texture. The new texture starts out with no image data; " { $link allocate-texture } " or " { $link allocate-texture-image } " must be used to allocate memory for the texture." }
90 { $notes "Rectangle textures require OpenGL 3.1 or the " { $snippet "GL_ARB_texture_rectangle" } " extension." } ;
91
92 HELP: allocate-compressed-texture
93 { $values
94     { "tdt" texture-data-target } { "level" integer } { "dim" "an " { $link integer } " or sequence of " { $link integer } "s" } { "compressed-data" compressed-texture-data }
95 }
96 { $description "Allocates a new block of GPU memory for the " { $snippet "level" } "th level of detail of a " { $link texture-data-target } ". The new data is initialized with compressed texture data from the given " { $link compressed-texture-data } " object." }
97 { $notes "Using a " { $link buffer-ptr } " as the " { $snippet "ptr" } " of a " { $snippet "compressed-texture-data" } " object requires OpenGL 2.1 or later or the " { $snippet "GL_ARB_pixel_buffer_object" } " extension." } ;
98
99 HELP: allocate-texture
100 { $values
101     { "tdt" texture-data-target } { "level" integer } { "dim" "an " { $link integer } " or sequence of " { $link integer } "s" } { "data" { $maybe texture-data } }
102 }
103 { $description "Allocates a new block of GPU memory for the " { $snippet "level" } "th level of detail of a " { $link texture-data-target } ". If " { $snippet "data" } " is not " { $link f } ", the new data is initialized from the given " { $link texture-data } " object; otherwise, the new image is left uninitialized." }
104 { $notes "Using a " { $link buffer-ptr } " as the " { $snippet "ptr" } " of a " { $snippet "texture-data" } " object requires OpenGL 2.1 or later or the " { $snippet "GL_ARB_pixel_buffer_object" } " extension." } ;
105
106 HELP: allocate-texture-image
107 { $values
108     { "tdt" texture-data-target } { "level" integer } { "image" image }
109 }
110 { $description "Allocates a new block of GPU memory for the " { $snippet "level" } "th level of detail of a " { $link texture-data-target } " and initializes it with the contents of an " { $link image } "." } ;
111
112 { allocate-compressed-texture allocate-texture allocate-texture-image } related-words
113
114 HELP: clamp-texcoord-to-border
115 { $class-description "This " { $link texture-wrap } " value clamps texture coordinates to a texture's border." } ;
116
117 HELP: clamp-texcoord-to-edge
118 { $class-description "This " { $link texture-wrap } " value clamps texture coordinates to a texture image's edge." } ;
119
120 HELP: cube-map-axis
121 { $class-description "Objects of this class are stored in the " { $snippet "axis" } " slot of a " { $link cube-map-face } " to choose the referenced face: " { $link +X } ", " { $link +Y } ", " { $link +Z } ", " { $link -X } ", " { $link -Y } ", or " { $link -Z } "."
122 } ;
123
124 HELP: cube-map-face
125 { $class-description "A " { $snippet "cube-map-face" } " tuple references a single face of a " { $link texture-cube-map } " object for use with " { $link allocate-texture } ", " { $link update-texture } ", or " { $link read-texture } "."
126 { $list
127 { "The " { $snippet "texture" } " slot indicates the cube map texture being referenced." }
128 { "The " { $snippet "axis" } " slot indicates which face to reference: " { $link +X } ", " { $link +Y } ", " { $link +Z } ", " { $link -X } ", " { $link -Y } ", or " { $link -Z } "." }
129 } } ;
130
131 HELP: filter-linear
132 { $class-description "This " { $link texture-filter } " value selects linear filtering between pixel samples." } ;
133
134 HELP: filter-nearest
135 { $class-description "This " { $link texture-filter } " value selects nearest-neighbor sampling." } ;
136
137 HELP: generate-mipmaps
138 { $values
139     { "texture" texture }
140 }
141 { $description "Replaces the image data for all levels of detail of " { $snippet "texture" } " below the highest level with images automatically generated from the highest level of detail image." }
142 { $notes "This word requires OpenGL 3.0 or one of the " { $snippet "GL_EXT_framebuffer_object" } " or " { $snippet "GL_ARB_framebuffer_object" } " extensions." } ;
143
144 HELP: image>texture-data
145 { $values
146     { "image" image }
147     { "dim" "a sequence of " { $link integer } "s" } { "texture-data" texture-data }
148 }
149 { $description "Constructs a " { $link texture-data } " tuple referencing the pixel data from an " { $link image } "." } ;
150
151 HELP: read-compressed-texture
152 { $values
153     { "tdt" texture-data-target } { "level" integer }
154     { "byte-array" byte-array }
155 }
156 { $description "Reads the entire compressed image for the " { $snippet "level" } "th level of detail of a texture into a new " { $link byte-array } ". The format of the data in the byte array is determined by the " { $link compressed-texture-format } " of the data originally allocated by " { $link allocate-compressed-texture } " for the texture." } ;
157
158 HELP: read-compressed-texture-to
159 { $values
160     { "tdt" texture-data-target } { "level" integer }
161     { "gpu-data-ptr" byte-array }
162 }
163 { $description "Reads the entire compressed image for the " { $snippet "level" } "th level of detail of a texture into the CPU or GPU memory referenced by " { $link gpu-data-ptr } ". The format of the written data is determined by the " { $link compressed-texture-format } " of the data originally allocated by " { $link allocate-compressed-texture } " for the texture." }
164 { $notes "Reading texture data into a GPU " { $snippet "buffer-ptr" } " requires OpenGL 2.1 or later or the " { $snippet "GL_ARB_pixel_buffer_object" } " extension." } ;
165
166 HELP: read-texture
167 { $values
168     { "tdt" texture-data-target } { "level" integer }
169     { "byte-array" byte-array }
170 }
171 { $description "Reads the entire image for the " { $snippet "level" } "th level of detail of a texture into a new " { $link byte-array } ". The format of the data in the byte array is determined by the " { $link component-order } " and " { $link component-type } " of the texture." } ;
172
173 HELP: read-texture-image
174 { $values
175     { "tdt" texture-data-target } { "level" integer }
176     { "image" image }
177 }
178 { $description "Reads the entire image for the " { $snippet "level" } "th level of detail of a texture into a new " { $link image } ". The format of the image is determined by the " { $link component-order } " and " { $link component-type } " of the texture." } ;
179
180 HELP: read-texture-to
181 { $values
182     { "tdt" texture-data-target } { "level" integer } { "gpu-data-ptr" gpu-data-ptr }
183 }
184 { $description "Reads the entire image for the " { $snippet "level" } "th level of detail of a texture into the CPU or GPU memory referenced by " { $link gpu-data-ptr } ". The format of the written data is determined by the " { $link component-order } " and " { $link component-type } " of the texture." }
185 { $notes "Reading texture data into a GPU " { $snippet "buffer-ptr" } " requires OpenGL 2.1 or later or the " { $snippet "GL_ARB_pixel_buffer_object" } " extension." } ;
186
187 { read-compressed-texture read-compressed-texture-to read-texture read-texture-image read-texture-to } related-words
188
189 HELP: repeat-texcoord
190 { $class-description "This " { $link texture-wrap } " value causes the texture image to be repeated through texture coordinate space." } ;
191
192 HELP: repeat-texcoord-mirrored
193 { $class-description "This " { $link texture-wrap } " value causes the texture image to be repeated through texture coordinate space, mirroring the image on every repetition." } ;
194
195 HELP: set-texture-parameters
196 { $values
197     { "texture" texture } { "parameters" texture-parameters }
198 }
199 { $description "Changes the " { $link texture-parameters } " of a " { $link texture } "." } ;
200
201 HELP: texture
202 { $class-description "Textures are typed, multidimensional arrays of GPU memory used for storing image data, lookup tables, and other kinds of multidimensional data for use with shader programs. They come in different types depending on dimensionality and intended usage:"
203 { $subsections
204     texture-1d
205     texture-2d
206     texture-3d
207     texture-cube-map
208     texture-rectangle
209     texture-1d-array
210     texture-2d-array
211 }
212 "Textures are constructed using the corresponding " { $snippet "<constructor word>" } " for their type. The constructor sets the texture's " { $link component-order } ", " { $link component-type } ", and " { $link texture-parameters } ". Once created, memory for a texture can be allocated with " { $link allocate-texture } ", updated with " { $link update-texture } ", or retrieved with " { $link read-texture } "." } ;
213
214 HELP: texture-1d
215 { $class-description "A one-dimensional " { $link texture } " object. Textures of this type are dimensioned by single integers in calls to " { $link allocate-texture } " and " { $link update-texture } "." } ;
216
217 { texture-1d <texture-1d> } related-words
218
219 HELP: texture-1d-array
220 { $class-description "A one-dimensional array " { $link texture } " object. Textures of this type are dimensioned by pairs of integers in calls to " { $link allocate-texture } " and " { $link update-texture } ". A 1D array texture is distinct from a 2D texture (" { $link texture-2d } ") in that each row of the texture is independent; texture values are not filtered between rows, and lower levels of detail retain the same height, only losing detail in the width direction." }
221 { $notes "Array textures require OpenGL 3.0 or the " { $snippet "GL_EXT_texture_array" } " extension." } ;
222
223 { texture-1d-array <texture-1d-array> } related-words
224
225 HELP: texture-2d
226 { $class-description "A two-dimensional " { $link texture } " object. Textures of this type are dimensioned by pairs of integers in calls to " { $link allocate-texture } " and " { $link update-texture } "." } ;
227
228 { texture-2d <texture-2d> } related-words
229
230 HELP: texture-2d-array
231 { $class-description "A two-dimensional array " { $link texture } " object. Textures of this type are dimensioned by sequences of three integers in calls to " { $link allocate-texture } " and " { $link update-texture } ". A 2D array texture is distinct from a 3D texture (" { $link texture-3d } ") in that each plane of the texture is independent; texture values are not filtered between planes, and lower levels of detail retain the same depth, only losing detail in the width and height directions." }
232 { $notes "Array textures require OpenGL 3.0 or the " { $snippet "GL_EXT_texture_array" } " extension." } ;
233
234 { texture-2d-array <texture-2d-array> } related-words
235
236 HELP: texture-3d
237 { $class-description "A three-dimensional " { $link texture } " object. Textures of this type are dimensioned by sequences of three integers in calls to " { $link allocate-texture } " and " { $link update-texture } "." } ;
238
239 { texture-3d <texture-3d> } related-words
240
241 HELP: texture-wrap
242 { $class-description "Values of this class are used in the " { $snippet "wrap" } " slot of a set of " { $link texture-parameters } " to specify how texture coordinates outside the 0.0 to 1.0 range should be mapped onto the texture image."
243 { $list
244 { { $link clamp-texcoord-to-edge } " clamps coordinates to the edge of the texture image." }
245 { { $link clamp-texcoord-to-border } " clamps coordinates to the border of the texture image." }
246 { { $link repeat-texcoord } " repeats the texture image." }
247 { { $link repeat-texcoord-mirrored } " repeats the texture image, mirroring it with each repetition." }
248 } } ;
249
250 HELP: texture-cube-map
251 { $class-description "A cube map " { $link texture } " object. Textures of this type comprise six two-dimensional image sets, which are independently referenced by " { $link cube-map-face } " objects and dimensioned by pairs of integers in calls to " { $link allocate-texture } " and " { $link update-texture } ". When a cube map is sampled in shader code, the three-dimensional texture coordinates are projected onto the unit cube, and the cube face that is hit by the vector is used to select a face of the cube map texture." } ;
252
253 { texture-cube-map <texture-cube-map> } related-words
254
255 HELP: texture-data
256 { $class-description { $snippet "texture-data" } " tuples are used to feed image data to " { $link allocate-texture } " and " { $link update-texture } "."
257 { $list
258 { "The " { $snippet "ptr" } " slot references either CPU memory (as a " { $link byte-array } " or " { $link alien } ") or a GPU " { $link buffer-ptr } " that contains the image data." }
259 { "The " { $snippet "component-order" } " and " { $snippet "component-type" } " slots determine the " { $link component-order } " and " { $link component-type } " of the referenced data." }
260 } }
261 { $notes "Using a " { $link buffer-ptr } " as the " { $snippet "ptr" } " of a " { $snippet "texture-data" } " object requires OpenGL 2.1 or later or the " { $snippet "GL_ARB_pixel_buffer_object" } " extension." } ;
262
263 { texture-data <texture-data> } related-words
264
265 HELP: texture-data-size
266 { $values
267     { "tdt" texture-data-target } { "level" integer }
268     { "size" integer }
269 }
270 { $description "Returns the size in bytes of the image data allocated for the " { $snippet "level" } "th level of detail of a " { $link texture-data-target } "." } ;
271
272 HELP: texture-data-target
273 { $class-description "Most " { $link texture } " types can have image data assigned to themselves directly by " { $link allocate-texture } " and " { $link update-texture } "; however, " { $link texture-cube-map } " objects comprise six independent image sets, each of which must be referenced separately with a " { $link cube-map-face } " tuple when allocating or updating images. The " { $snippet "texture-data-target" } " class is a union of all " { $link texture } " classes (except " { $snippet "texture-cube-map" } ") and the " { $snippet "cube-map-face" } " class." } ;
274
275 HELP: texture-dim
276 { $values
277     { "tdt" texture-data-target } { "level" integer }
278     { "dim" "an " { $link integer } " or sequence of integers" }
279 }
280 { $description "Returns the dimensions of the memory allocated for the " { $snippet "level" } "th level of detail of the given " { $link texture-data-target } "." } ;
281
282 HELP: compressed-texture-data-size
283 { $values
284     { "tdt" texture-data-target } { "level" integer }
285     { "size" integer }
286 }
287 { $description "Returns the size in bytes of the memory allocated for the compressed texture data making up the " { $snippet "level" } "th level of detail of the given " { $link texture-data-target } "." } ;
288
289 HELP: texture-filter
290 { $class-description { $snippet "texture-filter" } " values are used in a " { $link texture-parameters } " tuple to determine how a texture should be sampled between pixels or between levels of detail. " { $link filter-linear } " selects linear filtering, while " { $link filter-nearest } " selects nearest-neighbor sampling." } ;
291
292 HELP: texture-parameters
293 { $class-description "A " { $snippet "texture-parameters" } " tuple is supplied when constructing a " { $link texture } " to control the wrapping, filtering, and level-of-detail handling of the texture. These tuples have the following slots:"
294 { $list
295 { "The " { $snippet "wrap" } " slot determines how texture coordinates outside the 0.0 to 1.0 range are mapped to the texture image. The slot either contains a single " { $link texture-wrap } " value, which will apply to all three axes, or a sequence of up to three values, which will apply to the S, T, and R axes, respectively." }
296 { "The " { $snippet "min-filter" } " and " { $snippet "min-mipmap-filter" } " determine how the texture image is filtered when sampled below its highest level of detail, the former filtering between pixels within a level of detail and the latter filtering between levels of detail. A setting of " { $link filter-linear } " uses linear, bilinear, or trilinear filtering among the sampled pixels, while a setting of " { $link filter-nearest } " uses nearest-neighbor sampling. The " { $snippet "min-mipmap-filter" } " slot may additionally be set to " { $link f } " to disable mipmapping and only sample the highest level of detail." }
297 { "The " { $snippet "mag-filter" } " analogously determines how the texture image is filtered when sampled above its highest level of detail." }
298 { "The " { $snippet "min-lod" } " and " { $snippet "max-lod" } " slots contain integer values that will clamp the range of levels of detail that will be sampled from the texture." }
299 { "The " { $snippet "lod-bias" } " slot contains an integer value that will offset the levels of detail that would normally be sampled from the texture." }
300 { "The " { $snippet "base-level" } " slot contains an integer value that identifies the highest level of detail for the image, typically zero." }
301 { "The " { $snippet "max-level" } " slot contains an integer value that identifies the lowest level of detail for the image. This value will automatically be clamped to the maximum of the base-2 logarithms of the dimensions of the highest level of detail image." }
302 } } ;
303
304 { texture-parameters set-texture-parameters } related-words
305
306 HELP: texture-rectangle
307 { $class-description "A two-dimensional rectangle " { $link texture } " object. Textures of this type are dimensioned by pairs of integers in calls to " { $link allocate-texture } " and " { $link update-texture } ". Rectangle textures differ from normal 2D textures (" { $link texture-2d } ") in that texture coordinates map directly to pixel coordinates when they are sampled from shader code, rather than being normalized into the 0.0 to 1.0 range as with other texture types. Also, rectangle textures do not support mipmapping or texture wrapping." }
308 { $notes "Rectangle textures require OpenGL 3.1 or the " { $snippet "GL_ARB_texture_rectangle" } " extension." } ;
309
310 HELP: update-compressed-texture
311 { $values
312     { "tdt" texture-data-target } { "level" integer } { "loc" "an " { $link integer } " or sequence of integers" } { "dim" "an " { $link integer } " or sequence of integers" } { "compressed-data" texture-data }
313 }
314 { $description "Updates the linear, rectangular, or cubic subregion of a compressed " { $link texture-data-target } " bounded by " { $snippet "loc" } " and " { $snippet "dim" } " with the data referenced by the given " { $link compressed-texture-data } " tuple. The given level of detail of the texture must have been previously allocated for compressed data with " { $link allocate-compressed-texture } "." }
315 { $notes "Using a " { $link buffer-ptr } " as the " { $snippet "ptr" } " of a " { $snippet "compressed-texture-data" } " object requires OpenGL 2.1 or later or the " { $snippet "GL_ARB_pixel_buffer_object" } " extension." } ;
316
317 HELP: update-texture
318 { $values
319     { "tdt" texture-data-target } { "level" integer } { "loc" "an " { $link integer } " or sequence of integers" } { "dim" "an " { $link integer } " or sequence of integers" } { "data" texture-data }
320 }
321 { $description "Updates the linear, rectangular, or cubic subregion of a " { $link texture-data-target } " bounded by " { $snippet "loc" } " and " { $snippet "dim" } " with new image data from a " { $link texture-data } " tuple." }
322 { $notes "Using a " { $link buffer-ptr } " as the " { $snippet "ptr" } " of a " { $snippet "texture-data" } " object requires OpenGL 2.1 or later or the " { $snippet "GL_ARB_pixel_buffer_object" } " extension." } ;
323
324 HELP: update-texture-image
325 { $values
326     { "tdt" texture-data-target } { "level" integer } { "loc" "an " { $link integer } " or sequence of integers" } { "image" image }
327 }
328 { $description "Updates the linear, rectangular, or cubic subregion of a " { $link texture-data-target } " bounded by " { $snippet "loc" } " and " { $snippet "dim" } " with new image data from an " { $link image } " object." } ;
329
330 { update-compressed-texture update-texture update-texture-image } related-words
331
332 HELP: compressed-texture-format
333 { $class-description { $snippet "compressed-texture-format" } " values are used as part of a " { $link compressed-texture-data } " tuple to specify the binary format of texture data being given to " { $link allocate-compressed-texture } " or " { $link update-compressed-texture } ". The following compressed formats are available:"
334 { $list
335 { { $link DXT1-RGB } }
336 { { $link DXT1-RGBA } }
337 { { $link DXT3 } }
338 { { $link DXT5 } }
339 { { $link LATC1 } }
340 { { $link LATC1-SIGNED } }
341 { { $link LATC2 } }
342 { { $link LATC2-SIGNED } }
343 { { $link RGTC1 } }
344 { { $link RGTC1-SIGNED } }
345 { { $link RGTC2 } }
346 { { $link RGTC2-SIGNED } }
347 } }
348 { $notes "The " { $snippet "DXT1" } " formats require either the " { $snippet "GL_EXT_texture_compression_s3tc" } " or " { $snippet "GL_EXT_texture_compression_dxt1" } " extension. The other " { $snippet "DXT" } " formats require the " { $snippet "GL_EXT_texture_compression_s3tc" } " extension. The " { $snippet "LATC" } " formats require the " { $snippet "GL_EXT_texture_compression_latc" } " extension. The " { $snippet "RGTC" } " formats require OpenGL 3.0 or later or the " { $snippet "GL_EXT_texture_compression_rgtc" } " extension." } ;
349
350 HELP: compressed-texture-data
351 { $class-description { $snippet "compressed-texture-data" } " tuples are used to feed compressed texture data to " { $link allocate-compressed-texture } " and " { $link update-compressed-texture } "."
352 { $list
353 { "The " { $snippet "ptr" } " slot references either CPU memory (as a " { $link byte-array } " or " { $link alien } ") or a GPU " { $link buffer-ptr } " that contains the image data." }
354 { "The " { $snippet "format" } " slot determines the " { $link compressed-texture-format } " of the referenced data." }
355 { "The " { $snippet "length" } " slot determines the size in bytes of the referenced data." }
356 } }
357 { $notes "Using a " { $link buffer-ptr } " as the " { $snippet "ptr" } " of a " { $snippet "texture-data" } " object requires OpenGL 2.1 or later or the " { $snippet "GL_ARB_pixel_buffer_object" } " extension." } ;
358
359 { compressed-texture-data <compressed-texture-data> } related-words
360
361 ARTICLE: "gpu.textures" "Texture objects"
362 "The " { $vocab-link "gpu.textures" } " vocabulary provides words for creating, allocating, updating, and reading GPU texture objects."
363 { $subsections
364     texture
365     texture-data
366     allocate-texture
367     update-texture
368     texture-dim
369     read-texture
370     read-texture-to
371 }
372 "Words are also provided to use " { $link image } " objects from the " { $vocab-link "images" } " library as data sources and destinations for texture data:"
373 { $subsections
374     allocate-texture-image
375     update-texture-image
376     read-texture-image
377 }
378 "Compressed texture data can also be supplied and read:"
379 { $subsections
380     compressed-texture-format
381     compressed-texture-data
382     allocate-compressed-texture
383     update-compressed-texture
384     compressed-texture-data-size
385     read-compressed-texture
386     read-compressed-texture-to
387 } ;
388
389 ABOUT: "gpu.textures"