summaryrefslogtreecommitdiff
path: root/plugins/ZaMaximX2/ZaMaximX2UI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/ZaMaximX2/ZaMaximX2UI.cpp')
-rw-r--r--plugins/ZaMaximX2/ZaMaximX2UI.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/plugins/ZaMaximX2/ZaMaximX2UI.cpp b/plugins/ZaMaximX2/ZaMaximX2UI.cpp
index 75d7312..884fbec 100644
--- a/plugins/ZaMaximX2/ZaMaximX2UI.cpp
+++ b/plugins/ZaMaximX2/ZaMaximX2UI.cpp
@@ -30,7 +30,7 @@ ZaMaximX2UI::ZaMaximX2UI()
setSize(ZaMaximX2Artwork::zamaximx2Width, ZaMaximX2Artwork::zamaximx2Height);
// background
- fImgBackground = Image(ZaMaximX2Artwork::zamaximx2Data, ZaMaximX2Artwork::zamaximx2Width, ZaMaximX2Artwork::zamaximx2Height, GL_BGR);
+ fImgBackground = Image(ZaMaximX2Artwork::zamaximx2Data, ZaMaximX2Artwork::zamaximx2Width, ZaMaximX2Artwork::zamaximx2Height, kImageFormatBGR);
// led images
fLedRedImg = Image(ZaMaximX2Artwork::ledredData, ZaMaximX2Artwork::ledredWidth, ZaMaximX2Artwork::ledredHeight);
@@ -143,7 +143,8 @@ void ZaMaximX2UI::imageKnobValueChanged(ZamKnob* knob, float value)
void ZaMaximX2UI::onDisplay()
{
- fImgBackground.draw();
+ const GraphicsContext& context(getGraphicsContext());
+ fImgBackground.draw(context);
// draw leds
static const float sLedSpacing = 15.5f;
@@ -181,8 +182,8 @@ void ZaMaximX2UI::onDisplay()
numRedLeds = 1;
else numRedLeds = 0;
- for (int i=numRedLeds; i>0; --i)
- fLedRedImg.drawAt(sLedInitialX + (12 - i)*sLedSpacing, sRedLedStaticY);
+ for (int i=numRedLeds; i>0; --i)
+ fLedRedImg.drawAt(context, sLedInitialX + (12 - i)*sLedSpacing, sRedLedStaticY);
if (fLedYellowValue >= 20.f)
numYellowLeds = 19;
@@ -226,12 +227,12 @@ void ZaMaximX2UI::onDisplay()
if (numYellowLeds > 12) {
for (int i=12; i<numYellowLeds; ++i)
- fLedRedImg.drawAt(sLedInitialX + i*sLedSpacing, sYellowLedStaticY);
+ fLedRedImg.drawAt(context, sLedInitialX + i*sLedSpacing, sYellowLedStaticY);
for (int i=0; i<12; ++i)
- fLedYellowImg.drawAt(sLedInitialX + i*sLedSpacing, sYellowLedStaticY);
+ fLedYellowImg.drawAt(context, sLedInitialX + i*sLedSpacing, sYellowLedStaticY);
} else {
for (int i=0; i<numYellowLeds; ++i)
- fLedYellowImg.drawAt(sLedInitialX + i*sLedSpacing, sYellowLedStaticY);
+ fLedYellowImg.drawAt(context, sLedInitialX + i*sLedSpacing, sYellowLedStaticY);
}
}