diff --git a/dpf b/dpf index 51a6f9c..0538427 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit 51a6f9c3ba792374158b8ed2123844369a8f916d +Subproject commit 05384270a88a734439db13aba8eb4714b7a78f80 diff --git a/plugins/ProM/DistrhoUIProM.cpp b/plugins/ProM/DistrhoUIProM.cpp index f3ae23b..9a555a9 100644 --- a/plugins/ProM/DistrhoUIProM.cpp +++ b/plugins/ProM/DistrhoUIProM.cpp @@ -85,16 +85,45 @@ void DistrhoUIProM::d_uiIdle() } } +void DistrhoUIProM::d_uiReshape(int width, int height) +{ + glEnable(GL_BLEND); + glEnable(GL_LINE_SMOOTH); + glEnable(GL_POINT_SMOOTH); + + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glShadeModel(GL_SMOOTH); + + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(0, width, height, 0, 0.0f, 1.0f); + glViewport(0, 0, width, height); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + glDrawBuffer(GL_BACK); + glReadBuffer(GL_BACK); + + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + glLineStipple(2, 0xAAAA); + + if (fPM == nullptr) + fPM = new projectM(kSettings); // std::string("/usr/share/projectM/config.inp")); + + fPM->projectM_resetGL(width, height); +} + // ----------------------------------------------------------------------- // Widget Callbacks void DistrhoUIProM::onDisplay() { if (fPM == nullptr) - { - fPM = new projectM(kSettings); // std::string("/usr/share/projectM/config.inp")); - fPM->projectM_resetGL(getWidth(), getHeight()); - } + return; fPM->renderFrame(); } @@ -241,26 +270,6 @@ bool DistrhoUIProM::onSpecial(bool press, uint key) return true; } -void DistrhoUIProM::onReshape(int width, int height) -{ - glShadeModel(GL_SMOOTH); - - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - - glDrawBuffer(GL_BACK); - glReadBuffer(GL_BACK); - glEnable(GL_BLEND); - - glEnable(GL_LINE_SMOOTH); - glEnable(GL_POINT_SMOOTH); - - glLineStipple(2, 0xAAAA); - - if (fPM != nullptr) - fPM->projectM_resetGL(width, height); -} - // ----------------------------------------------------------------------- UI* createUI() diff --git a/plugins/ProM/DistrhoUIProM.hpp b/plugins/ProM/DistrhoUIProM.hpp index 32452b3..c4ae923 100644 --- a/plugins/ProM/DistrhoUIProM.hpp +++ b/plugins/ProM/DistrhoUIProM.hpp @@ -54,6 +54,7 @@ protected: // UI Callbacks void d_uiIdle() override; + void d_uiReshape(int width, int height) override; // ------------------------------------------------------------------- // Widget Callbacks @@ -61,7 +62,6 @@ protected: void onDisplay() override; bool onKeyboard(bool press, uint32_t key) override; bool onSpecial(bool press, uint key) override; - void onReshape(int width, int height) override; private: ScopedPointer fPM;