Permalink
Browse files

UI: Enable the OpenGL 2.0 renderer using the UIPainter override.

  • Loading branch information...
1 parent ce1e0d4 commit 3411274a6b19f948918360e33374a5475f33d6c5 Mark Kendall committed Oct 22, 2011
View
2 mythtv/libs/libmythtv/videoout_opengl.cpp
@@ -294,7 +294,7 @@ bool VideoOutputOpenGL::SetupContext(void)
return false;
}
- gl_context = MythRenderOpenGL::Create(device);
+ gl_context = MythRenderOpenGL::Create("", device);
if (gl_context && gl_context->create())
{
gl_context->Init();
View
4 mythtv/libs/libmythui/mythmainwindow.cpp
@@ -947,11 +947,11 @@ void MythMainWindow::Init(void)
#endif
#ifdef USE_OPENGL_PAINTER
if ((painter == "auto" && (!d->painter && !d->paintwin)) ||
- painter == "opengl")
+ painter.contains("opengl"))
{
LOG(VB_GENERAL, LOG_INFO, "Trying the OpenGL painter");
d->painter = new MythOpenGLPainter();
- d->render = MythRenderOpenGL::Create();
+ d->render = MythRenderOpenGL::Create(painter);
MythRenderOpenGL *gl = dynamic_cast<MythRenderOpenGL*>(d->render);
d->paintwin = new MythPainterWindowGL(this, d, gl);
QGLWidget *qgl = dynamic_cast<QGLWidget *>(d->paintwin);
View
10 mythtv/libs/libmythui/mythrender_opengl.cpp
@@ -42,7 +42,8 @@ OpenGLLocker::~OpenGLLocker()
m_render->doneCurrent();
}
-MythRenderOpenGL* MythRenderOpenGL::Create(QPaintDevice* device)
+MythRenderOpenGL* MythRenderOpenGL::Create(const QString &painter,
+ QPaintDevice* device)
{
QGLFormat format;
format.setDepth(false);
@@ -56,9 +57,16 @@ MythRenderOpenGL* MythRenderOpenGL::Create(QPaintDevice* device)
return new MythRenderOpenGL2ES(format, device);
return new MythRenderOpenGL2ES(format);
#else
+ if (painter.contains("opengl2"))
+ {
+ if (device)
+ return new MythRenderOpenGL2(format, device);
+ return new MythRenderOpenGL2(format);
+ }
if (device)
return new MythRenderOpenGL1(format, device);
return new MythRenderOpenGL1(format);
+
#endif
}
View
3 mythtv/libs/libmythui/mythrender_opengl.h
@@ -89,7 +89,8 @@ class MUI_PUBLIC OpenGLLocker
class MUI_PUBLIC MythRenderOpenGL : public QGLContext, public MythRender
{
public:
- static MythRenderOpenGL* Create(QPaintDevice* device = NULL);
+ static MythRenderOpenGL* Create(const QString &painter,
+ QPaintDevice* device = NULL);
MythRenderOpenGL(const QGLFormat& format, QPaintDevice* device,
RenderType type = kRenderUnknown);

0 comments on commit 3411274

Please sign in to comment.