#ifndef __OPENGLPLAYGROUND_TEXTURE_HH__ #define __OPENGLPLAYGROUND_TEXTURE_HH__ #include #include #include #include #include #include "common.hh" class Framebuffer { public: Framebuffer(); ~Framebuffer(); void bind() const; gl::GLuint getID() const { return _fbID; } void attachTexture(GLenum textarget, gl::GLuint texID); private: gl::GLuint _fbID; }; class TextureCubeMap { public: TextureCubeMap(unsigned size); ~TextureCubeMap(); TextureCubeMap(TextureCubeMap const& copy) = delete; TextureCubeMap& operator=(TextureCubeMap const& copy) = delete; TextureCubeMap(TextureCubeMap && move); TextureCubeMap& operator=(TextureCubeMap && move); void bind() const; gl::GLuint getID() const { return _texID; } private: gl::GLuint _texID; }; class Texture2D { public: Texture2D(unsigned width, unsigned height); Texture2D(std::string const& file); Texture2D(SDL_Surface *surface); Texture2D(Texture2D const& copy) = delete; Texture2D& operator=(Texture2D const& copy) = delete; Texture2D(Texture2D&& move); Texture2D& operator=(Texture2D&& move); ~Texture2D(); void bind() const; private: void _glCreate(unsigned width, unsigned height, bool alpha = false); gl::GLuint _texID; }; #endif