Files
game-engine/src/engine/texture.h
2024-04-11 01:05:03 -04:00

27 lines
692 B
C

#pragma once
#include <GL/glew.h>
#include <GL/gl.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include "../COMMON.h"
#define STRING_SDL_IMAGE_LOAD_ERROR "[ERROR] Unable to load image: %s | %s\n"
#define STRING_SDL_IMAGE_LOAD_SUCCESS "[INFO] Loaded image: %s\n"
typedef struct Texture
{
GLuint handle;
ivec2 size;
bool isInit;
} Texture;
bool texture_from_path_init(Texture* self, const char* path);
void texture_init(Texture* self, ivec2 size, void* data);
void texture_surface_init(Texture* self, SDL_Surface* surface);
void texture_parameter_set(GLenum pname, GLint parameter);
void texture_bind(Texture* self);
void texture_unbind(void);
void texture_free(Texture* self);