Texture.h 614 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef TEXTURE_H
  2. #define TEXTURE_H
  3. #include <GL/glew.h>
  4. #include "common/utils/Types.h"
  5. class Texture final {
  6. public:
  7. enum Mode {
  8. NEAREST, LINEAR
  9. };
  10. Texture(Mode mode = NEAREST);
  11. ~Texture();
  12. Texture(const Texture& other) = delete;
  13. Texture(Texture&& other) = delete;
  14. Texture& operator=(const Texture& other) = delete;
  15. Texture& operator=(Texture&& other) = delete;
  16. void setRGBAData(int width, int height, const u32* data);
  17. void setRGBFloatData(int width, int height, const float* data);
  18. void bind(uint index) const;
  19. private:
  20. GLuint texture;
  21. };
  22. #endif