]> git.localhorst.tv Git - blank.git/blob - src/graphics/BlendedSprite.hpp
a15d8a1cb2b41c077c498f92ed86f377defdeeed
[blank.git] / src / graphics / BlendedSprite.hpp
1 #ifndef BLANK_GRAPHICS_BLENDEDSPRITE_HPP_
2 #define BLANK_GRAPHICS_BLENDEDSPRITE_HPP_
3
4 #include "Program.hpp"
5
6 #include <GL/glew.h>
7 #include <glm/glm.hpp>
8
9
10 namespace blank {
11
12 class Texture;
13
14 class BlendedSprite {
15
16 public:
17         BlendedSprite();
18
19         void Activate() noexcept;
20
21         void SetM(const glm::mat4 &m) noexcept;
22         void SetProjection(const glm::mat4 &p) noexcept;
23         void SetView(const glm::mat4 &v) noexcept;
24         void SetVP(const glm::mat4 &v, const glm::mat4 &p) noexcept;
25         void SetMVP(const glm::mat4 &m, const glm::mat4 &v, const glm::mat4 &p) noexcept;
26
27         void SetTexture(Texture &) noexcept;
28         void SetFG(const glm::vec4 &) noexcept;
29         void SetBG(const glm::vec4 &) noexcept;
30
31         const glm::mat4 &Projection() const noexcept { return projection; }
32         const glm::mat4 &View() const noexcept { return view; }
33         const glm::mat4 &GetVP() const noexcept { return vp; }
34
35 private:
36         Program program;
37
38         glm::mat4 projection;
39         glm::mat4 view;
40         glm::mat4 vp;
41
42         GLuint mvp_handle;
43         GLuint sampler_handle;
44         GLuint fg_handle;
45         GLuint bg_handle;
46
47 };
48
49 }
50
51 #endif