Added generic button

This commit is contained in:
2022-06-21 14:52:36 +02:00
parent a3a1e900b5
commit 2402567330
8 changed files with 100 additions and 4 deletions
+12
View File
@@ -0,0 +1,12 @@
#include "gui.hpp"
std::shared_ptr<SDLPP::RectangleRender>
createButton(double x, double y, double w, double h,
std::shared_ptr<SDLPP::Renderer> &r, const std::string &text,
const std::string &color, const std::string &outline_color,
const std::string &background_color,
std::function<void(void *)> click_fun, void *input) {
auto button = std::make_shared<Button>(
x, y, w, h, r, text, color, outline_color, background_color, click_fun, input);
return std::static_pointer_cast<SDLPP::RectangleRender>(button);
}