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