- Timestamp:
- Sep 26, 2005, 2:28:46 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/graphics_engine.cc
r5255 r5260 53 53 this->videoFlags = 0; 54 54 this->screen = NULL; 55 56 57 // Hardware 58 this->hwRenderer = NULL; 59 this->hwVendor = NULL; 60 this->hwVersion = NULL; 61 this->hwExtensions = NULL; 55 62 } 56 63 … … 69 76 delete this->geTextMaxFPS; 70 77 delete this->geTextMinFPS; 78 79 delete[] this->hwRenderer; 80 delete[] this->hwVendor; 81 delete[] this->hwVersion; 82 delete this->hwExtensions; 71 83 72 84 delete Render2D::getInstance(); … … 159 171 this->setResolution(resX, resY, bbp); 160 172 173 // GRABBING ALL GL-extensions 174 this->grabHardwareSettings(); 175 161 176 // Enable default GL stuff 162 177 glEnable(GL_DEPTH_TEST); … … 208 223 SDL_GL_SetAttribute( SDL_GL_ACCUM_BLUE_SIZE, 0); 209 224 SDL_GL_SetAttribute( SDL_GL_ACCUM_ALPHA_SIZE, 0); 225 } 226 227 void GraphicsEngine::grabHardwareSettings() 228 { 229 const char* renderer = (const char*) glGetString(GL_RENDERER); 230 const char* vendor = (const char*) glGetString(GL_VENDOR); 231 const char* version = (const char*) glGetString(GL_VERSION); 232 const char* extensions = (const char*) glGetString(GL_EXTENSIONS); 233 234 // printf("%s %s %s\n %s", renderer, vendor, version, extensions); 235 236 if (this->hwRenderer == NULL && renderer != NULL) 237 { 238 this->hwRenderer = new char[strlen(renderer)+1]; 239 strcpy(this->hwRenderer, renderer); 240 } 241 if (this->hwVendor == NULL && vendor != NULL) 242 { 243 this->hwVendor = new char[strlen(vendor)+1]; 244 strcpy(this->hwVendor, vendor); 245 } 246 if (this->hwVersion == NULL && version != NULL) 247 { 248 this->hwVersion = new char[strlen(version)+11]; 249 strcpy(this->hwVersion, version); 250 } 251 252 if (this->hwExtensions == NULL && extensions != NULL) 253 this->hwExtensions = new SubString((char*)glGetString(GL_EXTENSIONS), true); 254 255 PRINT(4)("Running on : %s %s %s\n", vendor, renderer, version); 256 PRINT(4)("Extensions:\n"); 257 if (this->hwExtensions != NULL) 258 for (unsigned int i = 0; i < this->hwExtensions->getCount(); i++) 259 PRINT(4)("%d: %s\n", i, this->hwExtensions->getString(i)); 210 260 } 211 261 … … 230 280 // return -1; 231 281 } 282 glViewport(0,0,width,height); // Reset The Current Viewport 232 283 } 233 284 -
trunk/src/lib/graphics/graphics_engine.h
r5216 r5260 18 18 class Text; 19 19 class IniParser; 20 class SubString; 20 21 21 22 //! class to handle graphics … … 78 79 int initVideo(unsigned int resX, unsigned int resY, unsigned int bbp); 79 80 int setGLattribs(); 81 void grabHardwareSettings(); 80 82 81 83 public: … … 100 102 float minFPS; //!< minimal frame rate we ever got since start 101 103 104 // HARDWARE-Settings: 105 char* hwRenderer; 106 char* hwVendor; 107 char* hwVersion; 108 SubString* hwExtensions; 102 109 103 110 #ifndef NO_TEXT -
trunk/src/story_entities/world.cc
r5258 r5260 466 466 sprintf (npcChar, "NPC_%d", i); 467 467 tmp->setName(npcChar); 468 tmp->setAbsCoor(((float)rand()/RAND_MAX) * 5000, 50/*+ (float)rand()/RAND_MAX*20*/, ((float)rand()/RAND_MAX -.5) * 100);468 tmp->setAbsCoor(((float)rand()/RAND_MAX) * 5000, 50/*+ (float)rand()/RAND_MAX*20*/, ((float)rand()/RAND_MAX -.5) *50); 469 469 this->spawn(tmp); 470 470
Note: See TracChangeset
for help on using the changeset viewer.