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/input_system.hpp raw
#pragma once
#include <SDL3/SDL.h>
#include <string>
#include "utils/globals.hpp"
namespace
Nimbin
{
class Game;
enum class InputCommand : uint8_t
{
Jump,
Click,
FocusToggle,
Drop,
ShootAll,
Compile,
Run,
DebugPrint,
FreelookStart, FreelookEnd,
NumberInc, NumberDec,
TypingStart, TypingCommit, TypingCancel,
SandboxRestore,
ConnectPultSubmit,
ConnectPultExit,
};
struct FrameInput
{
bool forward = false;
bool backward = false;
bool left = false;
bool right = false;
bool pick = false;
bool shoot = false;// X held: focus the faced wall
bool vim_normal_keys = false;
bool capture_typing = false;
bool capture_vim = false;
bool typing_mode = false;
bool typing_commit = false;
bool typing_cancel = false;
int look_x = 0;
int look_y = 0;
double scroll_x = 0.0;
double scroll_y = 0.0;
std::string typing_buffer;
DynArray<int> vim_keys;
DynArray<InputCommand> commands;
};
struct InputSystem
{
void handle_Event(Game& game, const SDL_Event& e, FrameInput& input);
};
} // namespace Nimbin