/** * Jingga * * @copyright Jingga * @license OMS License 2.0 * @version 1.0.0 * @link https://jingga.app */ #ifndef TOS_PLATFORM_WIN32_WINDOW_H #define TOS_PLATFORM_WIN32_WINDOW_H #include #include "../../stdlib/Types.h" #include "../../system/Window.h" typedef HINSTANCE WindowInstance; struct Window { uint16 width; uint16 height; uint16 x; uint16 y; // 1. position // 2. focus // 3. size // 4. fullscreen byte state_changes; bool is_focused; bool is_fullscreen; HWND hwnd; HDC hdc; HGLRC openGLRC; HINSTANCE hInstance; char name[32]; WindowState state_old; }; inline void window_backup_state(Window* __restrict w) { w->state_old.style = GetWindowLongPtr(w->hwnd, GWL_STYLE); w->state_old.width = w->width; w->state_old.height = w->height; w->state_old.x = w->x; w->state_old.y = w->y; } inline void window_restore_state(Window* __restrict w) { w->width = w->state_old.width; w->height = w->state_old.height; w->x = w->state_old.x; w->y = w->state_old.y; } #endif