Changeset 3844 in orxonox.OLD for orxonox/trunk/src/lib/graphics
- Timestamp:
- Apr 17, 2005, 12:41:57 AM (20 years ago)
- Location:
- orxonox/trunk/src/lib/graphics
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/graphics_engine.cc
r3790 r3844 174 174 void GraphicsEngine::enter2DMode(void) 175 175 { 176 GraphicsEngine::storeMatrices(); 176 177 SDL_Surface *screen = SDL_GetVideoSurface(); 177 178 … … 218 219 } 219 220 221 /** 222 \brief stores the GL_matrices 223 */ 224 void GraphicsEngine::storeMatrices(void) 225 { 226 glGetDoublev(GL_PROJECTION_MATRIX, GraphicsEngine::projMat); 227 glGetDoublev(GL_MODELVIEW_MATRIX, GraphicsEngine::modMat); 228 glGetIntegerv(GL_VIEWPORT, GraphicsEngine::viewPort); 229 } 230 231 //! the stored ModelView Matrix. 232 GLdouble GraphicsEngine::modMat[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; 233 //! the stored Projection Matrix 234 GLdouble GraphicsEngine::projMat[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; 235 //! The ViewPort 236 GLint GraphicsEngine::viewPort[4] = {0,0,0,0}; 220 237 221 238 -
orxonox/trunk/src/lib/graphics/graphics_engine.h
r3790 r3844 40 40 static void leave2DMode(void); 41 41 42 static void storeMatrices(void); 43 static GLdouble modMat[16]; 44 static GLdouble projMat[16]; 45 static GLint viewPort[4]; 46 47 48 42 49 private: 43 50 GraphicsEngine(); -
orxonox/trunk/src/lib/graphics/text_engine.cc
r3843 r3844 183 183 void Text::draw(void) const 184 184 { 185 // storing all the Transformation Matrices.186 GLdouble modMat[16];187 GLdouble projMat[16];188 GLint viewPort[4];189 glGetDoublev(GL_PROJECTION_MATRIX, projMat);190 glGetDoublev(GL_MODELVIEW_MATRIX, modMat);191 glGetIntegerv(GL_VIEWPORT, viewPort);192 193 GraphicsEngine::enter2DMode();194 195 196 185 // setting the Position of this Text. 197 186 Vector pos; … … 202 191 GLdouble z = this->bindNode->getAbsCoor().z; 203 192 GLdouble tmp[3]; 204 gluProject(x, y, z, modMat, projMat,viewPort, tmp, tmp+1, tmp+2);193 gluProject(x, y, z, GraphicsEngine::modMat, GraphicsEngine::projMat, GraphicsEngine::viewPort, tmp, tmp+1, tmp+2); 205 194 pos.x = tmp[0] + this->posSize.x; 206 195 pos.y = GraphicsEngine::getInstance()->getResolutionY() - tmp[1] + this->posSize.y; … … 266 255 } 267 256 glPopMatrix(); 268 GraphicsEngine::leave2DMode();269 257 } 270 258 … … 931 919 void TextEngine::draw(void) const 932 920 { 921 // entering 3D-mode 922 GraphicsEngine::enter2DMode(); 923 // drawing all the texts 933 924 tIterator<Text>* textIterator = textList->getIterator(); 934 925 Text* text = textIterator->nextElement(); … … 939 930 } 940 931 delete textIterator; 932 // retruning to the previous mode 933 GraphicsEngine::leave2DMode(); 941 934 } 942 935
Note: See TracChangeset
for help on using the changeset viewer.