void initialise(Ogre::RenderWindow* _window, Ogre::SceneManager* _scene) { MYGUI_PLATFORM_ASSERT(!mIsInitialise, getClassTypeName() << " initialised twice"); MYGUI_PLATFORM_LOG(Info, "* Initialise: " << getClassTypeName()); mColorBlendMode.blendType = Ogre::LBT_COLOUR; mColorBlendMode.source1 = Ogre::LBS_TEXTURE; mColorBlendMode.source2 = Ogre::LBS_DIFFUSE; mColorBlendMode.operation = Ogre::LBX_MODULATE; mAlphaBlendMode.blendType = Ogre::LBT_ALPHA; mAlphaBlendMode.source1 = Ogre::LBS_TEXTURE; mAlphaBlendMode.source2 = Ogre::LBS_DIFFUSE; mAlphaBlendMode.operation = Ogre::LBX_MODULATE; mTextureAddressMode.u = Ogre::TextureUnitState::TAM_CLAMP; mTextureAddressMode.v = Ogre::TextureUnitState::TAM_CLAMP; mTextureAddressMode.w = Ogre::TextureUnitState::TAM_CLAMP; mSceneManager = nullptr; mWindow = nullptr; mUpdate = false; mRenderSystem = nullptr; mActiveViewport = 0; Ogre::Root* root = Ogre::Root::getSingletonPtr(); if (root != nullptr) setRenderSystem(root->getRenderSystem()); setRenderWindow(_window); setSceneManager(_scene); MYGUI_PLATFORM_LOG(Info, getClassTypeName() << " successfully initialized"); mIsInitialise = true; }
void initialise(Ogre::RenderWindow* _window, Ogre::SceneManager* _scene) { MYGUI_PLATFORM_ASSERT(!mIsInitialise, getClassTypeName() << " initialised twice"); MYGUI_PLATFORM_LOG(Info, "* Initialise: " << getClassTypeName()); mColorBlendMode.blendType = Ogre::LBT_COLOUR; mColorBlendMode.source1 = Ogre::LBS_TEXTURE; mColorBlendMode.source2 = Ogre::LBS_DIFFUSE; mColorBlendMode.operation = Ogre::LBX_MODULATE; mAlphaBlendMode.blendType = Ogre::LBT_ALPHA; mAlphaBlendMode.source1 = Ogre::LBS_TEXTURE; mAlphaBlendMode.source2 = Ogre::LBS_DIFFUSE; mAlphaBlendMode.operation = Ogre::LBX_MODULATE; mTextureAddressMode.u = Ogre::TextureUnitState::TAM_CLAMP; mTextureAddressMode.v = Ogre::TextureUnitState::TAM_CLAMP; mTextureAddressMode.w = Ogre::TextureUnitState::TAM_CLAMP; mSceneManager = nullptr; mWindow = nullptr; mUpdate = false; mRenderSystem = nullptr; mActiveViewport = 0; Ogre::Root* root = Ogre::Root::getSingletonPtr(); if (root != nullptr) setRenderSystem(root->getRenderSystem()); setRenderWindow(_window); setSceneManager(_scene); // ADDED sh::MaterialInstance* mat = sh::Factory::getInstance().getMaterialInstance("MyGUI/NoTexture"); sh::Factory::getInstance()._ensureMaterial("MyGUI/NoTexture", "Default"); mVertexProgramNoTexture = static_cast<sh::OgreMaterial*>(mat->getMaterial())->getOgreTechniqueForConfiguration("Default")->getPass(0) ->getVertexProgram()->_getBindingDelegate(); mat = sh::Factory::getInstance().getMaterialInstance("MyGUI/OneTexture"); sh::Factory::getInstance()._ensureMaterial("MyGUI/OneTexture", "Default"); mVertexProgramOneTexture = static_cast<sh::OgreMaterial*>(mat->getMaterial())->getOgreTechniqueForConfiguration("Default")->getPass(0) ->getVertexProgram()->_getBindingDelegate(); mat = sh::Factory::getInstance().getMaterialInstance("MyGUI/NoTexture"); sh::Factory::getInstance()._ensureMaterial("MyGUI/NoTexture", "Default"); mFragmentProgramNoTexture = static_cast<sh::OgreMaterial*>(mat->getMaterial())->getOgreTechniqueForConfiguration("Default")->getPass(0) ->getFragmentProgram()->_getBindingDelegate(); mat = sh::Factory::getInstance().getMaterialInstance("MyGUI/OneTexture"); sh::Factory::getInstance()._ensureMaterial("MyGUI/OneTexture", "Default"); mFragmentProgramOneTexture = static_cast<sh::OgreMaterial*>(mat->getMaterial())->getOgreTechniqueForConfiguration("Default")->getPass(0) ->getFragmentProgram()->_getBindingDelegate(); MYGUI_PLATFORM_LOG(Info, getClassTypeName() << " successfully initialized"); mIsInitialise = true; }
GridLineFactory::GridLineFactory(Ogre::SceneManager* sceneManager) { mCellCount = mInitialCellCount; mLineList = NULL; mLineID = 0; createMaterials(); setSceneManager(sceneManager); }
//-------------------------------------------------------------- void ofApp::setup() { // ofSetDataPathRoot("../../data/"); sceneManager.add(new ofIntroScene()); sceneManager.add(new of3dLevelScene("level0")); sceneManager.gotoScene("level0"); setSceneManager(&sceneManager); }
void shutdown() { MYGUI_PLATFORM_ASSERT(mIsInitialise, getClassTypeName() << " is not initialised"); MYGUI_PLATFORM_LOG(Info, "* Shutdown: " << getClassTypeName()); destroyAllResources(); setSceneManager(nullptr); setRenderWindow(nullptr); setRenderSystem(nullptr); MYGUI_PLATFORM_LOG(Info, getClassTypeName() << " successfully shutdown"); mIsInitialise = false; }
//-------------------------------------------------------------- void ofApp::setup() { // setup for nice jaggy-less rendering ofSetVerticalSync(true); ofBackground(0, 0, 0); // setup the render size (working area) transformer.setRenderSize(600, 400); // turn on transform origin translation and scaling to screen size, // disable quad warping, and enable aspect ratio and centering when scaling transformer.setTransforms(true, true, false, true, true); // set the ofxApp transformer so it's automatically applied in draw() setTransformer(&transformer); #ifdef HAVE_OFX_GUI // setup transform panel with transformer pointer, // loads settings & quad warper xml files if found panel.setup(&transformer); #endif // load scenes particleScene = (ParticleScene*) sceneManager.add(new ParticleScene()); // save pointer sceneManager.add(new LineScene()); sceneManager.setup(true); // true = setup all the scenes now (not on the fly) ofSetLogLevel("ofxSceneManager", OF_LOG_VERBOSE); // lets see whats going on inside // start with a specific scene // set now to true in order to ignore the scene fade and change now sceneManager.gotoScene("Lines", true); lastScene = sceneManager.getCurrentSceneIndex(); // overlap scenes when transitioning sceneManager.setOverlap(true); // attach scene manager to this ofxApp so it's called automatically, // you can also call the callbacks (update, draw, keyPressed, etc) manually // if you don't set it // // you can also turn off the auto sceneManager update and draw calls with: // setSceneManagerUpdate(false); // setSceneManagerDraw(false); // // the input callbacks in your scenes will be called if they are implemented // setSceneManager(&sceneManager); }
void RTTLayer::deserialization(xml::ElementPtr _node, Version _version) { Base::deserialization(_node, _version); MyGUI::xml::ElementEnumerator propert = _node->getElementEnumerator(); while (propert.next("Property")) { const std::string& key = propert->findAttribute("key"); const std::string& value = propert->findAttribute("value"); if (key == "TextureSize") setTextureSize(utility::parseValue<IntSize>(value)); #ifdef MYGUI_OGRE_PLATFORM else if (key == "Entity") setEntity(value); else if (key == "Material") setMaterial(value); else if (key == "SceneManager") setSceneManager(value); else if (key == "Camera") setCamera(value); #endif } }
StatusIndicatorMenuWindow::StatusIndicatorMenuWindow(QWidget *parent) : MWindow(parent), statusBar(new MStatusBar), menuWidget(NULL) { QDBusConnection bus = QDBusConnection::sessionBus(); bus.registerService(SERVICE_NAME); bus.registerObject(OBJECT_NAME, this, QDBusConnection::ExportScriptableSlots); // Show status bar setSceneManager(new MSceneManager); sceneManager()->appearSceneWindowNow(statusBar); currentLanguage = MLocale().language(); statusBar->setStyleName("StatusIndicatorMenuWindowStatusBar"); // Set the X window type, so that the window does not appear in the switcher and // home screen can provide the correct UI flow setAttribute(Qt::WA_X11NetWmWindowTypeMenu); setTranslucentBackground(true); setWindowTitle("Status Indicator Menu"); setProperty("followsCurrentApplicationWindowOrientation", true); connect(this, SIGNAL(displayEntered()), this, SLOT(displayActive())); connect(this, SIGNAL(displayExited()), this, SLOT(displayInActive())); #ifdef HAVE_QMSYSTEM /* * We need to receive updates when device lock state changes * to prevent status indicator menu opening when device lock is on */ connect (&qmLocks, SIGNAL(stateChanged (MeeGo::QmLocks::Lock, MeeGo::QmLocks::State)), this, SLOT(setWindowStateAccordingToDeviceLockState(MeeGo::QmLocks::Lock, MeeGo::QmLocks::State))); if (qmLocks.getState(MeeGo::QmLocks::Device) != MeeGo::QmLocks::Locked) { deviceLocked = false; } else { deviceLocked = true; } #endif resetMenuWidget(); }
//--------------------------------------------------------------------- bool PagedWorldSection::load(StreamSerialiser& ser) { if (!ser.readChunkBegin(CHUNK_ID, CHUNK_VERSION, "PagedWorldSection")) return false; // Name ser.read(&mName); // AABB ser.read(&mAABB); // SceneManager type String smType, smInstanceName; SceneManager* sm = 0; ser.read(&smType); ser.read(&smInstanceName); Root& root = Root::getSingleton(); if (root.hasSceneManager(smInstanceName)) sm = root.getSceneManager(smInstanceName); else sm = root.createSceneManager(smType, smInstanceName); setSceneManager(sm); // Page Strategy Name String stratname; ser.read(&stratname); setStrategy(stratname); // Page Strategy Data bool strategyDataOk = mStrategyData->load(ser); if (!strategyDataOk) LogManager::getSingleton().stream() << "Error: PageStrategyData for section '" << mName << "' was not loaded correctly, check file contents"; /// Load any data specific to a subtype of this class loadSubtypeData(ser); ser.readChunkEnd(CHUNK_ID); return true; }
//-------------------------------------------------------------- void ofApp::setup() { ofSetColor(200); // setup for nice jaggy-less rendering ofSetVerticalSync(true); ofBackground(0, 0, 0); // load scenes sceneManager.add(new GlitchS1()); sceneManager.setup(true); // true = setup all the scenes now (not on the fly) ofSetLogLevel("ofxSceneManager", OF_LOG_VERBOSE); // lets see whats going on inside // start with a specific scene // set now to true in order to ignore the scene fade and change now sceneManager.gotoScene("GS1", true); lastScene = sceneManager.getCurrentSceneIndex(); // overlap scenes when transitioning sceneManager.setOverlap(true); // attach scene manager to this ofxApp so it's called automatically, // you can also call the callbacks (update, draw, keyPressed, etc) manually // if you don't set it // // you can also turn off the auto sceneManager update and draw calls with: // setSceneManagerUpdate(false); // setSceneManagerDraw(false); // // the input callbacks in your scenes will be called if they are implemented // setSceneManager(&sceneManager); debug = false; }
///-------------------------------------------------------------- void ofApp::setup() { ofSetFrameRate(60); ofSetVerticalSync(true); //ofBackground(ofColor::black); isFullScreen = (DEFAULT_WINDOW_MODE == OF_FULLSCREEN); currentScene = 2; currentSceneName = ""; // Initialize audio analyzer { PMSettingsManagerAudioAnalyzers settingsAA = PMSettingsManagerAudioAnalyzers::getInstance(); PMAudioAnalyzer::getInstance().init( settingsAA.getSilenceThreshold(), settingsAA.getSilenceQueueLength(), settingsAA.getOnsetsThreshold(), settingsAA.getAscDescAnalysisSize()); } // General Settings { #ifdef OF_DEBUG showFPS = PMSettingsManagerGeneral::getInstance().getDebugShowFPS(); #else showFPS = PMSettingsManagerGeneral::getInstance().getReleaseShowFPS(); #endif } // Scenes scene1 = new PMSc1Settings(); sceneManager.add(scene1); scene2 = new PMSc2Start(); sceneManager.add(scene2); scene3 = new PMSc3Song_Choose(); sceneManager.add(scene3); scene4 = new PMSc4Palette_Choose(); sceneManager.add(scene4); scene5 = new PMSc5Brushes_Choose(); sceneManager.add(scene5); scene6 = new PMSc6Kinect_Detect(); sceneManager.add(scene6); scene7 = new PMSc7Countdown(); sceneManager.add(scene7); scene8 = new PMSc8Main(); sceneManager.add(scene8); scene9 = new PMSc9Export(); sceneManager.add(scene9); scene10 = new PMSc10Thanks(); sceneManager.add(scene10); sceneManager.setup(false); sceneManager.setOverlap(true); ofSetLogLevel("ofxSceneManager", OF_LOG_VERBOSE); //lets see whats going on inside setSceneManager(&sceneManager); sceneManager.gotoScene("Scene 1", false); ofAddListener(scene1->goToSceneEvent, this, &ofApp::changeScene); ofAddListener(scene2->goToSceneEvent, this, &ofApp::changeScene); ofAddListener(scene3->goToSceneEvent, this, &ofApp::changeScene); ofAddListener(scene4->goToSceneEvent, this, &ofApp::changeScene); ofAddListener(scene5->goToSceneEvent, this, &ofApp::changeScene); ofAddListener(scene6->goToSceneEvent, this, &ofApp::changeScene); ofAddListener(scene7->goToSceneEvent, this, &ofApp::changeScene); ofAddListener(scene8->goToSceneEvent, this, &ofApp::changeScene); ofAddListener(scene9->goToSceneEvent, this, &ofApp::changeScene); ofAddListener(scene10->goToSceneEvent, this, &ofApp::changeScene); }
//--------------------------------------------------------------------- void PagedWorldSection::setSceneManager(const String& smName) { setSceneManager(Root::getSingleton().getSceneManager(smName)); }