Changeset 3610 in orxonox.OLD for orxonox/trunk/src/orxonox.cc
- Timestamp:
- Mar 21, 2005, 1:36:16 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/orxonox.cc
r3592 r3610 25 25 26 26 #include "orxonox.h" 27 27 28 #include "world.h" 28 29 #include "camera.h" … … 30 31 #include "command_node.h" 31 32 #include "game_loader.h" 33 #include "graphics_engine.h" 34 32 35 #include <string.h> 33 36 int verbose = 4; … … 111 114 { 112 115 printf("> Initializing video\n"); 113 if (SDL_Init(SDL_INIT_VIDEO) == -1) 114 { 115 printf ("could not initialize SDL Video\n"); 116 return -1; 117 } 118 // Set video mode 119 // TO DO: parse arguments for settings 120 //SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5); 121 //SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5); 122 //SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5); 123 //SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); 124 125 126 SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); 127 SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16); 128 SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, 0); 129 SDL_GL_SetAttribute( SDL_GL_ACCUM_RED_SIZE, 0); 130 SDL_GL_SetAttribute( SDL_GL_ACCUM_GREEN_SIZE, 0); 131 SDL_GL_SetAttribute( SDL_GL_ACCUM_BLUE_SIZE, 0); 132 SDL_GL_SetAttribute( SDL_GL_ACCUM_ALPHA_SIZE, 0); 133 134 135 136 int bpp = 16; 137 int width = 640; 138 int height = 480; 139 //Uint32 flags = SDL_HWSURFACE | SDL_OPENGL | SDL_GL_DOUBLEBUFFER; /* \todo: SDL_OPENGL doen't permit to load images*/ 140 //Uint32 flags = SDL_HWSURFACE | SDL_GL_DOUBLEBUFFER; 141 142 Uint32 videoFlags = SDL_OPENGL | SDL_HWPALETTE | SDL_RESIZABLE; 143 144 /* query SDL for information about our video hardware */ 145 const SDL_VideoInfo* videoInfo = SDL_GetVideoInfo (); 146 147 if( videoInfo == NULL) 148 { 149 printf ("Orxonox::initVideo() - Failed getting Video Info :%s\n", SDL_GetError()); 150 SDL_Quit (); 151 } 152 if( videoInfo->hw_available) 153 videoFlags |= SDL_HWSURFACE; 154 else 155 videoFlags |= SDL_SWSURFACE; 156 /* 157 if(VideoInfo -> blit_hw) 158 VideoFlags |= SDL_HWACCEL; 159 */ 160 161 if((this->screen = SDL_SetVideoMode (width, height, bpp, videoFlags)) == NULL) 162 { 163 printf("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", width, height, bpp, videoFlags, SDL_GetError()); 164 SDL_Quit(); 165 return -1; 166 } 167 168 // Set window labeling 169 SDL_WM_SetCaption ("Orxonox " PACKAGE_VERSION, "Orxonox " PACKAGE_VERSION); 170 171 // TO DO: Create a cool icon and use it here 172 // SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask); 173 116 117 GraphicsEngine::getInstance(); 118 174 119 return 0; 175 120 }
Note: See TracChangeset
for help on using the changeset viewer.