]> git.localhorst.tv Git - blank.git/blobdiff - src/graphics/Viewport.hpp
sky box model & shader
[blank.git] / src / graphics / Viewport.hpp
index d64e580e56676bcc9024ce302c01bc07f8528885..03e0e0d05c247420387bdc5fc1c851a71b3f992b 100644 (file)
@@ -1,14 +1,16 @@
 #ifndef BLANK_GRAPHICS_VIEWPORT_HPP_
 #define BLANK_GRAPHICS_VIEWPORT_HPP_
 
+#include "align.hpp"
 #include "BlendedSprite.hpp"
 #include "BlockLighting.hpp"
 #include "Camera.hpp"
 #include "Canvas.hpp"
 #include "DirectionalLighting.hpp"
+#include "PlainColor.hpp"
+#include "SkyBoxShader.hpp"
 
 #include <glm/glm.hpp>
-#include <SDL.h>
 
 
 namespace blank {
@@ -24,6 +26,7 @@ public:
        void VSync(bool b) noexcept;
 
        void EnableDepthTest() noexcept;
+       void EqualDepthTest() noexcept;
        void DisableDepthTest() noexcept;
 
        void EnableBackfaceCulling() noexcept;
@@ -41,26 +44,34 @@ public:
        void Clear() noexcept;
        void ClearDepth() noexcept;
 
+       void SetCursor(const glm::vec3 &);
+       void SetCursor(const glm::vec3 &, Gravity);
+       void MoveCursor(const glm::vec3 &);
+       const glm::mat4 &Cursor() const noexcept { return cursor; }
+
        BlockLighting &ChunkProgram() noexcept;
        DirectionalLighting &EntityProgram() noexcept;
        DirectionalLighting &HUDProgram() noexcept;
+       PlainColor &WorldOutlineProgram() noexcept;
+       PlainColor &HUDOutlineProgram() noexcept;
+       SkyBoxShader &SkyBoxProgram() noexcept;
        BlendedSprite &SpriteProgram() noexcept;
 
        void WorldPosition(const glm::mat4 &) noexcept;
 
        const glm::mat4 &Perspective() const noexcept { return cam.Projection(); }
        const glm::mat4 &Ortho() const noexcept { return canv.Projection(); }
-       const glm::mat4 &CenterTransform() const noexcept { return center; }
 
 private:
-       SDL_GLContext ctx;
        Camera cam;
        Canvas canv;
 
-       glm::mat4 center;
+       glm::mat4 cursor;
 
        BlockLighting chunk_prog;
        DirectionalLighting entity_prog;
+       PlainColor outline_prog;
+       SkyBoxShader sky_prog;
        BlendedSprite sprite_prog;
 
        enum {
@@ -68,6 +79,9 @@ private:
                CHUNK,
                ENTITY,
                HUD,
+               OUTLINE_WORLD,
+               OUTLINE_HUD,
+               SKY_BOX,
                SPRITE,
        } active_prog;