Skip to content
This repository
Browse code

[gles] fixed, m_iVSyncMode var in two places with different type, opp…

…s. pick one, please
  • Loading branch information...
commit 8d2e0fe0d3cd5592765910de545ff471c90cea8c 1 parent 5dc1030
authored February 27, 2013
9  xbmc/windowing/egl/WinSystemEGL.cpp
@@ -43,7 +43,7 @@ CWinSystemEGL::CWinSystemEGL() : CWinSystemBase()
43 43
   m_config            = NULL;
44 44
 
45 45
   m_egl               = NULL;
46  
-  m_iVSyncMode        = false;
  46
+  m_iVSyncMode        = 0;
47 47
 }
48 48
 
49 49
 CWinSystemEGL::~CWinSystemEGL()
@@ -384,9 +384,12 @@ bool CWinSystemEGL::PresentRenderImpl(const CDirtyRegionList &dirty)
384 384
 
385 385
 void CWinSystemEGL::SetVSyncImpl(bool enable)
386 386
 {
387  
-  m_iVSyncMode = enable;
388  
-  if (!m_egl->SetVSync(m_display, m_iVSyncMode))
  387
+  m_iVSyncMode = enable ? 10:0;
  388
+  if (!m_egl->SetVSync(m_display, enable))
  389
+  {
  390
+    m_iVSyncMode = 0;
389 391
     CLog::Log(LOGERROR, "%s,Could not set egl vsync", __FUNCTION__);
  392
+  }
390 393
 }
391 394
 
392 395
 void CWinSystemEGL::ShowOSMouse(bool show)
1  xbmc/windowing/egl/WinSystemEGL.h
@@ -75,7 +75,6 @@ class CWinSystemEGL : public CWinSystemBase, public CRenderSystemGLES
75 75
   EGLConfig             m_config;
76 76
 
77 77
   CEGLWrapper           *m_egl;
78  
-  bool                  m_iVSyncMode;
79 78
   std::string           m_extensions;
80 79
 };
81 80
 

0 notes on commit 8d2e0fe

Cory Fields

No, that's testing code from a long time ago. Should of course be 0/1.

But EGL does allow for this to be set to higher than 1, it's basically a vblank timing divisor.

davilla

darwin uses 10, it comes from x11 stuff, I'm not sure wtf 10 means anymore. It was needed with darwin when I changes osx and added ios, so I did the same here until someone figures out what these magic things really means and creates a proper enum for them.

davilla

@theuni , not here, in the actual m_egl->SetVSync code which only checks the value of the bool and sets the sync to 0 or 1. That 0 or 1 is the vblank timing divisor, for example 2 is also valid.... on some platforms.

popcornmix

Could we make m_iVSyncMode default to enabled?
Currently the "let driver choose" option for vsync leaves it disabled which seems inappropriate for any EGL platform, which are generally low powered devices that won't want to render faster than vsync.

davilla

pivos does that in the packaging steps. we hate ifdefs :)

popcornmix

But does it need an ifdef? Does anyone want it to be disabled?

davilla

maybe windows breaks if vsync is enabled ? who know, you are asking for a platform change here, so it needs to be checked and verified on all platforms that it might effect.

Cory Fields

Looks like each renderer has its own definition of vsyncmode. In the case of gles, it appears as though we only test whether it's non-null or not. Am I missing something else?

Please sign in to comment.
Something went wrong with that request. Please try again.