#ifndef __TEXTURE_H__ #define __TEXTURE_H__ #include #include #include #include #include #include #include "shader.hpp" struct textureSettings{ // how to handle pixels outside of texture (s=x, t=y) GLenum s_wraping; GLenum t_wraping; // how to handle higher res pixels GLenum mag_min; GLenum mag_max; }; class texture{ public: GLuint ref; textureSettings settings; int width; int height; void genTexureGpu(GLfloat pixels[], int width, int height, GLenum texUnit = GL_TEXTURE0); void genTexureGpu(GLfloat pixels[], int width, int height, textureSettings settings, GLenum texUnit = GL_TEXTURE0); void loadFromPath(std::string path, GLenum texUnit = GL_TEXTURE0); void loadFromPath(std::string path, textureSettings settings, GLenum texUnit = GL_TEXTURE0); void setTexUniformLocation(std::string name, GLint id, shader *program); }; textureSettings VELAGE_generateTextureSettings(GLenum s_wraping, GLenum t_wraping, GLenum mag_min, GLenum mag_max); textureSettings VELAGE_generateTextureSettings(GLenum wraping, GLenum mag); #endif