Changeset 4619 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Jun 13, 2005, 10:30:08 AM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/graphics_engine.cc
r4597 r4619 95 95 this->setResolution(800, 600, 16); 96 96 97 // Set window labeling98 SDL_WM_SetCaption ("Orxonox " PACKAGE_VERSION, "Orxonox " PACKAGE_VERSION);99 97 100 98 // TO DO: Create a cool icon and use it here … … 106 104 glEnable(GL_DEPTH_TEST); 107 105 } 106 107 108 /** 109 * sets the Window Captions and the Name of the icon. 110 * @param windowName The name of the Window 111 * @param icon The name of the Icon on the Disc 112 */ 113 void GraphicsEngine::setWindowName(const char* windowName, const char* icon) 114 { 115 // Set window labeling 116 SDL_WM_SetCaption (windowName, icon); 117 } 118 108 119 109 120 /** -
orxonox/trunk/src/lib/graphics/graphics_engine.h
r4536 r4619 1 /*! 1 /*! 2 2 \file graphics_engine.h 3 3 4 4 \brief defines a Interface between orxonox and graphical input 5 5 … … 21 21 /** 22 22 handles graphical SDL-initialisation, textures, resolutions, and so on 23 */ 24 class GraphicsEngine : public BaseObject 23 */ 24 class GraphicsEngine : public BaseObject 25 25 { 26 public:27 virtual ~GraphicsEngine();28 /** \returns a Pointer to the only object of this Class */29 inline static GraphicsEngine* getInstance(void) { if (!singletonRef) singletonRef = new GraphicsEngine(); return singletonRef; };26 public: 27 virtual ~GraphicsEngine(); 28 /** \returns a Pointer to the only object of this Class */ 29 inline static GraphicsEngine* getInstance(void) { if (!singletonRef) singletonRef = new GraphicsEngine(); return singletonRef; }; 30 30 31 int initVideo(); 32 int setGLattribs(void); 33 int setResolution(int width, int height, int bpp); 34 void setFullscreen(bool fullscreen = false); 35 static void setBackgroundColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha = 1.0); 31 int initVideo(); 36 32 37 /** \returns the x resolution */ 38 inline int getResolutionX(void) const {return this->resolutionX;} 39 /** \returns the y resolution */ 40 inline int getResolutionY(void) const {return this->resolutionY;} 41 /** \returns the Bits Per Pixel */ 42 inline int getbbp(void) const {return this->bitsPerPixel;} 43 int resolutionChanged(SDL_ResizeEvent* resizeInfo); 44 void listModes(void); 33 void setWindowName(const char* windowName, const char* icon); 34 int setGLattribs(void); 35 int setResolution(int width, int height, int bpp); 36 void setFullscreen(bool fullscreen = false); 37 static void setBackgroundColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha = 1.0); 45 38 46 static bool texturesEnabled; 39 /** \returns the x resolution */ 40 inline int getResolutionX(void) const { return this->resolutionX; }; 41 /** \returns the y resolution */ 42 inline int getResolutionY(void) const { return this->resolutionY; }; 43 /** \returns the Bits Per Pixel */ 44 inline int getbbp(void) const { return this->bitsPerPixel; }; 47 45 48 static void enter2DMode(void); 49 static void leave2DMode(void); 46 int resolutionChanged(SDL_ResizeEvent* resizeInfo); 50 47 51 static void storeMatrices(void); 52 static GLdouble modMat[16]; 53 static GLdouble projMat[16]; 54 static GLint viewPort[4]; 55 56 void tick(float dt); 57 void displayFPS(bool display); 48 static void enter2DMode(void); 49 static void leave2DMode(void); 58 50 51 static void storeMatrices(void); 52 static GLdouble modMat[16]; 53 static GLdouble projMat[16]; 54 static GLint viewPort[4]; 59 55 60 private: 61 GraphicsEngine(); 62 static GraphicsEngine* singletonRef; 56 void tick(float dt); 57 void displayFPS(bool display); 63 58 64 private: 65 SDL_Surface* screen; //!< the screen we draw to 66 int resolutionX; //!< the X-resoultion of the screen 67 int resolutionY; //!< the Y-resolution of the screen 68 int bitsPerPixel; //!< the bits per pixels of the screen 69 bool fullscreen; //!< if we are in fullscreen mode 70 Uint32 videoFlags; //!< flags for video 71 SDL_Rect** videoModes; //!< list of resolutions 72 73 bool bDisplayFPS; //!< is true if the fps should be displayed 74 float currentFPS; //!< the current frame rate: frames per seconds 75 float maxFPS; //!< maximal frame rate we ever got since start of the game 76 float minFPS; //!< minimal frame rate we ever got since start 59 void listModes(void); 60 61 public: 62 static bool texturesEnabled; 63 64 private: 65 GraphicsEngine(); 66 67 private: 68 static GraphicsEngine* singletonRef; 69 70 SDL_Surface* screen; //!< the screen we draw to 71 int resolutionX; //!< the X-resoultion of the screen 72 int resolutionY; //!< the Y-resolution of the screen 73 int bitsPerPixel; //!< the bits per pixels of the screen 74 bool fullscreen; //!< if we are in fullscreen mode 75 Uint32 videoFlags; //!< flags for video 76 SDL_Rect** videoModes; //!< list of resolutions 77 78 bool bDisplayFPS; //!< is true if the fps should be displayed 79 float currentFPS; //!< the current frame rate: frames per seconds 80 float maxFPS; //!< maximal frame rate we ever got since start of the game 81 float minFPS; //!< minimal frame rate we ever got since start 82 77 83 78 84 #ifndef NO_TEXT -
orxonox/trunk/src/orxonox.cc
r4616 r4619 144 144 145 145 GraphicsEngine::getInstance(); 146 GraphicsEngine::getInstance()->setWindowName("orxonox " PACKAGE_VERSION, "orxonox " PACKAGE_VERSION); 146 147 147 148 return 0; -
orxonox/trunk/src/subprojects/collision_detection/collision_detection.cc
r4618 r4619 31 31 { 32 32 CDEngine::getInstance(); 33 CDEngine::getInstance()->debug();33 //CDEngine::getInstance()->debug(); 34 34 35 //model = new MD2Model("models/tris.md2", "models/tris.pcx");36 //model->tick(0.1f);37 //CDEngine::getInstance()->debugSpawnTree(2, model->data->pVertices, model->data->numVertices);35 model = new MD2Model("models/tris.md2", "models/tris.pcx"); 36 model->tick(0.1f); 37 CDEngine::getInstance()->debugSpawnTree(1, model->data->pVertices, model->data->numVertices); 38 38 39 39 LightManager* lightMan = LightManager::getInstance(); … … 70 70 LightManager::getInstance()->draw(); 71 71 72 //model->draw();72 model->draw(); 73 73 } 74 74
Note: See TracChangeset
for help on using the changeset viewer.