Adapt to new dpf, UI type agnostic
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
b5aa7b7c13
commit
fee3b8f5b3
|
@ -26,11 +26,11 @@ namespace Art = DistrhoArtworkNekobi;
|
|||
|
||||
DistrhoUINekobi::DistrhoUINekobi()
|
||||
: UI(Art::backgroundWidth, Art::backgroundHeight),
|
||||
fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, GL_BGR),
|
||||
fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, kImageFormatBGR),
|
||||
fAboutWindow(this)
|
||||
{
|
||||
// about
|
||||
Image aboutImage(Art::aboutData, Art::aboutWidth, Art::aboutHeight, GL_BGR);
|
||||
Image aboutImage(Art::aboutData, Art::aboutWidth, Art::aboutHeight, kImageFormatBGR);
|
||||
fAboutWindow.setImage(aboutImage);
|
||||
|
||||
// slider
|
||||
|
@ -171,7 +171,7 @@ void DistrhoUINekobi::imageButtonClicked(ImageButton* button, int)
|
|||
if (button != fButtonAbout)
|
||||
return;
|
||||
|
||||
fAboutWindow.exec();
|
||||
fAboutWindow.runAsModal();
|
||||
}
|
||||
|
||||
void DistrhoUINekobi::imageKnobDragStarted(ImageKnob* knob)
|
||||
|
@ -206,8 +206,10 @@ void DistrhoUINekobi::imageSliderValueChanged(ImageSlider* slider, float value)
|
|||
|
||||
void DistrhoUINekobi::onDisplay()
|
||||
{
|
||||
fImgBackground.draw();
|
||||
fNeko.draw();
|
||||
const GraphicsContext& context(getGraphicsContext());
|
||||
|
||||
fImgBackground.draw(context);
|
||||
fNeko.draw(context);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Neko widget animation
|
||||
* Copyright (C) 2013-2015 Filipe Coelho <falktx@falktx.com>
|
||||
* Copyright (C) 2013-2021 Filipe Coelho <falktx@falktx.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
|
@ -21,7 +21,6 @@
|
|||
#include "DistrhoArtworkNekobi.hpp"
|
||||
|
||||
#include "Image.hpp"
|
||||
#include "Widget.hpp"
|
||||
|
||||
#include <cstdlib> // rand
|
||||
|
||||
|
@ -61,7 +60,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void draw()
|
||||
void draw(const GraphicsContext& context)
|
||||
{
|
||||
int x = fPos+108;
|
||||
int y = -2;
|
||||
|
@ -72,7 +71,7 @@ public:
|
|||
y += 12;
|
||||
}
|
||||
|
||||
fCurImage->drawAt(x, y);
|
||||
fCurImage->drawAt(context, x, y);
|
||||
}
|
||||
|
||||
// returns true if needs repaint
|
||||
|
|
Loading…
Reference in New Issue