00001 #ifndef __RENDERENGINE_H 00002 #define __RENDERENGINE_H 00003 00004 #include <gtk/gtk.h> 00005 #include <gtk/gtkgl.h> 00006 #include <GL/gl.h> 00007 #include <GL/glu.h> 00008 #include <glib.h> 00009 #include "../drawing/drawableobject.h" 00010 #include "../positions/position.h" 00011 #include "../trees/filesystem.h" 00012 00013 #include <vector> 00014 using namespace std; 00015 00017 00022 class RenderEngine 00023 { 00024 public: 00025 RenderEngine(int argc, char *argv[]); 00026 ~RenderEngine(); 00027 00028 GtkWidget* getDrawingArea(); 00029 00030 void render(); 00031 void renderSelect(); 00032 00033 void increment(); 00034 00035 void incrementXAngle(); 00036 void incrementCameraAngle(); 00037 void decrementCameraAngle(); 00038 void incrementXCenter(); 00039 void decrementXCenter(); 00040 void incrementYCenter(); 00041 void decrementYCenter(); 00042 void incrementZCenter(); 00043 void decrementZCenter(); 00044 void zoomCameraIn(); 00045 void zoomCameraOut(); 00046 00047 void setupView(); 00048 void setupGlobalMatrix(); 00049 void setupModes(); 00050 00052 void setupSelectView(GLdouble x, GLdouble y, GLint theViewport[]); 00054 int* processHits(GLint hits, GLuint buffer[]); 00055 00056 friend gboolean button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer data); 00057 00058 private: 00059 // GTK Data 00060 GtkWidget *drawingArea; 00061 GdkGLConfig *glconfig; 00062 00063 // camera data 00064 GLfloat xSpeed; 00065 GLfloat xAngle; 00066 GLfloat cameraAngle; 00067 GLfloat cameraAngleSpeed; 00068 GLfloat xCenter; 00069 GLfloat yCenter; 00070 GLfloat zCenter; 00071 GLfloat cameraOffset; 00072 00073 // rotation center 00074 Position *rotationCenter; 00075 00076 // object vectors 00077 vector<DrawableObject*> *normal; 00078 vector<DrawableObject*> *selectionCubes; 00079 vector<DrawableObject*> *notDrawn; 00080 vector<DrawableObject*> *highlight; 00081 00082 // handles fs type stuff 00083 FileSystem theFs; 00084 }; 00085 00086 #endif
1.3.6