当前位置: 首页>>代码示例>>C++>>正文


C++ setupResources函数代码示例

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


在下文中一共展示了setupResources函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Root

/** Sets up the application - returns false if the user chooses to abandon configuration. */
bool Renderer::Initialize(void)
{

	String pluginsPath;
	// only use plugins.cfg if not static
#ifndef OGRE_STATIC_LIB
	pluginsPath = mResourcePath + "plugins.cfg";
#endif
	
    m_pRoot = new Root(pluginsPath,mResourcePath + "ogre.cfg", mResourcePath + "Ogre.log");

	// setup default resources from resource paths etc.
    setupResources();

	// calls the configuration dialog box if needed
    bool carryOn = configure();
    if (!carryOn) return false;

	// create the scene manager
    m_pManager = m_pRoot->createSceneManager(ST_GENERIC, "ExampleSMInstance");

	// setup a default camera
    createDefaultCamera();

	// and a viewport
    createViewports();

    // Set default mipmap level (NB some APIs ignore this)
    TextureManager::getSingleton().setDefaultNumMipmaps(5);

	// Load resources
	loadResources();

    return true;
}
开发者ID:mwilksy,项目名称:ogreGame,代码行数:36,代码来源:Renderer.cpp

示例2: setupResources

//-------------------------------------------------------------------------------------
bool BaseApplication::setup(Ogre::String& window_title)
{
#ifdef _DEBUG
    mResourcesCfg = "resources_d.cfg";
    mPluginsCfg = "plugins_d.cfg";
#else
    mResourcesCfg = "resources.cfg";
    mPluginsCfg = "plugins.cfg";
#endif
    
    mRoot = new Ogre::Root(mPluginsCfg);

    setupResources();

    bool carryOn = configure(window_title);
    if (!carryOn) return false;

    chooseSceneManager();

    // Set default mipmap level (NB some APIs ignore this)
    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);

    // Create any resource listeners (for loading screens)
    createResourceListener();
    // Load resources
    loadResources();

    // Create the scene
    createScene();

    createFrameListener();

    return true;
}
开发者ID:Avant-Flux,项目名称:oni,代码行数:35,代码来源:BaseApplication.cpp

示例3: State

GameState::GameState(pyro::StateStack* stack, sf::RenderWindow* window)
	: State(stack, window)
	, camera_(nullptr)
	, blood_splatter_lifetime_(sf::seconds(30.f))
	, crosshair_(nullptr)
	, wave_(0)
	, infected_per_wave_(6)
	, world_bounds_(0.f, 0.f, 2500.f, 2500.f)
{
	window_->setMouseCursorVisible(false);
	
	setupResources();
	projectile_data_     = std::move(data::initializeProjectileData(projectile_textures_));
	survivor_data_       = std::move(data::initializeSurvivorData(survivor_textures_));
	infected_data_       = std::move(data::initializeInfectedData(infected_textures_));
	blood_spray_data_    = std::move(data::initializeBloodSprayData(blood_spray_textures_));
	blood_splatter_data_ = std::move(data::initializeBloodSplatterData(blood_splatter_textures_));

	buildScene();

	auto wave_text(std::make_unique<pyro::Text>());
	wave_text->loadFontFromFile("Assets/Fonts/Waves.ttf");
	wave_text->setOriginFlags(pyro::utils::OriginFlag::Right | pyro::utils::OriginFlag::Top);
	wave_text->setTextColor(sf::Color::White);
	wave_text->activateShadow(true);
	wave_text->setShadowColor(sf::Color::Black);
	wave_text->setShadowOffset(2.f, 2.f);
	wave_text->setPosition(window_->getSize().x - 5.f, 5.f);
	wave_text_ = wave_text.get();
	camera_->attachChild(std::move(wave_text));

	music_player_.setVolume(70.f);
}
开发者ID:OtemPsych,项目名称:Infestation,代码行数:33,代码来源:GameState.cpp

示例4: setupResources

//-------------------------------------------------------------------------------------
bool SystemOgre::ControllerAbstract::setup(void)
{
    mRoot = new Ogre::Root(mPluginsCfg);

    setupResources();

    bool carryOn = configure();
    if (!carryOn) return false;

    chooseSceneManager();
    createCamera();
    createViewports();

    // Set default mipmap level (NB some APIs ignore this)
    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);

    // Create any resource listeners (for loading screens)
    createResourceListener();
    // Load resources
    loadResources();

    // Create the scene
    createScene();

    createFrameListener();

    return true;
};
开发者ID:jeanCarloMachado,项目名称:rpg,代码行数:29,代码来源:ControllerAbstract.cpp

示例5: setupResources

//-------------------------------------------------------------------------------------
bool BaseApplication::setup(void)
{
    mRoot = new Ogre::Root(mPluginsCfg);

    setupResources();

    bool carryOn = configure();
    if (!carryOn) return false;

    chooseSceneManager();
    createCamera();
    createViewports();

    // Set default mipmap level (NB some APIs ignore this)
    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);


    
    // Create background material
    Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().create("Background", "General");
    material->getTechnique(0)->getPass(0)->createTextureUnitState("space.jpg");
    material->getTechnique(0)->getPass(0)->setDepthCheckEnabled(false);
    material->getTechnique(0)->getPass(0)->setDepthWriteEnabled(false);
    material->getTechnique(0)->getPass(0)->setLightingEnabled(false);

    // Create background rectangle covering the whole screen
    rect = new Ogre::Rectangle2D(true);
    rect->setCorners(-1.0, 1.0, 1.0, -1.0);
    rect->setMaterial("Background");
     
    // Render the background before everything else
    rect->setRenderQueueGroup(Ogre::RENDER_QUEUE_BACKGROUND);
     
    // Use infinite AAB to always stay visible
    Ogre::AxisAlignedBox aabInf;
    aabInf.setInfinite();
    rect->setBoundingBox(aabInf);
     
    // Attach background to the scene
    Ogre::SceneNode* node = mSceneMgr->getRootSceneNode()->createChildSceneNode("Background");
    node->attachObject(rect);
     
    // Example of background scrolling
    material->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setScrollAnimation(-0.10, 0.0);
     
    // Don't forget to delete the Rectangle2D in the destructor of your application:

    // Create any resource listeners (for loading screens)
    createResourceListener();
    // Load resources
    loadResources();

    // Create the scene
    createScene();
    

    createFrameListener();

    return true;
};
开发者ID:dcastil1983,项目名称:ProjectFunny,代码行数:61,代码来源:BaseApplication.cpp

示例6: unload

bool Scene::load(const ofBuffer& buffer, bool optimize, Handedness handness, const char* extension) {
	unload();

	unsigned int flags = aiProcessPreset_TargetRealtime_MaxQuality;

	if (optimize) {
		flags |= aiProcess_ImproveCacheLocality | 
				 aiProcess_JoinIdenticalVertices |
				 aiProcess_RemoveRedundantMaterials;
	}

	if (handness == LEFT_HANDED) {
		flags |= aiProcess_ConvertToLeftHanded;
	}

	scene = aiImportFileFromMemory(buffer.getBinaryBuffer(), buffer.size(),
								   flags, extension);
	string err_str = aiGetErrorString();
	if (!err_str.empty())
	{
		ofLogError("ofxAssimp::Scene::load") << err_str;
	}
	assert(scene);
	
	setupResources();
	setupNodes();
	setupAnimations();

	return true;
}
开发者ID:satoruhiga,项目名称:ofxAssimp,代码行数:30,代码来源:Scene.cpp

示例7: configure

//-------------------------------------------------------------------------------------
bool BaseApplication::setup(void)
{
    std::cerr << "mPluginsCfg: " << mPluginsCfg << std::endl;
    mRoot = new Ogre::Root(mPluginsCfg);
    if(mRoot == 0) {
        std::cerr << "Couldn't create root!" << std::endl;
    }

    bool carryOn = configure();
    if (!carryOn) return false;

    chooseSceneManager();
    createCamera();
    createViewports();

    // Set default mipmap level (NB some APIs ignore this)
    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);

    // Create any resource listeners (for loading screens)
    createResourceListener();
    
    // Load resources
    setupResources();
    loadResources();

    // Create the scene
    createScene();

//    createFrameListener();

    return true;
};
开发者ID:heropunch,项目名称:cyberdeck,代码行数:33,代码来源:BaseApplication.cpp

示例8: setupResources

//-------------------------------------------------------------------------------------
bool OgreApplication::setup(void)
{
#ifdef _DEBUG
    mRoot = new Ogre::Root("plugins_d.cfg");
#else
    mRoot = new Ogre::Root();
#endif
    setupResources();

    if (!configure()) return false;

    // Set default mipmap level (NB some APIs ignore this)
    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);

    // Create any resource listeners (for loading screens)
    createResourceListener();
    // Load resources
    loadResources();

    createFrameListener();
	
	mWindow->setDeactivateOnFocusChange(false);
	changeSpace(new SpaceLogin(mRoot, mWindow, mInputManager, mTrayMgr));
    return true;
};
开发者ID:CoolJie2001,项目名称:kbengine,代码行数:26,代码来源:OgreApplication.cpp

示例9: Root

/** Sets up the application - returns false if the user chooses to abandon configuration. */
bool CRtcApplication::setup()
{

    String pluginsPath;
    // only use plugins.cfg if not static
#ifndef OGRE_STATIC_LIB
    pluginsPath = mResourcePath + skPluginsFilename;
#endif

    mpRoot = new Root(pluginsPath, mResourcePath + skOgreConfigFilename, mResourcePath + skOgreLogFilename);

    setupResources();

    if ( !configure() )
    {
        // config failed.
        return false;
    }

    // Set default mipmap level (NB some APIs ignore this)
    TextureManager::getSingleton().setDefaultNumMipmaps(5);

    // Create any resource listeners (for loading screens)
    createResourceListener();
    // Load resources
    loadResources();

    chooseSceneManager();

    // Create the scene
    createScene();

    return true;
}
开发者ID:leandronunescorreia,项目名称:realtimecameras,代码行数:35,代码来源:crtcapplication.cpp

示例10: Root

bool EUClient::setup(void)
{
	mRoot = new Root();
	setupResources();

	bool carryOn = configure();
	if (!carryOn) return false;

	chooseSceneManager();
	createCamera();
	createViewports();

	// Set default mipmap level (NB some APIs ignore this)
	TextureManager::getSingleton().setDefaultNumMipmaps(5);

	// Create any resource listeners (for loading screens)
	createResourceListener();
	// Load resources
	loadResources();

	// Create the scene
	createGUI();
	createScene();

	createFrameListener();

	return true;
}
开发者ID:BackupTheBerlios,项目名称:evouni-svn,代码行数:28,代码来源:EUClient.cpp

示例11: setupResources

//-------------------------------------------------------------------------------------
bool BaseApplication::setup(void)
{
#ifdef _DEBUG
    mRoot = new Ogre::Root("plugins_debug.cfg");
#else
    mRoot = new Ogre::Root();
#endif
    setupResources();

    if (!configure()) return false;

    chooseSceneManager();
    createCamera();
    createViewports();

    // Set default mipmap level (NB some APIs ignore this)
    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);

    // Create any resource listeners (for loading screens)
    createResourceListener();
    // Load resources
    loadResources();

    // Create the scene
    createScene();

    createFrameListener();

    return true;
};
开发者ID:aspiringprogrammer,项目名称:Capstone,代码行数:31,代码来源:BaseApplication.cpp

示例12: setupResources

bool ApplicationBase::setup()
{
	m_Root = OGRE_NEW Ogre::Root(m_PluginsCfg);

	setupResources();

	// RenderSystem setup
	if (!(/*m_Root->restoreConfig() || */m_Root->showConfigDialog()))
	{
		return false;
	}

	// Create a RenderWindow
	m_Window = m_Root->initialise(true, "PhysicsSimulation_Server");

	chooseSceneManager();
	createCamera();
	createViewports();

	// Set default mipmap level, which is related to LOD
	Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);

	loadResources();

	createFrameListener();

	return true;
}
开发者ID:Harbinger1304,项目名称:OgreLab,代码行数:28,代码来源:ApplicationBase.cpp

示例13: setupResources

void RenderPump::initialize()
{
    logManager = new Ogre::LogManager;
    logManager->createLog("tmp.log", true, false, true);
    logManager->getLog("tmp.log")->addListener(new LogListener);
    logManager->getLog("tmp.log")->setLogDetail(Ogre::LL_BOREME);

    root = OGRE_NEW Ogre::Root("plugins_d.cfg", "ogre.cfg", "tmp.log");
    overlaySystem = OGRE_NEW Ogre::OverlaySystem();

    // 为了正确加载天龙八部的骨骼文件
    OGRE_DELETE Ogre::SkeletonManager::getSingletonPtr();
    OGRE_NEW SkeletonManagerEx;

    setupResources();
    loadConfig();
    //if(!mRoot->showConfigDialog())
    //{
    //	OGRE_DELETE mRoot;
    //	mRoot = NULL;
    //}
    if(!root->restoreConfig())
    {
        if(!root->showConfigDialog())
        {
            OGRE_DELETE root;
            root = NULL;
        }
        else
            root->saveConfig();
    }
    root->initialise(false);
}
开发者ID:zhouxs1023,项目名称:Editor,代码行数:33,代码来源:RenderPump.cpp

示例14: setupResources

//------------------------------------------------------------------------------
bool BaseApplication::setup(void)
{
    root = new Ogre::Root(plugins_cfg);

    setupResources();

    bool carryOn = configure();
    if (!carryOn)
        return false;

    chooseSceneManager();
    createCamera();
    createViewports();

    // Set default mipmap level (NB some APIs ignore this)
    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);

    // Create any resource listeners (for loading screens) and load everything
    createResourceListener();
    loadResources();

    // Create the scene
    createScene();

    createFrameListener();

    return true;
};
开发者ID:wilbefast,项目名称:open-war,代码行数:29,代码来源:BaseApplication.cpp

示例15: setupResources

Graph::Graph()
:width(0)
,height(0)

,threshold(0)
,thresholdSmoothing(.999)
,percentile(.98)

,noData(true) 
,lastTrigger(0)
,triggered(false)

,normalized(0)
,normalizedDerivative(0)

,activitySmoothing(.99)
,activity(0)

,downSmoothing(0)
,upSmoothing(0)
,bidirectional(false)
,minRange(0)
,maxRange(0) {
	setupResources();
	setSize(128, 32);
}
开发者ID:ofZach,项目名称:hwTTStoColor,代码行数:26,代码来源:Graph.cpp


注:本文中的setupResources函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。