Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-02-02 14:53:46 +0000
committerStijn Buys <ingar@osirion.org>2008-02-02 14:53:46 +0000
commit67f8a7a783e550cab8e6a77d997b31815ee8cd7e (patch)
treeb68bde793bb881b965366569cfc9cea65423eb12 /src/client/shipdrawer.cc
parent8ac9b27f5f0a1e833974058464cdf7029c9d7e0b (diff)
introduced librender
Diffstat (limited to 'src/client/shipdrawer.cc')
-rw-r--r--src/client/shipdrawer.cc61
1 files changed, 31 insertions, 30 deletions
diff --git a/src/client/shipdrawer.cc b/src/client/shipdrawer.cc
index e1c9adf..074dbd8 100644
--- a/src/client/shipdrawer.cc
+++ b/src/client/shipdrawer.cc
@@ -5,14 +5,15 @@
*/
#include "client/shipdrawer.h"
-#include "gl/gllib.h"
-#include "gl/box.h"
+#include "render/render.h"
+#include "render/box.h"
#include <iostream>
namespace client {
-using namespace gl;
+using namespace render;
+
using math::Vector3f;
using math::Color;
@@ -40,12 +41,12 @@ void ShipDrawer::draw(float elapsed)
{
gl::push();
- rotate(ship->yaw(), 0.0f, 1.0f, 0.0f );
+ gl::rotate(ship->yaw(), 0.0f, 1.0f, 0.0f );
Vector3f tl(0.25, 0.125, 0.125);
Vector3f br(-0.25, -0.125, -0.125);
- gl::Box box(tl, br);
+ Box box(tl, br);
box.draw();
tl = Vector3f(0, 0.07, 0.25);
@@ -70,43 +71,43 @@ void ShipDrawer::draw(float elapsed)
cockpit.draw();
if(ship->thrust() > 0 ) {
- color(1.0f,0 ,0 );
- begin(Lines);
- vertex(-0.5f, 0, 0.185);
- vertex(-0.5f-0.25f*ship->thrust(), 0, 0.185);
+ gl::color(1.0f,0 ,0 );
+ gl::begin(gl::Lines);
+ gl::vertex(-0.5f, 0, 0.185);
+ gl::vertex(-0.5f-0.25f*ship->thrust(), 0, 0.185);
- vertex(-0.5f, 0, -0.185f);
- vertex(-0.5f-0.25f*ship->thrust(), 0, -0.185f);
- end();
+ gl::vertex(-0.5f, 0, -0.185f);
+ gl::vertex(-0.5f-0.25f*ship->thrust(), 0, -0.185f);
+ gl::end();
}
// shield rotation
- rotate(angle, 0.0f, 1.0f, 0.0f );
+ gl::rotate(angle, 0.0f, 1.0f, 0.0f );
angle += 180.0f * elapsed;
if( angle > 360.0f ) {
angle -= 360.0f;
}
// draw the shield
- color(Color(0.0f, 1.0f ,0.0f , 0.5f));
+ gl::color(Color(0.0f, 1.0f ,0.0f , 0.5f));
+
+ gl::begin(gl::LineStrip);
+ gl::vertex(v0);
+ gl::vertex(v1);
+ gl::vertex(v2);
+ gl::vertex(v3);
+ gl::vertex(v0);
+ gl::end();
- begin(LineStrip);
- vertex(v0);
- vertex(v1);
- vertex(v2);
- vertex(v3);
- vertex(v0);
- end();
-
- begin(LineStrip);
- vertex(v4);
- vertex(v5);
- vertex(v6);
- vertex(v7);
- vertex(v4);
- end();
+ gl::begin(gl::LineStrip);
+ gl::vertex(v4);
+ gl::vertex(v5);
+ gl::vertex(v6);
+ gl::vertex(v7);
+ gl::vertex(v4);
+ gl::end();
gl::pop();
}
-} // namespace client
+}