The new SFMLGui is now worked into the code and barely works. Cleanup is next.

This commit is contained in:
Zed A. Shaw 2024-09-01 18:11:33 -04:00
parent 70d1389c54
commit 4bd2d12219
5 changed files with 41 additions and 121 deletions

View file

@ -3,6 +3,8 @@
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Graphics/Sprite.hpp>
#include <SFML/Graphics/Font.hpp>
#include "game_engine.hpp"
#include <string>
constexpr int FPS=30;
constexpr int X_DIM = 1920 / 2;
@ -22,9 +24,11 @@ class SFMLGui {
bool show_build_log = false;
int hit_points = 50;
sf::Font font;
GameEngine &game;
vector<string> log;
public:
SFMLGui();
SFMLGui(GameEngine &g);
void startup();
@ -33,8 +37,9 @@ public:
void handle_events();
void update_entities();
void update_log(vector<string> &lines);
void write_text(int x, int y, const char *content);
void write_text(int x, int y, std::string content);
void ImGui_setup();
void ImGui_update();