blob: 350e7db6aad02ba5b26cc251129e7582e2dda2f8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#pragma once
#include <string>
#include "sdl_widget.hpp"
class SdlButton : public SdlWidget
{
public:
SdlButton(SDL_Renderer* renderer, const std::string& label, int id, const SDL_Rect& rect);
SdlButton(SdlButton&& other) noexcept;
~SdlButton() override = default;
bool highlight(SDL_Renderer* renderer);
bool mouseover(SDL_Renderer* renderer);
bool update(SDL_Renderer* renderer);
[[nodiscard]] int id() const;
private:
SdlButton(const SdlButton& other) = delete;
private:
std::string _name;
int _id;
};
|