1 #ifndef BLANK_GRAPHICS_VIEWPORT_HPP_
2 #define BLANK_GRAPHICS_VIEWPORT_HPP_
5 #include "BlendedSprite.hpp"
6 #include "BlockLighting.hpp"
9 #include "DirectionalLighting.hpp"
10 #include "PlainColor.hpp"
11 #include "SkyBoxShader.hpp"
13 #include <glm/glm.hpp>
23 Viewport(const Viewport &) = delete;
24 Viewport &operator =(const Viewport &) = delete;
26 void VSync(bool b) noexcept;
28 void EnableDepthTest() noexcept;
29 void EqualDepthTest() noexcept;
30 void DisableDepthTest() noexcept;
32 void EnableBackfaceCulling() noexcept;
33 void DisableBackfaceCulling() noexcept;
35 void EnableAlphaBlending() noexcept;
36 void EnableInvertBlending() noexcept;
37 void DisableBlending() noexcept;
39 void Resize(int w, int h) noexcept;
41 float Width() const noexcept { return canv.Size().x; }
42 float Height() const noexcept { return canv.Size().y; }
44 void Clear() noexcept;
45 void ClearDepth() noexcept;
47 glm::vec2 GetPosition(const glm::vec2 &off, Gravity grav) const noexcept;
49 void SetCursor(const glm::vec3 &) noexcept;
50 void SetCursor(const glm::vec3 &, Gravity) noexcept;
51 void MoveCursor(const glm::vec3 &) noexcept;
52 const glm::mat4 &Cursor() const noexcept { return cursor; }
54 BlockLighting &ChunkProgram() noexcept;
55 DirectionalLighting &EntityProgram() noexcept;
56 DirectionalLighting &HUDProgram() noexcept;
57 PlainColor &WorldColorProgram() noexcept;
58 PlainColor &HUDColorProgram() noexcept;
59 SkyBoxShader &SkyBoxProgram() noexcept;
60 BlendedSprite &SpriteProgram() noexcept;
62 void WorldPosition(const glm::mat4 &) noexcept;
64 const glm::mat4 &Perspective() const noexcept { return cam.Projection(); }
65 const glm::mat4 &Ortho() const noexcept { return canv.Projection(); }
73 BlockLighting chunk_prog;
74 DirectionalLighting entity_prog;
75 PlainColor color_prog;
76 SkyBoxShader sky_prog;
77 BlendedSprite sprite_prog;