]> git.localhorst.tv Git - blank.git/blob - src/graphics/Texture.hpp
implemented font redering
[blank.git] / src / graphics / Texture.hpp
1 #ifndef BLANK_GRAPHICS_TEXTURE_HPP_
2 #define BLANK_GRAPHICS_TEXTURE_HPP_
3
4 #include "Format.hpp"
5
6 #include <GL/glew.h>
7
8 struct SDL_Surface;
9
10
11 namespace blank {
12
13 class Texture {
14
15 public:
16         Texture();
17         ~Texture();
18
19         Texture(Texture &&) noexcept;
20         Texture &operator =(Texture &&) noexcept;
21
22         Texture(const Texture &) = delete;
23         Texture &operator =(const Texture &) = delete;
24
25 public:
26         GLsizei Width() const noexcept { return width; }
27         GLsizei Height() const noexcept { return height; }
28
29         void Bind() noexcept;
30
31         void Data(const SDL_Surface &, bool pad2 = true) noexcept;
32         void Data(GLsizei w, GLsizei h, const Format &, GLvoid *data) noexcept;
33
34         void FilterNearest() noexcept;
35         void FilterLinear() noexcept;
36         void FilterTrilinear() noexcept;
37
38         static void UnpackAlignment(GLint) noexcept;
39         static int UnpackAlignmentFromPitch(int) noexcept;
40         static void UnpackRowLength(GLint) noexcept;
41
42 private:
43         GLuint handle;
44
45         GLsizei width, height;
46
47 };
48
49 }
50
51 #endif