Changeset 4194 in orxonox.OLD for orxonox/branches/openAL/src/lib/graphics/graphics_engine.cc
- Timestamp:
- May 16, 2005, 1:33:19 PM (20 years ago)
- Location:
- orxonox/branches/openAL
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/openAL
- Property svn:externals
-
old new 1 data http://svn.orxonox.ethz.ch/data 1
-
- Property svn:externals
-
orxonox/branches/openAL/src/lib/graphics/graphics_engine.cc
r3844 r4194 17 17 18 18 #include "graphics_engine.h" 19 #include "resource_manager.h" 19 20 20 21 #include "debug.h" … … 30 31 { 31 32 this->setClassName ("GraphicsEngine"); 33 34 this->fullscreen = false; 35 32 36 this->initVideo(); 33 37 … … 101 105 102 106 // TO DO: Create a cool icon and use it here 103 SDL_WM_SetIcon(SDL_LoadBMP("../data/pictures/orxonox-icon32x32.bmp"), NULL); 104 107 char* loadPic = new char[strlen(ResourceManager::getInstance()->getDataDir())+ 100]; 108 sprintf(loadPic, "%s%s", ResourceManager::getInstance()->getDataDir(), "pictures/orxonox-icon32x32.bmp"); 109 SDL_WM_SetIcon(SDL_LoadBMP(loadPic), NULL); 110 delete loadPic; 105 111 // Enable default GL stuff 106 112 glEnable(GL_DEPTH_TEST); … … 137 143 int GraphicsEngine::setResolution(int width, int height, int bpp) 138 144 { 145 Uint32 fullscreenFlag; 139 146 this->resolutionX = width; 140 147 this->resolutionY = height; 141 148 this->bitsPerPixel = bpp; 149 if (this->fullscreen) 150 fullscreenFlag = SDL_FULLSCREEN; 151 else 152 fullscreenFlag = 0; 142 153 143 154 printf ("ok\n"); 144 if((this->screen = SDL_SetVideoMode(this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags )) == NULL)155 if((this->screen = SDL_SetVideoMode(this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags | fullscreenFlag)) == NULL) 145 156 { 146 157 PRINTF(1)("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags, SDL_GetError()); … … 148 159 // return -1; 149 160 } 150 161 } 162 163 void GraphicsEngine::setFullscreen(bool fullscreen) 164 { 165 this->fullscreen = fullscreen; 166 this->setResolution(this->resolutionX, this->resolutionY, this->bitsPerPixel); 151 167 } 152 168 … … 254 270 /* Check if our resolution is restricted */ 255 271 if(this->videoModes == (SDL_Rect **)-1){ 256 PRINTF( 1)("All resolutions available.\n");272 PRINTF(2)("All resolutions available.\n"); 257 273 } 258 274 else{ … … 260 276 PRINT(0)("Available Resoulution Modes are\n"); 261 277 for(int i = 0; this->videoModes[i]; ++i) 262 PRINT( 0)(" | %d x %d\n", this->videoModes[i]->w, this->videoModes[i]->h);278 PRINT(4)(" | %d x %d\n", this->videoModes[i]->w, this->videoModes[i]->h); 263 279 } 264 280
Note: See TracChangeset
for help on using the changeset viewer.