, cursor(1.0f)
, chunk_prog()
, entity_prog()
+, sky_prog()
, sprite_prog()
, active_prog(NONE) {
glClearColor(0.0, 0.0, 0.0, 1.0);
glDepthFunc(GL_LESS);
}
+void Viewport::EqualDepthTest() noexcept {
+ glEnable(GL_DEPTH_TEST);
+ glDepthFunc(GL_LEQUAL);
+}
+
void Viewport::DisableDepthTest() noexcept {
glDisable(GL_DEPTH_TEST);
}
return entity_prog;
}
+PlainColor &Viewport::WorldOutlineProgram() noexcept {
+ if (active_prog != OUTLINE_WORLD) {
+ outline_prog.Activate();
+ outline_prog.SetVP(cam.View(), cam.Projection());
+ active_prog = OUTLINE_WORLD;
+ }
+ return outline_prog;
+}
+
+PlainColor &Viewport::HUDOutlineProgram() noexcept {
+ if (active_prog != OUTLINE_HUD) {
+ outline_prog.Activate();
+ outline_prog.SetVP(canv.View(), canv.Projection());
+ active_prog = OUTLINE_HUD;
+ }
+ return outline_prog;
+}
+
+SkyBoxShader &Viewport::SkyBoxProgram() noexcept {
+ if (active_prog != SKY_BOX) {
+ sky_prog.Activate();
+ DisableBlending();
+ EqualDepthTest();
+ active_prog = SKY_BOX;
+ }
+ return sky_prog;
+}
+
BlendedSprite &Viewport::SpriteProgram() noexcept {
if (active_prog != SPRITE) {
sprite_prog.Activate();