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();
- ~Texture();
- Texture(const Texture& other) = delete;
- Texture(Texture&& other) = delete;
- Texture& operator=(const Texture& other) = delete;
- Texture& operator=(Texture&& other) = delete;
- void init(const TextureFormat& format, int maxMipMaps);
- 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
|