From d57835d806987c9cbc583c45458ff8e9e1ec9f57 Mon Sep 17 00:00:00 2001
From: Rtch90 <ritchie.cunningham@protonmail.com>
Date: Sun, 15 Apr 2012 13:42:10 +0100
Subject: [PATCH] [Fix] Fixed the orthorgraphic view bug Tamir introduced.

---
 src/Main/main.cpp | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/Main/main.cpp b/src/Main/main.cpp
index a263ae4..c9d659c 100644
--- a/src/Main/main.cpp
+++ b/src/Main/main.cpp
@@ -31,6 +31,7 @@ void Destroy(void) {
 static void ResizeWindow(Game& game, int w, int h) {
   SDL_SetVideoMode(w, h, 32, SDL_OPENGL | SDL_RESIZABLE);
   game.OnResize(w, h);
+
   SDL_GL_SwapBuffers();
 }
 
@@ -68,7 +69,7 @@ int main(int argc, char** argv) {
   }
 
   if(TTF_Init()) {
-	  Debug::logger->message("SDL_ttf initialized.\n");
+    Debug::logger->message("SDL_ttf initialized.\n");
   }
 
   info = SDL_GetVideoInfo();
@@ -93,6 +94,11 @@ int main(int argc, char** argv) {
   Uint32 timeStart = SDL_GetTicks();
   float dt = 1.0f / 60.0f;
 
+  // We need to give windowWidth and windowHeight an initial value
+  // Otherwise it is just garbage, and the orthorgraphic view
+  // screws up for me. -- Allanis.
+  game.OnResize(windowWidth, windowHeight);
+
   bool isRunning = true;
   while(isRunning) {
 
@@ -114,8 +120,8 @@ int main(int argc, char** argv) {
     SDL_GL_SwapBuffers();
 
     Uint32 timeEnd = SDL_GetTicks();
-	  dt = (float)(timeEnd - timeStart) / 1000.0f;
-	  timeStart = timeEnd;
+    dt = (float)(timeEnd - timeStart) / 1000.0f;
+    timeStart = timeEnd;
   }
 
   game.Shutdown();