Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

OpenGL: Force OpenGL sync to vblank for OS X.

OS X does not offer any facility to enable OpenGL vsync, so enable it by
default. Refactor MythRenderOpenGL::Create.
  • Loading branch information...
commit f063d4ed6c8463a2db1c8ca17f564010e20b8091 1 parent a6d4268
Mark Kendall authored
View
5 mythtv/libs/libmythtv/videoout_opengl.cpp
@@ -287,9 +287,6 @@ bool VideoOutputOpenGL::SetupContext(void)
return true;
}
- QGLFormat fmt;
- fmt.setDepth(false);
-
QGLWidget *device = (QGLWidget*)QWidget::find(gl_parent_win);
if (!device)
{
@@ -297,7 +294,7 @@ bool VideoOutputOpenGL::SetupContext(void)
return false;
}
- gl_context = MythRenderOpenGL::Create(fmt, device);
+ gl_context = MythRenderOpenGL::Create(device);
if (gl_context && gl_context->create())
{
gl_context->Init();
View
4 mythtv/libs/libmythui/mythmainwindow.cpp
@@ -961,9 +961,7 @@ void MythMainWindow::Init(void)
{
LOG(VB_GENERAL, LOG_INFO, "Trying the OpenGL painter");
d->painter = new MythOpenGLPainter();
- QGLFormat fmt;
- fmt.setDepth(false);
- d->render = MythRenderOpenGL::Create(fmt);
+ d->render = MythRenderOpenGL::Create();
MythRenderOpenGL *gl = dynamic_cast<MythRenderOpenGL*>(d->render);
d->paintwin = new MythPainterWindowGL(this, d, gl);
QGLWidget *qgl = dynamic_cast<QGLWidget *>(d->paintwin);
View
9 mythtv/libs/libmythui/mythrender_opengl.cpp
@@ -42,8 +42,15 @@ OpenGLLocker::~OpenGLLocker()
m_render->doneCurrent();
}
-MythRenderOpenGL* MythRenderOpenGL::Create(const QGLFormat& format, QPaintDevice* device)
+MythRenderOpenGL* MythRenderOpenGL::Create(QPaintDevice* device)
{
+ QGLFormat format;
+ format.setDepth(false);
+
+#if defined(Q_WS_MAC)
+ format.setSwapInterval(1);
+#endif
+
#ifdef USING_OPENGLES
if (device)
return new MythRenderOpenGL2ES(format, device);
View
3  mythtv/libs/libmythui/mythrender_opengl.h
@@ -98,8 +98,7 @@ class MUI_PUBLIC OpenGLLocker
class MUI_PUBLIC MythRenderOpenGL : public QGLContext, public MythRender
{
public:
- static MythRenderOpenGL* Create(const QGLFormat& format,
- QPaintDevice* device = NULL);
+ static MythRenderOpenGL* Create(QPaintDevice* device = NULL);
MythRenderOpenGL(const QGLFormat& format, QPaintDevice* device,
RenderType type = kRenderUnknown);
Please sign in to comment.
Something went wrong with that request. Please try again.