Handbook
Glossary
texture-dim ( tdt level -- dim )
GPU-accelerated rendering
ยป
Texture objects
Prev:
update-texture ( tdt level loc dim data -- )
Next:
read-texture ( tdt: texture-data-target level: integer -- byte-array: byte-array )
Vocabulary
gpu
.
textures
Inputs
tdt
a
texture-data-target
level
an
integer
Outputs
dim
an
integer
or sequence of integers
Word description
Returns the dimensions of the memory allocated for the
level
th level of detail of the given
texture-data-target
.
Definition
IN:
gpu.textures
GENERIC#:
texture-dim
1
( tdt level -- dim )
Methods
USING:
gpu.textures
gpu.textures.private
opengl.gl
opengl.textures
;
M::
texture-1d-data-target
texture-dim
( tdt level -- dim )
tdt
bind-tdt
:>
texture tdt
texture-data-gl-target
level
GL_TEXTURE_WIDTH
get-texture-int
;
inline
USING:
arrays
gpu.textures
gpu.textures.private
kernel
opengl.gl
opengl.textures
;
M::
texture-2d-data-target
texture-dim
( tdt level -- dim )
tdt
bind-tdt
:>
texture tdt
texture-data-gl-target
level
[
GL_TEXTURE_WIDTH
get-texture-int
]
[
GL_TEXTURE_HEIGHT
get-texture-int
]
2bi
2array
;
inline
USING:
arrays
gpu.textures
gpu.textures.private
kernel
opengl.gl
opengl.textures
;
M::
texture-3d-data-target
texture-dim
( tdt level -- dim )
tdt
bind-tdt
:>
texture tdt
texture-data-gl-target
level
[
GL_TEXTURE_WIDTH
get-texture-int
]
[
GL_TEXTURE_HEIGHT
get-texture-int
]
[
GL_TEXTURE_DEPTH
get-texture-int
]
2tri
3array
;
inline