30 lines
548 B
C
30 lines
548 B
C
|
#ifndef TWN_GPU_TEXTURE_H
|
||
|
#define TWN_GPU_TEXTURE_H
|
||
|
|
||
|
#ifdef EMSCRIPTEN
|
||
|
#include <GLES2/gl2.h>
|
||
|
#else
|
||
|
#include <glad/glad.h>
|
||
|
#endif
|
||
|
|
||
|
#include <stdbool.h>
|
||
|
|
||
|
|
||
|
typedef GLuint gpu_texture;
|
||
|
|
||
|
enum texture_filter {
|
||
|
TEXTURE_FILTER_NEAREAST,
|
||
|
TEXTURE_FILTER_LINEAR,
|
||
|
};
|
||
|
|
||
|
|
||
|
gpu_texture create_gpu_texture(enum texture_filter filter, bool generate_mipmaps);
|
||
|
|
||
|
void delete_gpu_texture(gpu_texture texture);
|
||
|
|
||
|
void specify_gpu_texture(gpu_texture texture, void *pixels, int channels, int width, int height);
|
||
|
|
||
|
void bind_gpu_texture(gpu_texture texture);
|
||
|
|
||
|
#endif
|