Provides functions for handling textures.
More...
#include <kinc/global.h>
#include <kinc/backend/graphics4/texture.h>
#include <kinc/image.h>
Go to the source code of this file.
|
|
typedef kinc_image_t | kinc_g4_image_t |
|
typedef struct kinc_g4_texture | kinc_g4_texture_t |
|
| KINC_FUNC void | kinc_g4_texture_init (kinc_g4_texture_t *texture, int width, int height, kinc_image_format_t format) |
| | Allocates and initializes a texture without copying any data into it.
|
| KINC_FUNC void | kinc_g4_texture_init3d (kinc_g4_texture_t *texture, int width, int height, int depth, kinc_image_format_t format) |
| | Allocates and initializes a 3d-texture without copying any data into it.
|
| KINC_FUNC void | kinc_g4_texture_init_from_image (kinc_g4_texture_t *texture, kinc_image_t *image) |
| | Allocates and initializes a texture and copies image-data into it.
|
| KINC_FUNC void | kinc_g4_texture_init_from_image3d (kinc_g4_texture_t *texture, kinc_image_t *image) |
| | Allocates and initializes a texture and copies image-data into it.
|
| KINC_FUNC void | kinc_g4_texture_destroy (kinc_g4_texture_t *texture) |
| | Deallocates and destroys a texture.
|
|
KINC_FUNC unsigned char * | kinc_g4_texture_lock (kinc_g4_texture_t *texture) |
|
KINC_FUNC void | kinc_g4_texture_unlock (kinc_g4_texture_t *texture) |
|
KINC_FUNC void | kinc_g4_texture_clear (kinc_g4_texture_t *texture, int x, int y, int z, int width, int height, int depth, unsigned color) |
| | Clears parts of a texture to a color.
|
| KINC_FUNC void | kinc_g4_texture_generate_mipmaps (kinc_g4_texture_t *texture, int levels) |
| | Generates the mipmap-chain for a texture.
|
| KINC_FUNC void | kinc_g4_texture_set_mipmap (kinc_g4_texture_t *texture, kinc_image_t *mipmap, int level) |
| | Sets the mipmap for one level of a texture.
|
| KINC_FUNC int | kinc_g4_texture_stride (kinc_g4_texture_t *texture) |
| | Returns the stride of the first mipmap-layer of the texture in bytes.
|
Provides functions for handling textures.
◆ kinc_g4_texture_destroy()
| KINC_FUNC void kinc_g4_texture_destroy |
( |
kinc_g4_texture_t * | texture | ) |
|
Deallocates and destroys a texture.
- Parameters
-
| texture | The texture to destroy |
◆ kinc_g4_texture_generate_mipmaps()
| KINC_FUNC void kinc_g4_texture_generate_mipmaps |
( |
kinc_g4_texture_t * | texture, |
|
|
int | levels ) |
Generates the mipmap-chain for a texture.
- Parameters
-
| renderTarget | The render-target to create the mipmaps for |
| levels | The number of mipmap-levels to generate |
◆ kinc_g4_texture_init()
| KINC_FUNC void kinc_g4_texture_init |
( |
kinc_g4_texture_t * | texture, |
|
|
int | width, |
|
|
int | height, |
|
|
kinc_image_format_t | format ) |
Allocates and initializes a texture without copying any data into it.
- Parameters
-
| texture | The texture to initialize |
| width | The width of the texture to create |
| height | The height of the texture to create |
| format | The format of the texture to create |
◆ kinc_g4_texture_init3d()
| KINC_FUNC void kinc_g4_texture_init3d |
( |
kinc_g4_texture_t * | texture, |
|
|
int | width, |
|
|
int | height, |
|
|
int | depth, |
|
|
kinc_image_format_t | format ) |
Allocates and initializes a 3d-texture without copying any data into it.
- Parameters
-
| texture | The texture to initialize |
| width | The width of the texture to create |
| height | The height of the texture to create |
| depth | The depth of the texture to create |
| format | The format of the texture to create |
◆ kinc_g4_texture_init_from_image()
| KINC_FUNC void kinc_g4_texture_init_from_image |
( |
kinc_g4_texture_t * | texture, |
|
|
kinc_image_t * | image ) |
Allocates and initializes a texture and copies image-data into it.
- Parameters
-
| texture | The texture to initialize |
| image | The image which's data is copied into the texture |
◆ kinc_g4_texture_init_from_image3d()
| KINC_FUNC void kinc_g4_texture_init_from_image3d |
( |
kinc_g4_texture_t * | texture, |
|
|
kinc_image_t * | image ) |
Allocates and initializes a texture and copies image-data into it.
- Parameters
-
| texture | The texture to initialize |
| image | The image which's data is copied into the texture |
◆ kinc_g4_texture_set_mipmap()
| KINC_FUNC void kinc_g4_texture_set_mipmap |
( |
kinc_g4_texture_t * | texture, |
|
|
kinc_image_t * | mipmap, |
|
|
int | level ) |
Sets the mipmap for one level of a texture.
- Parameters
-
| texture | The texture to set a mipmap-level for |
| mipmap | The image-data for the mipmap-level to set |
| level | The mipmap-level to set |
◆ kinc_g4_texture_stride()
| KINC_FUNC int kinc_g4_texture_stride |
( |
kinc_g4_texture_t * | texture | ) |
|
Returns the stride of the first mipmap-layer of the texture in bytes.
- Parameters
-
| texture | The texture to figure out the stride for |
- Returns
- The stride of the first mipmap-layer in bytes