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 void SetCursor(const glm::vec3 &);
48 void SetCursor(const glm::vec3 &, Gravity);
49 void MoveCursor(const glm::vec3 &);
50 const glm::mat4 &Cursor() const noexcept { return cursor; }
52 BlockLighting &ChunkProgram() noexcept;
53 DirectionalLighting &EntityProgram() noexcept;
54 DirectionalLighting &HUDProgram() noexcept;
55 PlainColor &WorldOutlineProgram() noexcept;
56 PlainColor &HUDOutlineProgram() noexcept;
57 SkyBoxShader &SkyBoxProgram() noexcept;
58 BlendedSprite &SpriteProgram() noexcept;
60 void WorldPosition(const glm::mat4 &) noexcept;
62 const glm::mat4 &Perspective() const noexcept { return cam.Projection(); }
63 const glm::mat4 &Ortho() const noexcept { return canv.Projection(); }
71 BlockLighting chunk_prog;
72 DirectionalLighting entity_prog;
73 PlainColor outline_prog;
74 SkyBoxShader sky_prog;
75 BlendedSprite sprite_prog;