1 #ifndef BLANK_GRAPHICS_VIEWPORT_HPP_
2 #define BLANK_GRAPHICS_VIEWPORT_HPP_
4 #include "BlendedSprite.hpp"
5 #include "BlockLighting.hpp"
8 #include "DirectionalLighting.hpp"
10 #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 BlockLighting &ChunkProgram() noexcept;
45 DirectionalLighting &EntityProgram() noexcept;
46 DirectionalLighting &HUDProgram() noexcept;
47 BlendedSprite &SpriteProgram() noexcept;
49 void WorldPosition(const glm::mat4 &) noexcept;
51 const glm::mat4 &Perspective() const noexcept { return cam.Projection(); }
52 const glm::mat4 &Ortho() const noexcept { return canv.Projection(); }
53 const glm::mat4 &CenterTransform() const noexcept { return center; }
62 BlockLighting chunk_prog;
63 DirectionalLighting entity_prog;
64 BlendedSprite sprite_prog;