Changeset 3365 in orxonox.OLD for orxonox/trunk/src/orxonox.cc
- Timestamp:
- Jan 7, 2005, 1:14:33 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/orxonox.cc
r3226 r3365 115 115 // Set video mode 116 116 // TO DO: parse arguments for settings 117 SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5); 118 SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5); 119 SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5); 120 SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); 121 117 //SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5); 118 //SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5); 119 //SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5); 120 //SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); 121 122 123 SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); 124 SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16); 125 SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, 0); 126 SDL_GL_SetAttribute( SDL_GL_ACCUM_RED_SIZE, 0); 127 SDL_GL_SetAttribute( SDL_GL_ACCUM_GREEN_SIZE, 0); 128 SDL_GL_SetAttribute( SDL_GL_ACCUM_BLUE_SIZE, 0); 129 SDL_GL_SetAttribute( SDL_GL_ACCUM_ALPHA_SIZE, 0); 130 131 132 122 133 int bpp = 16; 123 134 int width = 640; 124 135 int height = 480; 125 Uint32 flags = SDL_HWSURFACE | SDL_OPENGL | SDL_GL_DOUBLEBUFFER; 126 127 if((screen = SDL_SetVideoMode (width, height, bpp, flags)) == NULL) 136 //Uint32 flags = SDL_HWSURFACE | SDL_OPENGL | SDL_GL_DOUBLEBUFFER; /* \todo: SDL_OPENGL doen't permit to load images*/ 137 //Uint32 flags = SDL_HWSURFACE | SDL_GL_DOUBLEBUFFER; 138 139 Uint32 videoFlags = SDL_OPENGL | SDL_HWPALETTE | SDL_RESIZABLE; 140 141 /* query SDL for information about our video hardware */ 142 const SDL_VideoInfo* videoInfo = SDL_GetVideoInfo (); 143 144 if( videoInfo == NULL) 145 { 146 printf ("Orxonox::initVideo() - Failed getting Video Info :%s\n", SDL_GetError()); 147 SDL_Quit (); 148 } 149 if( videoInfo->hw_available) 150 videoFlags |= SDL_HWSURFACE; 151 else 152 videoFlags |= SDL_SWSURFACE; 153 /* 154 if(VideoInfo -> blit_hw) 155 VideoFlags |= SDL_HWACCEL; 156 */ 157 158 if((this->screen = SDL_SetVideoMode (width, height, bpp, videoFlags)) == NULL) 128 159 { 129 printf("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", width, height, bpp, flags, SDL_GetError());160 printf("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", width, height, bpp, videoFlags, SDL_GetError()); 130 161 SDL_Quit(); 131 162 return -1; … … 133 164 134 165 // Set window labeling 135 SDL_WM_SetCaption ("Orxonox " PACKAGE_VERSION, "Orxonox " PACKAGE_VERSION);166 SDL_WM_SetCaption ("Orxonox " PACKAGE_VERSION, "Orxonox " PACKAGE_VERSION); 136 167 137 168 // TO DO: Create a cool icon and use it here … … 139 170 140 171 // OpenGL stuff 141 // (Is this all we initialize globally???) 142 glClearColor(0.0, 0.0, 0.0, 0.0); 143 glEnable(GL_DEPTH_TEST); 172 glClearColor (0.0, 0.0, 0.0, 0.0); 173 glEnable (GL_DEPTH_TEST); 144 174 145 175 // LIGHTING … … 148 178 GLfloat lightPosition[] = {10.0, 10, 19.0, 0.0}; 149 179 150 glLightfv (GL_LIGHT0, GL_DIFFUSE, whiteLight);151 glLightfv (GL_LIGHT0, GL_SPECULAR, whiteLight);152 glEnable (GL_LIGHTING);153 glEnable (GL_LIGHT0);154 glEnable (GL_DEPTH_TEST);155 glLightfv (GL_LIGHT0, GL_POSITION, lightPosition);156 glLightfv (GL_LIGHT0, GL_DIFFUSE, whiteLight);180 glLightfv (GL_LIGHT0, GL_DIFFUSE, whiteLight); 181 glLightfv (GL_LIGHT0, GL_SPECULAR, whiteLight); 182 glEnable (GL_LIGHTING); 183 glEnable (GL_LIGHT0); 184 glEnable (GL_DEPTH_TEST); 185 glLightfv (GL_LIGHT0, GL_POSITION, lightPosition); 186 glLightfv (GL_LIGHT0, GL_DIFFUSE, whiteLight); 157 187 188 //glEnable (GL_TEXTURE_2D); 158 189 // glEnable(GL_COLOR); 159 190 // glShadeModel(GL_SMOOTH); … … 311 342 312 343 344 SDL_Surface* Orxonox::getScreen () 345 { 346 return this->screen; 347 } 313 348 314 349
Note: See TracChangeset
for help on using the changeset viewer.