diff options
-rw-r--r-- | SConstruct | 3 | ||||
-rw-r--r-- | build/depends.py | 10 | ||||
-rw-r--r-- | build/features.py | 19 | ||||
-rw-r--r-- | src/waveform/renderers/glslwaveformrenderersignal.cpp | 9 | ||||
-rw-r--r-- | src/waveform/renderers/glvsynctestrenderer.cpp | 4 | ||||
-rw-r--r-- | src/waveform/renderers/glwaveformrendererfilteredsignal.cpp | 5 | ||||
-rw-r--r-- | src/waveform/renderers/glwaveformrendererrgb.cpp | 5 | ||||
-rw-r--r-- | src/waveform/renderers/glwaveformrenderersimplesignal.cpp | 5 |
8 files changed, 54 insertions, 6 deletions
diff --git a/SConstruct b/SConstruct index da6fbbe678..6c4f62d7ba 100644 --- a/SConstruct +++ b/SConstruct @@ -62,6 +62,9 @@ available_features = [features.Mad, features.AsmLib, features.IPod, features.FFMPEG, + + # Experimental features + features.OpenGLES ] build = mixxx.MixxxBuild(target, machine, build_type, diff --git a/build/depends.py b/build/depends.py index 970ffb3696..20b6de9b8a 100644 --- a/build/depends.py +++ b/build/depends.py @@ -863,11 +863,6 @@ class MixxxCore(Feature): "waveform/renderers/waveformrendererrgb.cpp", "waveform/renderers/qtwaveformrendererfilteredsignal.cpp", "waveform/renderers/qtwaveformrenderersimplesignal.cpp", - "waveform/renderers/glwaveformrendererfilteredsignal.cpp", - "waveform/renderers/glwaveformrenderersimplesignal.cpp", - "waveform/renderers/glslwaveformrenderersignal.cpp", - "waveform/renderers/glvsynctestrenderer.cpp", - "waveform/renderers/glwaveformrendererrgb.cpp", "waveform/renderers/waveformsignalcolors.cpp", @@ -875,6 +870,11 @@ class MixxxCore(Feature): "waveform/renderers/waveformmark.cpp", "waveform/renderers/waveformmarkset.cpp", "waveform/renderers/waveformmarkrange.cpp", + "waveform/renderers/glwaveformrenderersimplesignal.cpp", + "waveform/renderers/glwaveformrendererrgb.cpp", + "waveform/renderers/glwaveformrendererfilteredsignal.cpp", + "waveform/renderers/glslwaveformrenderersignal.cpp", + "waveform/renderers/glvsynctestrenderer.cpp", "waveform/widgets/waveformwidgetabstract.cpp", "waveform/widgets/emptywaveformwidget.cpp", diff --git a/build/features.py b/build/features.py index 9b54696919..11daee530e 100644 --- a/build/features.py +++ b/build/features.py @@ -6,6 +6,25 @@ from mixxx import Feature import SCons.Script as SCons import depends +class OpenGLES(Feature): + def description(self): + return "OpenGL-ES >= 2.0 support [Experimental]" + + def enabled(self, build): + build.flags['opengles'] = util.get_flags(build.env, 'opengles', 0) + return int(build.flags['opengles']) + + def add_options(self, build, vars): + vars.Add('opengles', 'Set to 1 to enable OpenGL-ES >= 2.0 support [Experimental]', 0) + + def configure(self, build, conf): + if not self.enabled(build): + return + if build.flags['opengles']: + build.env.Append(CPPDEFINES='__OPENGLES__') + + def sources(self, build): + return [] class HSS1394(Feature): def description(self): diff --git a/src/waveform/renderers/glslwaveformrenderersignal.cpp b/src/waveform/renderers/glslwaveformrenderersignal.cpp index b04970d0cc..57c803d6f3 100644 --- a/src/waveform/renderers/glslwaveformrenderersignal.cpp +++ b/src/waveform/renderers/glslwaveformrenderersignal.cpp @@ -143,6 +143,8 @@ void GLSLWaveformRendererSignal::createGeometry() { if (m_unitQuadListId != -1) return; +#ifndef __OPENGLES__ + glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-1.0, 1.0, -1.0, 1.0, -10.0, 10.0); @@ -169,6 +171,8 @@ void GLSLWaveformRendererSignal::createGeometry() { glEnd(); } glEndList(); + +#endif } void GLSLWaveformRendererSignal::createFrameBuffers() @@ -275,6 +279,8 @@ void GLSLWaveformRendererSignal::draw(QPainter* painter, QPaintEvent* /*event*/) //qDebug() << "GAIN" << allGain << lowGain << midGain << highGain; +#ifndef __OPENGLES__ + //paint into frame buffer { glMatrixMode(GL_PROJECTION); @@ -346,7 +352,6 @@ void GLSLWaveformRendererSignal::draw(QPainter* painter, QPaintEvent* /*event*/) } glEnd(); - m_framebuffer->release(); m_frameShaderProgram->release(); @@ -421,5 +426,7 @@ void GLSLWaveformRendererSignal::draw(QPainter* painter, QPaintEvent* /*event*/) glMatrixMode(GL_PROJECTION); glPopMatrix(); +#endif + painter->endNativePainting(); } diff --git a/src/waveform/renderers/glvsynctestrenderer.cpp b/src/waveform/renderers/glvsynctestrenderer.cpp index 75eab2eabe..59b0a1142b 100644 --- a/src/waveform/renderers/glvsynctestrenderer.cpp +++ b/src/waveform/renderers/glvsynctestrenderer.cpp @@ -72,6 +72,8 @@ void GLVSyncTestRenderer::draw(QPainter* painter, QPaintEvent* /*event*/) { glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); +#ifndef __OPENGLES__ + //t7 = timer.restart(); // 5,770 glMatrixMode(GL_PROJECTION); @@ -113,6 +115,8 @@ void GLVSyncTestRenderer::draw(QPainter* painter, QPaintEvent* /*event*/) { glMatrixMode(GL_PROJECTION); glPopMatrix(); +#endif + //t12 = timer.restart(); // 22,426 painter->endNativePainting(); diff --git a/src/waveform/renderers/glwaveformrendererfilteredsignal.cpp b/src/waveform/renderers/glwaveformrendererfilteredsignal.cpp index 5aa38b7b9f..d7f3a7fc00 100644 --- a/src/waveform/renderers/glwaveformrendererfilteredsignal.cpp +++ b/src/waveform/renderers/glwaveformrendererfilteredsignal.cpp @@ -70,6 +70,8 @@ void GLWaveformRendererFilteredSignal::draw(QPainter* painter, QPaintEvent* /*ev float maxHigh[2]; float meanIndex; +#ifndef __OPENGLES__ + if (m_alignment == Qt::AlignCenter) { glMatrixMode(GL_PROJECTION); glPushMatrix(); @@ -198,5 +200,8 @@ void GLWaveformRendererFilteredSignal::draw(QPainter* painter, QPaintEvent* /*ev glPopMatrix(); glMatrixMode(GL_PROJECTION); glPopMatrix(); + +#endif + painter->endNativePainting(); } diff --git a/src/waveform/renderers/glwaveformrendererrgb.cpp b/src/waveform/renderers/glwaveformrendererrgb.cpp index 5588a384a3..a3bad93672 100644 --- a/src/waveform/renderers/glwaveformrendererrgb.cpp +++ b/src/waveform/renderers/glwaveformrendererrgb.cpp @@ -63,6 +63,8 @@ void GLWaveformRendererRGB::draw(QPainter* painter, QPaintEvent* /*event*/) { const float kHeightScaleFactor = 255.0 / sqrtf(255 * 255 * 3); +#ifndef __OPENGLES__ + if (m_alignment == Qt::AlignCenter) { glMatrixMode(GL_PROJECTION); glPushMatrix(); @@ -191,5 +193,8 @@ void GLWaveformRendererRGB::draw(QPainter* painter, QPaintEvent* /*event*/) { glPopMatrix(); glMatrixMode(GL_PROJECTION); glPopMatrix(); + +#endif + painter->endNativePainting(); } diff --git a/src/waveform/renderers/glwaveformrenderersimplesignal.cpp b/src/waveform/renderers/glwaveformrenderersimplesignal.cpp index 2b39e7842b..ea93b2a8ec 100644 --- a/src/waveform/renderers/glwaveformrenderersimplesignal.cpp +++ b/src/waveform/renderers/glwaveformrenderersimplesignal.cpp @@ -59,6 +59,8 @@ void GLWaveformRendererSimpleSignal::draw(QPainter* painter, QPaintEvent* /*even // Reset device for native painting painter->beginNativePainting(); +#ifndef __OPENGLES__ + glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -154,5 +156,8 @@ void GLWaveformRendererSimpleSignal::draw(QPainter* painter, QPaintEvent* /*even glPopMatrix(); glMatrixMode(GL_PROJECTION); glPopMatrix(); + +#endif + painter->endNativePainting(); } |