diff --git a/include/opengl-playground/opengltexture.hpp b/include/opengl-playground/opengltexture.hpp new file mode 100644 index 0000000..7057bcc --- /dev/null +++ b/include/opengl-playground/opengltexture.hpp @@ -0,0 +1,19 @@ +#ifndef OPENGLTEXTURE_HPP +#define OPENGLTEXTURE_HPP + +#include + +class OpenGlTexture +{ + public: + OpenGlTexture(); + OpenGlTexture(const OpenGlTexture &tex); + OpenGlTexture(const OpenGlTexture &&tex); + ~OpenGlTexture(); + + protected: + GLuint texture; + +}; + +#endif // OPENGLTEXTURE_HPP diff --git a/src/opengltexture.cpp b/src/opengltexture.cpp new file mode 100644 index 0000000..69d6700 --- /dev/null +++ b/src/opengltexture.cpp @@ -0,0 +1,28 @@ +#include + +OpenGlTexture::OpenGlTexture() +{ + glGenTextures(1, &this->texture); + glBindTexture(GL_TEXTURE_2D, this->texture); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); +} + +OpenGlTexture::OpenGlTexture(const OpenGlTexture &tex) +{ + this->texture = tex.texture; +} + +OpenGlTexture::OpenGlTexture(const OpenGlTexture &&tex) +{ + this->texture = tex.texture; +} + + + +OpenGlTexture::~OpenGlTexture() +{ + +}