12345678910111213141516171819202122232425262728293031323334353637 |
- #ifndef TEXTURE_H
- #define TEXTURE_H
- #include "rendering/TextureFormat.h"
- #include "wrapper/GL.h"
- class Texture final {
- TextureFormat format;
- GL::Texture texture;
- int maxMipMaps;
- template<int N>
- friend class Framebuffer;
- public:
- Texture(const TextureFormat& format, int maxMipMaps = 0);
- Texture(int maxMipMaps = 0);
- ~Texture();
- Texture(const Texture& other) = delete;
- Texture(Texture&& other) = delete;
- Texture& operator=(const Texture& other) = delete;
- Texture& operator=(Texture&& other) = delete;
- void setFormat(const TextureFormat& format);
- void setNearestFilter();
- void setLinearFilter();
- void setRepeatWrap();
- void setClampWrap();
- void setData(int width, int height, const void* data = nullptr);
- void bindTo(int index = 0) const;
- private:
- void bind() const;
- };
- #endif
|