Browse Source

Adapt to new dpf, UI type agnostic

Signed-off-by: falkTX <falktx@falktx.com>
pull/16/head
falkTX 3 years ago
parent
commit
fee3b8f5b3
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 10 additions and 9 deletions
  1. +7
    -5
      plugins/Nekobi/DistrhoUINekobi.cpp
  2. +3
    -4
      plugins/Nekobi/NekoWidget.hpp

+ 7
- 5
plugins/Nekobi/DistrhoUINekobi.cpp View File

@@ -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);
}

// -----------------------------------------------------------------------


+ 3
- 4
plugins/Nekobi/NekoWidget.hpp View File

@@ -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…
Cancel
Save