read-texture ( tdt: texture-data-target level: integer -- byte-array: byte-array )
GPU-accelerated rendering ยป Texture objects

Prev:texture-dim ( tdt level -- dim )
Next:read-texture-to ( tdt: texture-data-target level: integer gpu-data-ptr -- )


Vocabulary
gpu.textures

Inputs
tdta texture-data-target
levelan integer


Outputs
byte-arraya byte-array


Word description
Reads the entire image for the levelth level of detail of a texture into a new byte-array. The format of the data in the byte array is determined by the component-order and component-type of the texture.

See also
read-compressed-texture, read-compressed-texture-to, read-texture-image, read-texture-to

Definition


TYPED: read-texture
( tdt: texture-data-target level: integer -- byte-array: byte-array )
2dup texture-data-size (byte-array) [ read-texture-to ] keep
;