Ejemplo n.º 1
0
/** 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;
}
Ejemplo n.º 2
0
//-------------------------------------------------------------------------------------
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;
}
Ejemplo n.º 3
0
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);
}
Ejemplo n.º 4
0
//-------------------------------------------------------------------------------------
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;
};
Ejemplo n.º 5
0
//-------------------------------------------------------------------------------------
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;
};
Ejemplo n.º 6
0
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;
}
Ejemplo n.º 7
0
//-------------------------------------------------------------------------------------
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;
};
Ejemplo n.º 8
0
//-------------------------------------------------------------------------------------
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;
};
/** 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;
}
Ejemplo n.º 10
0
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;
}
Ejemplo n.º 11
0
//-------------------------------------------------------------------------------------
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;
};
Ejemplo n.º 12
0
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;
}
Ejemplo n.º 13
0
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);
}
Ejemplo n.º 14
0
//------------------------------------------------------------------------------
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;
};
Ejemplo n.º 15
0
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);
}
Ejemplo n.º 16
0
//-------------------------------------------------------------------------------------
bool BaseApplication::setup(void)
{
    Ogre::LogManager * lm = new Ogre::LogManager();
    lm->createLog("Ogre.log", true, false, false);
    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;
};
Ejemplo n.º 17
0
bool Game::setup(){

	mOgreRoot = new Ogre::Root(mOgrePluginsCfg);

	setupResources();

	chooseSceneManager();

	if(!configure())
		return false;

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

	// Create the frame listener
	createFrameListener();

	bulletSetup();

	if(mOnlineMode)
		networkSetup();
	else
		offlineSetup();

	if(mInput->hasOculusRift())
		mGameWindow->setViewMode(OCULUS);
	else
		mGameWindow->setViewMode(SIMPLE);

	return true;

}
Ejemplo n.º 18
0
//-------------------------------------------------------------------------------------
bool BaseApplication::setup(void)
{
    mRoot = new Ogre::Root(Ogre::macBundlePath() + "/Contents/Resources/" + 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;
};
Ejemplo n.º 19
0
bool Application::setup(void)
{
    Ogre::String pluginsPath = mResourcePath + "plugins.cfg";
    mRoot = new Ogre::Root(pluginsPath, mConfigPath + "ogre.cfg", mResourcePath + "Ogre.log");
    setupResources();
    if (!configure())
        return false;

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

    mPlatform = new MyGUI::OgrePlatform();
    mPlatform->initialise(mWindow, mSceneMgr);
    mGUI = new MyGUI::Gui();
    mGUI->initialise("");
    MyGUI::FactoryManager::getInstance().registerFactory<MyGUI::RTTLayer>("Layer");
    MyGUI::ResourceManager::getInstance().load("core.xml");
    
    GuiListener* guiL = new GuiListener(mGUI);
    mInputManager->regKeyboardListener(guiL);
    mInputManager->regMouseListener(guiL);

    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);

    createResourceListener();
    loadResources();
    return true;
}
Ejemplo n.º 20
0
void GraphicsImpl::threadWillStart()
{
	subscribeToFeed("input_keyboard", boost::bind(&GraphicsImpl::handleKeyEvents, this, _1));
	subscribeToFeed("input_mouse", boost::bind(&GraphicsImpl::handleMouseEvents, this, _1));
	subscribeToFeed("world_dynamic", boost::bind(&GraphicsImpl::handleWorldEvents, this, _1));
	subscribeToFeed("create_object", boost::bind(&GraphicsImpl::handleObjectEvents, this, _1));
	subscribeToFeed("create_terrain", boost::bind(&GraphicsImpl::handleTerrainEvents, this, _1));
	subscribeToFeed("world_removed", boost::bind(&GraphicsImpl::handleRemovedObjects, this, _1));

	Dout <<  "Creating root";
	root = new Ogre::Root("", "", resourcePath + "ogre.log");

	Dout << "Loading plugins" ;
	loadPlugins();

	Dout << "Setting Ressources" ;
	setupResources();

	Dout << "Configuring root" ;

	if (!configure()) {
		Derr << "Failed to configure root";
	}


	Dout << "Create Scenemanager" ;

	chooseSceneManager();

	Dout << "Create Camera" ;
	createCamera();

	Dout << "Create Viewport" ;
	createViewports();

	Dout << "Set default MipMap lvl" ;
	Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);

	Dout << "Create resource listeners" ;
	createResourceListener();

	Dout << "Load resources" ;
	loadResources();

	Dout << "Setup GUI";
	setupGUI();

	Dout << "Create Framelistener" ;
	createFrameListener();

	Dout << "Create Basic Scene" ;
	createScene();

	root->clearEventTimes();

	InformationManager::Instance()->offerData("window", this);
}
Ejemplo n.º 21
0
/** Handle a paint event (just render again, if needed create render window)
@param e The event data
*/
void QtSpacescapeWidget::paintEvent(QPaintEvent *) {
	if(!mRenderWindow) {
		createRenderWindow();
		setupResources();
		setupScene();
	}

	update();
}
Ejemplo n.º 22
0
bool 
OgreCarRacing::setup(void)
{

    Ogre::String pluginsPath;
	Ogre::String configPath;
    // only use plugins.cfg if not static
#ifndef OGRE_STATIC_LIB

#if OGRE_DEBUG_MODE == 1 && (OGRE_PLATFORM != OGRE_PLATFORM_APPLE && OGRE_PLATFORM != OGRE_PLATFORM_APPLE_IOS)
	// add _d suffix to config files
	pluginsPath = mResourcePath + "plugins_d.cfg";
	configPath = mResourcePath + "ogre_d.cfg";
#else
	pluginsPath = mResourcePath + "plugins.cfg";
	configPath = mResourcePath + "ogre.cfg";

#endif


#endif
	
    mRoot = new Ogre::Root(pluginsPath, 
        configPath, mResourcePath + "Ogre.log");

    setupResources();

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

    // Create the SceneManager, in this case a generic one
    mSceneMgr = mRoot->createSceneManager(Ogre::ST_GENERIC, "PongSMInstance");
    createCamera();
    createViewports();
	createMiniMapCamera();
	createMiniMapViewports();
    // Set default mipmap level (NB some APIs ignore this)
    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);


	mOverlaySystem = new Ogre::OverlaySystem();
	mSceneMgr->addRenderQueueListener(mOverlaySystem);


    Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
    createScene();


    // When we start the renderer, it will run forever, making callbacks every
    // frame to the frame listeners.  These listeners are where all of the non-
    // rendering work is done.  
    createFrameListener();

    return true;

}
Ejemplo n.º 23
0
	void BaseManager::createGui()
	{
		mPlatform = new MyGUI::OpenGL3Platform();
		mPlatform->initialise(this);

		setupResources();

		mGUI = new MyGUI::Gui();
		mGUI->initialise(mResourceFileName);
	}
Ejemplo n.º 24
0
	void BaseManager::createGui()
	{
		mPlatform = new MyGUI::MyGUI_EFFPlatform();
		mPlatform->initialise(mDevice);

		setupResources();

		mGUI = new MyGUI::Gui();
		mGUI->initialise(mResourceFileName);
	}
Ejemplo n.º 25
0
int X11Grabber::updateScreenDimensions()
{
	const Status status = XGetWindowAttributes(_x11Display, _window, &_windowAttr);
	if (status == 0)
	{
		Error(_log, "Failed to obtain window attributes");
		return -1;
	}

	if (_screenWidth == unsigned(_windowAttr.width) && _screenHeight == unsigned(_windowAttr.height))
	{
		// No update required
		return 0;
	}

	if (_screenWidth || _screenHeight)
	{
		freeResources();
	}

	Info(_log, "Update of screen resolution: [%dx%d]  to [%dx%d]", _screenWidth, _screenHeight, _windowAttr.width, _windowAttr.height);
	_screenWidth  = _windowAttr.width;
	_screenHeight = _windowAttr.height;
	
	// Image scaling is performed by XRender when available, otherwise by ImageResampler
	if (_XRenderAvailable && !_useXGetImage)
	{
		_croppedWidth  =  (_screenWidth > unsigned(_cropLeft + _cropRight))
			? ((_screenWidth - _cropLeft - _cropRight) / _horizontalDecimation)
			: _screenWidth / _horizontalDecimation;
		
		_croppedHeight =  (_screenHeight > unsigned(_cropTop + _cropBottom))
			? ((_screenHeight - _cropTop - _cropBottom) / _verticalDecimation)
			: _screenHeight / _verticalDecimation;
			
		Info(_log, "Using XRender for grabbing");
	}
	else
	{
		_croppedWidth  =  (_screenWidth > unsigned(_cropLeft + _cropRight))
			? (_screenWidth - _cropLeft - _cropRight)
			: _screenWidth;
		
		_croppedHeight =  (_screenHeight > unsigned(_cropTop + _cropBottom))
			? (_screenHeight - _cropTop - _cropBottom)
			: _screenHeight;
			
		Info(_log, "Using XGetImage for grabbing");
	}

	_image.resize(_croppedWidth, _croppedHeight);
	setupResources();

	return 1;
}
Ejemplo n.º 26
0
	void MyGUIRenderClick::createGui()
	{
		mPlatform = new MyGUI::DirectXPlatform();
		mPlatform->initialise(mDevice);

		setupResources();

		mGUI = new MyGUI::Gui();
		mGUI->initialise(mResourceFileName);

	}
Ejemplo n.º 27
0
void BasisManager::createBasisManager(void) // создаем начальную точки каркаса приложения
{
	Ogre::String pluginsPath;
	// only use plugins.cfg if not static
	#ifndef OGRE_STATIC_LIB
		pluginsPath = mResourcePath + "plugins.cfg";
	#endif
	
	mRoot = new Ogre::Root(pluginsPath, mResourcePath + "ogre.cfg", mResourcePath + "Ogre.log");

	setupResources();

	if (!mRoot->restoreConfig()) { // попробуем завестись на дефолтных
		if (!mRoot->showConfigDialog()) return; // ничего не получилось, покажем диалог
	}

	mWindow = mRoot->initialise(true, "MyGUI Layout Editor");
	mWidth = mWindow->getWidth();
	mHeight = mWindow->getHeight();

	mSceneMgr = mRoot->createSceneManager(Ogre::ST_GENERIC, "BasisSceneManager");

	mCamera = mSceneMgr->createCamera("BasisCamera");
	mCamera->setNearClipDistance(5);
	mCamera->setPosition(Ogre::Vector3(200, 200, 200));
	mCamera->lookAt(Ogre::Vector3(0.0, 0.0, 0.0));

	// Create one viewport, entire window
	Ogre::Viewport * vp = mWindow->addViewport(mCamera);
	// Alter the camera aspect ratio to match the viewport
	mCamera->setAspectRatio(Ogre::Real(mWidth) / Ogre::Real(mHeight));

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

	Ogre::Light* mLight = mSceneMgr->createLight("BasisLight");
	mLight->setDiffuseColour(Ogre::ColourValue::White);
	mLight->setSpecularColour(Ogre::ColourValue::White);
	mLight->setAttenuation(8000,1,0.0005,0);

	// Load resources
	Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();

	createInput();

	changeState(&mEditor);

#ifdef WIN32
	g_setMainWindowInfo("MyGUI Layout Editor", IDI_ICON);
#endif

	mRoot->startRendering();
}
Ejemplo n.º 28
0
	void BaseManager::createGui()
	{
		mPlatform = new MyGUI::HGEPlatform();
		mPlatform->initialise(mpHGE);

		setupResources();

		mGUI = new MyGUI::Gui();
		mGUI->initialise(mResourceFileName);

		mInfo = new diagnostic::StatisticInfo();
		mFocusInfo = new diagnostic::InputFocusInfo();
	}
Ejemplo n.º 29
0
OgreView::OgreView(QWidget* parent) : QWidget(parent)
{
	mRenderWindow = NULL;
	mSceneMgr = NULL;
	mVp = NULL;
	widget = parent;
	visible = true;
	mouseLeftPressed = false;
	posX = 0;
	oldX = 0;

	setupResources();
}
Ejemplo n.º 30
0
	void GraphicsManager::initialiseWithSettingsDialog(Ogre::String inWindowTitle) 
	{
		mRootNode = new Ogre::Root(PLUGIN_CONFIG, GRAPHICS_CONFIG);
		mRootNode->showConfigDialog();
		mRootNode->initialise(true, inWindowTitle);
		mRootNode->saveConfig();
		mRenderWindow = mRootNode->getAutoCreatedWindow();
		
		setupResources();
		
		mSceneManager = mRootNode->createSceneManager(Ogre::ST_GENERIC, "DefaultSceneManager");
		
		return;
	}