medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit ebc9d98547279eb488a59db5eadf83ec7577460d
parent 9ed1bb4102f5795d5253fe0e258bc54c82327484
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sun Jan 17 23:20:55 +0000

Move window parameters into game.h

Diffstat:
btt.cc | 2+-
game.h | 6++++++
gl.cc | 4+---
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/btt.cc b/btt.cc @@ -214,7 +214,7 @@ BTTs btt_from_heightmap( const Heightmap * const hm, MemoryArena * const arena ) return roots; } -static const glm::mat4 P( glm::perspective( glm::radians( 120.0f ), 640.0f / 480.0f, 0.1f, 10000.0f ) ); +static const glm::mat4 P( glm::perspective( glm::radians( 120.0f ), ( float ) WIDTH / ( float ) HEIGHT, NEAR, FAR ) ); extern "C" GAME_INIT( game_init ) { state->pos = glm::vec3( 100, 100, 50 ); diff --git a/game.h b/game.h @@ -92,6 +92,12 @@ #include "keys.h" #include "stb_truetype.h" +const int WIDTH = 640; +const int HEIGHT = 480; + +const float NEAR = 0.1f; +const float FAR = 10000.0f; + struct GameState { glm::vec3 pos; glm::vec3 angles; diff --git a/gl.cc b/gl.cc @@ -8,11 +8,9 @@ #include <GL/glew.h> #endif +#include "game.h" #include "gl.h" -static const int WIDTH = 640; -static const int HEIGHT = 480; - #define RESET "\x1b[0m" #define RED "\x1b[1;31m" #define YELLOW "\x1b[1;32m"