コード例 #1
0
ファイル: Game.cpp プロジェクト: xcasadio/casaengine
bool Game::LoadGamePlayDLL( const char *pFileName_ )
{
	//TODO create release method ??

	m_pGamePlayDLL = NEW_AO DynamicModule(pFileName_);
	return m_pGamePlayDLL != nullptr;
}
コード例 #2
0
ファイル: Scheme.cpp プロジェクト: AjaxWang1989/cegui
/*************************************************************************
    Load all windowset modules specified.and register factories.
*************************************************************************/
void Scheme::loadWindowFactories()
{
    // check factories
    for (UIModuleList::iterator cmod = d_widgetModules.begin();
        cmod != d_widgetModules.end(); ++cmod)
    {
        if (!(*cmod).factoryModule)
        {
#if !defined(CEGUI_STATIC)
            // load dynamic module as required
            if (!(*cmod).dynamicModule)
                (*cmod).dynamicModule = CEGUI_NEW_AO DynamicModule((*cmod).name);

            FactoryModule& (*getWindowFactoryModuleFunc)() =
                reinterpret_cast<FactoryModule&(*)()>(
                    (*cmod).dynamicModule->
                        getSymbolAddress("getWindowFactoryModule"));

            if (!getWindowFactoryModuleFunc)
                CEGUI_THROW(InvalidRequestException(
                    "Required function export "
                    "'FactoryModule& ""getWindowFactoryModule()' "
                    "was not found in module '" + (*cmod).name + "'."));

            // get the WindowRendererModule object for this module.
            (*cmod).factoryModule = &getWindowFactoryModuleFunc();
#else
            (*cmod).factoryModule = &getWindowFactoryModule();
#endif
        }

        // see if we should just register all factories available in the module
        // (i.e. No factories explicitly specified)
        if ((*cmod).types.size() == 0)
        {
            Logger::getSingleton().logEvent("No Window factories "
                                            "specified for module '" +
                                            (*cmod).name + "' - adding all "
                                            "available factories...");
            (*cmod).factoryModule->registerAllFactories();
        }
        // some names were explicitly given, so only register those.
        else
        {
            UIModule::TypeList::const_iterator elem = (*cmod).types.begin();
            for (; elem != (*cmod).types.end(); ++elem)
                (*cmod).factoryModule->registerFactory(*elem);
        }
    }
}