update formatting

This commit is contained in:
2026-02-22 23:35:17 -05:00
parent de55a1c1df
commit 1e724f6a2c
5 changed files with 108 additions and 66 deletions

View File

@@ -20,8 +20,7 @@ struct PlatformWindow {
static PlatformWindow *g_current_window = nullptr;
static LRESULT CALLBACK win32_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
static LRESULT CALLBACK win32_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
if (ImGui_ImplWin32_WndProcHandler(hwnd, msg, wparam, lparam))
return true;
@@ -51,8 +50,7 @@ static LRESULT CALLBACK win32_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
return DefWindowProcW(hwnd, msg, wparam, lparam);
}
PlatformWindow *platform_create_window(PlatformWindowDesc *desc)
{
PlatformWindow *platform_create_window(PlatformWindowDesc *desc) {
WNDCLASSEXW wc = {};
wc.cbSize = sizeof(wc);
wc.style = CS_CLASSDC;
@@ -100,8 +98,7 @@ PlatformWindow *platform_create_window(PlatformWindowDesc *desc)
return window;
}
void platform_destroy_window(PlatformWindow *window)
{
void platform_destroy_window(PlatformWindow *window) {
if (!window) return;
if (window->hwnd) {
@@ -115,8 +112,7 @@ void platform_destroy_window(PlatformWindow *window)
delete window;
}
bool platform_poll_events(PlatformWindow *window)
{
bool platform_poll_events(PlatformWindow *window) {
MSG msg;
while (PeekMessageW(&msg, nullptr, 0, 0, PM_REMOVE)) {
TranslateMessage(&msg);
@@ -128,19 +124,16 @@ bool platform_poll_events(PlatformWindow *window)
return !window->should_close;
}
void platform_get_size(PlatformWindow *window, int32_t *w, int32_t *h)
{
void platform_get_size(PlatformWindow *window, int32_t *w, int32_t *h) {
if (w) *w = window->width;
if (h) *h = window->height;
}
void *platform_get_native_handle(PlatformWindow *window)
{
void *platform_get_native_handle(PlatformWindow *window) {
return (void *)window->hwnd;
}
void platform_set_menu(PlatformWindow *window, PlatformMenu *menus, int32_t menu_count)
{
void platform_set_menu(PlatformWindow *window, PlatformMenu *menus, int32_t menu_count) {
HMENU menu_bar = CreateMenu();
for (int32_t i = 0; i < menu_count; i++) {
@@ -169,8 +162,7 @@ void platform_set_menu(PlatformWindow *window, PlatformMenu *menus, int32_t menu
SetMenu(window->hwnd, menu_bar);
}
int32_t platform_poll_menu_command(PlatformWindow *window)
{
int32_t platform_poll_menu_command(PlatformWindow *window) {
int32_t cmd = window->pending_menu_cmd;
window->pending_menu_cmd = 0;
return cmd;