Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/view.cc')
-rw-r--r--src/client/view.cc25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/client/view.cc b/src/client/view.cc
index 8881ac2..3b5f785 100644
--- a/src/client/view.cc
+++ b/src/client/view.cc
@@ -12,8 +12,6 @@
#include "sys/sys.h"
#include "math/mathlib.h"
-#include <SDL/SDL.h>
-
using namespace render;
namespace client
@@ -49,7 +47,8 @@ void View::reset() {
// Culling
gl::cullface( GL_BACK );
gl::frontface(GL_CCW );
-}
+
+}
void View::draw_world(float elapsed)
@@ -135,18 +134,22 @@ void View::draw(float elapsed)
{
// Clear the color and depth buffers.
gl::clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
+
// Change to the projection matrix and set our viewing volume.
gl::matrixmode( GL_PROJECTION );
gl::loadidentity();
//glu::perspective( 64.0, video::ratio, 1.0, 1024.0 );
const float frustumsize = 0.5f;
- gl::frustum( -frustumsize * video.ratio, frustumsize * video.ratio, -frustumsize, frustumsize, 1.0f, 1024.0f);
-
+ x = -frustumsize * video.ratio;
+ width = video.ratio;
+ y = -frustumsize;
+ height = 1;
- gl::matrixmode( GL_MODELVIEW );
+ //gl::frustum( -frustumsize * video.ratio, frustumsize * video.ratio, -frustumsize, frustumsize, 1.0f, 1024.0f);
+ gl::frustum(x, x+width, y, y +height, 1.0f, 1024.0f);
+ gl::matrixmode( GL_MODELVIEW );
gl::loadidentity();
gl::rotate(90.0f, 0, 1.0, 0);
@@ -159,13 +162,15 @@ void View::draw(float elapsed)
// draw the semi-static background
draw_background(elapsed);
- // draw the console
- //gl::matrixmode( GL_PROJECTION );
- //gl::loadidentity();
+ // switch to ortographic projection to draw the GUI
+ gl::matrixmode( GL_PROJECTION );
+ gl::loadidentity();
+ glOrtho(0, video.width, video.height, 0, -1000.0f, 1000.0f);
gl::matrixmode( GL_MODELVIEW );
gl::loadidentity();
+ // draw the console
console.draw();
}