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