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"
12 #include <glm/glm.hpp>
22 Viewport(const Viewport &) = delete;
23 Viewport &operator =(const Viewport &) = delete;
25 void VSync(bool b) noexcept;
27 void EnableDepthTest() noexcept;
28 void DisableDepthTest() noexcept;
30 void EnableBackfaceCulling() noexcept;
31 void DisableBackfaceCulling() noexcept;
33 void EnableAlphaBlending() noexcept;
34 void EnableInvertBlending() noexcept;
35 void DisableBlending() noexcept;
37 void Resize(int w, int h) noexcept;
39 float Width() const noexcept { return canv.Size().x; }
40 float Height() const noexcept { return canv.Size().y; }
42 void Clear() noexcept;
43 void ClearDepth() noexcept;
45 void SetCursor(const glm::vec3 &);
46 void SetCursor(const glm::vec3 &, Gravity);
47 void MoveCursor(const glm::vec3 &);
48 const glm::mat4 &Cursor() const noexcept { return cursor; }
50 BlockLighting &ChunkProgram() noexcept;
51 DirectionalLighting &EntityProgram() noexcept;
52 DirectionalLighting &HUDProgram() noexcept;
53 PlainColor &WorldOutlineProgram() noexcept;
54 PlainColor &HUDOutlineProgram() noexcept;
55 BlendedSprite &SpriteProgram() noexcept;
57 void WorldPosition(const glm::mat4 &) noexcept;
59 const glm::mat4 &Perspective() const noexcept { return cam.Projection(); }
60 const glm::mat4 &Ortho() const noexcept { return canv.Projection(); }
68 BlockLighting chunk_prog;
69 DirectionalLighting entity_prog;
70 PlainColor outline_prog;
71 BlendedSprite sprite_prog;