mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-07-17 14:51:26 -07:00
strip out update/render/repaint window cruft; promote layer per-tick APIs to base layer
This commit is contained in:
@@ -142,12 +142,6 @@ os_window_first_paint(OS_Handle handle)
|
||||
XMapWindow(os_lnx_gfx_state->display, w->window);
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_equip_repaint(OS_Handle handle, OS_WindowRepaintFunctionType *repaint, void *user_data)
|
||||
{
|
||||
if(os_handle_match(handle, os_handle_zero())) {return;}
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_focus(OS_Handle handle)
|
||||
{
|
||||
|
||||
+5
-3
@@ -24,8 +24,6 @@ enum
|
||||
OS_WindowFlag_CustomBorder = (1<<0),
|
||||
};
|
||||
|
||||
typedef void OS_WindowRepaintFunctionType(OS_Handle window, void *user_data);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Cursor Types
|
||||
|
||||
@@ -103,6 +101,11 @@ struct OS_EventList
|
||||
OS_Event *last;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Application-Defined Frame Hook Forward Declaration
|
||||
|
||||
internal B32 frame(void);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Event Functions (Helpers, Implemented Once)
|
||||
|
||||
@@ -139,7 +142,6 @@ internal String8 os_get_clipboard_text(Arena *arena);
|
||||
internal OS_Handle os_window_open(Vec2F32 resolution, OS_WindowFlags flags, String8 title);
|
||||
internal void os_window_close(OS_Handle window);
|
||||
internal void os_window_first_paint(OS_Handle window);
|
||||
internal void os_window_equip_repaint(OS_Handle window, OS_WindowRepaintFunctionType *repaint, void *user_data);
|
||||
internal void os_window_focus(OS_Handle window);
|
||||
internal B32 os_window_is_focused(OS_Handle window);
|
||||
internal B32 os_window_is_fullscreen(OS_Handle window);
|
||||
|
||||
@@ -50,11 +50,6 @@ os_window_first_paint(OS_Handle window)
|
||||
{
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_equip_repaint(OS_Handle window, OS_WindowRepaintFunctionType *repaint, void *user_data)
|
||||
{
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_focus(OS_Handle window)
|
||||
{
|
||||
|
||||
@@ -356,18 +356,11 @@ os_w32_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case WM_SIZE:
|
||||
case WM_PAINT:
|
||||
{
|
||||
if(window->repaint != 0)
|
||||
{
|
||||
PAINTSTRUCT ps = {0};
|
||||
BeginPaint(hwnd, &ps);
|
||||
window->repaint(os_w32_handle_from_window(window), window->repaint_user_data);
|
||||
EndPaint(hwnd, &ps);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = DefWindowProcW(hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
{
|
||||
PAINTSTRUCT ps = {0};
|
||||
BeginPaint(hwnd, &ps);
|
||||
update();
|
||||
EndPaint(hwnd, &ps);
|
||||
}break;
|
||||
|
||||
case WM_CLOSE:
|
||||
@@ -1089,14 +1082,6 @@ os_window_first_paint(OS_Handle window_handle)
|
||||
}
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_equip_repaint(OS_Handle handle, OS_WindowRepaintFunctionType *repaint, void *user_data)
|
||||
{
|
||||
OS_W32_Window *window = os_w32_window_from_handle(handle);
|
||||
window->repaint = repaint;
|
||||
window->repaint_user_data = user_data;
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_focus(OS_Handle handle)
|
||||
{
|
||||
@@ -1125,8 +1110,6 @@ internal void
|
||||
os_window_set_fullscreen(OS_Handle handle, B32 fullscreen)
|
||||
{
|
||||
OS_W32_Window *window = os_w32_window_from_handle(handle);
|
||||
OS_WindowRepaintFunctionType *repaint = window->repaint;
|
||||
window->repaint = 0;
|
||||
DWORD window_style = GetWindowLong(window->hwnd, GWL_STYLE);
|
||||
B32 is_fullscreen_already = os_window_is_fullscreen(handle);
|
||||
if(fullscreen)
|
||||
@@ -1155,7 +1138,6 @@ os_window_set_fullscreen(OS_Handle handle, B32 fullscreen)
|
||||
SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER |
|
||||
SWP_NOOWNERZORDER | SWP_FRAMECHANGED);
|
||||
}
|
||||
window->repaint = repaint;
|
||||
}
|
||||
|
||||
internal B32
|
||||
|
||||
@@ -39,8 +39,6 @@ struct OS_W32_Window
|
||||
OS_W32_Window *prev;
|
||||
HWND hwnd;
|
||||
WINDOWPLACEMENT last_window_placement;
|
||||
OS_WindowRepaintFunctionType *repaint;
|
||||
void *repaint_user_data;
|
||||
F32 dpi;
|
||||
B32 first_paint_done;
|
||||
B32 maximized;
|
||||
|
||||
Reference in New Issue
Block a user