#pragma once

// ::Game::Types::Header::

typedef struct GUIWindow
{
	Vec2 p0;
	Vec2 p1;
	Vec2 grabbed_pos;
	u64 id;
	b8 grabbed;
} GUIWindow;

typedef struct GUIButton
{
	Vec2 p0;
	Vec2 p1;
	u64	 id;
	b8 	 pressed;
	b8 	 pressed_prev;
} GUIButton;

typedef struct GameContext
{
	GUIContext gui;
	PushConst  pc;
	Arena      *arena;
	GUIWindow  *windows;
	u32        window_len;
	GUIButton  *buttons;
	u32        btn_len;
} GameContext;

// ::Game::Init::Functions::Header::

static void InitializeGame(Arena *arena, GameContext *ctx, Arena *ctx_arena);
static void DestroyGame();

// ::Game::GameLoop::Functions::Header::

static void RunCycle(GameContext *ctx, GameInput *inputs, u32 i_count);

// ::Game::Inputs::Functions::Header::

static void HandleInputs(GameInput *inputs, u32 count);

// ::Game::GUI::Functions::Header::

static inline void PrepareGUICtx(GameContext *ctx);
static void DrawRect(GUIContext *ctx, Vec2 p0, Vec2 p1, Vec4 col);
static b32 UIWindow(GameContext *ctx, c8 *title, f32 x0, f32 y0, f32 x1, f32 y1);
static b32 UIButton(GameContext *ctx, c8 *label, f32 x0, f32 y0, f32 x1, f32 y1);
