Changeset 7219 in orxonox.OLD for branches/std/src/lib/graphics/graphics_engine.cc
- Timestamp:
- Mar 12, 2006, 5:14:44 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/std/src/lib/graphics/graphics_engine.cc
r7211 r7219 78 78 this->screen = NULL; 79 79 80 81 // Hardware82 this->hwRenderer = NULL;83 this->hwVendor = NULL;84 this->hwVersion = NULL;85 this->hwExtensions = NULL;86 87 80 // initialize the Modules 88 81 TextEngine::getInstance(); … … 103 96 // delete what has to be deleted here 104 97 this->displayFPS( false ); 105 106 delete[] this->hwRenderer;107 delete[] this->hwVendor;108 delete[] this->hwVersion;109 delete this->hwExtensions;110 98 111 99 //TextEngine … … 312 300 // printf("%s %s %s\n %s", renderer, vendor, version, extensions); 313 301 314 if (this->hwRenderer == NULL && renderer != NULL) 315 { 316 this->hwRenderer = new char[strlen(renderer)+1]; 317 strcpy(this->hwRenderer, renderer); 318 } 319 if (this->hwVendor == NULL && vendor != NULL) 320 { 321 this->hwVendor = new char[strlen(vendor)+1]; 322 strcpy(this->hwVendor, vendor); 323 } 324 if (this->hwVersion == NULL && version != NULL) 325 { 326 this->hwVersion = new char[strlen(version)+11]; 327 strcpy(this->hwVersion, version); 328 } 329 330 if (this->hwExtensions == NULL && extensions != NULL) 331 this->hwExtensions = new SubString((char*)glGetString(GL_EXTENSIONS), " \n\t,"); 302 if (renderer != NULL) 303 { 304 this->hwRenderer == renderer; 305 } 306 if (vendor != NULL) 307 { 308 this->hwVendor == vendor; 309 } 310 if (version != NULL) 311 { 312 this->hwVersion == version; 313 } 314 315 if (extensions != NULL) 316 this->hwExtensions.split(extensions, " \n\t,"); 332 317 333 318 PRINT(4)("Running on : vendor: %s, renderer: %s, version:%s\n", vendor, renderer, version); 334 319 PRINT(4)("Extensions:\n"); 335 if (this->hwExtensions != NULL) 336 for (unsigned int i = 0; i < this->hwExtensions->getCount(); i++) 337 PRINT(4)("%d: %s\n", i, this->hwExtensions->getString(i)); 320 for (unsigned int i = 0; i < this->hwExtensions.getCount(); i++) 321 PRINT(4)("%d: %s\n", i, this->hwExtensions.getString(i).c_str()); 338 322 339 323 … … 529 513 * @return true if it is, false otherwise 530 514 */ 531 bool GraphicsEngine::hwSupportsEXT(const char* extension) 532 { 533 if (this->hwExtensions != NULL) 534 for (unsigned int i = 0; i < this->hwExtensions->getCount(); i++) 535 if ( this->hwExtensions->getString(i) == extension) 536 return true; 515 bool GraphicsEngine::hwSupportsEXT(const std::string& extension) 516 { 517 for (unsigned int i = 0; i < this->hwExtensions.getCount(); i++) 518 if ( this->hwExtensions.getString(i) == extension) 519 return true; 537 520 return false; 538 521 } … … 587 570 void GraphicsEngine::draw() const 588 571 { 589 // LightManager::getInstance()->draw();572 // LightManager::getInstance()->draw(); 590 573 591 574 GraphicsEngine::storeMatrices(); … … 668 651 switch (event.type) 669 652 { 670 671 672 673 } 674 } 653 case EV_VIDEO_RESIZE: 654 this->resolutionChanged(event.resize); 655 break; 656 } 657 }
Note: See TracChangeset
for help on using the changeset viewer.