本文整理汇总了C++中cegui::DefaultResourceProvider类的典型用法代码示例。如果您正苦于以下问题:C++ DefaultResourceProvider类的具体用法?C++ DefaultResourceProvider怎么用?C++ DefaultResourceProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DefaultResourceProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialiseResourceGroupDirectories
//----------------------------------------------------------------------------//
void CEGuiBaseApplication::initialiseResourceGroupDirectories()
{
// initialise the required dirs for the DefaultResourceProvider
CEGUI::DefaultResourceProvider* rp =
static_cast<CEGUI::DefaultResourceProvider*>
(CEGUI::System::getSingleton().getResourceProvider());
const char* dataPathPrefix = getDataPathPrefix();
char resourcePath[PATH_MAX];
// for each resource type, set a resource group directory
sprintf(resourcePath, "%s/%s", dataPathPrefix, "schemes/");
rp->setResourceGroupDirectory("schemes", resourcePath);
sprintf(resourcePath, "%s/%s", dataPathPrefix, "imagesets/");
rp->setResourceGroupDirectory("imagesets", resourcePath);
sprintf(resourcePath, "%s/%s", dataPathPrefix, "fonts/");
rp->setResourceGroupDirectory("fonts", resourcePath);
sprintf(resourcePath, "%s/%s", dataPathPrefix, "layouts/");
rp->setResourceGroupDirectory("layouts", resourcePath);
sprintf(resourcePath, "%s/%s", dataPathPrefix, "looknfeel/");
rp->setResourceGroupDirectory("looknfeels", resourcePath);
sprintf(resourcePath, "%s/%s", dataPathPrefix, "lua_scripts/");
rp->setResourceGroupDirectory("lua_scripts", resourcePath);
sprintf(resourcePath, "%s/%s", dataPathPrefix, "xml_schemas/");
rp->setResourceGroupDirectory("schemas", resourcePath);
sprintf(resourcePath, "%s/%s", dataPathPrefix, "animations/");
rp->setResourceGroupDirectory("animations", resourcePath);
}
示例2: dataPathPrefix
//----------------------------------------------------------------------------//
void CEGuiBaseApplication::initialiseResourceGroupDirectories
(const CEGUI::String& dataPathPrefixOverride)
{
// initialise the required dirs for the DefaultResourceProvider
CEGUI::DefaultResourceProvider* rp =
static_cast<CEGUI::DefaultResourceProvider*>
(CEGUI::System::getSingleton().getResourceProvider());
initDataPathPrefix(dataPathPrefixOverride);
CEGUI::String dataPathPrefix(getDataPathPrefix());
/* for each resource type, set a resource group directory. We cast strings
to "const CEGUI::utf8*" in order to support general Unicode strings,
rather than only ASCII strings (even though currently they're all ASCII).
*/
rp->setResourceGroupDirectory("schemes",
dataPathPrefix + "/schemes/");
rp->setResourceGroupDirectory("imagesets",
dataPathPrefix + "/imagesets/");
rp->setResourceGroupDirectory("fonts",
dataPathPrefix + "/fonts/");
rp->setResourceGroupDirectory("layouts",
dataPathPrefix + "/layouts/");
rp->setResourceGroupDirectory("looknfeels",
dataPathPrefix + "/looknfeel/");
rp->setResourceGroupDirectory("lua_scripts",
dataPathPrefix + "/lua_scripts/");
rp->setResourceGroupDirectory("schemas",
dataPathPrefix + "/xml_schemas/");
rp->setResourceGroupDirectory("animations",
dataPathPrefix + "/animations/");
}
示例3: initialiseResources
void Application::initialiseResources()
{
CEGUI::DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*>(CEGUI::System::getSingleton().getResourceProvider());
rp->setResourceGroupDirectory("schemes", "data/gui/schemes");
rp->setResourceGroupDirectory("imagesets", "data/gui/imagesets");
rp->setResourceGroupDirectory("fonts", "data/gui/fonts");
rp->setResourceGroupDirectory("layouts", "data/gui/layouts");
rp->setResourceGroupDirectory("looknfeels", "data/gui/looknfeel");
rp->setResourceGroupDirectory("lua_scripts", "data/gui/lua_scripts");
rp->setResourceGroupDirectory("schemas", "data/gui/xml_schemas");
rp->setResourceGroupDirectory("animations", "data/gui/animations");
CEGUI::ImageManager::setImagesetDefaultResourceGroup("imagesets");
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::Scheme::setDefaultResourceGroup("schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
CEGUI::WindowManager::setDefaultResourceGroup("layouts");
CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");
CEGUI::AnimationManager::setDefaultResourceGroup("animations");
CEGUI::XMLParser* parser = CEGUI::System::getSingleton().getXMLParser();
if (parser->isPropertyPresent("SchemaDefaultResourceGroup"))
{
parser->setProperty("SchemaDefaultResourceGroup", "schemas");
}
}
示例4: OnOkClick
//--------------------------------------------------------------------------------
void DialogResourceGroups::OnOkClick( wxCommandEvent& event )
{
// dump the grid values into a map
ResourceGroupsMap newGroups;
int sz = m_groupsGrid->GetNumberRows();
for ( int i = 0; i < sz; ++i )
newGroups[ m_groupsGrid->GetCellValue( i, 0 ) ] =
m_groupsGrid->GetCellValue( i, 1 );
// build a list of deleted groups
wxArrayString deletedGroups;
ResourceGroupsMap::iterator iter = m_resourceGroups.begin();
while ( iter != m_resourceGroups.end() )
{
if ( newGroups.count( iter->first ) == 0 )
deletedGroups.Add( iter->first );
++iter;
}
// set our map to equal the new set of defined groups
m_resourceGroups = newGroups;
// get the resource provier from CEGUI::System
CEGUI::DefaultResourceProvider* rp =
static_cast<CEGUI::DefaultResourceProvider*>(
CEGUI::System::getSingleton().getResourceProvider() );
// erase groups that were deleted
for ( size_t j = 0; j < deletedGroups.size(); ++j )
rp->clearResourceGroupDirectory( CEGUIHelper::ToCEGUIString( deletedGroups[ j ] ) );
// update all groups according to our map
iter = m_resourceGroups.begin();
while ( iter != m_resourceGroups.end() )
{
rp->setResourceGroupDirectory(
CEGUIHelper::ToCEGUIString( iter->first ),
CEGUIHelper::ToCEGUIString( iter->second ) );
++iter;
}
// Set the default resource group
rp->setDefaultResourceGroup(
CEGUIHelper::ToCEGUIString( m_defaultGroupName ) );
// wipe out backup info incase some strangeness happens
m_backupResourceGroups.clear();
m_backupDefaultGroupName.clear();
event.Skip();
}
示例5: Init
void GUI::Init(const std::string& _resourceDirectory)
{
// Check if the renderer and system were not already initialized
if (m_renderer == nullptr)
{
m_renderer = &CEGUI::OpenGL3Renderer::bootstrapSystem();
}
//set up the resource group directories
CEGUI::DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*>(CEGUI::System::getSingleton().getResourceProvider());
rp->setResourceGroupDirectory("imagesets", _resourceDirectory + "/imagesets/");
rp->setResourceGroupDirectory("schemes", _resourceDirectory + "/schemes/");
rp->setResourceGroupDirectory("fonts", _resourceDirectory + "/fonts/");
rp->setResourceGroupDirectory("layouts", _resourceDirectory + "/layouts/");
rp->setResourceGroupDirectory("looknfeels", _resourceDirectory + "/looknfeel/");
rp->setResourceGroupDirectory("lua_scripts", _resourceDirectory + "/lua_scripts/");
//set the default resource groups
CEGUI::ImageManager::setImagesetDefaultResourceGroup("imagesets");
CEGUI::Scheme::setDefaultResourceGroup("schemes");
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
CEGUI::WindowManager::setDefaultResourceGroup("layouts");
CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");
//set up the context
m_context = &CEGUI::System::getSingleton().createGUIContext(m_renderer->getDefaultRenderTarget());
m_root = CEGUI::WindowManager::getSingleton().createWindow("DefaultWindow", "root");
m_context->setRootWindow(m_root);
}
示例6: init
void GUI::init(std::string resourcePath)
{
if (renderer == nullptr)
{
renderer = &CEGUI::OpenGL3Renderer::bootstrapSystem();
CEGUI::DefaultResourceProvider *resourceProvider = static_cast<CEGUI::DefaultResourceProvider*>(CEGUI::System::getSingleton().getResourceProvider());
resourceProvider->setResourceGroupDirectory("imagesets", resourcePath + "/imagesets/");
resourceProvider->setResourceGroupDirectory("schemes", resourcePath + "/schemes/");
resourceProvider->setResourceGroupDirectory("fonts", resourcePath + "/fonts/");
resourceProvider->setResourceGroupDirectory("layouts", resourcePath + "/layouts/");
resourceProvider->setResourceGroupDirectory("looknfeels", resourcePath + "/looknfeel/");
resourceProvider->setResourceGroupDirectory("lua_scripts", resourcePath + "/lua_scripts/");
CEGUI::ImageManager::setImagesetDefaultResourceGroup("imagesets");
CEGUI::Scheme::setDefaultResourceGroup("schemes");
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
CEGUI::WindowManager::setDefaultResourceGroup("layouts");
CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");
}
context = &CEGUI::System::getSingleton().createGUIContext(renderer->getDefaultRenderTarget());
root = CEGUI::WindowManager::getSingleton().createWindow("DefaultWindow", "root");
context->setRootWindow(root);
}
示例7: getDefaultResourceGroupRelativePath
//-----------------------------------------------------------------------
wxString EditorDocument::getDefaultResourceGroupRelativePath( const wxString& filename ) const
{
wxString resourcePath( wxT( "./" ) );
wxFileName filespec( filename );
CEGUI::DefaultResourceProvider* rp =
static_cast<CEGUI::DefaultResourceProvider*>(
CEGUI::System::getSingleton().getResourceProvider() );
CEGUI::String defResGrp = rp->getDefaultResourceGroup();
if ( !defResGrp.empty() )
resourcePath = CEGUIHelper::ToWXString(
rp->getResourceGroupDirectory( defResGrp ) );
filespec.MakeRelativeTo( resourcePath );
return filespec.GetFullPath();
}
示例8: initializeGlobal
//===========================================================================//
void GlobalHandler::initializeGlobal()
{
// Bootstrap CEGUI::System with an OpenGLRenderer object that uses the
// current GL viewport, the DefaultResourceProvider, and the default
// ImageCodec.
//
// NB: Your OpenGL context must already be initialised when you call this; CEGUI
// will not create the OpenGL context itself.
mRenderer = &CEGUI::OpenGLRenderer::bootstrapSystem();
mRenderer->enableExtraStateSettings(true);
mSystem = CEGUI::System::getSingletonPtr();
// TODO: Find a generic way to specify these.
// initialize the required dirs for the DefaultResourceProvider
CEGUI::DefaultResourceProvider* resourceProvider =
static_cast<CEGUI::DefaultResourceProvider*>(
mSystem->getResourceProvider());
const std::string baseDir = core::DATA_PATH + "/../share/cegui-0/";
resourceProvider->setResourceGroupDirectory("schemes",
baseDir + "schemes/");
resourceProvider->setResourceGroupDirectory("imagesets",
baseDir + "imagesets/");
resourceProvider->setResourceGroupDirectory("fonts",
baseDir + "fonts/");
resourceProvider->setResourceGroupDirectory("layouts",
baseDir + "layouts/");
resourceProvider->setResourceGroupDirectory("looknfeels",
baseDir + "looknfeel/");
resourceProvider->setResourceGroupDirectory("lua_scripts",
baseDir + "lua_scripts/");
// set the default resource groups to be used
CEGUI::ImageManager::setImagesetDefaultResourceGroup("imagesets");
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::Scheme::setDefaultResourceGroup("schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
CEGUI::WindowManager::setDefaultResourceGroup("layouts");
CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");
// create (load) the TaharezLook scheme file
// (this auto-loads the TaharezLook looknfeel and imageset files)
CEGUI::SchemeManager::getSingleton().createFromFile(mScheme + ".scheme");
// create (load) a font.
// The first font loaded automatically becomes the default font, but note
// that the scheme might have already loaded a font, so there may already
// be a default set - if we want the "DejaVuSans-10" font to definitely
// be the default, we should set the default explicitly afterwards.
CEGUI::FontManager::getSingleton().createFromFile("DejaVuSans-14-NoScale.font");
CEGUI::GUIContext& context = mSystem->getDefaultGUIContext();
context.setDefaultFont("DejaVuSans-14-NoScale");
//context.getMouseCursor().setDefaultImage(mScheme + "/MouseArrow");
context.setDefaultTooltipType(mScheme + "/Tooltip");
mWindowManager = CEGUI::WindowManager::getSingletonPtr();
mRoot = mWindowManager->createWindow("DefaultWindow", "root");
context.setRootWindow(mRoot);
}
示例9: main
int main (int argc, char **argv)
{
SDL_Surface * screen;
atexit (SDL_Quit);
SDL_Init (SDL_INIT_VIDEO);
screen = SDL_SetVideoMode (600, 480, 0, SDL_OPENGL);
if (screen == NULL) {
/* Se ainda n?o der, desiste! */
fprintf (stderr, "Imposs¨ªvel ajustar ao v¨ªdeo: %s\n", SDL_GetError ());
exit (1);
}
//renderer = new CEGUI::OpenGLRenderer (0, 600, 480);
renderer = &CEGUI::OpenGLRenderer::create();
CEGUI::System::create(*renderer);
SDL_ShowCursor (SDL_DISABLE);
SDL_EnableUNICODE (1);
SDL_EnableKeyRepeat (SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
// initialise the required dirs for the DefaultResourceProvider
CEGUI::DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*>
(CEGUI::System::getSingleton().getResourceProvider());
rp->setResourceGroupDirectory("schemes", "../../cegui/CEGUI-SDK-0.7.5-vc8/datafiles/schemes/");
rp->setResourceGroupDirectory("imagesets", "../../cegui/CEGUI-SDK-0.7.5-vc8/datafiles/imagesets/");
rp->setResourceGroupDirectory("fonts", "../../cegui/CEGUI-SDK-0.7.5-vc8/datafiles/fonts/");
rp->setResourceGroupDirectory("layouts", "../../cegui/CEGUI-SDK-0.7.5-vc8/datafiles/layouts/");
rp->setResourceGroupDirectory("looknfeels", "../../cegui/CEGUI-SDK-0.7.5-vc8/datafiles/looknfeel/");
rp->setResourceGroupDirectory("lua_scripts", "../../cegui/CEGUI-SDK-0.7.5-vc8/datafiles/lua_scripts/");
// set the default resource groups to be used
CEGUI::Imageset::setDefaultResourceGroup("imagesets");
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::Scheme::setDefaultResourceGroup("schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
CEGUI::WindowManager::setDefaultResourceGroup("layouts");
CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");
// Get window manager which we wil use for a few jobs here.
WindowManager& winMgr = WindowManager::getSingleton();
// Load the scheme to initialse the VanillaSkin which we use in this sample
SchemeManager::getSingleton().create("VanillaSkin.scheme");
// set default mouse image
System::getSingleton().setDefaultMouseCursor("Vanilla-Images", "MouseArrow");
FontManager::getSingleton().create("DejaVuSans-10.font");
Window *root = winMgr.loadWindowLayout("VanillaWindows.layout");
Window *console = winMgr.loadWindowLayout("VanillaConsole.layout", "Demo");
root->addChildWindow(console);
// install this as the root GUI sheet
System::getSingleton().setGUISheet(root);
main_loop();
return 0;
}
示例10: glEnable
RenderWindow::RenderWindow(int width, int height, std::string name) : sf::RenderWindow(sf::VideoMode(width, height), name, sf::Style::Close | sf::Style::Titlebar)
{
elapsedclock = new sf::Clock;
inpMan = new InputManager;
glEnable(GL_TEXTURE_2D);
CEGUI::OpenGLRenderer& renderer = CEGUI::OpenGLRenderer::bootstrapSystem();
CEGUI::DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*>(CEGUI::System::getSingleton().getResourceProvider());
rp->setResourceGroupDirectory("schemes", GameManager::getGameFolderName() + "gui/schemes/");
rp->setResourceGroupDirectory("imagesets", GameManager::getGameFolderName() + "gui/imagesets/");
rp->setResourceGroupDirectory("fonts", GameManager::getGameFolderName() + "gui/fonts/");
rp->setResourceGroupDirectory("layouts", GameManager::getGameFolderName() + "gui/layouts/");
rp->setResourceGroupDirectory("looknfeels", GameManager::getGameFolderName() + "gui/looknfeel/");
rp->setResourceGroupDirectory("lua_scripts", GameManager::getGameFolderName() + "gui/lua_scripts/");
rp->setResourceGroupDirectory("falcon_scripts", GameManager::getGameFolderName() + "gui/falcon_scripts/");
rp->setResourceGroupDirectory("schemas", GameManager::getGameFolderName() + "gui/xml_schemas/");
CEGUI::ImageManager::setImagesetDefaultResourceGroup("imagesets");
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::Scheme::setDefaultResourceGroup("schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
CEGUI::WindowManager::setDefaultResourceGroup("layouts");
CEGUI::ScriptModule::setDefaultResourceGroup("falcon_scripts");
CEGUI::XMLParser* parser = CEGUI::System::getSingleton().getXMLParser();
if(parser->isPropertyPresent("SchemaDefaultResourceGroup"))
parser->setProperty("SchemaDefaultResourceGroup", "schemas");
#ifdef FALCON1
#else
CEGUI::System::getSingleton().setScriptingModule(FalconScriptingModule::create());
#endif
CEGUI::System::getSingleton().executeScriptFile("gui", "falcon_scripts");
this->setVerticalSyncEnabled(true);
this->setFramerateLimit(60);
// Remove and put to script ASAP
loadScheme("TaharezLook");
loadFont("Inconsolata-14");
setArrowandTooltipScheme("TaharezLook");
// --END--
setupMap();
}
示例11: initCEGUI
bool CServer::initCEGUI()
{
CEGUI::OgreRenderer& CEGUIRenderer = CEGUI::OgreRenderer::create(*_renderWindow);
_luaModule = &CEGUI::LuaScriptModule::create(ScriptManager::CServer::getSingletonPtr()->getLuaState());
CEGUI::System::create(CEGUIRenderer, NULL, NULL, NULL, _luaModule, "media/gui/configs/CEGUIConfig.xml");
_GUISystem = CEGUI::System::getSingletonPtr();
// Inicializamos los directorios necesarios para el Resource Provider,
// así cuando creemos un recurso no tenemos que dar una ruta completa.
CEGUI::DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*>(
CEGUI::System::getSingleton().getResourceProvider());
rp->setResourceGroupDirectory("fonts", "media/gui/fonts/");
rp->setResourceGroupDirectory("imagesets", "media/gui/imagesets/");
rp->setResourceGroupDirectory("layouts", "media/gui/layouts");
rp->setResourceGroupDirectory("looknfeels", "media/gui/looknfeel/");
rp->setResourceGroupDirectory("schemes", "media/gui/schemes/");
// Definimos los grupos de recursos que usaremos
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::Imageset::setDefaultResourceGroup("imagesets");
CEGUI::WindowManager::setDefaultResourceGroup("layouts");
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
CEGUI::Scheme::setDefaultResourceGroup("schemes");
return true;
} // initCEGUI
示例12: initializeResourceGroups
void GUI::initializeResourceGroups()
{
CEGUI::DefaultResourceProvider* rp;
rp = static_cast<CEGUI::DefaultResourceProvider*>(CEGUI::System::getSingleton().getResourceProvider());
std::string rootPath = "GUIData/";
rp->setResourceGroupDirectory("schemes", rootPath + "schemes/");
rp->setResourceGroupDirectory("imagesets", rootPath + "imagesets/");
rp->setResourceGroupDirectory("fonts", rootPath + "fonts/");
rp->setResourceGroupDirectory("layouts", rootPath + "layouts/");
rp->setResourceGroupDirectory("looknfeel", rootPath + "looknfeel/");
rp->setResourceGroupDirectory("lua_scripts", rootPath + "lua_scripts/");
rp->setResourceGroupDirectory("schemas", rootPath + "schemas/");
rp->setResourceGroupDirectory("animations", rootPath + "animations/");
CEGUI::Imageset::setDefaultResourceGroup("imagesets");
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::Scheme::setDefaultResourceGroup("schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeel");
CEGUI::WindowManager::setDefaultResourceGroup("layouts");
CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");
CEGUI::AnimationManager::setDefaultResourceGroup("animations");
}
示例13: create_cegui_system
void UIMng::create_cegui_system()
{
LOG_ENTER;
void * pD3DDevice = SINGLETON(Render).GetDevice();
// 创建cegui
CEGUI::Direct3D9Renderer& renderer(CEGUI::Direct3D9Renderer::create((LPDIRECT3DDEVICE9)pD3DDevice));
LOG_TRACE("Create Direct3D9Renderer ok");
CEGUI::DefaultResourceProvider* rp = new CEGUI::DefaultResourceProvider();
CEGUI::System::create(renderer, rp);
LOG_TRACE("Create System ok");
// 设置资源
rp->setResourceGroupDirectory("schemes", "ui/schemes/");
rp->setResourceGroupDirectory("imagesets", "ui/imagesets/");
rp->setResourceGroupDirectory("fonts", "ui/fonts/");
rp->setResourceGroupDirectory("layouts", "ui/layouts/");
rp->setResourceGroupDirectory("looknfeels", "ui/looknfeel/");
rp->setResourceGroupDirectory("lua_scripts", "ui/lua_scripts/");
rp->setResourceGroupDirectory("schemas", "ui/xml_schemas/");
rp->setResourceGroupDirectory("animations", "ui/animations/");
CEGUI::Imageset::setDefaultResourceGroup("imagesets");
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::Scheme::setDefaultResourceGroup("schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
CEGUI::WindowManager::setDefaultResourceGroup("layouts");
CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");
CEGUI::AnimationManager::setDefaultResourceGroup("animations");
LOG_TRACE("setDefaultResourceGroup ok");
CEGUI::Logger::getSingleton().setLoggingLevel(CEGUI::Informative);
LOG_LEAVE;
}
示例14:
GuiMgr::GuiMgr()
{
CEGUI::OpenGLRenderer::bootstrapSystem();
std::string folder = "media/cegui/";
// Initialise the required dirs for the DefaultResourceProvider
CEGUI::DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*>
(CEGUI::System::getSingleton().getResourceProvider());
rp->setResourceGroupDirectory("schemes", folder + "schemes/");
rp->setResourceGroupDirectory("imagesets", folder + "imagesets/");
rp->setResourceGroupDirectory("fonts", folder + "fonts/");
rp->setResourceGroupDirectory("layouts", folder + "layouts/");
rp->setResourceGroupDirectory("looknfeels", folder + "looknfeel/");
rp->setResourceGroupDirectory("lua_scripts", folder + "lua_scripts/");
// Set the default resource groups to be used
CEGUI::Imageset::setDefaultResourceGroup("imagesets");
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::Scheme::setDefaultResourceGroup("schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
CEGUI::WindowManager::setDefaultResourceGroup("layouts");
CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");
// Load the scheme
CEGUI::SchemeManager::getSingleton().create("TaharezLook.scheme");
CEGUI::SchemeManager::getSingleton().create("VanillaSkin.scheme");
// Set the defaults
CEGUI::System::getSingleton().setDefaultFont("DejaVuSans-10");
//CEGUI::System::getSingleton().setDefaultMouseCursor("Vanilla-Images", "MouseArrow");
CEGUI::Window* myRoot =
CEGUI::WindowManager::getSingleton().createWindow("DefaultWindow", "_MasterRoot");
CEGUI::System::getSingleton().setGUISheet(myRoot);
std::clog << "GuiMgr created\n";
// Add Console window to gui
Console *c = new Console;
CEGUI::System::getSingleton().getGUISheet()->addChildWindow(c->getWindow());
c->setVisible(false);
}
示例15: init
void CeguiDrawable::init() const
{
if (m_initDone)
return;
CEGUI::OpenGL3Renderer::bootstrapSystem();
CEGUI::DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*>(CEGUI::System::getSingleton().getResourceProvider());
rp->setResourceGroupDirectory("schemes", "./cegui/schemes/");
rp->setResourceGroupDirectory("imagesets", "./cegui/imagesets/");
rp->setResourceGroupDirectory("fonts", "./cegui/fonts/");
rp->setResourceGroupDirectory("looknfeels", "./cegui/looknfeel/");
rp->setResourceGroupDirectory("layouts", "./cegui/layouts/");
rp->setResourceGroupDirectory("anims", "./cegui/animations/");
CEGUI::ImageManager::setImagesetDefaultResourceGroup("imagesets");
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::Scheme::setDefaultResourceGroup("schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
CEGUI::WindowManager::setDefaultResourceGroup("layouts");
CEGUI::AnimationManager::setDefaultResourceGroup("anims");
CEGUI::SchemeManager::getSingleton().createFromFile("Generic.scheme");
CEGUI::System::getSingleton().getDefaultGUIContext().getMouseCursor().setDefaultImage("TaharezLook/MouseArrow");
//CEGUI::System::getSingleton().getDefaultGUIContext().setDefaultFont("DejaVuSans-12");
//CEGUI::System::getSingleton().getDefaultGUIContext().setDefaultTooltipType("TaharezLook/Tooltip");
using namespace CEGUI;
Window* myRoot = WindowManager::getSingleton().loadLayoutFromFile("futurella.xml");
System::getSingleton().getDefaultGUIContext().setRootWindow(myRoot);
//AnimationManager::getSingleton().loadAnimationsFromXML("example.anims");
/// HACKS, hacks hacks all around...
// well, what else can you do here, i have no idea.
CeguiDrawable* self = const_cast<CeguiDrawable*>(this);
self->setEventCallback(new GlobalEventHandler(m_guiApp));
self->setUpdateCallback(new TickEvents);
self->m_guiApp->registerEvents();
m_initDone = true;
}