From f620d82757becbb2270a37921fc989cb777f8824 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Wed, 29 Jun 2016 20:19:55 -0400 Subject: [PATCH] ortho template FIX --- brice.dat | 8 ++++---- main.cpp | 21 +++++++++++---------- xml/bobshouse.xml | 2 +- xml/town.xml | 4 ++-- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/brice.dat b/brice.dat index 4dad711..2033bae 100644 --- a/brice.dat +++ b/brice.dat @@ -1,7 +1,7 @@ 3 -Slow -0 -canJump -0 canSprint 1 +canJump +0 +Slow +0 diff --git a/main.cpp b/main.cpp index 1bfce77..5e06f6b 100644 --- a/main.cpp +++ b/main.cpp @@ -413,20 +413,21 @@ void render() { offset.y = std::max(player->loc.y + player->height / 2, SCREEN_HEIGHT / 2.0f); // "setup" - glm::mat4 projection = glm::ortho( floor(offset.x-SCREEN_WIDTH/2), //left - floor(offset.x+SCREEN_WIDTH/2), //right - floor(offset.y-SCREEN_HEIGHT/2), //bottom - floor(offset.y+SCREEN_HEIGHT/2), //top - 10.0, //near - -10.0); //far + glm::mat4 projection = glm::ortho(floor(offset.x - SCREEN_WIDTH / 2), // left + floor(offset.x + SCREEN_WIDTH / 2), // right + floor(offset.y - SCREEN_HEIGHT / 2), // bottom + floor(offset.y + SCREEN_HEIGHT / 2), // top + static_cast(10.0), // near + static_cast(-10.0)); // far - glm::mat4 view = glm::lookAt(glm::vec3(0,0,0.0f), //pos - glm::vec3(0,0,-10.0f), //looking at - glm::vec3(0,1.0f,0)); //up vector + glm::mat4 view = glm::lookAt(glm::vec3(0.0f, 0.0f, 0.0f), // pos + glm::vec3(0.0f, 0.0f, -10.0f), // looking at + glm::vec3(0.0f, 1.0f, 0.0f)); // up vector glm::mat4 ortho = projection * view; - glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + // TODO add depth glEnable(GL_DEPTH_TEST); //glEnable(GL_CULL_FACE); diff --git a/xml/bobshouse.xml b/xml/bobshouse.xml index 2d69813..0319b89 100644 --- a/xml/bobshouse.xml +++ b/xml/bobshouse.xml @@ -3,5 +3,5 @@