这篇教程C++ windowResized函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中windowResized函数的典型用法代码示例。如果您正苦于以下问题:C++ windowResized函数的具体用法?C++ windowResized怎么用?C++ windowResized使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了windowResized函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: m_WindowFrameListenerBase::FrameListenerBase(Ogre::RenderWindow* rw, Ogre::Camera* camera) : m_Window(rw), m_Camera(camera){ // Initialize OIS(Object-oriented Input System) Ogre::LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***"); OIS::ParamList pl; size_t windowHnd = 0; std::ostringstream windowHndStr; m_Window->getCustomAttribute("WINDOW", &windowHnd); windowHndStr << windowHnd; pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str())); m_InputManager = OIS::InputManager::createInputSystem(pl); // Buffered input m_Keyboard = static_cast<OIS::Keyboard*>(m_InputManager->createInputObject(OIS::OISKeyboard, true)); m_Mouse = static_cast<OIS::Mouse*>(m_InputManager->createInputObject(OIS::OISMouse, true)); m_Keyboard->setEventCallback(this); m_Mouse->setEventCallback(this); // Set initial mouse clipping state windowResized(m_Window); // Register as a WindowEventListener Ogre::WindowEventUtilities::addWindowEventListener(m_Window, this);}
开发者ID:Harbinger1304,项目名称:OgreLab,代码行数:29,
示例2: windowResizedvoid TutorialApplication::createFrameListener(void){ Ogre::LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***"); OIS::ParamList pl; size_t windowHnd = 0; std::ostringstream windowHndStr; mWindow->getCustomAttribute("WINDOW", &windowHnd); windowHndStr << windowHnd; pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str())); mInputManager = OIS::InputManager::createInputSystem( pl ); mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, true )); mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, true )); mMouse->setEventCallback(this); mKeyboard->setEventCallback(this); //Set initial mouse clipping size windowResized(mWindow); //Register as a Window listener Ogre::WindowEventUtilities::addWindowEventListener(mWindow, this); mRoot->addFrameListener(this);}
开发者ID:BaeSangRyol,项目名称:ogre-basic-tutorial8,代码行数:27,
示例3: windowResizedvoid OISManager::initialize() { Ogre::LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***"); OIS::ParamList pl; size_t windowHnd = 0; std::ostringstream windowHndStr; Client::getInstance().getOgreManager().getWindow()->getCustomAttribute("WINDOW", &windowHnd); windowHndStr << windowHnd; pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str())); pl.insert(std::make_pair(std::string("x11_mouse_grab"), std::string("false"))); pl.insert(std::make_pair(std::string("x11_mouse_hide"), std::string("false"))); pl.insert(std::make_pair(std::string("x11_keyboard_grab"), std::string("false"))); pl.insert(std::make_pair(std::string("XAutoRepeatOn"), std::string("true"))); inputManager = OIS::InputManager::createInputSystem( pl ); keyboard = static_cast<OIS::Keyboard*>(inputManager->createInputObject( OIS::OISKeyboard, true )); mouse = static_cast<OIS::Mouse*>(inputManager->createInputObject( OIS::OISMouse, true )); mouse->setEventCallback(this); keyboard->setEventCallback(this); // unsigned int width, height, depth; // int left, top; // Client::getInstance().getOgreManager().getWindow()->getMetrics(width, height, depth, left, top); windowResized( Client::getInstance().getOgreManager().getWindow()); Ogre::WindowEventUtilities::addWindowEventListener( Client::getInstance().getOgreManager().getWindow(), this); DEBUG("!!!!!!!!!!! OIS INITIATE DONE !!!!!!!!!!!");}
开发者ID:andrewjchen,项目名称:courtIchiro,代码行数:34,
示例4: windowResizedvoid TutorialApplication::initInput(){ Ogre::LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***"); OIS::ParamList pl; size_t windowHnd = 0; std::ostringstream windowHndStr; mWindow->getCustomAttribute("WINDOW", &windowHnd); windowHndStr << windowHnd; pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str())); pl.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_FOREGROUND" ))); pl.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_NONEXCLUSIVE"))); pl.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_FOREGROUND"))); pl.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_NONEXCLUSIVE"))); mInputManager = OIS::InputManager::createInputSystem( pl ); mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, true )); mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, true )); mMouse->setEventCallback(this);mKeyboard->setEventCallback(this); //Set initial mouse clipping size windowResized(mWindow);}
开发者ID:Sisky,项目名称:Game-Programming-Assignment-3,代码行数:27,
示例5: windowResizedvoid GameCore::initializeEventListeners(){ //compiled from ogre framework OIS::ParamList pl; size_t windowHnd = 0; std::ostringstream windowHndStr; renderWindow->getCustomAttribute("WINDOW", &windowHnd); windowHndStr << windowHnd; pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str())); pl.insert(std::make_pair(std::string("XAutoRepeatOn"), std::string("true"))); inputManager = OIS::InputManager::createInputSystem( pl ); keyboard = static_cast<OIS::Keyboard*>(inputManager->createInputObject( OISKeyboard, true )); mouse = static_cast<OIS::Mouse*>(inputManager->createInputObject( OISMouse, true )); mouse->setEventCallback(this); keyboard->setEventCallback(this); windowResized(renderWindow); Ogre::WindowEventUtilities::addWindowEventListener(renderWindow, this);}
开发者ID:asekerefe,项目名称:TeamTwo,代码行数:30,
示例6: whilevoid ApplicationContext::pollEvents(){#if OGRE_BITES_HAVE_SDL if(!mSDLWindow) { // SDL events not initialized return; } SDL_Event event; while (SDL_PollEvent(&event)) { switch (event.type) { case SDL_QUIT: mRoot->queueEndRendering(); break; case SDL_WINDOWEVENT: if(event.window.event == SDL_WINDOWEVENT_RESIZED) { mWindow->resize(event.window.data1, event.window.data2); windowResized(mWindow); } break; default: _fireInputEvent(event); break; } }#endif}
开发者ID:wjwwood,项目名称:ogre,代码行数:30,
示例7: m_WindowGameFrameListener::GameFrameListener( Ogre::RenderWindow* win ): m_Window( win ), m_InputManager( 0 ), m_Keyboard( 0 ){ OIS::ParamList pl; size_t windowHnd = 0; std::ostringstream windowHndStr; win->getCustomAttribute( "WINDOW", &windowHnd ); windowHndStr << windowHnd; pl.insert( std::make_pair( std::string( "WINDOW" ), windowHndStr.str() ) );#if defined __WIN32__ pl.insert( std::make_pair( std::string( "w32_mouse" ), std::string( "DISCL_FOREGROUND" ) ) ); pl.insert( std::make_pair( std::string( "w32_mouse" ), std::string( "DISCL_NONEXCLUSIVE" ) ) );#else pl.insert( std::make_pair( std::string( "x11_mouse_grab" ), std::string( "false" ) ) ); pl.insert( std::make_pair( std::string( "x11_mouse_hide" ), std::string( "false" ) ) );#endif m_InputManager = OIS::InputManager::createInputSystem( pl ); m_Keyboard = static_cast< OIS::Keyboard* >( m_InputManager->createInputObject( OIS::OISKeyboard, true ) ); m_Keyboard->setEventCallback( this ); m_Mouse = static_cast< OIS::Mouse* >( m_InputManager->createInputObject( OIS::OISMouse, true ) ); m_Mouse->setEventCallback( this ); windowResized( m_Window ); //Register as a Window listener Ogre::WindowEventUtilities::addWindowEventListener( m_Window, this );}
开发者ID:DeejStar,项目名称:q-gears,代码行数:34,
示例8: windowResizedvoid Game::InitializeOIS(bool useBufferedInput){ //Set up logger Ogre::LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***"); //Initialize OIS OIS::ParamList pl; size_t windowHnd = 0; std::ostringstream windowHndStr; mWindow->getCustomAttribute("WINDOW", &windowHnd); windowHndStr << windowHnd; pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str())); pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str())); pl.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_FOREGROUND" ))); pl.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_NONEXCLUSIVE"))); pl.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_FOREGROUND"))); pl.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_NONEXCLUSIVE"))); mInputManager = OIS::InputManager::createInputSystem( pl ); mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, useBufferedInput )); mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, useBufferedInput )); mKeyboard->setEventCallback(InputNotifier::GetInstance()); mMouse->setEventCallback(InputNotifier::GetInstance()); //Set initial mouse clipping size windowResized(mWindow);}
开发者ID:VagabondOfHell,项目名称:ProBending,代码行数:31,
示例9: windowResized bool Input::Start(Ogre::RenderWindow * win, bool exclusive) { window = win; OIS::ParamList pl; size_t windowHnd=0; std::ostringstream windowHndStr; window->getCustomAttribute("WINDOW", &windowHnd); windowHndStr << windowHnd; pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str())); if(!exclusive) { pl.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_FOREGROUND" ))); pl.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_NONEXCLUSIVE"))); } manager = OIS::InputManager::createInputSystem(pl); keyboard = static_cast<OIS::Keyboard*>(manager->createInputObject(OIS::OISKeyboard, true)); mouse = static_cast<OIS::Mouse*>(manager->createInputObject(OIS::OISMouse, true)); keyboard->setBuffered(true); mouse->setBuffered(true); keyboard->setEventCallback(this); mouse->setEventCallback(this); Ogre::WindowEventUtilities::addWindowEventListener(window, this); windowResized(window); running = true; return true; }
开发者ID:Takmo,项目名称:Breezy,代码行数:26,
示例10: windowResizedvoid Client::InitializeWindow() { Ogre::LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***"); OIS::ParamList pl; size_t windowHnd = 0; std::ostringstream windowHndStr; mWindow->getCustomAttribute("WINDOW", &windowHnd); windowHndStr << windowHnd; pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));#ifdef DEBUG pl.insert(std::make_pair(std::string("x11_mouse_grab"), std::string("false"))); pl.insert(std::make_pair(std::string("x11_keyboard_grab"), std::string("false")));#endif mInputManager = OIS::InputManager::createInputSystem( pl ); mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, true )); mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, true )); // Register for callback mKeyboard->setEventCallback(this); mMouse->setEventCallback(this); //mMouse->setBuffered(true); // Set initial mouse clipping size windowResized(mWindow); // Register as a Window listener Ogre::WindowEventUtilities::addWindowEventListener(mWindow, this); // Register as Frame Listener mOgreRoot->addFrameListener(this);}
开发者ID:opatut,项目名称:chars,代码行数:33,
示例11: windowResized// Add this class as a frame listener to react on different input.void InputHandler::createFrameListener(void) { Ogre::LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***"); OIS::ParamList pl; size_t windowHnd = 0; std::ostringstream windowHndStr; mWindow->getCustomAttribute("WINDOW", &windowHnd); windowHndStr << windowHnd; pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str())); mInputManager = OIS::InputManager::createInputSystem( pl ); mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, true )); mKeyboard->setEventCallback(this); mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, true )); mMouse->setEventCallback(this); //Set initial mouse clipping size windowResized(mWindow); //Register as a Window listener Ogre::WindowEventUtilities::addWindowEventListener(mWindow, this); const OIS::MouseState &mouseState = mMouse->getMouseState(); // mMouse is type of OIS::Mouse* mouseState.width = mWindow->getWidth(); // your rendering area width mouseState.height = mWindow->getHeight(); // your rendering area height}
开发者ID:hundben,项目名称:simeng-g4,代码行数:29,
示例12: windowResizedvoid Game::setResolution(sf::Vector2u size){ if (fullscreen) window.create(sf::VideoMode(size.x, size.y), title, sf::Style::Close | sf::Style::Titlebar | sf::Style::Fullscreen); else window.create(sf::VideoMode(size.x, size.y), title, sf::Style::Close | sf::Style::Titlebar); windowResized(size);}
开发者ID:Julzso23,项目名称:upwards-journey-2,代码行数:8,
示例13: windowResized//-------------------------------------------------------------------------------------void BaseApplication::createFrameListener(void){ Ogre::LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***"); OIS::ParamList pl; size_t windowHnd = 0; std::ostringstream windowHndStr; mWindow->getCustomAttribute("WINDOW", &windowHnd); windowHndStr << windowHnd; pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str())); mInputManager = OIS::InputManager::createInputSystem( pl ); mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, true )); mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, true )); mMouse->setEventCallback(this); mKeyboard->setEventCallback(this); //Set initial mouse clipping size windowResized(mWindow); //Register as a Window listener Ogre::WindowEventUtilities::addWindowEventListener(mWindow, this); OgreBites::InputContext input; input.mAccelerometer = NULL; input.mKeyboard = mKeyboard; input.mMouse = mMouse; input.mMultiTouch = NULL; mTrayMgr = new OgreBites::SdkTrayManager(Ogre::String("InterfaceName"), mWindow, input, this); mTrayMgr->showFrameStats(OgreBites::TL_BOTTOMLEFT); mTrayMgr->showLogo(OgreBites::TL_BOTTOMRIGHT); mTrayMgr->hideCursor(); // create a params panel for displaying sample details Ogre::StringVector items; items.push_back("cam.pX"); items.push_back("cam.pY"); items.push_back("cam.pZ"); items.push_back(""); items.push_back("cam.oW"); items.push_back("cam.oX"); items.push_back("cam.oY"); items.push_back("cam.oZ"); items.push_back(""); items.push_back("Filtering"); items.push_back("Poly Mode"); mDetailsPanel = mTrayMgr->createParamsPanel(OgreBites::TL_NONE, "DetailsPanel", 200, items); mDetailsPanel->setParamValue(9, "Bilinear"); mDetailsPanel->setParamValue(10, "Solid"); mDetailsPanel->hide(); mRoot->addFrameListener(this);}
开发者ID:heropunch,项目名称:cyberdeck,代码行数:58,
示例14: windowResizedvoid ApplicationContextAndroid::pollEvents(){ for(WindowList::iterator it = mWindows.begin(); it != mWindows.end(); ++it) { Ogre::RenderWindow* win = it->render; win->windowMovedOrResized(); windowResized(win); }}
开发者ID:yiliu1203,项目名称:OGRE,代码行数:9,
示例15: MYGUI_ASSERT void Gui::setActiveViewport(Ogre::ushort _num) { if (_num == mActiveViewport) return; MYGUI_ASSERT(mWindow, "Gui is not initialised."); MYGUI_ASSERT(mWindow->getNumViewports() >= _num, "index out of range"); mActiveViewport = _num; // рассылка обновлений windowResized(mWindow); }
开发者ID:twktheainur,项目名称:vortex-ee,代码行数:9,
示例16: switchvoid SDL_Event_Handler::windowEvent(const SDL_Event *event) { switch (event->window.event) { case SDL_WINDOWEVENT_SHOWN: //windowShown(event); break; case SDL_WINDOWEVENT_HIDDEN: //windowHidden(event); break; case SDL_WINDOWEVENT_EXPOSED: //windowExposed(event); break; case SDL_WINDOWEVENT_MOVED: //windowMoved(event); break; case SDL_WINDOWEVENT_RESIZED: windowResized(event); break; case SDL_WINDOWEVENT_SIZE_CHANGED: break; // will trigger above event too case SDL_WINDOWEVENT_MINIMIZED: //windowMinimized(event); break; case SDL_WINDOWEVENT_MAXIMIZED: //windowMaximized(event); break; case SDL_WINDOWEVENT_RESTORED: //windowRestored(event); break; case SDL_WINDOWEVENT_ENTER: //windowEntered(event); break; case SDL_WINDOWEVENT_LEAVE: //windowLeave(event); break; case SDL_WINDOWEVENT_FOCUS_GAINED: windowFocusGain(event); break; case SDL_WINDOWEVENT_FOCUS_LOST: windowFocusLost(event); break; case SDL_WINDOWEVENT_CLOSE: //windowClose(event); break;#if SDL_VERSION_ATLEAST(2, 0, 5) case SDL_WINDOWEVENT_TAKE_FOCUS: //windowTakeFocus(event); break; case SDL_WINDOWEVENT_HIT_TEST: //windowHitTest(event); break;#endif default: //unkownEvent(event); break; }}
开发者ID:enigma-dev,项目名称:enigma-dev,代码行数:56,
示例17: ofSetFrameRate//--------------------------------------------------------------void testApp::setup() { for(int i=0; i<strlen(sz); i++) sz[i] += 20; // setup fluid stuff fluidSolver.setup(100, 100); fluidSolver.enableRGB(true).setFadeSpeed(0.002).setDeltaT(0.5).setVisc(0.00015).setColorDiffusion(0); fluidDrawer.setup(&fluidSolver); fluidCellsX = 150; drawFluid = true; drawParticles = true; ofSetFrameRate(60); ofBackground(0, 0, 0); ofSetVerticalSync(false); #ifdef USE_TUIO tuioClient.start(3333);#endif #ifdef USE_GUI gui.addSlider("fluidCellsX", fluidCellsX, 20, 400); gui.addButton("resizeFluid", resizeFluid); gui.addSlider("colorMult", colorMult, 0, 100); gui.addSlider("velocityMult", velocityMult, 0, 100); gui.addSlider("fs.viscocity", fluidSolver.viscocity, 0.0, 0.01); gui.addSlider("fs.colorDiffusion", fluidSolver.colorDiffusion, 0.0, 0.0003); gui.addSlider("fs.fadeSpeed", fluidSolver.fadeSpeed, 0.0, 0.1); gui.addSlider("fs.solverIterations", fluidSolver.solverIterations, 1, 50); gui.addSlider("fs.deltaT", fluidSolver.deltaT, 0.1, 5);// gui.addComboBox("fd.drawMode", (int&)fluidDrawer.drawMode, msa::fluid::getDrawModeTitles()); gui.addToggle("fs.doRGB", fluidSolver.doRGB); gui.addToggle("fs.doVorticityConfinement", fluidSolver.doVorticityConfinement); gui.addToggle("drawFluid", drawFluid); gui.addToggle("drawParticles", drawParticles); gui.addToggle("fs.wrapX", fluidSolver.wrap_x); gui.addToggle("fs.wrapY", fluidSolver.wrap_y); gui.currentPage().setXMLName("ofxMSAFluidSettings.xml"); gui.loadFromXML(); gui.setDefaultKeys(true); gui.setAutoSave(true); gui.show();#endif windowResized(ofGetWidth(), ofGetHeight()); // force this at start (cos I don't think it is called) pMouse = msa::getWindowCenter(); resizeFluid = true; ofEnableAlphaBlending(); ofSetBackgroundAuto(false);}
开发者ID:oherterich,项目名称:NWS_violins,代码行数:54,
示例18: windowResizedvoid BaseApplication::createFrameListener(void){ mMouse->setEventCallback(this); mKeyboard->setEventCallback(this); //Set initial mouse clipping size windowResized(mWindow); //Register as a Window listener Ogre::WindowEventUtilities::addWindowEventListener(mWindow, this); mRoot->addFrameListener(this);}
开发者ID:vladotrocol,项目名称:Bubbles,代码行数:12,
示例19: ofSetLogLevel//--------------------------------------------------------------void fluid001::setup() { ofSetLogLevel(OF_LOG_VERBOSE); for(int i=0; i<strlen(sz); i++) { sz[i] = sz[i] + 20; } printf("%s/n", sz); // setup fluid stuff fluidSolver.setup(100, 100); fluidSolver.enableRGB(true).setFadeSpeed(0.002).setDeltaT(0.5).setVisc(0.00015).setColorDiffusion(0); fluidDrawer.setup(&fluidSolver); fluidCellsX = 150; drawFluid = true; drawParticles = true; renderUsingVA = true; ofBackground(0, 0, 0); ofSetVerticalSync(false);// ofSetFrameRate(60); #ifdef USE_TUIO tuioClient.start(3333);#endif #ifdef USE_GUI gui.addSlider("fluidCellsX", fluidCellsX, 20, 400); gui.addButton("resizeFluid", resizeFluid); gui.addSlider("fs.viscocity", fluidSolver.viscocity, 0.0, 1, 0.5); gui.addSlider("fs.colorDiffusion", fluidSolver.colorDiffusion, 0.0, 0.0003, 0.5); gui.addSlider("fs.fadeSpeed", fluidSolver.fadeSpeed, 0.0, 0.1, 0.5); gui.addSlider("fs.solverIterations", fluidSolver.solverIterations, 1, 50); gui.addSlider("fs.deltaT", fluidSolver.deltaT, 0.1, 5); gui.addSlider("fd.drawMode", fluidDrawer.drawMode, 0, FLUID_DRAW_MODE_COUNT-1); gui.addToggle("fs.doRGB", fluidSolver.doRGB); gui.addToggle("fs.doVorticityConfinement", fluidSolver.doVorticityConfinement); gui.addToggle("drawFluid", drawFluid); gui.addToggle("drawParticles", drawParticles); gui.addToggle("renderUsingVA", renderUsingVA); gui.addToggle("fs.wrapX", fluidSolver.wrap_x); gui.addToggle("fs.wrapY", fluidSolver.wrap_y); gui.addSlider("velocityMult", velocityMult, 0.0, 1); gui.setAutoSave(true); gui.loadFromXML(); #endif windowResized(ofGetWidth(), ofGetHeight()); // force this at start (cos I don't think it is called) resizeFluid = true;}
开发者ID:mazbox,项目名称:TukeSprint,代码行数:54,
示例20: ofSetVerticalSync//--------------------------------------------------------------void ofApp::setup(){ showInfo = false; dropped = 0; changed = false; clearFbos = false; lastMouseMoved = 0; exporting = 0; applicationRunning = false; ofSetVerticalSync(true); ofBackground(0); ofSetBackgroundAuto(false); // shaderLoader handles this for us// shader.setGeometryInputType(GL_LINES);// shader.setGeometryOutputType(GL_QUADS);// shader.setGeometryOutputCount(4); shaderLoader.setup(&shader, "shaders/osci"); vector<RtAudio::DeviceInfo> devices = listRtSoundDevices(); ofSetFrameRate(60); root = new mui::Root(); globals.loadFromFile(); globals.player.loadSound( "konichiwa.wav" ); globals.player.setLoop(true); globals.player.stop(); configView = new ConfigView(); configView->fromGlobals(); if( globals.autoDetect ){ configView->autoDetect(); } root->add( configView ); osciView = new OsciView(); osciView->visible = false; root->add( osciView ); left.loop = false; right.loop = false; if( globals.autoDetect ){ startApplication(); } windowResized(ofGetWidth(), ofGetHeight());}
开发者ID:anwar-hegazy,项目名称:Oscilloscope,代码行数:53,
示例21: setActiveViewport void setActiveViewport(unsigned short _num) { mActiveViewport = _num; if (mWindow != nullptr) { Ogre::WindowEventUtilities::removeWindowEventListener(mWindow, this); Ogre::WindowEventUtilities::addWindowEventListener(mWindow, this); // рассылка обновлений windowResized(mWindow); } }
开发者ID:jhooks1,项目名称:openmw,代码行数:13,
示例22: graphicExceptionbool Application::init(const std::string &host, int port){ _plugins = "plugins.cfg"; _ressources = "resources.cfg"; Factory::init(); Factory::Client::init(); if (!(_root = new Ogre::Root(_plugins))) throw graphicException("fail init root"); this->loadResources(); if (!(_root->restoreConfig() || _root->showConfigDialog())) return false; if (!(_window = _root->initialise(true, "Hexatyla"))) throw graphicException("can't initialise window renderer"); if (!_fontmanager) _fontmanager = new Ogre::FontManager(); if (!(_overlaySystem = new Ogre::OverlaySystem())) throw graphicException("Failed to instanciate OverlaySystem"); Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5); Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); this->initInput(); this->initScene(); windowResized(_window); this->initOverlaySceneManager(); bool pb = false; Kernel::Manager::getInstance()->init(); try { Network::Manager::Client::getInstance()->init(host, port); } catch (Network::Exception *e) { Logger::getInstance()->log(e->what(), Logger::FATAL); delete (e); pb = true; } if (pb == false) { this->_thNetwork->start(&start_network_manager, Network::Manager::Client::getInstance()); } return true;}
开发者ID:Hexatyla,项目名称:Client,代码行数:51,
示例23: __android_handle_cmd//callbackextern void __android_handle_cmd(struct android_app* app, int32_t cmd) { switch(cmd){ case APP_CMD_INIT_WINDOW: setIsAndroidValidDevice(true); if(initAndroid) initAndroid(app->userData); break; case APP_CMD_TERM_WINDOW: if(termAndroid) termAndroid(app->userData); break; case APP_CMD_PAUSE: setIsAndroidValidDevice(false); if(pauseAndroid) pauseAndroid(app->userData); break; case APP_CMD_WINDOW_RESIZED: if(windowResized){ int32_t width = ANativeWindow_getWidth(getAndroidApp()->window); int32_t height = ANativeWindow_getHeight(getAndroidApp()->window); windowResized(app->userData,(int)width,(int)height); } break; case APP_CMD_RESUME: if(resumeAndroid) resumeAndroid(app->userData); break; case APP_CMD_CONFIG_CHANGED: if(configChange) configChange(app->userData); break; case APP_CMD_SAVE_STATE: if(saveStateAndroid) saveStateAndroid(app->userData); break; case APP_CMD_GAINED_FOCUS: setEnableAccelerometer((1000L/60)*1000); if(getFocusAndroid) getFocusAndroid(app->userData); break; case APP_CMD_LOST_FOCUS: setDisableAccelerometer(); if(lostFocusAndroid) lostFocusAndroid(app->userData); break; default:break; } }
开发者ID:Gabriele91,项目名称:Easy2D,代码行数:50,
示例24: setupResourcesbool BareOgre::go(void) { mLog = new Ogre::LogManager; mLog->createLog("Ogre.log");#ifdef _DEBUG mResourcesCfg = "resources_d.cfg"; mPluginsCfg = "plugins_d.cfg";#else mResourcesCfg = "resources.cfg"; mPluginsCfg = "plugins.cfg";#endif mRoot = new Ogre::Root(mPluginsCfg); // Load resource paths from resources config file. setupResources(); // Configure dialog. if (!( mRoot->restoreConfig() || mRoot->showConfigDialog() )) { return false; } // Create RenderWindow. mWindow = mRoot->initialise(true, "BareOgre Render Window"); // Set default mipmap level. Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5); // Initialize all resource groups. Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); // Create scene. createScene(); // Initialize input. (OIS) initInput(); // Set initial mouse clipping size. windowResized(mWindow); // Register as a Window listener. Ogre::WindowEventUtilities::addWindowEventListener(mWindow, this); // Render loop. mRoot->addFrameListener(this); mRoot->startRendering(); return true;}
开发者ID:DreamPhage,项目名称:OgreVox,代码行数:49,
示例25: setRenderWindow void setRenderWindow(Ogre::RenderWindow* _window) { // отписываемся if (mWindow != nullptr) { Ogre::WindowEventUtilities::removeWindowEventListener(mWindow, this); mWindow = nullptr; } mWindow = _window; if (mWindow != nullptr) { Ogre::WindowEventUtilities::addWindowEventListener(mWindow, this); windowResized(mWindow); } }
开发者ID:jhooks1,项目名称:openmw,代码行数:17,
示例26: windowResized//-------------------------------------------------------------------------------------void BaseApplication::createFrameListener(void){ Ogre::LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***"); OIS::ParamList pl; size_t windowHnd = 0; std::ostringstream windowHndStr; mWindow->getCustomAttribute("WINDOW", &windowHnd); windowHndStr << windowHnd; pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str())); mInputManager = OIS::InputManager::createInputSystem( pl ); mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, true )); mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, true )); mMouse->setEventCallback(this); mKeyboard->setEventCallback(this); //Set initial mouse clipping size windowResized(mWindow); //Register as a Window listener Ogre::WindowEventUtilities::addWindowEventListener(mWindow, this); mInputContext.mKeyboard = mKeyboard; mInputContext.mMouse = mMouse; mTrayMgr = new OgreBites::SdkTrayManager("InterfaceName", mWindow, mInputContext, this); mTrayMgr->showFrameStats(OgreBites::TL_BOTTOMLEFT); mTrayMgr->showLogo(OgreBites::TL_BOTTOMRIGHT); //mTrayMgr->hideCursor(); // create a params panel for displaying sample details Ogre::StringVector items; items.push_back("ID : "); items.push_back("HP :"); items.push_back("STATE :"); items.push_back("KILLS : "); items.push_back("DEATHS : "); items.push_back("POWERUP : "); mDetailsPanel = mTrayMgr->createParamsPanel(OgreBites::TL_NONE, "DetailsPanel", 200, items); mDetailsPanel->hide(); mRoot->addFrameListener(this);}
开发者ID:erlendtv,项目名称:TankOnTerrain,代码行数:47,
示例27: windowResized//-------------------------------------------------------------------------------------void BaseApplication::createFrameListener(void){ size_t windowHnd = 0; std::stringstream windowHndStr; mWindow->getCustomAttribute("WINDOW", &windowHnd); windowHndStr << windowHnd; //Set initial mouse clipping size windowResized(mWindow); //Register as a Window listener WindowEventUtilities::addWindowEventListener(mWindow, this); OgreBites::InputContext input; //input.mMouse = mMouse; mTrayMgr = new OgreBites::SdkTrayManager("InterfaceName", mWindow, input, this); mTrayMgr->showFrameStats(OgreBites::TL_BOTTOMLEFT); mTrayMgr->showLogo(OgreBites::TL_BOTTOMRIGHT); mTrayMgr->hideCursor(); // create a params panel for displaying sample details StringVector items; items.push_back("cam.pX"); items.push_back("cam.pY"); items.push_back("cam.pZ"); items.push_back(""); items.push_back("cam.oW"); items.push_back("cam.oX"); items.push_back("cam.oY"); items.push_back("cam.oZ"); items.push_back(""); items.push_back("Filtering"); items.push_back("Poly Mode"); mDetailsPanel = mTrayMgr->createParamsPanel(OgreBites::TL_NONE, "DetailsPanel", 200, items); mDetailsPanel->setParamValue(9, "Bilinear"); mDetailsPanel->setParamValue(10, "Solid"); mDetailsPanel->hide(); mRoot->addFrameListener(this);}
开发者ID:drwbns,项目名称:1stperson-remake2,代码行数:47,
示例28: logMessagevoid application::create_frame_listener(){ Ogre::LogManager::getSingletonPtr() -> logMessage("Initializing OIS"); OIS::ParamList pl; size_t wndhnd = 0; std::ostringstream wndhndstr; wnd->getCustomAttribute ("WINDOW", &wndhnd); wndhndstr << wndhnd; pl.insert (std::make_pair (std::string {"WINDOW"}, wndhndstr.str())); input = OIS::InputManager::createInputSystem(pl); kbd = static_cast<OIS::Keyboard*> (input->createInputObject (OIS::OISKeyboard, true)); mouse = static_cast<OIS::Mouse*> (input->createInputObject (OIS::OISMouse, true)); mouse -> setEventCallback(this); kbd -> setEventCallback(this); windowResized(wnd); Ogre::WindowEventUtilities::addWindowEventListener (wnd, this); OgreBites::InputContext inctx; inctx.mMouse = mouse; inctx.mKeyboard = kbd; tray_mgr = new OgreBites::SdkTrayManager ("InterfaceName", wnd, inctx, this); tray_mgr->showFrameStats(OgreBites::TL_BOTTOMLEFT); tray_mgr->showLogo(OgreBites::TL_BOTTOMRIGHT); tray_mgr->hideCursor(); Ogre::StringVector items; items.push_back("cam.pX"); items.push_back("cam.pY"); items.push_back("cam.pZ"); items.push_back(""); items.push_back("cam.oW"); items.push_back("cam.oX"); items.push_back("cam.oY"); items.push_back("cam.oZ"); items.push_back(""); items.push_back("Filtering"); items.push_back("Poly Mode"); root->addFrameListener(this);}
开发者ID:vcu-cmsc451-1,项目名称:Senior-Design-Project,代码行数:46,
示例29: whilevoid ApplicationContextSDL::pollEvents(){ if(mWindows.empty()) { // SDL events not initialized return; } SDL_Event event; while (SDL_PollEvent(&event)) { switch (event.type) { case SDL_QUIT: mRoot->queueEndRendering(); break; case SDL_WINDOWEVENT: if(event.window.event != SDL_WINDOWEVENT_RESIZED) continue; for(WindowList::iterator it = mWindows.begin(); it != mWindows.end(); ++it) { if(event.window.windowID != SDL_GetWindowID(it->native)) continue; Ogre::RenderWindow* win = it->render; win->windowMovedOrResized(); windowResized(win); } break; default: _fireInputEvent(convert(event), event.window.windowID); break; } }#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE // hacky workaround for black window on OSX for(const auto& win : mWindows) { SDL_SetWindowSize(win.native, win.render->getWidth(), win.render->getHeight()); win.render->windowMovedOrResized(); }#endif}
开发者ID:yiliu1203,项目名称:OGRE,代码行数:45,
示例30: aglSetCurrentContext//-------------------------------------------------------------------------------------------------//void OSXCarbonWindow::swapBuffers( bool waitForVSync ){ if(!mIsFullScreen) { if(mAGLContext != aglGetCurrentContext()) aglSetCurrentContext(mAGLContext); aglSwapBuffers(mAGLContext); } else swapCGLBuffers(); if(mHasResized) { windowResized(); mHasResized = false; }}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:19,
注:本文中的windowResized函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ windowTitle函数代码示例 C++ windowHandle函数代码示例 |