17#include "OgreMemoryAllocatorConfig.h"
21#include "OgreD3D9RenderWindow.h"
22#include "OgreD3D9DeviceManager.h"
25char*
itoa(
int val,
char* buf,
int base){
27 for (; val && i; --i, val /= base)
28 buf[i] =
"0123456789abcdef"[val % base];
34#include <QGuiApplication>
53SWindow::SWindow() : SData(
"")
58SWindow::SWindow(
SRoot* parent,
const ScolWindowHandle& windowHandle,
const std::string& windowName,
const int& width,
const int& height,
const std::string& fsaa) :
SData(windowName)
63 subEntitySelector = 0;
66#if defined(ANDROID) || defined(APPLE_IOS) || defined(OSX) || defined(RPI)
79 hwnd = (ScolWindowHandle)windowHandle;
80 Ogre::String winHandle = Ogre::StringConverter::toString((
size_t)(ScolWindowHandle)hwnd);
84 SetWindowLongPtr(hwnd, GWL_STYLE, (GetWindowLongPtr(hwnd, GWL_STYLE))|WS_CLIPCHILDREN);
88 Ogre::NameValuePairList viewConfig;
90 struct android_app* androidApp = (
struct android_app*)SCgetExtra(
"this_inst");
91 ScolWindowHandle awindow = (ScolWindowHandle)SCgetExtra(
"hscol");
92 AConfiguration* config = AConfiguration_new();
95 AConfiguration_fromAssetManager(config, androidApp->activity->assetManager);
99 viewConfig[
"externalWindowHandle"] = Ogre::StringConverter::toString(SCOL_PTR awindow);
100 viewConfig[
"androidConfig"] = Ogre::StringConverter::toString(SCOL_PTR config);
101 viewConfig[
"minColourBufferSize"] = Ogre::StringConverter::toString(24);
102 viewConfig[
"preserveContext"] =
"true";
103 viewConfig[
"MSAA"] =
"2";
135 viewConfig[
"externalWindowHandle"] = winHandle;
138#elif defined(APPLE_IOS)
139 viewConfig[
"externalViewHandle"] = winHandle;
140 viewConfig[
"retainedBacking"] =
"Yes";
141 QScreen* screen = QGuiApplication::primaryScreen();
142 QRect screenSize = screen->geometry();
143 awidth = screenSize.width();
144 aheight = screenSize.height();
146#elif defined(__APPLE__)
147 viewConfig[
"externalWindowHandle"] = winHandle;
149 viewConfig[
"externalWindowHandle"] = winHandle;
151 viewConfig[
"parentWindowHandle"] = winHandle;
156 viewConfig[
"useNVPerfHUD"] =
"Yes";
163 if(fsaa.find(
"[Quality]") != string::npos)
165 viewConfig[
"FSAAHint"] =
"Quality";
166 viewConfig[
"FSAA"] = fsaa.substr(0, fsaa.find(
"[Quality]")-2);
170 viewConfig[
"FSAA"] = fsaa;
171 viewConfig[
"FSAAHint"] =
"";
175 O3Window = Ogre::Root::getSingleton().createRenderWindow(windowName, awidth, aheight,
false, &viewConfig);
177 O3Window->setPriority(0);
180 if(O3Window->isPrimary())
183 O3Window->addListener(
this);
187 hwndFullscreenOgre = NULL;
188 styleFullscreenOgre = NULL;
189 exstyleFullscreenOgre = NULL;
190 mLastWindowRegion = NULL;
194 AConfiguration_delete(config);
199#if !defined(OSX) && !defined(APPLE_IOS)
200 Ogre::PixelFormat rttformat;
217 O3Window->removeListener(
this);
218 SO3_SAFE_DELETE(subEntitySelector);
219 SO3_SAFE_DELETE(stereoManager);
222 if(!O3Window->isPrimary())
231 SetWindowLongPtr(hwnd, GWL_STYLE, (GetWindowLongPtr(hwnd, GWL_STYLE))& ~(WS_CLIPCHILDREN));
237 if (evt.source == O3Window)
252 ClientToScreen(hwnd, &screenPoint);
254 screenPos.x = (Ogre::Real)screenPoint.x;
255 screenPos.y = (Ogre::Real)screenPoint.y;
271 result = GetClientRect(hwnd, &rc);
275 unsigned int width = rc.right - rc.left;
276 unsigned int height = rc.bottom - rc.top;
278 if ((width > 4) && (height > 4))
285 O3Window->windowMovedOrResized();
287 catch (Ogre::Exception&)
297 O3Window->windowMovedOrResized();
299 catch (Ogre::Exception&)
312 if (evt.source == O3Window)
330 if (subEntitySelector)
336#if !defined(OSX) && !defined(APPLE_IOS)
337 Ogre::PixelFormat rttformat;
341 if (state && !subEntitySelector)
344 SViewPortList::iterator iViewport = listOfViewPort.begin();
345 while (iViewport != listOfViewPort.end())
353 else if (!state && subEntitySelector)
354 SO3_SAFE_DELETE(subEntitySelector);
361 if (mSelectorMode != mode)
363#if defined(ANDROID) || defined(APPLE_IOS) || defined(OSX) || defined(RPI)
366 mSelectorMode = mode;
369#if !defined(OSX) && !defined(APPLE_IOS)
372 if (subEntitySelector)
374 SO3_SAFE_DELETE(subEntitySelector);
380 Ogre::PixelFormat rttformat;
384 bool useDepth =
false;
389 SViewPortList::iterator iViewport = listOfViewPort.begin();
390 while (iViewport != listOfViewPort.end())
405 return mSelectorMode;
414 if (subEntitySelector)
422 if (subEntitySelector)
463 if (std::find(mViewportsToDel.begin(), mViewportsToDel.end(), existingViewport) == mViewportsToDel.end())
464 mViewportsToDel.push_back(existingViewport);
475 SSceneMap::iterator iScene = sceneList.begin();
476 while (iScene != sceneList.end())
479 iScene->second->UnregisterViewport(existingViewport);
485 SO3_SAFE_DELETE(existingViewport);
492 for (
unsigned int i = 0; i < mViewportsToDel.size(); i++)
496 mViewportsToDel.clear();
550 SViewPortList::iterator iViewportSearched = listOfViewPort.find(existingViewport->
GetPriority());
551 if(iViewportSearched == listOfViewPort.end())
553 listOfViewPort.insert(SViewPortList::value_type(existingViewport->
GetPriority(), existingViewport));
554 if (subEntitySelector != 0)
560 OGRE_EXCEPT(Ogre::Exception::ERR_DUPLICATE_ITEM,
"Can not add Viewport, an identical element with the same priority already exist!",
"SWindow::AddViewport");
566 SViewPortList::iterator iViewportSearched = listOfViewPort.find(existingViewport->
GetPriority());
567 if(iViewportSearched != listOfViewPort.end())
569 listOfViewPort.erase(iViewportSearched);
570 if (subEntitySelector != 0)
576 OGRE_EXCEPT(Ogre::Exception::ERR_ITEM_NOT_FOUND,
"Can not remove Viewport, element not found!",
"SWindow::RemoveViewport");
582 return listOfViewPort;
588 SViewPortList::const_iterator iViewportSearched = listOfViewPort.find(priority);
589 if(iViewportSearched != listOfViewPort.end())
591 existingViewport = iViewportSearched->second;
596 OGRE_EXCEPT(Ogre::Exception::ERR_ITEM_NOT_FOUND,
"Can not find Viewport with this priority, windows do not have such element!",
"SWindow::GetViewport");
598 return existingViewport;
606 SViewPortList::iterator iViewport = listOfViewPort.begin();
607 while(iViewport != listOfViewPort.end())
609 int curZ = iViewport->second->GetPriority();
610 int left = iViewport->second->GetLeftPixels();
611 int top = iViewport->second->GetTopPixels();
612 int width = iViewport->second->GetWidthPixels();
613 int height = iViewport->second->GetHeightPixels();
615 if(((x >= left)&&(y >= top)&&(x <= left + width)&&(y <= top + height)) && curZ >= highestZ)
617 resultViewport = iViewport->second;
624 return resultViewport;
643int SWindow::Size(
const int& x,
const int& y,
const int&
w,
const int& h,
const int& ext)
649 O3Window->resize(std::max(4, iw) , std::max(4, ih));
652#if !defined(LINUX) && !defined(OSX)
653 O3Window->reposition(x, y);
655 O3Window->windowMovedOrResized();
657 catch(Ogre::Exception &)
665 SViewPortList::iterator iViewport = listOfViewPort.begin();
666 while(iViewport != listOfViewPort.end())
690 catch(Ogre::Exception&)
711 valid = (device != 0) ? !device->isDeviceLost() :
false;
713 catch(Ogre::Exception&)
731 result = GetClientRect(hwnd, &rc);
735 unsigned int width = rc.right - rc.left;
736 unsigned int height = rc.bottom - rc.top;
738 if ((width > 3) && (height > 3))
742 O3Window->windowMovedOrResized();
744 catch (Ogre::Exception&)
752 O3Window->windowMovedOrResized();
754 catch (Ogre::Exception&)
760 Ogre::CompositorManager &compositorManager = Ogre::CompositorManager::getSingleton();
769 SViewPortList::iterator iViewport = listOfViewPort.begin();
770 while(iViewport != listOfViewPort.end())
802 catch(Ogre::Exception&)
813 catch(Ogre::Exception&)
823 catch (Ogre::Exception& e)
825 MMechostr(MSKDEBUG,
"SO3Engine error on window resize : %s", e.what());
833 return O3Window->getWidth();
838 return O3Window->getHeight();
843 unsigned int nullUintPtr;
844 int left, nullIntPtr;
845 O3Window->getMetrics(nullUintPtr, nullUintPtr, nullIntPtr, left);
851 unsigned int nullUintPtr;
853 O3Window->getMetrics(nullUintPtr, nullUintPtr, nullIntPtr, top);
859 bool success =
false;
865 if(!fullscreen && O3Window->isFullScreen())
867 O3Window->setVSyncEnabled(
scolRoot->GetVSyncEnable());
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);
873 screenPos = Ogre::Vector2(0.0f, 0.0f);
876 SetParent(hwnd, (ScolWindowHandle)hwndFullscreenOgre);
877 SetWindowLongPtr(hwnd, GWL_STYLE, styleFullscreenOgre);
878 SetWindowLongPtr(hwnd, GWL_EXSTYLE, exstyleFullscreenOgre);
880 SetWindowRgn(hwnd, mLastWindowRegion, FALSE);
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);
890 else if(fullscreen && !O3Window->isFullScreen())
915 OGRE_EXCEPT(Ogre::Exception::ERR_INVALIDPARAMS,
"Invalid resolution parameters, fullscreen not setted",
"SWindow::SetFullScreen");
921 hwndFullscreenOgre = GetWindowLongPtr(hwnd, GWLP_HWNDPARENT);
922 styleFullscreenOgre = GetWindowLongPtr(hwnd, GWL_STYLE);
923 exstyleFullscreenOgre = GetWindowLongPtr(hwnd, GWL_EXSTYLE);
924 GetWindowPlacement(hwnd, &mLastPos);
925 GetWindowRgn(hwnd, mLastWindowRegion);
930 ClientToScreen(hwnd, &screenPoint);
933 SetParent(hwnd, NULL);
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);
937 MONITORINFOEX minfos;
938 minfos.cbSize =
sizeof(minfos);
939 GetMonitorInfo(MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST), &minfos);
942 O3Window->setVSyncEnabled(
true);
949 SetWindowLongPtr(hwnd, GWL_STYLE, styleFullscreenOgre);
950 SetWindowLongPtr(hwnd, GWL_EXSTYLE, exstyleFullscreenOgre);
951 SetParent(hwnd, (ScolWindowHandle)hwndFullscreenOgre);
953 SetWindowRgn(hwnd, mLastWindowRegion, FALSE);
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);
962 SetWindowPos(hwnd, HWND_TOPMOST, minfos.rcMonitor.left, minfos.rcMonitor.top,
nwidth,
nheight, SWP_NOZORDER | SWP_FRAMECHANGED | SWP_SHOWWINDOW);
963 Size(minfos.rcMonitor.left, minfos.rcMonitor.top,
nwidth, height, 0);
967 PostMessage(hwnd, WM_SIZE, 0, wsize);
970#elif defined(ANDROID) || defined(APPLE_IOS) || defined(RPI)
982#if defined(ANDROID) || defined(APPLE_IOS) || defined(RPI)
985 return O3Window->isFullScreen();
996 Ogre::ConfigOptionMap::iterator itr = m_system_caps.begin();
997 while(itr != m_system_caps.end() && !vmc)
999 if((itr)->first ==
"Video Mode" )
1001 Ogre::StringVector possible_values = (itr)->second.possibleValues;
1002 Ogre::StringVector::iterator pv_itr = possible_values.begin();
1003 while(pv_itr != possible_values.end() && !vmc)
1005 if (pv_itr->find(
itoa((
int)width, strW, 10)) != string::npos && pv_itr->find(
itoa((
int)height, strH, 10)) != string::npos && pv_itr->find(
itoa((
int)width, strW, 10))<pv_itr->find(
itoa((
int)height, strH, 10)))
1020 O3Window->update(
true);
1022 catch(Ogre::Exception &e)
1024 Ogre::LogManager::getSingleton().getDefaultLog()->logMessage(
"An exception has occurred: "+ e.getDescription());
1030 unsigned int bcount = 0;
1032 SViewPortList::iterator iViewport = listOfViewPort.begin();
1033 while (iViewport != listOfViewPort.end())
1035 bcount += iViewport->second->GetNumRenderedBatches();
1044 unsigned int tcount = 0;
1045 SViewPortList::iterator iViewport = listOfViewPort.begin();
1046 while (iViewport != listOfViewPort.end())
1048 tcount += iViewport->second->GetNumRenderedFaces();
1057 return O3Window->getStatistics().bestFrameTime;
1062 return O3Window->getStatistics().worstFrameTime;
1067 return O3Window->getStatistics().bestFPS;
1072 return O3Window->getStatistics().worstFPS;
1077 return O3Window->getStatistics().avgFPS;
1082 return O3Window->getFSAA();
1087 mStereoMode = stereoMode;
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);
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)
1196 ScolWindowHandle awindow = (ScolWindowHandle)SCgetExtra(
"hscol");
1197 int nwidth = (int)ANativeWindow_getWidth(awindow);
1198 int nheight = (int)ANativeWindow_getHeight(awindow);
1202#elif defined(APPLE_IOS)
1214 if (resultViewport != 0)
1217 lastRaycast = resultViewport->
RayCast(pixelsX, pixelsY, subEntitySelector);
1229 if (resultViewport != 0)
1232 raycastReturn = resultViewport->
RayCast(pixelsX, pixelsY, subEntitySelector);
1235 return raycastReturn;
1250 Ogre::SceneManager* sceneManager = Ogre::Root::getSingleton().getSceneManager(lastRaycast.
sceneName);
1251 Ogre::Entity* entity = sceneManager->getEntity(lastRaycast.
entityName);
1260 catch(Ogre::Exception&)
1279 O3Window->writeContentsToFile(path);
1281 Ogre::PixelFormat pf = Ogre::PixelFormat::PF_BYTE_RGBA;
1283 uchar *data = OGRE_ALLOC_T(uchar, O3Window->getWidth() * O3Window->getHeight() * Ogre::PixelUtil::getNumElemBytes(pf), Ogre::MEMCATEGORY_RENDERSYS);
1284 Ogre::PixelBox pb(O3Window->getWidth(), O3Window->getHeight(), 1, pf, data);
1285 Ogre::Box pbs(0, 0, O3Window->getWidth(), O3Window->getHeight());
1286 O3Window->copyContentsToMemory(pbs, pb);
1288 Ogre::Image().loadDynamicImage(data, O3Window->getWidth(), O3Window->getHeight(), 1, pf,
false, 1, 0).save(path);
1290 OGRE_FREE(data, Ogre::MEMCATEGORY_RENDERSYS);
MMechostr(MSKDEBUG, " > Start loading Plugin SO3Engine dll\n")
SCOL_EXPORT int cbmachine w
int getBufferPostRenderEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
int getBufferPreRenderEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
SRoot * scolRoot
Shared data.
char * itoa(int val, char *buf, int base)
int BUFFER_STEREO_BEFORE_UPDATE_EVENT
int BUFFER_STEREO_UPDATED_EVENT
int BUFFER_PRE_RENDER_EVENT
Declaration of the global instance for the virtual Machine.
int getBufferPostRenderEvent(struct Mmachine *, SCOL_PTR_TYPE, SCOL_PTR_TYPE)
int BUFFER_POST_RENDER_EVENT
int BUFFER_STEREO_UPDATE_PARAMS_EVENT
int getBufferPreRenderEvent(struct Mmachine *, SCOL_PTR_TYPE, SCOL_PTR_TYPE)
Ogre::Camera * GetOgreCameraPointer()
const Ogre::Matrix4 & GetProjectionMatrix()
const Ogre::Affine3 & GetViewMatrix()
std::string GetName() const
void UnregisterViewport(SViewPort *targetViewport)
void RegisterViewport(SViewPort *targetViewport)
bool IsRegisteredViewport(SViewPort *targetViewport)
SScene * GetParentScene()
bool GetRttPixelFormat(Ogre::PixelFormat &format, bool alpha=false, bool floattex=false)
void UnregisterViewport(SViewPort *viewport)
bool SetFullScreenState(SWindow *window, const bool &state, const int &width, const int &height)
void RegisterViewport(SViewPort *viewport)
Ogre::RenderSystem * GetOgreRenderSystem()
static SRoot & getSingleton()
static SRoot * getSingletonPtr()
SEnvironment * GetEnvironment() const
void UpdateBufferSize(const bool &forceRefresh)
void RemoveViewport(SViewPort *existingViewport)
void AddViewport(SViewPort *newViewport)
SRaycastResult RayCast(const int &pixelsX, const int &pixelsY, SSubEntitySelectorBuffer *subEntitySelector)
Ogre::Viewport * GetOgreViewPortPointer()
void windowFocusChange(Ogre::RenderWindow *rw)
void SetStereoTimeWarpMatrix(const Ogre::Matrix4 &leftStartMatrix, const Ogre::Matrix4 &leftEndMatrix, const Ogre::Matrix4 &rightStartMatrix, const Ogre::Matrix4 &rightEndMatrix)
void SetStereoAspectRatio(const float &ratio)
void ToPixelPos(int &px, int &py)
void RegisterStereoViewport(SViewPort *viewport)
bool UpdateStereoCompositorState(SViewPort *viewport, const Ogre::String compname, bool state)
Ogre::Vector2 GetScreenPos()
void SetStereoProjectionOffset(const float &offset)
void UpdateStereoCameraMatrix(SViewPort *viewport, Ogre::Camera *camera)
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)
void UpdateStereoCamera(SViewPort *viewport, Ogre::Camera *camera)
void SetStereoChromaticAbCorrection(bool enable, Ogre::Vector4 chromAbC)
float GetBestFrameTime() const
ScolWindowHandle GetWindowHandle() const
virtual void postRenderTargetUpdate(const Ogre::RenderTargetEvent &evt)
std::array< SCOL_PTR_TYPE, 2 > GetStereoTextures()
Ogre::RenderWindow * GetOgreRenderWindowPointer()
void WindowMovedOrResized()
void RemoveViewport(SViewPort *existingViewport)
float GetAverageFPS() const
float GetStereoEyesSpacing()
void SetStereoCustomProjectonMatrix(bool enable, const Ogre::Matrix4 &leftMatrix, const Ogre::Matrix4 &rightMatrix)
void RestoreStereoCamera(SViewPort *viewport)
void SynchStereoViewportSetup(SViewPort *viewport, bool overlay=false, bool shadow=false)
void DeleteViewport(SViewPort *existingViewport)
void SetWindowHandle(ScolWindowHandle win)
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)
void SetStereoWindow(SO3::SPoint< int > pos, SO3::SPoint< int > size, int index, bool state)
unsigned int GetFSAA() const
void WriteContentsToFile(const std::string &path)
SelectorMode GetSelectorMode()
void SetStereoDistortion(bool enable, Ogre::Vector4 dist)
void UnregisterStereoViewport(SViewPort *viewport)
bool IsStereoViewportRegistered(SViewPort *viewport)
const SViewPortList & GetViewportList() const
void SetStereoFOVy(const float &fov)
bool CheckVideoMode(const int width, const int height)
unsigned int GetTriangleCount()
int Size(const int &x, const int &y, const int &w, const int &h, const int &ext)
void windowResized(Ogre::RenderWindow *rw)
unsigned int GetHeight() const
void SetSelectorEnable(const bool &state)
unsigned int GetBatchCount()
void SetStereoEyesSpacing(const float &eyesSpacing)
float GetWorstFPS() const
void SetStereoMeshRttSize(SO3::SPoint< int > leftsize, SO3::SPoint< int > rightsize)
StereoManager::StereoMode GetStereoMode()
void SetStereoRotateView(const bool state)
SRaycastResult RayCast(const int &pixelsX, const int &pixelsY)
SViewPort * GetViewport(const int &priority) const
virtual void preRenderTargetUpdate(const Ogre::RenderTargetEvent &evt)
void AddViewport(SViewPort *existingViewport)
unsigned int GetWidth() const
void windowMoved(Ogre::RenderWindow *rw)
std::array< SO3::SPoint< int >, 2 > GetStereoViewportSize()
void RefreshSelector(const bool &forceRefresh=false)
float GetWorstFrameTime() const
void windowClosed(Ogre::RenderWindow *rw)
void SetStereoMode(const StereoManager::StereoMode &stereoMode)
SRaycastResult IndRayCast(const int &pixelsX, const int &pixelsY)
SViewPort * CreateViewport(SCamera *camera, int priority, const float &x, const float &y, const float &w, const float &h)
void SetStereoMeshUVConfig(Ogre::Vector2 leftuvscale, Ogre::Vector2 leftuvoffset, Ogre::Vector2 rightuvscale, Ogre::Vector2 rightuvoffset)
void SetSelectorMode(SelectorMode mode)
bool GetStereoRotateView()
void GetStereoCustomProjectonMatrix(bool &enabled, Ogre::Matrix4 &leftMatrix, Ogre::Matrix4 &rightMatrix) const
bool SetFullScreen(const bool &fullscreen, const int &width=0, const int &height=0)
SRaycastResult & GetLastRayCast()
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)
void SetStereoFOVy(Ogre::Real fov)
std::array< SCOL_PTR_TYPE, 2 > GetStereoTextures()
void SetCustomProjectonMatrices(bool enable, const Ogre::Matrix4 &leftMatrix, const Ogre::Matrix4 &rightMatrix)
bool UpdateStereoCompositorState(Ogre::Viewport *ogreViewportInstance, const Ogre::String compname, bool state)
void SetStereoProjectionOffset(Ogre::Real offset)
void SetStereoDistortion(bool enable, Ogre::Vector4 dist)
void GetCustomProjectonMatrices(bool &enabled, Ogre::Matrix4 &leftMatrix, Ogre::Matrix4 &rightMatrix) const
void SetStereoMeshRttSize(SO3::SPoint< int > leftsize, SO3::SPoint< int > rightsize)
bool IsViewportRegistered(Ogre::Viewport *ogreViewportInstance)
void SetStereoChromaticAbCorrection(bool enable, Ogre::Vector4 chromAbC)
void SetStereoMode(const StereoMode &newStereoMode)
void SetStereoWindow(SO3::SPoint< int > pos, SO3::SPoint< int > size, int index, bool state)
Ogre::Real GetEyesSpacing() const
void UnregisterViewport(SViewPort *viewportInstance)
void SetTimeWarpMatrix(const Ogre::Matrix4 &leftStartMatrix, const Ogre::Matrix4 &leftEndMatrix, const Ogre::Matrix4 &rightStartMatrix, const Ogre::Matrix4 &rightEndMatrix)
std::array< SO3::SPoint< int >, 2 > GetStereoViewportSize()
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)
void SetStereoMeshUVConfig(Ogre::Vector2 leftuvscale, Ogre::Vector2 leftuvoffset, Ogre::Vector2 rightuvscale, Ogre::Vector2 rightuvoffset)
void UpdateStereoCamera(Ogre::Viewport *ogreViewportInstance, Ogre::Camera *camera)
void RestoreStereoCamera(Ogre::Viewport *ogreViewportInstance)
void RegisterViewport(SViewPort *viewportInstance)
void SynchViewportSetup(SViewPort *viewportInstance, bool overlay=false, bool shadow=false)
void SetEyesSpacing(Ogre::Real l)
void SetStereoAspectRatio(Ogre::Real ratio)
void UpdateStereoCameraMatrix(Ogre::Viewport *ogreViewportInstance, Ogre::Camera *camera)
void SetRotateView(bool state)
std::unordered_map< int, SViewPort * > SViewPortList
std::unordered_map< std::string, SScene * > SSceneMap