SO3Engine
|
SO3Window.cpp
Go to the documentation of this file.
58SWindow::SWindow(SRoot* parent, const ScolWindowHandle& windowHandle, const std::string& windowName, const int& width, const int& height, const std::string& fsaa) : SData(windowName)
160 /******************************************* Options Setting ***************************************/
175 O3Window = Ogre::Root::getSingleton().createRenderWindow(windowName, awidth, aheight, false, &viewConfig);
204 subEntitySelector = new SSubEntitySelectorBuffer(this, (mSelectorMode == SO3_SELECTOR_FAST) ? true : false);
287 catch (Ogre::Exception&) //error can appen on compositor resources creation if the device is not ready
343 subEntitySelector = new SSubEntitySelectorBuffer(this, (mSelectorMode == SO3_SELECTOR_FAST) ? true : false);
446SViewPort* SWindow::CreateViewport(SCamera* camera, int priority, const float& x, const float& y, const float& w, const float& h)
499bool SWindow::UpdateStereoCompositorState(SViewPort* viewport, const Ogre::String compname, bool state)
501 return stereoManager->UpdateStereoCompositorState(viewport->GetOgreViewPortPointer(), compname, state);
550 SViewPortList::iterator iViewportSearched = listOfViewPort.find(existingViewport->GetPriority());
553 listOfViewPort.insert(SViewPortList::value_type(existingViewport->GetPriority(), existingViewport));
566 SViewPortList::iterator iViewportSearched = listOfViewPort.find(existingViewport->GetPriority());
675 cRatio = (float)vp->GetOgreViewPortPointer()->getActualWidth() / (float)vp->GetOgreViewPortPointer()->getActualHeight();
710 Ogre::D3D9Device* device = static_cast<Ogre::D3D9RenderSystem*>(SRoot::getSingleton().GetOgreRenderSystem())->getDeviceManager()->getActiveDevice();
744 catch (Ogre::Exception&) //error can appen on compositor resources creation if the device is not ready
754 catch (Ogre::Exception&) //error can appen on compositor resources creation if the device is not ready
781 cRatio = (float)vp->GetOgreViewPortPointer()->getActualWidth() / (float)vp->GetOgreViewPortPointer()->getActualHeight();
802 catch(Ogre::Exception&) //error can appen on compositor resources creation if the device is not ready
864 //DO NOT CHANGE ANYTHING UNTIL YOU TEST BOTH OPENGL AND DIRECTX, WINDOWED AND FULLSCREEN SWITCHING
868 success = SRoot::getSingleton().SetFullScreenState(this, fullscreen, mLastPos.rcNormalPosition.right - mLastPos.rcNormalPosition.left, mLastPos.rcNormalPosition.bottom - mLastPos.rcNormalPosition.top);
870 SetWindowPos(hwnd, HWND_NOTOPMOST, mLastPos.rcNormalPosition.left, mLastPos.rcNormalPosition.top, mLastPos.rcNormalPosition.right - mLastPos.rcNormalPosition.left -1, mLastPos.rcNormalPosition.bottom - mLastPos.rcNormalPosition.top -1, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
883 Size(mLastPos.rcNormalPosition.left, mLastPos.rcNormalPosition.top, mLastPos.rcNormalPosition.right - mLastPos.rcNormalPosition.left -1, mLastPos.rcNormalPosition.bottom - mLastPos.rcNormalPosition.top -1, 0);
886 Size(mLastPos.rcNormalPosition.left, mLastPos.rcNormalPosition.top, mLastPos.rcNormalPosition.right - mLastPos.rcNormalPosition.left, mLastPos.rcNormalPosition.bottom - mLastPos.rcNormalPosition.top, 0);
915 OGRE_EXCEPT(Ogre::Exception::ERR_INVALIDPARAMS, "Invalid resolution parameters, fullscreen not setted", "SWindow::SetFullScreen");
935 SetWindowPos(hwnd, HWND_TOPMOST, mLastPos.rcNormalPosition.left + screenPoint.x, mLastPos.rcNormalPosition.top + screenPoint.y, mLastPos.rcNormalPosition.right - mLastPos.rcNormalPosition.left -1, mLastPos.rcNormalPosition.bottom - mLastPos.rcNormalPosition.top -1, SWP_NOZORDER | SWP_FRAMECHANGED);
955 SetWindowPos(hwnd, HWND_TOPMOST, mLastPos.rcNormalPosition.left, mLastPos.rcNormalPosition.top, mLastPos.rcNormalPosition.right - mLastPos.rcNormalPosition.left, mLastPos.rcNormalPosition.bottom - mLastPos.rcNormalPosition.top, SWP_FRAMECHANGED | SWP_SHOWWINDOW);
957 Size(mLastPos.rcNormalPosition.left, mLastPos.rcNormalPosition.top, mLastPos.rcNormalPosition.right - mLastPos.rcNormalPosition.left, mLastPos.rcNormalPosition.bottom - mLastPos.rcNormalPosition.top, 0);
995 Ogre::ConfigOptionMap m_system_caps = SRoot::getSingleton().GetOgreRenderSystem()->getConfigOptions();
1143void SWindow::SetStereoCustomProjectonMatrix(bool enable, const Ogre::Matrix4 &leftMatrix, const Ogre::Matrix4 &rightMatrix)
1148void SWindow::GetStereoCustomProjectonMatrix(bool &enabled, Ogre::Matrix4 &leftMatrix, Ogre::Matrix4 &rightMatrix) const
1153void SWindow::SetStereoTimeWarpMatrix(const Ogre::Matrix4 &leftStartMatrix, const Ogre::Matrix4 &leftEndMatrix, const Ogre::Matrix4 &rightStartMatrix, const Ogre::Matrix4 &rightEndMatrix)
1155 stereoManager->SetTimeWarpMatrix(leftStartMatrix, leftEndMatrix, rightStartMatrix, rightEndMatrix);
1158void SWindow::SetStereoMeshUVConfig(Ogre::Vector2 leftuvscale, Ogre::Vector2 leftuvoffset, Ogre::Vector2 rightuvscale, Ogre::Vector2 rightuvoffset)
1168void SWindow::SetStereoWindow(SO3::SPoint<int> pos, SO3::SPoint<int> size, int index, bool state)
1173void SWindow::SetStereoMeshLeft(std::vector<Ogre::Vector3> vertices, std::vector<std::vector<Ogre::Vector2> > uvs, std::vector<Ogre::Real> vignetteColor, std::vector<Ogre::Real> warp, std::vector<int> indexs)
1178void SWindow::SetStereoMeshRight(std::vector<Ogre::Vector3> vertices, std::vector<std::vector<Ogre::Vector2> > uvs, std::vector<Ogre::Real> vignetteColor, std::vector<Ogre::Real> warp, std::vector<int> indexs)
1250 Ogre::SceneManager* sceneManager = Ogre::Root::getSingleton().getSceneManager(lastRaycast.sceneName);
1265 // Catching Exception::ERR_ITEM_NOT_FOUND in case sceneManager or entity was deleted since last rtt update. Forwarding other errors.
1283 uchar *data = OGRE_ALLOC_T(uchar, O3Window->getWidth() * O3Window->getHeight() * Ogre::PixelUtil::getNumElemBytes(pf), Ogre::MEMCATEGORY_RENDERSYS);
MMechostr(MSKDEBUG, " > Start loading Plugin SO3Engine dll\n")
int getBufferPostRenderEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
Definition SO3SCOL.cpp:4582
int getBufferPreRenderEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
Definition SO3SCOL.cpp:4567
int BUFFER_PRE_RENDER_EVENT
Declaration of the global instance for the virtual Machine.
Definition SO3SCOL.cpp:196
int getBufferPostRenderEvent(struct Mmachine *, SCOL_PTR_TYPE, SCOL_PTR_TYPE)
int getBufferPreRenderEvent(struct Mmachine *, SCOL_PTR_TYPE, SCOL_PTR_TYPE)
Definition SO3Camera.h:43
const Ogre::Matrix4 & GetProjectionMatrix()
Definition SO3Camera.cpp:198
Definition SO3DataScol.h:41
void UnregisterViewport(SViewPort *targetViewport)
Definition SO3Environment.cpp:161
void RegisterViewport(SViewPort *targetViewport)
Definition SO3Environment.cpp:128
bool IsRegisteredViewport(SViewPort *targetViewport)
Definition SO3Environment.cpp:199
Definition SO3Point.h:37
Definition SO3RayCast.h:41
Definition SO3Root.h:73
bool GetRttPixelFormat(Ogre::PixelFormat &format, bool alpha=false, bool floattex=false)
Definition SO3Root.cpp:650
void UnregisterViewport(SViewPort *viewport)
Definition SO3Root.cpp:1611
bool SetFullScreenState(SWindow *window, const bool &state, const int &width, const int &height)
Definition SO3Root.cpp:1493
Definition SO3Scene.h:125
void UpdateBufferSize(const bool &forceRefresh)
Definition SO3SubEntitySelectorBuffer.cpp:715
void RemoveViewport(SViewPort *existingViewport)
Definition SO3SubEntitySelectorBuffer.cpp:263
void CreateBuffers()
Definition SO3SubEntitySelectorBuffer.cpp:122
void DestroyBuffers()
Definition SO3SubEntitySelectorBuffer.cpp:116
void AddViewport(SViewPort *newViewport)
Definition SO3SubEntitySelectorBuffer.cpp:256
Definition SO3ViewPort.h:56
SRaycastResult RayCast(const int &pixelsX, const int &pixelsY, SSubEntitySelectorBuffer *subEntitySelector)
Definition SO3ViewPort.cpp:733
Ogre::Viewport * GetOgreViewPortPointer()
Definition SO3ViewPort.cpp:98
void windowFocusChange(Ogre::RenderWindow *rw)
Definition SO3Window.cpp:639
void SetStereoTimeWarpMatrix(const Ogre::Matrix4 &leftStartMatrix, const Ogre::Matrix4 &leftEndMatrix, const Ogre::Matrix4 &rightStartMatrix, const Ogre::Matrix4 &rightEndMatrix)
Definition SO3Window.cpp:1153
void SetStereoAspectRatio(const float &ratio)
Definition SO3Window.cpp:1123
void RegisterStereoViewport(SViewPort *viewport)
Definition SO3Window.cpp:528
bool UpdateStereoCompositorState(SViewPort *viewport, const Ogre::String compname, bool state)
Definition SO3Window.cpp:499
void SetStereoProjectionOffset(const float &offset)
Definition SO3Window.cpp:1118
void UpdateStereoCameraMatrix(SViewPort *viewport, Ogre::Camera *camera)
Definition SO3Window.cpp:516
void SetStereoMeshRight(std::vector< Ogre::Vector3 > vertices, std::vector< std::vector< Ogre::Vector2 > > uvs, std::vector< Ogre::Real > vignetteColor, std::vector< Ogre::Real > warp, std::vector< int > indexs)
Definition SO3Window.cpp:1178
void UpdateStereoCamera(SViewPort *viewport, Ogre::Camera *camera)
Definition SO3Window.cpp:510
void SetStereoChromaticAbCorrection(bool enable, Ogre::Vector4 chromAbC)
Definition SO3Window.cpp:1138
virtual void postRenderTargetUpdate(const Ogre::RenderTargetEvent &evt)
Definition SO3Window.cpp:310
std::array< SCOL_PTR_TYPE, 2 > GetStereoTextures()
Definition SO3Window.cpp:1183
Ogre::RenderWindow * GetOgreRenderWindowPointer()
Definition SO3Window.cpp:441
void RemoveViewport(SViewPort *existingViewport)
Definition SO3Window.cpp:564
void SetStereoCustomProjectonMatrix(bool enable, const Ogre::Matrix4 &leftMatrix, const Ogre::Matrix4 &rightMatrix)
Definition SO3Window.cpp:1143
void RestoreStereoCamera(SViewPort *viewport)
Definition SO3Window.cpp:504
void SynchStereoViewportSetup(SViewPort *viewport, bool overlay=false, bool shadow=false)
Definition SO3Window.cpp:534
void DeleteViewport(SViewPort *existingViewport)
Definition SO3Window.cpp:459
void SetStereoMeshLeft(std::vector< Ogre::Vector3 > vertices, std::vector< std::vector< Ogre::Vector2 > > uvs, std::vector< Ogre::Real > vignetteColor, std::vector< Ogre::Real > warp, std::vector< int > indexs)
Definition SO3Window.cpp:1173
void SetStereoWindow(SO3::SPoint< int > pos, SO3::SPoint< int > size, int index, bool state)
Definition SO3Window.cpp:1168
void WriteContentsToFile(const std::string &path)
Definition SO3Window.cpp:1276
void SetStereoDistortion(bool enable, Ogre::Vector4 dist)
Definition SO3Window.cpp:1133
void UnregisterStereoViewport(SViewPort *viewport)
Definition SO3Window.cpp:522
bool IsStereoViewportRegistered(SViewPort *viewport)
Definition SO3Window.cpp:540
const SViewPortList & GetViewportList() const
Definition SO3Window.cpp:580
bool CheckVideoMode(const int width, const int height)
Definition SO3Window.cpp:989
int Size(const int &x, const int &y, const int &w, const int &h, const int &ext)
Definition SO3Window.cpp:643
void SetSelectorEnable(const bool &state)
Definition SO3Window.cpp:334
void SetStereoEyesSpacing(const float &eyesSpacing)
Definition SO3Window.cpp:1103
void SetStereoMeshRttSize(SO3::SPoint< int > leftsize, SO3::SPoint< int > rightsize)
Definition SO3Window.cpp:1163
void SetStereoRotateView(const bool state)
Definition SO3Window.cpp:1108
SRaycastResult RayCast(const int &pixelsX, const int &pixelsY)
Definition SO3Window.cpp:1210
SViewPort * GetViewport(const int &priority) const
Definition SO3Window.cpp:585
virtual void preRenderTargetUpdate(const Ogre::RenderTargetEvent &evt)
Definition SO3Window.cpp:235
std::array< SO3::SPoint< int >, 2 > GetStereoViewportSize()
Definition SO3Window.cpp:1188
void RefreshSelector(const bool &forceRefresh=false)
Definition SO3Window.cpp:327
void SetStereoMode(const StereoManager::StereoMode &stereoMode)
Definition SO3Window.cpp:1085
SRaycastResult IndRayCast(const int &pixelsX, const int &pixelsY)
Definition SO3Window.cpp:1223
SViewPort * CreateViewport(SCamera *camera, int priority, const float &x, const float &y, const float &w, const float &h)
Definition SO3Window.cpp:446
void SetStereoMeshUVConfig(Ogre::Vector2 leftuvscale, Ogre::Vector2 leftuvoffset, Ogre::Vector2 rightuvscale, Ogre::Vector2 rightuvoffset)
Definition SO3Window.cpp:1158
void GetStereoCustomProjectonMatrix(bool &enabled, Ogre::Matrix4 &leftMatrix, Ogre::Matrix4 &rightMatrix) const
Definition SO3Window.cpp:1148
bool SetFullScreen(const bool &fullscreen, const int &width=0, const int &height=0)
Definition SO3Window.cpp:857
Definition SO3StereoManager.h:51
void SetStereoMeshLeft(std::vector< Ogre::Vector3 > vertices, std::vector< std::vector< Ogre::Vector2 > > uvs, std::vector< Ogre::Real > vignetteColor, std::vector< Ogre::Real > warp, std::vector< int > indexs)
Definition SO3StereoManager.cpp:1376
void SetStereoFOVy(Ogre::Real fov)
Definition SO3StereoManager.cpp:1743
std::array< SCOL_PTR_TYPE, 2 > GetStereoTextures()
Definition SO3StereoManager.cpp:1273
void SetCustomProjectonMatrices(bool enable, const Ogre::Matrix4 &leftMatrix, const Ogre::Matrix4 &rightMatrix)
Definition SO3StereoManager.cpp:1211
bool UpdateStereoCompositorState(Ogre::Viewport *ogreViewportInstance, const Ogre::String compname, bool state)
Definition SO3StereoManager.cpp:229
void SetStereoProjectionOffset(Ogre::Real offset)
Definition SO3StereoManager.cpp:1712
void SetStereoDistortion(bool enable, Ogre::Vector4 dist)
Definition SO3StereoManager.cpp:1787
void GetCustomProjectonMatrices(bool &enabled, Ogre::Matrix4 &leftMatrix, Ogre::Matrix4 &rightMatrix) const
Definition SO3StereoManager.cpp:1226
void SetStereoMeshRttSize(SO3::SPoint< int > leftsize, SO3::SPoint< int > rightsize)
Definition SO3StereoManager.cpp:1242
bool IsViewportRegistered(Ogre::Viewport *ogreViewportInstance)
Definition SO3StereoManager.cpp:445
void SetStereoChromaticAbCorrection(bool enable, Ogre::Vector4 chromAbC)
Definition SO3StereoManager.cpp:1773
void SetStereoMode(const StereoMode &newStereoMode)
Definition SO3StereoManager.cpp:174
void SetStereoWindow(SO3::SPoint< int > pos, SO3::SPoint< int > size, int index, bool state)
Definition SO3StereoManager.cpp:1331
Ogre::Real GetEyesSpacing() const
Definition SO3StereoManager.cpp:1201
void UnregisterViewport(SViewPort *viewportInstance)
Definition SO3StereoManager.cpp:434
void SetTimeWarpMatrix(const Ogre::Matrix4 &leftStartMatrix, const Ogre::Matrix4 &leftEndMatrix, const Ogre::Matrix4 &rightStartMatrix, const Ogre::Matrix4 &rightEndMatrix)
Definition SO3StereoManager.cpp:1218
std::array< SO3::SPoint< int >, 2 > GetStereoViewportSize()
Definition SO3StereoManager.cpp:1308
void SetStereoMeshRight(std::vector< Ogre::Vector3 > vertices, std::vector< std::vector< Ogre::Vector2 > > uvs, std::vector< Ogre::Real > vignetteColor, std::vector< Ogre::Real > warp, std::vector< int > indexs)
Definition SO3StereoManager.cpp:1544
void SetStereoMeshUVConfig(Ogre::Vector2 leftuvscale, Ogre::Vector2 leftuvoffset, Ogre::Vector2 rightuvscale, Ogre::Vector2 rightuvoffset)
Definition SO3StereoManager.cpp:1233
void UpdateStereoCamera(Ogre::Viewport *ogreViewportInstance, Ogre::Camera *camera)
Definition SO3StereoManager.cpp:311
void RestoreStereoCamera(Ogre::Viewport *ogreViewportInstance)
Definition SO3StereoManager.cpp:270
void RegisterViewport(SViewPort *viewportInstance)
Definition SO3StereoManager.cpp:422
void SynchViewportSetup(SViewPort *viewportInstance, bool overlay=false, bool shadow=false)
Definition SO3StereoManager.cpp:454
void SetEyesSpacing(Ogre::Real l)
Definition SO3StereoManager.cpp:1206
void SetStereoAspectRatio(Ogre::Real ratio)
Definition SO3StereoManager.cpp:1725
void UpdateStereoCameraMatrix(Ogre::Viewport *ogreViewportInstance, Ogre::Camera *camera)
Definition SO3StereoManager.cpp:392
Definition SO3DataScol.h:38
std::unordered_map< int, SViewPort * > SViewPortList
Definition SO3Prerequisites.h:278
std::unordered_map< std::string, SScene * > SSceneMap
Definition SO3Prerequisites.h:275
Generated by 1.9.8