Skip to content

Commit

Permalink
[EGL] Consider stereomode when considering creating a new window
Browse files Browse the repository at this point in the history
We might be changing from a non-3D to a 3D mode
  • Loading branch information
popcornmix committed Dec 16, 2015
1 parent b65bb38 commit 33d8026
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion xbmc/windowing/egl/WinSystemEGL.cpp
Expand Up @@ -52,6 +52,7 @@ CWinSystemEGL::CWinSystemEGL() : CWinSystemBase()
m_surface = EGL_NO_SURFACE;
m_context = EGL_NO_CONTEXT;
m_config = NULL;
m_stereo_mode = RENDER_STEREO_MODE_OFF;

m_egl = NULL;
m_iVSyncMode = 0;
Expand Down Expand Up @@ -273,6 +274,7 @@ bool CWinSystemEGL::CreateNewWindow(const std::string& name, bool fullScreen, RE
{
RESOLUTION_INFO current_resolution;
current_resolution.iWidth = current_resolution.iHeight = 0;
RENDER_STEREO_MODE stereo_mode = g_graphicsContext.GetStereoMode();

m_nWidth = res.iWidth;
m_nHeight = res.iHeight;
Expand All @@ -284,12 +286,14 @@ bool CWinSystemEGL::CreateNewWindow(const std::string& name, bool fullScreen, RE
current_resolution.iWidth == res.iWidth && current_resolution.iHeight == res.iHeight &&
current_resolution.iScreenWidth == res.iScreenWidth && current_resolution.iScreenHeight == res.iScreenHeight &&
m_bFullScreen == fullScreen && current_resolution.fRefreshRate == res.fRefreshRate &&
(current_resolution.dwFlags & D3DPRESENTFLAG_MODEMASK) == (res.dwFlags & D3DPRESENTFLAG_MODEMASK))
(current_resolution.dwFlags & D3DPRESENTFLAG_MODEMASK) == (res.dwFlags & D3DPRESENTFLAG_MODEMASK) &&
m_stereo_mode == stereo_mode)
{
CLog::Log(LOGDEBUG, "CWinSystemEGL::CreateNewWindow: No need to create a new window");
return true;
}

m_stereo_mode = stereo_mode;
m_bFullScreen = fullScreen;
// Destroy any existing window
if (m_surface != EGL_NO_SURFACE)
Expand Down
1 change: 1 addition & 0 deletions xbmc/windowing/egl/WinSystemEGL.h
Expand Up @@ -78,6 +78,7 @@ class CWinSystemEGL : public CWinSystemBase, public CRenderSystemGLES
EGLSurface m_surface;
EGLContext m_context;
EGLConfig m_config;
RENDER_STEREO_MODE m_stereo_mode;

CEGLWrapper *m_egl;
std::string m_extensions;
Expand Down

0 comments on commit 33d8026

Please sign in to comment.