Changeset 8706 for code/trunk/src/libraries/core/GUIManager.cc
- Timestamp:
- Jun 14, 2011, 8:53:28 PM (13 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/core/GUIManager.cc
r8530 r8706 38 38 #include <CEGUIDefaultLogger.h> 39 39 #include <CEGUIExceptions.h> 40 #include <CEGUIFontManager.h> 40 41 #include <CEGUIInputEvent.h> 41 42 #include <CEGUIMouseCursor.h> … … 44 45 #include <CEGUIWindow.h> 45 46 #include <CEGUIWindowManager.h> 47 #include <CEGUIXMLAttributes.h> 46 48 #include <elements/CEGUIListbox.h> 47 49 #include <elements/CEGUIListboxItem.h> … … 260 262 COUT(3) << "Initialising CEGUI." << std::endl; 261 263 264 this->oldCEGUI_ = false; 265 262 266 // Note: No SceneManager specified yet 263 267 #ifdef ORXONOX_OLD_CEGUI 264 268 guiRenderer_ = new OgreCEGUIRenderer(GraphicsManager::getInstance().getRenderWindow(), Ogre::RENDER_QUEUE_OVERLAY, false, 3000); 265 269 resourceProvider_ = guiRenderer_->createResourceProvider(); 270 this->oldCEGUI_ = true; 266 271 #else 267 272 guiRenderer_ = &OgreRenderer::create(*GraphicsManager::getInstance().getRenderWindow()); … … 729 734 } 730 735 736 /** 737 @brief 738 Adds a new freetype font to the CEGUI system. 739 @param name 740 The name of the new font. 741 @param size 742 The font size of the new font in pixels. 743 @param fontName 744 The filename of the font. 745 */ 746 /*static*/ void GUIManager::addFontHelper(const std::string& name, int size, const std::string& fontName) 747 { 748 #ifdef ORXONOX_OLD_CEGUI 749 if(CEGUI::FontManager::getSingleton().isFontPresent(name)) // If a font with that name already exists. 750 return; 751 752 CEGUI::Font* font = NULL; 753 CEGUI::XMLAttributes xmlAttributes; 754 755 // Attributes specified within CEGUIFont 756 xmlAttributes.add("Name", name); 757 xmlAttributes.add("Filename", fontName); 758 xmlAttributes.add("ResourceGroup", ""); 759 xmlAttributes.add("AutoScaled", "true"); 760 xmlAttributes.add("NativeHorzRes", "800"); 761 xmlAttributes.add("NativeVertRes", "600"); 762 763 // Attributes specified within CEGUIXMLAttributes 764 xmlAttributes.add("Size", multi_cast<std::string>(size)); 765 xmlAttributes.add("AntiAlias", "true"); 766 767 font = CEGUI::FontManager::getSingleton().createFont("FreeType", xmlAttributes); 768 if(font != NULL) 769 font->load(); 770 #else 771 if(CEGUI::FontManager::getSingleton().isDefined(name)) // If a font with that name already exists. 772 return; 773 774 CEGUI::FontManager::getSingleton().createFreeTypeFont(name, (float)size, true, fontName, "", true, 800.0f, 600.0f); 775 #endif 776 } 777 731 778 }
Note: See TracChangeset
for help on using the changeset viewer.