1 #ifndef BLANK_GRAPHICS_VIEWPORT_HPP_
2 #define BLANK_GRAPHICS_VIEWPORT_HPP_
5 #include "BlendedSprite.hpp"
6 #include "BlockLighting.hpp"
9 #include "DirectionalLighting.hpp"
11 #include <glm/glm.hpp>
21 Viewport(const Viewport &) = delete;
22 Viewport &operator =(const Viewport &) = delete;
24 void VSync(bool b) noexcept;
26 void EnableDepthTest() noexcept;
27 void DisableDepthTest() noexcept;
29 void EnableBackfaceCulling() noexcept;
30 void DisableBackfaceCulling() noexcept;
32 void EnableAlphaBlending() noexcept;
33 void EnableInvertBlending() noexcept;
34 void DisableBlending() noexcept;
36 void Resize(int w, int h) noexcept;
38 float Width() const noexcept { return canv.Size().x; }
39 float Height() const noexcept { return canv.Size().y; }
41 void Clear() noexcept;
42 void ClearDepth() noexcept;
44 void SetCursor(const glm::vec3 &);
45 void SetCursor(const glm::vec3 &, Gravity);
46 void MoveCursor(const glm::vec3 &);
47 const glm::mat4 &Cursor() const noexcept { return cursor; }
49 BlockLighting &ChunkProgram() noexcept;
50 DirectionalLighting &EntityProgram() noexcept;
51 DirectionalLighting &HUDProgram() noexcept;
52 BlendedSprite &SpriteProgram() noexcept;
54 void WorldPosition(const glm::mat4 &) noexcept;
56 const glm::mat4 &Perspective() const noexcept { return cam.Projection(); }
57 const glm::mat4 &Ortho() const noexcept { return canv.Projection(); }
65 BlockLighting chunk_prog;
66 DirectionalLighting entity_prog;
67 BlendedSprite sprite_prog;