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