power_play/src/window/window.h

70 lines
1.4 KiB
C

////////////////////////////////////////////////////////////
//~ Handle types
Struct(WND_Handle)
{
u64 v;
};
////////////////////////////////////////////////////////////
//~ Cmd types
Enum(WND_CmdKind)
{
WND_CmdKind_None,
WND_CmdKind_SetMinimized,
WND_CmdKind_SetMaximized,
WND_CmdKind_SetFullscreen,
WND_CmdKind_SetForcedTop,
WND_CmdKind_Restore,
};
Struct(WND_Cmd)
{
WND_CmdKind kind;
String restore;
b32 v;
};
////////////////////////////////////////////////////////////
//~ Frame types
Struct(WND_Frame)
{
WND_Handle window;
ControllerEventsArray controller_events;
Vec2I32 draw_size;
Vec2I32 monitor_size;
String restore;
b32 minimized;
b32 maximized;
b32 fullscreen;
b32 forced_top;
b32 has_focus;
};
////////////////////////////////////////////////////////////
//~ @hookdecl Startup
void WND_Startup(void);
////////////////////////////////////////////////////////////
//~ @hookdecl Helpers
u64 WND_OsHandleFromWindow(WND_Handle window);
////////////////////////////////////////////////////////////
//~ @hookdecl Command
#define WND_PushCmd(frame, ...) WND_PushCmd_((frame), (WND_Cmd) { __VA_ARGS__ })
void WND_PushCmd_(WND_Frame frame, WND_Cmd desc);
////////////////////////////////////////////////////////////
//~ @hookdecl Frame
WND_Frame WND_BeginFrame(void);
void WND_EndFrame(WND_Frame frame);