- Timestamp:
- Mar 21, 2005, 4:33:03 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/graphics_engine.cc
r3617 r3619 72 72 73 73 // setting the Video Flags. 74 this->videoFlags = SDL_OPENGL | SDL_HWPALETTE | SDL_RESIZABLE ;74 this->videoFlags = SDL_OPENGL | SDL_HWPALETTE | SDL_RESIZABLE | SDL_DOUBLEBUF; 75 75 76 76 /* query SDL for information about our video hardware */ … … 86 86 this->videoFlags |= SDL_SWSURFACE; 87 87 /* 88 if(VideoInfo -> blit_hw) 88 if(VideoInfo -> blit_hw) 89 89 VideoFlags |= SDL_HWACCEL; 90 90 */ 91 91 92 92 // setting up the Resolution 93 this->setReso ulution(800, 600, 16);93 this->setResolution(800, 600, 16); 94 94 95 95 // Set window labeling … … 121 121 } 122 122 123 int GraphicsEngine::setReso ulution(int width, int height, int bpp)123 int GraphicsEngine::setResolution(int width, int height, int bpp) 124 124 { 125 125 this->resolutionX = width; … … 127 127 this->bitsPerPixel = bpp; 128 128 129 printf ("ok\n"); 129 130 if((this->screen = SDL_SetVideoMode (this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags)) == NULL) 130 131 { … … 136 137 } 137 138 139 int GraphicsEngine::resolutionChanged(SDL_ResizeEvent* resizeInfo) 140 { 141 this->setResolution(resizeInfo->w, resizeInfo->h, this->bitsPerPixel); 142 } 138 143 139 144 -
orxonox/trunk/src/lib/graphics/graphics_engine.h
r3617 r3619 25 25 int initVideo(); 26 26 int setGLattribs(void); 27 int setResoulution(int width, int height, int bpp); 27 int setResolution(int width, int height, int bpp); 28 int resolutionChanged(SDL_ResizeEvent* resizeInfo); 28 29 void listModes(void); 29 30 -
orxonox/trunk/src/orxonox.cc
r3613 r3619 213 213 { 214 214 // Handle special events such as reshape, quit, focus changes 215 switch (event->type) 216 { 217 case SDL_VIDEORESIZE: 218 GraphicsEngine* tmpGEngine = GraphicsEngine::getInstance(); 219 tmpGEngine->resolutionChanged(&event->resize); 220 break; 221 } 215 222 } 216 223
Note: See TracChangeset
for help on using the changeset viewer.