Use platform windows for windowing instead of custom draggable window system

This commit is contained in:
2026-03-05 11:44:23 -05:00
parent b75cb920eb
commit 5eaae4deb9
15 changed files with 833 additions and 742 deletions

View File

@@ -53,10 +53,23 @@ struct PlatformInput {
struct PlatformWindow;
enum PlatformWindowStyle {
PLATFORM_WINDOW_STYLE_NORMAL = 0,
PLATFORM_WINDOW_STYLE_POPUP = 1, // utility panel, owned by parent
};
struct PlatformWindowDesc {
const char *title = "autosample";
S32 width = 1280;
S32 height = 720;
const char *title = "autosample";
S32 width = 1280;
S32 height = 720;
PlatformWindowStyle style = PLATFORM_WINDOW_STYLE_NORMAL;
PlatformWindow *parent = nullptr;
};
enum PlatformMsgBoxType {
PLATFORM_MSGBOX_OK = 0,
PLATFORM_MSGBOX_OK_CANCEL = 1,
PLATFORM_MSGBOX_YES_NO = 2,
};
struct PlatformMenuItem {
@@ -88,6 +101,13 @@ S32 platform_poll_menu_command(PlatformWindow *window);
// Returns accumulated input since last call (keyboard events + polled mouse state), then clears the buffer.
PlatformInput platform_get_input(PlatformWindow *window);
// Returns true if the window's close button was clicked (for popup windows).
B32 platform_window_should_close(PlatformWindow *window);
// Blocks until user responds. Returns 0=first button, 1=second button, -1=dismissed.
S32 platform_message_box(PlatformWindow *parent, const char *title,
const char *message, PlatformMsgBoxType type);
// Cursor shapes for resize handles
enum PlatformCursor {
PLATFORM_CURSOR_ARROW = 0,