#ifndef TEXTURE_H #define TEXTURE_H #include #include "gaming-core/utils/Color.h" class Texture final { GLuint texture; public: Texture(); ~Texture(); Texture(const Texture& other) = delete; Texture(Texture&& other) = delete; Texture& operator=(const Texture& other) = delete; Texture& operator=(Texture&& other) = delete; void setColorData(int width, int height, const Color4* data); void setColorData(int width, int height, const Color3* data); void setColorData(int width, int height, const Color2* data); void setColorData(int width, int height, const Color1* data); void bind() const; private: template void setColorData(int width, int height, int mode, const Color* data) { glBindTexture(GL_TEXTURE_2D, texture); glTexImage2D(GL_TEXTURE_2D, 0, mode, width, height, 0, mode, GL_UNSIGNED_BYTE, data); } }; #endif