summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/config.h2
-rw-r--r--engine/engine.cpp15
2 files changed, 5 insertions, 12 deletions
diff --git a/engine/config.h b/engine/config.h
index cae33b4..1cf4713 100644
--- a/engine/config.h
+++ b/engine/config.h
@@ -10,8 +10,6 @@ namespace Config {
const float viewport_w = 900.0 / 1080.0;
const float viewport_h = 1050.0 / 1080.0;
- const unsigned int viewport_overscan = 10;
-
const float viewport_aspect = float(viewport_h) / float(viewport_w);
const float fps_x = 0.0;
diff --git a/engine/engine.cpp b/engine/engine.cpp
index 4c7d426..2e681e7 100644
--- a/engine/engine.cpp
+++ b/engine/engine.cpp
@@ -102,10 +102,10 @@ void Engine::update() {
float v_h = Config::window_h * Config::viewport_h;
glViewport(
- v_x - Config::viewport_overscan,
- v_y - Config::viewport_overscan,
- v_w + Config::viewport_overscan * 2,
- v_h + Config::viewport_overscan * 2);
+ v_x - v_w * 0.5,
+ v_y - v_h * 0.5,
+ v_w * 2,
+ v_h * 2);
glScissor(v_x, v_y, v_w, v_h);
glEnable(GL_SCISSOR_TEST);
@@ -141,12 +141,7 @@ void Engine::update() {
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
- glOrtho(
- -float(Config::viewport_overscan) / float(v_w),
- 1.0 + float(Config::viewport_overscan) / float(v_w),
- -float(Config::viewport_overscan) / float(v_w),
- Config::viewport_aspect + float(Config::viewport_overscan) / float(v_w),
- 0, 10);
+ glOrtho(-0.5, 1.5, -Config::viewport_aspect * 0.5, Config::viewport_aspect * 1.5, 0, 10);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();