From a3f4ac00ee76f5e3b2dae7838a6c13ccae40ceac Mon Sep 17 00:00:00 2001 From: cflip Date: Sun, 20 Feb 2022 09:15:40 -0700 Subject: Set up CMake build system --- src/gui.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/gui.h (limited to 'src/gui.h') diff --git a/src/gui.h b/src/gui.h new file mode 100644 index 0000000..76a1128 --- /dev/null +++ b/src/gui.h @@ -0,0 +1,37 @@ +#pragma once + +#include + +#include +#include "sequence.h" + +class Slider { +public: + Slider(int x, int y, float* valuePtr, float scaling = 1.f) + : m_bounds({ x, y, 25, 75 }), value(valuePtr), valueScaling(scaling) {} + + void Draw(SDL_Renderer*); + bool InBounds(int x, int y); + + float* value; + float valueScaling; +private: + SDL_Rect m_bounds; +}; + +class GUI { +public: + GUI(Sequence&); + + void OnMouseDown(int x, int y); + void OnMouseUp(); + void OnMouseMove(int x, int y); + + void Repaint(SDL_Renderer*, int currentStep); +private: + std::vector m_sliders; + + Sequence& m_sequence; + Slider* m_activeSlider{ nullptr }; + int m_dragStart{ 0 }; +}; \ No newline at end of file -- cgit v1.2.3