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/image.h>
6
7#include "textureunit.h"
8
9#include <kinc/backend/graphics5/texture.h>
10
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19typedef struct kinc_g5_texture {
20 int texWidth;
21 int texHeight;
22 kinc_image_format_t format;
23 Texture5Impl impl;
24} kinc_g5_texture_t;
25
33KINC_FUNC void kinc_g5_texture_init(kinc_g5_texture_t *texture, int width, int height, kinc_image_format_t format);
34
43KINC_FUNC void kinc_g5_texture_init3d(kinc_g5_texture_t *texture, int width, int height, int depth, kinc_image_format_t format);
44
50KINC_FUNC void kinc_g5_texture_init_from_image(kinc_g5_texture_t *texture, kinc_image_t *image);
51
52// void kinc_g5_texture_init_from_encoded_data(kinc_g5_texture_t *texture, void *data, int size, const char *format, bool readable);
53// void kinc_g5_texture_init_from_data(kinc_g5_texture_t *texture, void *data, int width, int height, int format, bool readable);
54
55KINC_FUNC void kinc_g5_texture_init_non_sampled_access(kinc_g5_texture_t *texture, int width, int height, kinc_image_format_t format);
56
61KINC_FUNC void kinc_g5_texture_destroy(kinc_g5_texture_t *texture);
62
63#ifdef KINC_ANDROID
64KINC_FUNC void kinc_g5_texture_init_from_id(kinc_g5_texture_t *texture, unsigned texid);
65#endif
66
67KINC_FUNC uint8_t *kinc_g5_texture_lock(kinc_g5_texture_t *texture);
68
69KINC_FUNC void kinc_g5_texture_unlock(kinc_g5_texture_t *texture);
70
74KINC_FUNC void kinc_g5_texture_clear(kinc_g5_texture_t *texture, int x, int y, int z, int width, int height, int depth, unsigned color);
75
76#if defined(KINC_IOS) || defined(KINC_MACOS)
77KINC_FUNC void kinc_g5_texture_upload(kinc_g5_texture_t *texture, uint8_t *data);
78#endif
79
85KINC_FUNC void kinc_g5_texture_generate_mipmaps(kinc_g5_texture_t *texture, int levels);
86
87KINC_FUNC void kinc_g5_texture_set_mipmap(kinc_g5_texture_t *texture, kinc_image_t *mipmap, int level);
88
94KINC_FUNC int kinc_g5_texture_stride(kinc_g5_texture_t *texture);
95
96#ifdef __cplusplus
97}
98#endif
Provides basic functionality that's used all over the place. There's usually no need to manually incl...
KINC_FUNC int kinc_g5_texture_stride(kinc_g5_texture_t *texture)
Returns the stride of the first mipmap-layer of the texture in bytes.
KINC_FUNC void kinc_g5_texture_init_from_image(kinc_g5_texture_t *texture, kinc_image_t *image)
Allocates and initializes a texture and copies image-data into it.
KINC_FUNC void kinc_g5_texture_init3d(kinc_g5_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_g5_texture_destroy(kinc_g5_texture_t *texture)
Deallocates and destroys a texture.
KINC_FUNC void kinc_g5_texture_clear(kinc_g5_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_g5_texture_init(kinc_g5_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_g5_texture_generate_mipmaps(kinc_g5_texture_t *texture, int levels)
Generates the mipmap-chain for a texture.
Provides a texture-unit-struct which is used for setting textures in a shader.
Functionality for creating and loading images. Image loading supports PNG, JPEG and the custom K form...
Definition texture.h:19