diff options
author | cflip <cflip@cflip.net> | 2022-02-20 09:15:40 -0700 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2022-02-20 09:15:40 -0700 |
commit | a3f4ac00ee76f5e3b2dae7838a6c13ccae40ceac (patch) | |
tree | af8575869f901657b2252c56c7a15e278ef2c0f7 /gui.h | |
parent | 3828bb56022c636a7dd056a4781249222ea0d3ca (diff) |
Diffstat (limited to 'gui.h')
-rw-r--r-- | gui.h | 37 |
1 files changed, 0 insertions, 37 deletions
@@ -1,37 +0,0 @@ -#pragma once - -#include <SDL2/SDL.h> - -#include <vector> -#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<Slider> m_sliders; - - Sequence& m_sequence; - Slider* m_activeSlider{ nullptr }; - int m_dragStart{ 0 }; -};
\ No newline at end of file |