type alias refactor
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "base/base_core.h"
|
||||
#include "base/base_math.h"
|
||||
|
||||
@@ -35,16 +33,16 @@ enum {
|
||||
|
||||
struct PlatformInput {
|
||||
// Typed characters (UTF-16 code units, printable only)
|
||||
uint16_t chars[PLATFORM_MAX_CHARS_PER_FRAME];
|
||||
int32_t char_count;
|
||||
U16 chars[PLATFORM_MAX_CHARS_PER_FRAME];
|
||||
S32 char_count;
|
||||
|
||||
// Key-down events (virtual key codes)
|
||||
uint8_t keys[PLATFORM_MAX_KEYS_PER_FRAME];
|
||||
int32_t key_count;
|
||||
U8 keys[PLATFORM_MAX_KEYS_PER_FRAME];
|
||||
S32 key_count;
|
||||
|
||||
// Modifier state at time of last key event
|
||||
bool ctrl_held;
|
||||
bool shift_held;
|
||||
B32 ctrl_held;
|
||||
B32 shift_held;
|
||||
|
||||
// Mouse state (polled per frame)
|
||||
Vec2F32 mouse_pos;
|
||||
@@ -57,19 +55,19 @@ struct PlatformWindow;
|
||||
|
||||
struct PlatformWindowDesc {
|
||||
const char *title = "autosample";
|
||||
int32_t width = 1280;
|
||||
int32_t height = 720;
|
||||
S32 width = 1280;
|
||||
S32 height = 720;
|
||||
};
|
||||
|
||||
struct PlatformMenuItem {
|
||||
const char *label; // nullptr = separator
|
||||
int32_t id; // command ID (ignored for separators)
|
||||
S32 id; // command ID (ignored for separators)
|
||||
};
|
||||
|
||||
struct PlatformMenu {
|
||||
const char *label;
|
||||
PlatformMenuItem *items;
|
||||
int32_t item_count;
|
||||
S32 item_count;
|
||||
};
|
||||
|
||||
// Called by the platform layer when the window needs a frame rendered
|
||||
@@ -79,13 +77,13 @@ typedef void (*PlatformFrameCallback)(void *user_data);
|
||||
|
||||
PlatformWindow *platform_create_window(PlatformWindowDesc *desc);
|
||||
void platform_destroy_window(PlatformWindow *window);
|
||||
bool platform_poll_events(PlatformWindow *window);
|
||||
void platform_get_size(PlatformWindow *window, int32_t *w, int32_t *h);
|
||||
B32 platform_poll_events(PlatformWindow *window);
|
||||
void platform_get_size(PlatformWindow *window, S32 *w, S32 *h);
|
||||
void *platform_get_native_handle(PlatformWindow *window);
|
||||
|
||||
void platform_set_frame_callback(PlatformWindow *window, PlatformFrameCallback cb, void *user_data);
|
||||
void platform_set_menu(PlatformWindow *window, PlatformMenu *menus, int32_t menu_count);
|
||||
int32_t platform_poll_menu_command(PlatformWindow *window);
|
||||
void platform_set_menu(PlatformWindow *window, PlatformMenu *menus, S32 menu_count);
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user