Permalink
Browse files

Ripped out GLOO, now need to slowly start replacing bits and pieces w…

…ith Horde3D
  • Loading branch information...
1 parent 0ffa40c commit 46b3d8a4b02e9e7b3725c3ee38ea7d5b521f354a @DavidMikeSimon committed Aug 21, 2011
View
@@ -22,7 +22,7 @@ along with Orbit Ribbon. If not, see http://www.gnu.org/licenses/
#include <Horde3D.h>
#include <Horde3DUtils.h>
-#include <GL/glew.h>
+//#include <GL/glew.h>
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <boost/array.hpp>
@@ -73,7 +73,7 @@ void App::frame_loop() {
unsigned int unsimulated_ticks = 0;
while (1) {
- GLint frame_start = SDL_GetTicks();
+ int frame_start = SDL_GetTicks();
// Fetch the latest state of the input devices
Input::update();
View
@@ -23,7 +23,7 @@ along with Orbit Ribbon. If not, see http://www.gnu.org/licenses/
#include <boost/lexical_cast.hpp>
#include <ode/ode.h>
#include <cmath>
-#include <GL/glew.h>
+//#include <GL/glew.h>
#include "autoxsd/orepkgdesc.h"
#include "avatar.h"
View
@@ -23,13 +23,13 @@ along with Orbit Ribbon. If not, see http://www.gnu.org/licenses/
#include <cmath>
#include <boost/foreach.hpp>
#include <boost/random.hpp>
-#include <GL/glew.h>
+//#include <GL/glew.h>
#include "autoxsd/orepkgdesc.h"
#include "background.h"
#include "except.h"
#include "geometry.h"
-#include "gloo.h"
+
#include "mesh.h"
// Settings for the main star
View
@@ -31,15 +31,11 @@ along with Orbit Ribbon. If not, see http://www.gnu.org/licenses/
#include "geometry.h"
class MeshAnimation;
-class GLOOTexture;
class Background {
private:
boost::shared_ptr<ORE1::SkySettingsType> _sky;
boost::taus88 _random_gen;
- std::vector<boost::shared_ptr<GLOOTexture> > _starbox_faces;
- boost::shared_ptr<GLOOTexture> _star_tex;
- boost::shared_ptr<MeshAnimation> _distant_bubble;
Vector _sky_offset;
struct RandomStuffDensityRange {
View
@@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with Orbit Ribbon. If not, see http://www.gnu.org/licenses/
*/
-#include <GL/glew.h>
+//#include <GL/glew.h>
#include "bubble.h"
#include "autoxsd/orepkgdesc.h"
View
@@ -23,7 +23,7 @@ along with Orbit Ribbon. If not, see http://www.gnu.org/licenses/
#include <boost/array.hpp>
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
-#include <GL/glew.h>
+//#include <GL/glew.h>
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
@@ -40,13 +40,13 @@ along with Orbit Ribbon. If not, see http://www.gnu.org/licenses/
#include "mode.h"
#include "mouse_cursor.h"
#include "performance.h"
-#include "gloo.h"
+
SDL_Surface* screen;
int Display::screen_width = 0;
int Display::screen_height = 0;
-GLfloat Display::screen_ratio = 0;
+float Display::screen_ratio = 0;
const SDL_VideoInfo* Display::vid_info = NULL;
const int SDL_VIDEO_FLAGS = SDL_OPENGL | SDL_GL_DOUBLEBUFFER;
@@ -209,7 +209,7 @@ void Display::init() {
// Quadratic value arrived at emperically, works OK but I don't think it's very realistic
float sprite_quadratic[] = { 0.0, 0.0, 0.0000015 };
glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, sprite_quadratic);
- GLfloat sprite_sizes[2];
+ float sprite_sizes[2];
glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, sprite_sizes);
glPointParameterf(GL_POINT_SIZE_MIN, sprite_sizes[0]);
glPointParameterf(GL_POINT_SIZE_MAX, sprite_sizes[1]);
@@ -231,7 +231,7 @@ void Display::init() {
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_INDEX_ARRAY);
- screen_ratio = GLfloat(screen_width)/GLfloat(screen_height);
+ screen_ratio = float(screen_width)/float(screen_height);
glViewport(0, 0, screen_width, screen_height);
glMatrixMode(GL_PROJECTION);
View
@@ -24,7 +24,7 @@ along with Orbit Ribbon. If not, see http://www.gnu.org/licenses/
#define ORBIT_RIBBON_DISPLAY_H
#include <list>
-#include <GL/glew.h>
+//#include <GL/glew.h>
#include "geometry.h"
@@ -51,7 +51,7 @@ struct SDL_VideoInfo;
class Display {
private:
static int screen_width, screen_height;
- static GLfloat screen_ratio;
+ static float screen_ratio;
static const SDL_VideoInfo* vid_info;
public:
View
@@ -28,7 +28,7 @@ along with Orbit Ribbon. If not, see http://www.gnu.org/licenses/
#include "except.h"
#include "font.h"
-#include "gloo.h"
+
#include "autoxsd/fontdesc.h"
#include "autoxsd/fontdesc-pimpl.h"
@@ -101,8 +101,8 @@ void Font::draw(const Point& upper_left, float height, const std::string& str) {
std::pair<unsigned char, short> hy = get_glyph_height_and_y_offset(height);
std::map<char, std::pair<short, unsigned char> >& glyphmap = _glyph_data[hy.first];
- static GLfloat points[FONT_MAX_STR_LENGTH*8];
- static GLfloat uv_points[FONT_MAX_STR_LENGTH*8];
+ static float points[FONT_MAX_STR_LENGTH*8];
+ static float uv_points[FONT_MAX_STR_LENGTH*8];
float x = 0.0;
Size t = _tex->get_size();
unsigned int glyphs = 0;
View
@@ -26,12 +26,9 @@ along with Orbit Ribbon. If not, see http://www.gnu.org/licenses/
#include <map>
class Point;
-class GLOOTexture;
class Font {
private:
- boost::shared_ptr<GLOOTexture> _tex;
-
// Key is max glyph height, value maps input char to offset and width. Offset is -1 for no character (i.e. space)
std::map<unsigned char, std::map<char, std::pair<short, unsigned char> > > _glyph_data;
View
@@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with Orbit Ribbon. If not, see http://www.gnu.org/licenses/
*/
-#include <GL/glew.h>
+//#include <GL/glew.h>
#include <ode/ode.h>
#include <boost/array.hpp>
#include <boost/foreach.hpp>
@@ -35,7 +35,7 @@ along with Orbit Ribbon. If not, see http://www.gnu.org/licenses/
#include "gameobj.h"
#include "geometry.h"
#include "globals.h"
-#include "gloo.h"
+
// Default coefficients for linear and angular damping on new GameObjs
const float DEFAULT_VEL_DAMP_COEF = 0.15;
@@ -166,7 +166,7 @@ void GameObj::step() {
// Apply damping
if (b != 0) {
- GLint i;
+ int i;
dReal x, y, z;
dVector3 v;
View
@@ -23,7 +23,7 @@ along with Orbit Ribbon. If not, see http://www.gnu.org/licenses/
#ifndef ORBIT_RIBBON_GAMEOBJ_H
#define ORBIT_RIBBON_GAMEOBJ_H
-#include <GL/glew.h>
+//#include <GL/glew.h>
#include <ode/ode.h>
#include <boost/array.hpp>
#include <boost/utility.hpp>
@@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with Orbit Ribbon. If not, see http://www.gnu.org/licenses/
*/
-#include <GL/glew.h>
+//#include <GL/glew.h>
#include <boost/format.hpp>
#include <cmath>
View
@@ -24,7 +24,7 @@ along with Orbit Ribbon. If not, see http://www.gnu.org/licenses/
#define ORBIT_RIBBON_GAMEPLAY_MODE_H
#include "geometry.h"
-#include "gloo.h"
+
#include "mode.h"
#include "mission_fsm.h"
@@ -35,7 +35,6 @@ class GameplayMode : public Mode {
MissionFSM _fsm;
std::string _avatar_key;
Point _condition_widget_cursor;
- GLOOCamera _camera;
public:
GameplayMode();
@@ -47,7 +46,7 @@ class GameplayMode : public Mode {
bool handle_input();
- const GLOOCamera* get_camera(bool top);
+ void set_camera(bool top);
void draw_3d_far(bool top);
void draw_3d_near(bool top);
void draw_2d(bool top);
View
@@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License
along with Orbit Ribbon. If not, see http://www.gnu.org/licenses/
*/
-#include <GL/glew.h>
+//#include <GL/glew.h>
#include <boost/format.hpp>
#include <cmath>
#include <string>
@@ -29,27 +29,27 @@ along with Orbit Ribbon. If not, see http://www.gnu.org/licenses/
const float SIMILARITY_DELTA = 0.0001;
-GLfloat rev2rad(GLfloat ang) {
+float rev2rad(float ang) {
return 2.0*ang*M_PI;
}
-GLfloat rad2rev(GLfloat ang) {
+float rad2rev(float ang) {
return ang/(M_PI*2.0);
}
-GLfloat rev2deg(GLfloat ang) {
+float rev2deg(float ang) {
return 360.0*ang;
}
-GLfloat deg2rev(GLfloat ang) {
+float deg2rev(float ang) {
return ang/360.0;
}
-GLfloat rad2deg(GLfloat ang) {
+float rad2deg(float ang) {
return (360.0*ang)/(M_PI*2);
}
-GLfloat deg2rad(GLfloat ang) {
+float deg2rad(float ang) {
return (ang/360.0)*2*M_PI;
}
@@ -102,7 +102,7 @@ Point Point::operator*(const Point& other) const {
return Point(x*other.x, y*other.y, z*other.z);
}
-Point Point::operator*(GLfloat f) const {
+Point Point::operator*(float f) const {
return Point(x*f, y*f, z*f);
}
@@ -112,7 +112,7 @@ void Point::operator*=(const Point& other) {
z *= other.z;
}
-void Point::operator*=(GLfloat f) {
+void Point::operator*=(float f) {
x *= f;
y *= f;
z *= f;
@@ -122,7 +122,7 @@ Point Point::operator/(const Point& other) const {
return Point(x/other.x, y/other.y, z/other.z);
}
-Point Point::operator/(GLfloat f) const {
+Point Point::operator/(float f) const {
return Point(x/f, y/f, z/f);
}
@@ -132,7 +132,7 @@ void Point::operator/=(const Point& other) {
z /= other.z;
}
-void Point::operator/=(GLfloat f) {
+void Point::operator/=(float f) {
x /= f;
y /= f;
z /= f;
@@ -154,11 +154,11 @@ bool Point::near_to(const Point& other) const {
);
}
-GLfloat Point::mag() const {
+float Point::mag() const {
return std::sqrt(pow(std::sqrt(x*x + y*y), 2) + z*z);
}
-GLfloat Point::dot_prod(const Point& other) const {
+float Point::dot_prod(const Point& other) const {
return x*other.x + y*other.y + z*other.z;
}
@@ -170,20 +170,20 @@ Point Point::cross_prod(const Point& other) const {
);
}
-GLfloat Point::dist_to(const Point& other) const {
+float Point::dist_to(const Point& other) const {
return std::sqrt(sq_dist_to(other));
}
-GLfloat Point::sq_dist_to(const Point& other) const {
+float Point::sq_dist_to(const Point& other) const {
return (x-other.x)*(x-other.x) + (y-other.y)*(y-other.y) + (z-other.z)*(z-other.z);
}
-GLfloat Point::ang_to(const Point& other) const {
+float Point::ang_to(const Point& other) const {
return rad2rev(std::acos((dot_prod(other))/(mag()*other.mag())));
}
Point Point::to_length(float len) const {
- GLfloat old_len = mag();
+ float old_len = mag();
if (old_len != 0.0) {
return (*this) * (len/old_len);
} else {
@@ -201,7 +201,7 @@ Point Point::project_onto(const Plane& p) const {
return *this - (n*dist);
}
-Plane::Plane(GLfloat na, GLfloat nb, GLfloat nc, GLfloat nd) :
+Plane::Plane(float na, float nb, float nc, float nd) :
a(na), b(nb), c(nc), d(nd)
{}
View
@@ -25,7 +25,7 @@ along with Orbit Ribbon. If not, see http://www.gnu.org/licenses/
#include "font.h"
#include "gameobj.h"
#include "globals.h"
-#include "gloo.h"
+
#include "mode.h"
#include "ore.h"
#include "mouse_cursor.h"
View
@@ -40,9 +40,7 @@ along with Orbit Ribbon. If not, see http://www.gnu.org/licenses/
class Background;
class GameObj;
class Mode;
-class GLOOFont;
class Font;
-class GLOOTexture;
class OrePackage;
class MouseCursor;
Oops, something went wrong.

0 comments on commit 46b3d8a

Please sign in to comment.