Kore
Loading...
Searching...
No Matches
texture.h
Go to the documentation of this file.
1#pragma once
2
3#include <kinc/global.h>
4
5#include <kinc/backend/graphics4/texture.h>
6#include <kinc/image.h>
7
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16typedef kinc_image_t kinc_g4_image_t;
17
18typedef struct kinc_g4_texture {
19 int tex_width;
20 int tex_height;
21 int tex_depth;
22 kinc_image_format_t format;
23 kinc_g4_texture_impl_t impl;
24} kinc_g4_texture_t;
25
33KINC_FUNC void kinc_g4_texture_init(kinc_g4_texture_t *texture, int width, int height, kinc_image_format_t format);
34
43KINC_FUNC void kinc_g4_texture_init3d(kinc_g4_texture_t *texture, int width, int height, int depth, kinc_image_format_t format);
44
50KINC_FUNC void kinc_g4_texture_init_from_image(kinc_g4_texture_t *texture, kinc_image_t *image);
51
57KINC_FUNC void kinc_g4_texture_init_from_image3d(kinc_g4_texture_t *texture, kinc_image_t *image);
58
63KINC_FUNC void kinc_g4_texture_destroy(kinc_g4_texture_t *texture);
64
65KINC_FUNC unsigned char *kinc_g4_texture_lock(kinc_g4_texture_t *texture);
66
67KINC_FUNC void kinc_g4_texture_unlock(kinc_g4_texture_t *texture);
68
72KINC_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);
73
79KINC_FUNC void kinc_g4_texture_generate_mipmaps(kinc_g4_texture_t *texture, int levels);
80
87KINC_FUNC void kinc_g4_texture_set_mipmap(kinc_g4_texture_t *texture, kinc_image_t *mipmap, int level);
88
94KINC_FUNC int kinc_g4_texture_stride(kinc_g4_texture_t *texture);
95
96#ifdef KINC_ANDROID
97KINC_FUNC void kinc_g4_texture_init_from_id(kinc_g4_texture_t *texture, unsigned texid);
98#endif
99
100#if defined(KINC_IOS) || defined(KINC_MACOS)
101KINC_FUNC void kinc_g4_texture_upload(kinc_g4_texture_t *texture, uint8_t *data, int stride);
102#endif
103
104#ifdef __cplusplus
105}
106#endif
Provides basic functionality that's used all over the place. There's usually no need to manually incl...
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 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_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 int kinc_g4_texture_stride(kinc_g4_texture_t *texture)
Returns the stride of the first mipmap-layer of the texture in bytes.
KINC_FUNC void kinc_g4_texture_destroy(kinc_g4_texture_t *texture)
Deallocates and destroys a texture.
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(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_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_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.
Functionality for creating and loading images. Image loading supports PNG, JPEG and the custom K form...
Definition texture.h:18