Image and texture

Line primitive Sprites.

r_texture_allocate

uint r_texture_allocate(PImageFormat format, uint x, uint y, uint z, boolean filter, boolean tile, void *data);

Description: Allocates an image. If z is set to 1 the image will be 2D, if the z is set to R_IB_IMAGE_CUBE a cube map is created where all six sides are x*y resolution. filter, and tiled are booleans that indicates if the resulting image should be filerd and tiled respectivly. The data pointer is a user provided pointer of data to fill up the texture. If data is set to NULL, Relinquish will generate a pattern as a defalut image to aid in debugging.

Types:

Enum:

PImageFormat

R_IF_R_UINT8

Description: Single chanel texture format with 8 bit integer storage corresponding to a float in GLSL

R_IF_RG_UINT8

Description: Dual chanel texture format with 8 bit integer storage corresponding to a vec2 in GLSL

R_IF_RGB_UINT8

Description: Tripple chanel texture format with 8 bit integer storage corresponding to a vec3 in GLSL

R_IF_RGBA_UINT8

Description: Quadruple chanel texture format with 8 bit integer storage corresponding to a vec4 in GLSL

R_IF_R_FLOAT16

Description: Single chanel texture format with 16 bit floating point storage corresponding to a float in GLSL

R_IF_RG_FLOAT16

Description: Dual chanel texture format with 16 bit floating point storage corresponding to a vec2 in GLSL

R_IF_RGB_FLOAT16

Description: Tripple chanel texture format with 16 bit floating point storage corresponding to a vec3 in GLSL

R_IF_RGBA_FLOAT16

Description: Quadruple chanel texture format with 16 bit floating point storage corresponding to a vec4 in GLSL

R_IF_R_FLOAT32

Description: Single chanel texture format with 32 bit floating point storage corresponding to a float in GLSL

R_IF_RG_FLOAT32

Description: Dual chanel texture format with 32 bit floating point storage corresponding to a vec2 in GLSL

R_IF_RGB_FLOAT32

Description: Tripple chanel texture format with 32 bit floating point storage corresponding to a vec3 in GLSL

R_IF_RGBA_FLOAT32

Description: Quadruple chanel texture format with 32 bit floating point storage corresponding to a vec4 in GLSL

R_IF_DEPTH16

Description: 16 Bit depth map.

R_IF_DEPTH24

Description: 24 Bit depth map.

R_IF_DEPTH32

Description: 32 Bit depth map.

R_IF_DEPTH24_STENCIL8

Description: 24 Bit depth map interleaved with a 8 bit stencil map.

r_texture_update

void r_texture_update(uint texture_id, PImageFormat format, uint x_offset, uint y_offset, uint z_offset, uint x_size, uint y_size, uint z_size, void *data);

Description: update the content pixels of a texture

Types:

Enum:

PImageFormat

R_IF_R_UINT8

Description: Single chanel texture format with 8 bit integer storage corresponding to a float in GLSL

R_IF_RG_UINT8

Description: Dual chanel texture format with 8 bit integer storage corresponding to a vec2 in GLSL

R_IF_RGB_UINT8

Description: Tripple chanel texture format with 8 bit integer storage corresponding to a vec3 in GLSL

R_IF_RGBA_UINT8

Description: Quadruple chanel texture format with 8 bit integer storage corresponding to a vec4 in GLSL

R_IF_R_FLOAT16

Description: Single chanel texture format with 16 bit floating point storage corresponding to a float in GLSL

R_IF_RG_FLOAT16

Description: Dual chanel texture format with 16 bit floating point storage corresponding to a vec2 in GLSL

R_IF_RGB_FLOAT16

Description: Tripple chanel texture format with 16 bit floating point storage corresponding to a vec3 in GLSL

R_IF_RGBA_FLOAT16

Description: Quadruple chanel texture format with 16 bit floating point storage corresponding to a vec4 in GLSL

R_IF_R_FLOAT32

Description: Single chanel texture format with 32 bit floating point storage corresponding to a float in GLSL

R_IF_RG_FLOAT32

Description: Dual chanel texture format with 32 bit floating point storage corresponding to a vec2 in GLSL

R_IF_RGB_FLOAT32

Description: Tripple chanel texture format with 32 bit floating point storage corresponding to a vec3 in GLSL

R_IF_RGBA_FLOAT32

Description: Quadruple chanel texture format with 32 bit floating point storage corresponding to a vec4 in GLSL

R_IF_DEPTH16

Description: 16 Bit depth map.

R_IF_DEPTH24

Description: 24 Bit depth map.

R_IF_DEPTH32

Description: 32 Bit depth map.

R_IF_DEPTH24_STENCIL8

Description: 24 Bit depth map interleaved with a 8 bit stencil map.

r_texture_free

void r_texture_free(uint texture_id);

Description: Frees a texture.