• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ cegui::DefaultResourceProvider类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中cegui::DefaultResourceProvider的典型用法代码示例。如果您正苦于以下问题:C++ DefaultResourceProvider类的具体用法?C++ DefaultResourceProvider怎么用?C++ DefaultResourceProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了DefaultResourceProvider类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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); 
}
开发者ID:kphillisjr,项目名称:cegui,代码行数:29,代码来源:CEGuiBaseApplication.cpp


示例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/");
}
开发者ID:ballisticwhisper,项目名称:cegui,代码行数:32,代码来源:CEGuiBaseApplication.cpp


示例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");
	}
}
开发者ID:rokuz,项目名称:DemoOpenGL,代码行数:27,代码来源:application.cpp


示例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();
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:55,代码来源:DialogResourceGroups.cpp


示例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);
 }
开发者ID:VasilStamatov,项目名称:GraphicsLearning,代码行数:27,代码来源:GUI.cpp


示例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);
}
开发者ID:linfredriksson,项目名称:FenrirModelViewer,代码行数:27,代码来源:gui.cpp


示例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();
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:19,代码来源:EditorDocument.cpp


示例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);
}
开发者ID:LCClyde,项目名称:Nyra,代码行数:60,代码来源:GlobalHandler.cpp


示例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;
}
开发者ID:hack99,项目名称:test,代码行数:59,代码来源:test_cegui.cpp


示例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();
}
开发者ID:Bobhostern,项目名称:Disandria,代码行数:45,代码来源:RenderWindow.cpp


示例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
开发者ID:JOSE89,项目名称:DamnedSunset,代码行数:30,代码来源:Server.cpp


示例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");
}
开发者ID:alienjon,项目名称:Escape-,代码行数:22,代码来源:GUI.cpp


示例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;
}
开发者ID:esrrhs,项目名称:fuck-music-player,代码行数:37,代码来源:uimng.cpp


示例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);
}
开发者ID:hjqqq,项目名称:marian,代码行数:45,代码来源:GuiMgr.cpp


示例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;
}
开发者ID:Jagholin,项目名称:Futurella,代码行数:44,代码来源:CEGUIDrawable.cpp


示例16: initCEGUI

	bool CServer::initCEGUI()
	{
		CEGUI::OgreRenderer& CEGUIRenderer =
				 CEGUI::OgreRenderer::create(*_renderWindow);

		//Creamos un objeto lua script module que luego le pasaremos al system cuando lo creemos
		//Le pasamos el interprete de Lua que queremos que modifique con las funciones de CEGUI
		CEGUI::LuaScriptModule &luaModule = CEGUI::LuaScriptModule::create(LUA::CScriptManager::GetPtrSingleton()->getNativeInterpreter());

		//Le pasamos el lua al crear CEGUI
		CEGUI::System::create(CEGUIRenderer, nullptr, nullptr, nullptr, &luaModule);

		//Aqui creamos el sistema de CEGUI
		_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*>(
			_GUISystem->getResourceProvider());

		//Aqui creamos cada uno de los grupos, asociando un nombre con una ruta de cada recurso
		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/");
		rp->setResourceGroupDirectory("xml_schemas", "media/gui/xml_schemas/");   

		//Definimos el tipo por defecto 
		CEGUI::Font::setDefaultResourceGroup("fonts");
		CEGUI::ImageManager::setImagesetDefaultResourceGroup("imagesets");
		CEGUI::WindowManager::setDefaultResourceGroup("layouts");
		CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
		CEGUI::Scheme::setDefaultResourceGroup("schemes");

		// setup default group for validation schemas
		_parser = _GUISystem->getXMLParser();
		if (_parser->isPropertyPresent("SchemaDefaultResourceGroup"))
			_parser->setProperty("SchemaDefaultResourceGroup", "xml_schemas");
			
		return true;

	} // initCEGUI
开发者ID:albmarvil,项目名称:The-Eternal-Sorrow,代码行数:43,代码来源:Server.cpp


示例17: initializeKeyMap

GameDesktop::GameDesktop(sf::RenderWindow &screen)
  : screen_(screen),
    renderer_(CEGUI::OpenGLRenderer::bootstrapSystem())
{
  // Set up default resource groups
  CEGUI::DefaultResourceProvider *rp = static_cast<CEGUI::DefaultResourceProvider*>(CEGUI::System::getSingleton().getResourceProvider());

  rp->setResourceGroupDirectory("schemes", "/usr/share/cegui-0/schemes/"); 
  rp->setResourceGroupDirectory("imagesets", "/usr/share/cegui-0/imagesets/");
  rp->setResourceGroupDirectory("fonts", "/usr/share/cegui-0/fonts/");
  rp->setResourceGroupDirectory("layouts", "/usr/share/cegui-0/layouts/");
  rp->setResourceGroupDirectory("looknfeels", "/usr/share/cegui-0/looknfeel");
  rp->setResourceGroupDirectory("lua_scripts", "/usr/share/cegui-0/lua_scripts/");

  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");

  // Set up the GUI
  CEGUI::SchemeManager::getSingleton().createFromFile("WindowsLook.scheme");
  CEGUI::FontManager::getSingleton().createFromFile("DejaVuSans-10.font");

  CEGUI::System::getSingleton().getDefaultGUIContext().getMouseCursor().setDefaultImage("WindowsLook/MouseArrow");

  CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
  CEGUI::Window *root = wmgr.createWindow("DefaultWindow", "root");
  root->setProperty("MousePassThroughEnabled", "True");
  CEGUI::System::getSingleton().getDefaultGUIContext().setRootWindow(root);

  CEGUI::FrameWindow *fw = static_cast<CEGUI::FrameWindow*>(wmgr.createWindow("WindowsLook/FrameWindow", "testWindow"));

  root->addChild(fw);
  fw->setText("Hello World!");

  // Initialize SFML-to-CEGUI key mapping
  initializeKeyMap();
  screen_.setView(view_);
}
开发者ID:ghtyrant,项目名称:SFML_CEGUI,代码行数:41,代码来源:gamedesktop.cpp


示例18: LoadResources

void GUISystem::LoadResources()
{
	// initialise the required dirs for the DefaultResourceProvider
	CEGUI::DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*>(CEGUI::System::getSingleton().getResourceProvider());
	rp->setResourceGroupDirectory("schemes", "./Data/Resources/UI/schemes/");
	rp->setResourceGroupDirectory("imagesets", "./Data/Resources/UI/imagesets/");
	rp->setResourceGroupDirectory("fonts", "./Data/Resources/UI/fonts/");
	rp->setResourceGroupDirectory("layouts", "./Data/Resources/UI/layouts/");
	rp->setResourceGroupDirectory("looknfeels", "./Data/Resources/UI/looknfeel/");
	rp->setResourceGroupDirectory("lua_scripts", "./Data/Resources/UI/lua_scripts/");

	rp->setResourceGroupDirectory("schemas", "./Data/Resources/UI/xml_schemas/");

	//Initialize resources groups
	CEGUI::Imageset::setDefaultResourceGroup("imagesets");
	CEGUI::Font::setDefaultResourceGroup("fonts");
	CEGUI::Scheme::setDefaultResourceGroup("schemes");
	CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
	CEGUI::WindowManager::setDefaultResourceGroup("layouts");

	CEGUI::XMLParser* parser = CEGUI::System::getSingleton().getXMLParser();
	if (parser->isPropertyPresent("SchemaDefaultResourceGroup"))
		parser->setProperty("SchemaDefaultResourceGroup", "schemas");
}
开发者ID:Mr3lw00d,项目名称:MGD_GAMEPLAY__MDG14,代码行数:24,代码来源:GUISystem.cpp


示例19: init_sdlgui

static void init_sdlgui(char * skin_layout,int fullscreen)
{
	SDL_Surface * screen;
// 	atexit (SDL_Quit);
	SDL_Init (SDL_INIT_VIDEO);
	int videoFlags;
	const SDL_VideoInfo *videoInfo;
	videoInfo = SDL_GetVideoInfo( );

	if ( !videoInfo )
	{
	    fprintf( stderr, "Video query failed: %s\n",
		     SDL_GetError( ) );
	}

	/* the flags to pass to SDL_SetVideoMode */
	videoFlags  = SDL_OPENGL;          /* Enable OpenGL in SDL */
	videoFlags |= SDL_GL_DOUBLEBUFFER; /* Enable double buffering */
	videoFlags |= SDL_HWPALETTE;       /* Store the palette in hardware */
	videoFlags |= SDL_RESIZABLE;       /* Enable window resizing */
	
	/* This checks to see if surfaces can be stored in memory */
	if ( videoInfo->hw_available )
		videoFlags |= SDL_HWSURFACE;
	else
		videoFlags |= SDL_SWSURFACE;
	
	/* This checks if hardware blits can be done */
	if ( videoInfo->blit_hw )
		videoFlags |= SDL_HWACCEL;
	
	/* Sets up OpenGL double buffering */
	SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );

	SDL_WM_SetCaption("NavIt - The OpenSource vector based navigation engine", NULL);

	/* get a SDL surface */
	screen = SDL_SetVideoMode( XRES, YRES, 32,
					videoFlags );

	if (screen == NULL) {
		fprintf (stderr, "Can't set SDL: %s\n", SDL_GetError ());
		exit (1);
	}
	if(fullscreen){
		SDL_WM_ToggleFullScreen(screen);
	}
	SDL_ShowCursor (SDL_ENABLE);
	SDL_EnableUNICODE (1);
	SDL_EnableKeyRepeat (SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);

	init_GL();
	
// 	sdl_audio_init();

	try
	{
		renderer = new CEGUI::OpenGLRenderer(0,XRES,YRES);
		new CEGUI::System(renderer);

		using namespace CEGUI;

		SDL_ShowCursor(SDL_ENABLE);
		SDL_EnableUNICODE(1);
		SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
		
		CEGUI::DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*>
		(System::getSingleton().getResourceProvider());
		

		// FIXME This should maybe move to navit.xml
		static char *datafiles_path[]={
			"./gui/sdl/datafiles",
			"/usr/share/navit/datafiles",
			"/usr/local/share/navit/datafiles",
			NULL,
		};

		char **filename=datafiles_path;

		while (*filename) {	
			if (FILE * file = fopen(*filename, "r"))
			{
				fclose(file);
				break;
			}
			filename++;
		}

		if(*filename==NULL){
			// FIXME Elaborate the possible solutions
			printf("Can't find the datafiles directory for CEGUI files. Navit will probably crash :)\n");
		} else {
			pri 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ cegui::Editbox类代码示例发布时间:2022-05-31
下一篇:
C++ cegui::Combobox类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap