sdl_runtime_compiler git · main
SDL3 game for running and compiling code at runtime
C++ 72.3% C 26.2%git clone https://git.christianimmanuel.de/sdl-graphics/sdl_runtime_compiler.gitwget https://git.christianimmanuel.de/sdl-graphics/sdl_runtime_compiler/archive/sdl_runtime_compiler.tar.gzsrc/systems/program_system.hpp raw
#pragma once
#include <string>
#include <sys/types.h>
#include "entities/world.hpp"
#include "text/handler.hpp"
#include "utils/globals.hpp"
namespace
Nimbin
{
struct ProgramSystem
{
private:
std::string _pending;
pid_t _child {-1};
int _out_fd {-1};
int _in_fd {-1};
int _count {0};
void push_Line (Text::Handler& out, const std::string& line);
void close_Child();
public:
static inline float line_height = 0.4f;
static inline float start_y = World::get_FloorY() + 1;
void run (Text::Handler& out);
void update (Text::Handler& out);
void feed_Input (const std::string& text);
void echo_Input (Text::Handler& out, const std::string& line);
void echo_Words (Text::Handler& out, DynArray<Text::TokenPtr>& words);
bool is_Running () const { return _child > 0; }
~ProgramSystem();
};
} // namespace Nimbin