Changeset 7219 in orxonox.OLD for branches/std/src/lib/graphics
- Timestamp:
- Mar 12, 2006, 5:14:44 PM (19 years ago)
- Location:
- branches/std/src/lib/graphics
- Files:
-
- 4 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 } -
branches/std/src/lib/graphics/graphics_engine.h
r7203 r7219 14 14 #include "sdlincl.h" 15 15 #include "glincl.h" 16 #include <list> 16 17 17 #include <list>18 #include "substring.h" 18 19 19 20 // Forward Declaration 20 21 class Text; 21 22 class IniParser; 22 class SubString;23 23 class WorldEntity; 24 24 class GraphicsEffect; … … 74 74 75 75 void listModes(); 76 bool hwSupportsEXT(const char*extension);76 bool hwSupportsEXT(const std::string& extension); 77 77 78 78 /** @brief swaps the GL_BUFFERS */ … … 116 116 117 117 // HARDWARE-Settings: 118 char*hwRenderer; //!< HW-renderer-string119 char*hwVendor; //!< HW-vendor-string120 char*hwVersion; //!< HW-version-string121 SubString *hwExtensions; //!< All suported Extensions.118 std::string hwRenderer; //!< HW-renderer-string 119 std::string hwVendor; //!< HW-vendor-string 120 std::string hwVersion; //!< HW-version-string 121 SubString hwExtensions; //!< All suported Extensions. 122 122 123 123 // FPS-related -
branches/std/src/lib/graphics/render2D/element_2d.cc
r7216 r7219 726 726 void Element2D::setParentMode2D (const std::string& parentingMode) 727 727 { 728 this->setParentMode2D(Element2D:: charToParentingMode2D(parentingMode));728 this->setParentMode2D(Element2D::stringToParentingMode2D(parentingMode)); 729 729 } 730 730 … … 952 952 this->relCoordinate.y, 953 953 this->getAbsDir2D(), 954 Element2D::parentingModeTo Char2D(parentMode),954 Element2D::parentingModeToString2D(parentMode), 955 955 Element2D::layer2DToChar(this->layer)); 956 956 … … 1074 1074 * @return the converted string 1075 1075 */ 1076 const char* Element2D::parentingModeTo Char2D(int parentingMode)1076 const char* Element2D::parentingModeToString2D(int parentingMode) 1077 1077 { 1078 1078 if (parentingMode == E2D_PARENT_LOCAL_ROTATE) … … 1093 1093 * @return the int corresponding to the named parentingMode 1094 1094 */ 1095 E2D_PARENT_MODE Element2D:: charToParentingMode2D(const std::string& parentingMode)1095 E2D_PARENT_MODE Element2D::stringToParentingMode2D(const std::string& parentingMode) 1096 1096 { 1097 1097 if (parentingMode == "local-rotate") -
branches/std/src/lib/graphics/render2D/element_2d.h
r7216 r7219 212 212 213 213 // helper functions // 214 static const char* parentingModeTo Char2D(int parentingMode);215 static E2D_PARENT_MODE charToParentingMode2D(const std::string& parentingMode);214 static const char* parentingModeToString2D(int parentingMode); 215 static E2D_PARENT_MODE stringToParentingMode2D(const std::string& parentingMode); 216 216 217 217 static const char* layer2DToChar(E2D_LAYER layer);
Note: See TracChangeset
for help on using the changeset viewer.