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 "PlainColor.hpp"
12 #include "SkyBoxShader.hpp"
22 Viewport(const Viewport &) = delete;
23 Viewport &operator =(const Viewport &) = delete;
27 void EnableDepthTest() noexcept;
28 void EqualDepthTest() noexcept;
29 void DisableDepthTest() noexcept;
31 void EnableBackfaceCulling() noexcept;
32 void DisableBackfaceCulling() noexcept;
34 void EnableAlphaBlending() noexcept;
35 void EnableInvertBlending() noexcept;
36 void DisableBlending() noexcept;
38 void Resize(int w, int h) noexcept;
40 float Width() const noexcept { return canv.Size().x; }
41 float Height() const noexcept { return canv.Size().y; }
43 void Clear() noexcept;
44 void ClearDepth() noexcept;
46 glm::vec2 GetPosition(const glm::vec2 &off, Gravity grav) const noexcept;
48 void SetCursor(const glm::vec3 &) noexcept;
49 void SetCursor(const glm::vec3 &, Gravity) noexcept;
50 void MoveCursor(const glm::vec3 &) noexcept;
51 const glm::mat4 &Cursor() const noexcept { return cursor; }
53 void OffsetCamera(const glm::vec3 &o) noexcept { cam_offset = o; }
54 const glm::vec3 &CameraOffset() const noexcept { return cam_offset; }
56 BlockLighting &ChunkProgram() noexcept;
57 DirectionalLighting &EntityProgram() noexcept;
58 DirectionalLighting &HUDProgram() noexcept;
59 PlainColor &WorldColorProgram() noexcept;
60 PlainColor &HUDColorProgram() noexcept;
61 SkyBoxShader &SkyBoxProgram() noexcept;
62 BlendedSprite &SpriteProgram() noexcept;
64 void WorldPosition(const glm::mat4 &) noexcept;
66 const glm::mat4 &Perspective() const noexcept { return cam.Projection(); }
67 const glm::mat4 &Ortho() const noexcept { return canv.Projection(); }
77 BlockLighting chunk_prog;
78 DirectionalLighting entity_prog;
79 PlainColor color_prog;
80 SkyBoxShader sky_prog;
81 BlendedSprite sprite_prog;