From 8ac9b27f5f0a1e833974058464cdf7029c9d7e0b Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 2 Feb 2008 14:14:15 +0000 Subject: removed libgl --- src/gl/box.cc | 100 ---------------------------------------------------------- 1 file changed, 100 deletions(-) delete mode 100644 src/gl/box.cc (limited to 'src/gl/box.cc') diff --git a/src/gl/box.cc b/src/gl/box.cc deleted file mode 100644 index 12507df..0000000 --- a/src/gl/box.cc +++ /dev/null @@ -1,100 +0,0 @@ -/* - gl/box.cc - This file is part of the Osirion project and is distributed under - the terms of the GNU General Public License version 2 -*/ - -// project headers -#include "gl/box.h" - -namespace gl { - -using math::Vector3f; -using math::Color; - -Box::Box(Vector3f const & tl, Vector3f const &br) : - topleft(tl), bottomright(br) -{ - topcolor = Color::White(); - bottomcolor= Color::White() * 0.7f; -} - -Box::Box(const Box & other) -{ - (*this) = other; -} - -Box& Box::operator=(const Box &other) -{ - bottomcolor = other.bottomcolor; - topcolor = other.topcolor; - - topleft = other.topleft; - bottomright = other.bottomright; - return (*this); -} - -void Box::draw() -{ - Vector3f v0(topleft.x, bottomright.y, bottomright.z); - Vector3f v1(topleft.x, topleft.y, bottomright.z); - Vector3f v2(topleft.x, topleft.y, topleft.z); - Vector3f v3(topleft.x, bottomright.y, topleft.z); - - Vector3f v4(bottomright.x, bottomright.y, bottomright.z); - Vector3f v5(bottomright.x, topleft.y, bottomright.z); - Vector3f v6(bottomright.x, topleft.y, topleft.z); - Vector3f v7(bottomright.x, bottomright.y, topleft.z); - - begin(Quads); - - // top - color(topcolor); - vertex(v2); - vertex(v1); - vertex(v5); - vertex(v6); - - // sides - color(bottomcolor); - vertex(v0); - color(topcolor); - vertex(v1); - vertex(v2); - color(bottomcolor); - vertex(v3); - - vertex(v3); - color(topcolor); - vertex(v2); - vertex(v6); - color(bottomcolor); - vertex(v7); - - vertex(v4); - color(topcolor); - vertex(v5); - vertex(v1); - color(bottomcolor); - vertex(v0); - - vertex(v7); - color(topcolor); - vertex(v6); - vertex(v5); - color(bottomcolor); - vertex(v4); - - // bottom - color(bottomcolor); - vertex(v4); - vertex(v0); - vertex(v3); - vertex(v7); - - end(); - -} - -} // namespace gl - -- cgit v1.2.3