Changeset 4746 in orxonox.OLD for orxonox/trunk/src/lib/graphics
- Timestamp:
- Jul 1, 2005, 12:48:48 PM (20 years ago)
- Location:
- orxonox/trunk/src/lib/graphics
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/graphics_engine.cc
r4739 r4746 119 119 \brief Sets the GL-attributes 120 120 */ 121 int GraphicsEngine::setGLattribs( void)121 int GraphicsEngine::setGLattribs() 122 122 { 123 123 // Set video mode … … 208 208 this is a GL-Projection-mode, that is orthogonal, for placing the font in fron of everything else 209 209 */ 210 void GraphicsEngine::enter2DMode( void)210 void GraphicsEngine::enter2DMode() 211 211 { 212 212 GraphicsEngine::storeMatrices(); … … 242 242 243 243 /** 244 \brief leaves the 2DMode again also \see Font::enter2DMode( void)245 */ 246 void GraphicsEngine::leave2DMode( void)244 \brief leaves the 2DMode again also \see Font::enter2DMode() 245 */ 246 void GraphicsEngine::leave2DMode() 247 247 { 248 248 glMatrixMode(GL_MODELVIEW); … … 258 258 \brief stores the GL_matrices 259 259 */ 260 void GraphicsEngine::storeMatrices( void)260 void GraphicsEngine::storeMatrices() 261 261 { 262 262 glGetDoublev(GL_PROJECTION_MATRIX, GraphicsEngine::projMat); … … 277 277 \brief outputs all the Fullscreen modes. 278 278 */ 279 void GraphicsEngine::listModes( void)279 void GraphicsEngine::listModes() 280 280 { 281 281 /* Get available fullscreen/hardware modes */ -
orxonox/trunk/src/lib/graphics/graphics_engine.h
r4681 r4746 27 27 virtual ~GraphicsEngine(); 28 28 /** \returns a Pointer to the only object of this Class */ 29 inline static GraphicsEngine* getInstance( void) { if (!singletonRef) singletonRef = new GraphicsEngine(); return singletonRef; };29 inline static GraphicsEngine* getInstance() { if (!singletonRef) singletonRef = new GraphicsEngine(); return singletonRef; }; 30 30 31 31 int initVideo(); 32 32 33 33 void setWindowName(const char* windowName, const char* icon); 34 int setGLattribs( void);34 int setGLattribs(); 35 35 int setResolution(int width, int height, int bpp); 36 36 void setFullscreen(bool fullscreen = false); … … 38 38 39 39 /** \returns the x resolution */ 40 inline int getResolutionX( void) const { return this->resolutionX; };40 inline int getResolutionX() const { return this->resolutionX; }; 41 41 /** \returns the y resolution */ 42 inline int getResolutionY( void) const { return this->resolutionY; };42 inline int getResolutionY() const { return this->resolutionY; }; 43 43 /** \returns the Bits Per Pixel */ 44 inline int getbbp( void) const { return this->bitsPerPixel; };44 inline int getbbp() const { return this->bitsPerPixel; }; 45 45 46 46 int resolutionChanged(SDL_ResizeEvent* resizeInfo); 47 47 48 static void enter2DMode( void);49 static void leave2DMode( void);48 static void enter2DMode(); 49 static void leave2DMode(); 50 50 51 static void storeMatrices( void);51 static void storeMatrices(); 52 52 static GLdouble modMat[16]; 53 53 static GLdouble projMat[16]; … … 57 57 void displayFPS(bool display); 58 58 59 void listModes( void);59 void listModes(); 60 60 61 61 /** \brief swaps the GL_BUFFERS */ 62 static void swapBuffers( void) { SDL_GL_SwapBuffers(); };62 static void swapBuffers() { SDL_GL_SwapBuffers(); }; 63 63 64 64 public: -
orxonox/trunk/src/lib/graphics/importer/array.h
r4580 r4746 32 32 ~Array(); 33 33 34 void finalizeArray ( void);34 void finalizeArray (); 35 35 void addEntry (T entry); 36 36 void addEntry(T entry0, T entry1, T entry2); … … 39 39 inline const T* getArray () const { return this->array; }; 40 40 /** \returns The Count of entries in the Array*/ 41 inline unsigned int getCount( void)const { return this->entryCount; };42 void debug( void) const ;41 inline unsigned int getCount()const { return this->entryCount; }; 42 void debug() const ; 43 43 44 44 private: … … 97 97 */ 98 98 template<class T> 99 void Array<T>::finalizeArray ( void)99 void Array<T>::finalizeArray () 100 100 { 101 101 PRINTF(4)("Finalizing array. Length: %i\n", entryCount); … … 157 157 */ 158 158 template<class T> 159 void Array<T>::debug ( void) const159 void Array<T>::debug () const 160 160 { 161 161 PRINT(0)("entryCount=%i, address=%p\n", this->entryCount, this->array); -
orxonox/trunk/src/lib/graphics/importer/material.cc
r4584 r4746 64 64 \brief sets the material with which the following Faces will be painted 65 65 */ 66 bool Material::select ( void)66 bool Material::select () 67 67 { 68 68 // setting diffuse color -
orxonox/trunk/src/lib/graphics/importer/material.h
r4584 r4746 28 28 ~Material (); 29 29 30 bool select ( void);30 bool select (); 31 31 32 32 void setIllum (int illum); -
orxonox/trunk/src/lib/graphics/importer/model.cc
r4677 r4746 113 113 actually does the same as the delete Operator, but does not delete the predecessing group 114 114 */ 115 void ModelGroup::cleanup( void)115 void ModelGroup::cleanup() 116 116 { 117 117 PRINTF(5)("Cleaning up group\n"); … … 164 164 Looks if any from model allocated space is still in use, and if so deleted it. 165 165 */ 166 Model::~Model( void)166 Model::~Model() 167 167 { 168 168 PRINTF(4)("Deleting Model "); … … 198 198 \brief Finalizes an Object. This can be done outside of the Class. 199 199 */ 200 void Model::finalize( void)200 void Model::finalize() 201 201 { 202 202 // this creates the display List. … … 218 218 It does this by just calling the Lists that must have been created earlier. 219 219 */ 220 void Model::draw ( void) const220 void Model::draw () const 221 221 { 222 222 PRINTF(4)("drawing the 3D-Models\n"); … … 292 292 \brief deletes all the arrays 293 293 */ 294 bool Model::deleteArrays( void)294 bool Model::deleteArrays() 295 295 { 296 296 if (this->vertices) … … 310 310 This funcion is needed, to delete all the Lists, and arrays that are no more needed because they are already imported into openGL. This will be applied at the end of the importing Process. 311 311 */ 312 bool Model::cleanup( void)312 bool Model::cleanup() 313 313 { 314 314 PRINTF(4)("cleaning up the 3D-Model to save Memory.\n"); … … 702 702 \brief reads and includes the Faces/Materials into the openGL state Machine 703 703 */ 704 bool Model::importToDisplayList( void)704 bool Model::importToDisplayList() 705 705 { 706 706 // finalize the Arrays … … 794 794 \brief reads and includes the Faces/Materials into the openGL state Machine 795 795 */ 796 bool Model::importToVertexArray( void)796 bool Model::importToVertexArray() 797 797 { 798 798 // finalize the Arrays … … 857 857 This will inject a Cube, because this is the most basic model. 858 858 */ 859 void Model::cubeModel( void)859 void Model::cubeModel() 860 860 { 861 861 this->addVertex (-0.5, -0.5, 0.5); -
orxonox/trunk/src/lib/graphics/importer/model.h
r4678 r4746 99 99 public: 100 100 Model(const char* modelName = NULL, MODEL_TYPE type = MODEL_DISPLAY_LIST); 101 virtual ~Model( void);101 virtual ~Model(); 102 102 103 void draw( void) const;103 void draw() const; 104 104 void draw(int groupNumber) const; 105 105 void draw(char* groupName) const; 106 106 107 107 /** \returns Count of the Models (Groups) in this File */ 108 inline int getGroupCount( void) const { return this->groupCount; };108 inline int getGroupCount() const { return this->groupCount; }; 109 109 110 110 /** \returns a Pointer to the Vertex-Array, if it was deleted it returns NULL */ 111 inline const GLfloat* getVertexArray( void) const { return this->vertices->getArray(); };111 inline const GLfloat* getVertexArray() const { return this->vertices->getArray(); }; 112 112 /** \returns the VertexCount of this Model */ 113 inline unsigned int getVertexCount( void) const { return this->vertexCount; };113 inline unsigned int getVertexCount() const { return this->vertexCount; }; 114 114 115 115 /** \returns a Pointer to the Normals-Array, if it was deleted it returns NULL */ 116 inline const GLfloat* getNormalsArray( void) const { return this->normals->getArray(); };116 inline const GLfloat* getNormalsArray() const { return this->normals->getArray(); }; 117 117 /** \returns the NormalsCount of this Model */ 118 inline unsigned int getNormalsCount( void) const { return this->normalCount; };118 inline unsigned int getNormalsCount() const { return this->normalCount; }; 119 119 120 120 /** \returns a Pointer to the TexCoord-Array, if it was deleted it returns NULL */ 121 inline const GLfloat* getTexCoordArray( void) const { return this->vTexture->getArray(); };121 inline const GLfloat* getTexCoordArray() const { return this->vTexture->getArray(); }; 122 122 /** \returns the TexCoord-Count of this Model */ 123 inline unsigned int getTexCoordCount( void) const { return this->texCoordCount; };123 inline unsigned int getTexCoordCount() const { return this->texCoordCount; }; 124 124 125 125 /** \returns the Count of Faces of this Model */ … … 141 141 bool setMaterial(const char* mtlString); 142 142 bool setMaterial(Material* mtl); 143 void finalize( void);143 void finalize(); 144 144 145 145 146 146 protected: 147 void cubeModel( void);147 void cubeModel(); 148 148 149 149 Material* findMaterialByName(const char* materialName); … … 154 154 155 155 private: 156 bool buildVertexNormals( void);156 bool buildVertexNormals(); 157 157 158 bool importToDisplayList( void);158 bool importToDisplayList(); 159 159 bool addGLElement(ModelFaceElement* elem); 160 160 161 bool importToVertexArray( void);161 bool importToVertexArray(); 162 162 163 bool deleteArrays( void);164 bool cleanup( void);163 bool deleteArrays(); 164 bool cleanup(); 165 165 166 166 private: -
orxonox/trunk/src/lib/graphics/importer/texture.cc
r4662 r4746 43 43 Frees Data, and deletes the textures from GL 44 44 */ 45 Texture::~Texture( void)45 Texture::~Texture() 46 46 { 47 47 if (this->texture) -
orxonox/trunk/src/lib/graphics/importer/texture.h
r4466 r4746 25 25 // Texture(TEXTURE_TYPE type, int resolution); 26 26 27 ~Texture( void);27 ~Texture(); 28 28 29 29 /** \returns The textureID of this texture. */ 30 inline GLuint getTexture( void) {return this->texture;}30 inline GLuint getTexture() {return this->texture;} 31 31 GLuint loadTexToGL (SDL_Surface* surface); 32 32 /** \returns true if texture has alpha, false otherwise */ 33 inline bool hasAlpha( void) const {return bAlpha;}33 inline bool hasAlpha() const {return bAlpha;} 34 34 35 35 bool loadImage(const char* imageName); -
orxonox/trunk/src/lib/graphics/light.cc
r4739 r4746 73 73 \brief destroys a Light 74 74 */ 75 Light::~Light( void)75 Light::~Light() 76 76 { 77 77 glDisable(lightsV[this->lightNumber]); … … 181 181 \brief draws this Light. Being a World-entity the possibility to do this lies at hand. 182 182 */ 183 void Light::draw( void) const183 void Light::draw() const 184 184 { 185 185 float pos[4] = {this->getAbsCoor().x, this->getAbsCoor().y, this->getAbsCoor().z, 1.0}; … … 192 192 \brief Prints out some nice formated debug information about the Light 193 193 */ 194 void Light::debug( void) const194 void Light::debug() const 195 195 { 196 196 PRINT(0)(":: %d :: -- reference %p\n", this->lightNumber, this); … … 348 348 \brief outputs debug information about the Class and its lights 349 349 */ 350 void LightManager::debug( void) const350 void LightManager::debug() const 351 351 { 352 352 PRINT(0)("=================================\n"); -
orxonox/trunk/src/lib/graphics/light.h
r4738 r4746 27 27 public: 28 28 Light(const TiXmlElement* root = NULL); 29 virtual ~Light( void);29 virtual ~Light(); 30 30 31 31 void loadParams(const TiXmlElement* root); … … 39 39 40 40 /** \returns the lightNumber*/ 41 int getLightNumber( void) const {return this->lightNumber;}41 int getLightNumber() const {return this->lightNumber;} 42 42 43 43 virtual void draw() const; 44 44 45 void debug( void) const;45 void debug() const; 46 46 47 47 // attributes … … 84 84 85 85 for some nice output just use: 86 \li void debug( void) const; (either on LightManager for a resume or on any Light for single information.)86 \li void debug() const; (either on LightManager for a resume or on any Light for single information.) 87 87 */ 88 88 class LightManager : public BaseObject … … 91 91 92 92 public: 93 virtual ~LightManager( void);93 virtual ~LightManager(); 94 94 /** \returns a Pointer to the only object of this Class */ 95 inline static LightManager* getInstance( void) { if (!singletonRef) singletonRef = new LightManager(); return singletonRef; };95 inline static LightManager* getInstance() { if (!singletonRef) singletonRef = new LightManager(); return singletonRef; }; 96 96 97 97 void loadParams(const TiXmlElement* root); … … 105 105 void draw() const; 106 106 107 void debug( void) const;107 void debug() const; 108 108 109 109 private: 110 LightManager( void);110 LightManager(); 111 111 112 112 int registerLight(Light* light); -
orxonox/trunk/src/lib/graphics/text_engine.cc
r4709 r4746 71 71 This also ereases the text from the textList of the TextEngine 72 72 */ 73 Text::~Text( void)73 Text::~Text() 74 74 { 75 75 TextEngine::getInstance()->deleteText(this); … … 167 167 this is only for TEXT_STATIC-mode 168 168 */ 169 void Text::createTexture( void)169 void Text::createTexture() 170 170 { 171 171 SDL_Surface* tmpSurf; … … 187 187 \brief draws the Font 188 188 */ 189 void Text::draw( void) const189 void Text::draw() const 190 190 { 191 191 // setting the Position of this Text. … … 271 271 \brief prints out some nice debug information about this text 272 272 */ 273 void Text::debug( void) const273 void Text::debug() const 274 274 { 275 275 PRINT(0)("=== TEXT: %s ===\n", this->text); … … 415 415 \brief destructs a font 416 416 */ 417 Font::~Font( void)417 Font::~Font() 418 418 { 419 419 // deleting the List of all Texts … … 509 509 \returns the maximum height of the Font, if the font was initialized, 0 otherwise 510 510 */ 511 int Font::getMaxHeight( void)511 int Font::getMaxHeight() 512 512 { 513 513 if (likely (this->font != NULL)) … … 522 522 the ascent is the pixels of the font above the baseline 523 523 */ 524 int Font::getMaxAscent( void)524 int Font::getMaxAscent() 525 525 { 526 526 if (likely(this->font != NULL)) … … 535 535 the descent is the pixels of the font below the baseline 536 536 */ 537 int Font::getMaxDescent( void)537 int Font::getMaxDescent() 538 538 { 539 539 if (likely(this->font != NULL)) … … 568 568 } 569 569 570 GLuint Font::createFastTexture( void)570 GLuint Font::createFastTexture() 571 571 { 572 572 /* interesting GLYPHS: … … 730 730 openGL-version < 1.2 compatibility ( and because it is realy easy like this :)) 731 731 */ 732 int Font::findOptimalFastTextureSize( void)732 int Font::findOptimalFastTextureSize() 733 733 { 734 734 int i; … … 775 775 \brief a simple function to get some interesting information about this class 776 776 */ 777 void Font::debug( void)777 void Font::debug() 778 778 { 779 779 // print the loaded font's style … … 832 832 \brief function to enable TTF_Fonts 833 833 */ 834 void TextEngine::enableFonts( void)834 void TextEngine::enableFonts() 835 835 { 836 836 if (!TTF_WasInit()) … … 848 848 \brief function to disable TTF_fonts 849 849 */ 850 void TextEngine::disableFonts( void)850 void TextEngine::disableFonts() 851 851 { 852 852 if (TTF_WasInit()) … … 900 900 \brief deletes all the Text, and tries to delete all allocated fonts 901 901 */ 902 void TextEngine::flush( void)902 void TextEngine::flush() 903 903 { 904 904 tIterator<Text>* textIterator = textList->getIterator(); … … 915 915 \brief draws all the Texts that have been initialized 916 916 */ 917 void TextEngine::draw( void) const917 void TextEngine::draw() const 918 918 { 919 919 // entering 3D-mode … … 937 937 \todo there should also be something outputted about Font 938 938 */ 939 void TextEngine::debug( void) const939 void TextEngine::debug() const 940 940 { 941 941 PRINT(0)("+-------------------------------+\n"); … … 960 960 \returns true if match, false otherwise 961 961 */ 962 bool TextEngine::checkVersion( void)962 bool TextEngine::checkVersion() 963 963 { 964 964 SDL_version compile_version; -
orxonox/trunk/src/lib/graphics/text_engine.h
r4662 r4746 108 108 friend class TextEngine; 109 109 public: 110 ~Text( void);110 ~Text(); 111 111 112 112 void setBindNode(PNode* bindNode); … … 124 124 void createTexture(); 125 125 126 void draw( void) const;127 128 void debug( void) const;126 void draw() const; 127 128 void debug() const; 129 129 130 130 private: … … 175 175 176 176 /** \returns a Pointer to the Array of Glyphs */ 177 inline Glyph** getGlyphArray( void) const {return glyphArray;}177 inline Glyph** getGlyphArray() const {return glyphArray;} 178 178 /** \returns the texture to the fast-texture */ 179 inline GLuint getFastTextureID( void) const {return fastTextureID;}180 181 private: 182 int getMaxHeight( void);183 int getMaxAscent( void);184 int getMaxDescent( void);179 inline GLuint getFastTextureID() const {return fastTextureID;} 180 181 private: 182 int getMaxHeight(); 183 int getMaxAscent(); 184 int getMaxDescent(); 185 185 Glyph* getGlyphMetrics(Uint16 character); 186 186 … … 188 188 189 189 void initGlyphs(Uint16 from, Uint16 count); 190 int findOptimalFastTextureSize( void);191 192 void debug( void);190 int findOptimalFastTextureSize(); 191 192 void debug(); 193 193 194 194 private: … … 216 216 { 217 217 public: 218 virtual ~TextEngine( void);218 virtual ~TextEngine(); 219 219 /** \returns a Pointer to the only object of this Class */ 220 inline static TextEngine* getInstance( void) { if (!singletonRef) singletonRef = new TextEngine(); return singletonRef; };220 inline static TextEngine* getInstance() { if (!singletonRef) singletonRef = new TextEngine(); return singletonRef; }; 221 221 222 222 Text* createText(const char* fontFile, … … 228 228 229 229 void deleteText(Text* text); 230 void flush( void);231 232 void draw( void) const;233 234 void debug( void) const;235 236 private: 237 TextEngine( void);230 void flush(); 231 232 void draw() const; 233 234 void debug() const; 235 236 private: 237 TextEngine(); 238 238 static TextEngine* singletonRef; 239 239 240 240 // general 241 static void enableFonts( void);242 static void disableFonts( void);243 static bool checkVersion( void);241 static void enableFonts(); 242 static void disableFonts(); 243 static bool checkVersion(); 244 244 245 245 private:
Note: See TracChangeset
for help on using the changeset viewer.