Browse Source

Clear up resize stuff

master
falkTX 11 years ago
parent
commit
87a95d5b58
3 changed files with 35 additions and 26 deletions
  1. +1
    -1
      dpf
  2. +33
    -24
      plugins/ProM/DistrhoUIProM.cpp
  3. +1
    -1
      plugins/ProM/DistrhoUIProM.hpp

+ 1
- 1
dpf

@@ -1 +1 @@
Subproject commit 51a6f9c3ba792374158b8ed2123844369a8f916d
Subproject commit 05384270a88a734439db13aba8eb4714b7a78f80

+ 33
- 24
plugins/ProM/DistrhoUIProM.cpp View File

@@ -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()


+ 1
- 1
plugins/ProM/DistrhoUIProM.hpp View File

@@ -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<projectM> fPM;


Loading…
Cancel
Save