1 #ifndef GONG_GRAPHICS_VIEWPORT_HPP_
2 #define GONG_GRAPHICS_VIEWPORT_HPP_
5 #include "BlendedSprite.hpp"
9 #include "PlainColor.hpp"
10 #include "SkyBoxShader.hpp"
21 Viewport(const Viewport &) = delete;
22 Viewport &operator =(const Viewport &) = delete;
26 void EnableDepthTest() noexcept;
27 void EqualDepthTest() 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 glm::vec2 GetPosition(const glm::vec2 &off, Gravity grav) const noexcept;
47 void SetCursor(const glm::vec3 &) noexcept;
48 void SetCursor(const glm::vec3 &, Gravity) noexcept;
49 void MoveCursor(const glm::vec3 &) noexcept;
50 const glm::mat4 &Cursor() const noexcept { return cursor; }
52 void OffsetCamera(const glm::vec3 &o) noexcept { cam_offset = o; }
53 const glm::vec3 &CameraOffset() const noexcept { return cam_offset; }
55 PlainColor &HUDColorProgram() noexcept;
56 SkyBoxShader &SkyBoxProgram() noexcept;
57 BlendedSprite &SpriteProgram() noexcept;
59 void WorldPosition(const glm::mat4 &) noexcept;
61 const glm::mat4 &Perspective() const noexcept { return cam.Projection(); }
62 const glm::mat4 &Ortho() const noexcept { return canv.Projection(); }
72 PlainColor color_prog;
73 SkyBoxShader sky_prog;
74 BlendedSprite sprite_prog;