Added WidgetText. Fixed some things. Updated README

This commit is contained in:
2025-12-04 17:23:53 +02:00
parent 58abb91c64
commit 56e07e1080
8 changed files with 473 additions and 8 deletions

View File

@@ -11,6 +11,7 @@
#include "sdl_helpers.h"
#include "Widgets/Widget.h"
#include "Widgets/WidgetText.h"
using std::cout;
using std::endl;
@@ -21,7 +22,7 @@ using nlohmann::json;
void init_builders(map<string, Widget*(*)(const json&)>& widget_builders)
{
// widget_builders["name"] = &WidgetName::builder;
widget_builders["text"] = &WidgetText::builder;
}
int main(int argc, char **argv)
@@ -107,7 +108,7 @@ int main(int argc, char **argv)
}
// Clear screen with white
SDL_FillRect(main_surface, nullptr, SDL_MapRGBA(main_surface->format, 255, 255, 255, 255));
SDL_FillRect(main_surface, nullptr, SDL_MapRGBA(main_surface->format, 255, 255, 255, SDL_ALPHA_OPAQUE));
// Draw and apply all widgets
for (Widget* widget : widgets)