|
SBgl 0.1.0
A graphics framework in C99
|
#include "core/sbgl_platform.h"#include "core/sbl_arena.h"#include "win32_internal.h"#include <stdio.h>#include <stdlib.h>#include <string.h>
Go to the source code of this file.
Functions | |
| static void | win32_report_error (const wchar_t *message) |
| Reports errors to both debugger output and stderr. | |
| static LRESULT CALLBACK | WindowProc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) |
| sbgl_Window * | sbgl_os_CreateWindow (struct SblArena *arena, sbgl_InputState *input, int width, int height, const char *title) |
| void | sbgl_os_DestroyWindow (sbgl_Window *window) |
| Destroys a native window. | |
| bool | sbgl_os_WindowShouldClose (sbgl_Window *window) |
| Checks the window's close flag. | |
| void | sbgl_os_GetWindowSize (sbgl_Window *window, int *w, int *h) |
| Retrieves the current client area size. | |
| bool | sbgl_os_WasWindowResized (sbgl_Window *window) |
| Checks if the window has been resized since the last check. | |
| void | sbgl_os_SetCursorVisible (sbgl_Window *window, bool visible) |
| Sets the visibility of the OS cursor for the given window. | |
| void | sbgl_os_SetCursorLocked (sbgl_Window *window, bool locked) |
| Locks or unlocks the cursor within the window bounds. | |
| bool | sbgl_os_IsWindowFocused (sbgl_Window *window) |
| Checks if the window currently has input focus. | |
| void | sbgl_os_PollEvents (sbgl_Window *window) |
| Dispatches OS events (messages/protocol requests). | |
| uint64_t | sbgl_os_GetPerfCount (sbgl_Window *window) |
| Gets the high-resolution performance counter. | |
| uint64_t | sbgl_os_GetPerfFreq (sbgl_Window *window) |
| Gets the performance counter frequency. | |
| void * | sbgl_os_GetNativeWindowHandle (sbgl_Window *window) |
| Retrieves the raw window handle for Vulkan surface creation. | |
| void * | sbgl_os_GetNativeInstanceHandle (sbgl_Window *window) |
| Retrieves the native instance handle (Win32 specific). | |
| void * | sbgl_os_GetNativeDisplayHandle (sbgl_Window *window) |
| Retrieves the native display handle (Linux specific). | |
| sbgl_Window * sbgl_os_CreateWindow | ( | struct SblArena * | arena, |
| sbgl_InputState * | input, | ||
| int | width, | ||
| int | height, | ||
| const char * | title ) |
Definition at line 101 of file window.c.
| void sbgl_os_DestroyWindow | ( | sbgl_Window * | window | ) |
Destroys a native window.
| window | The window to destroy. |
Definition at line 180 of file window.c.
| void * sbgl_os_GetNativeDisplayHandle | ( | sbgl_Window * | window | ) |
| void * sbgl_os_GetNativeInstanceHandle | ( | sbgl_Window * | window | ) |
| void * sbgl_os_GetNativeWindowHandle | ( | sbgl_Window * | window | ) |
| uint64_t sbgl_os_GetPerfCount | ( | sbgl_Window * | window | ) |
Gets the high-resolution performance counter.
| window | The window handle. |
Definition at line 312 of file window.c.
| uint64_t sbgl_os_GetPerfFreq | ( | sbgl_Window * | window | ) |
| void sbgl_os_GetWindowSize | ( | sbgl_Window * | window, |
| int * | w, | ||
| int * | h ) |
Retrieves the current client area size.
| window | The window handle. |
| w | Pointer to store width. |
| h | Pointer to store height. |
| bool sbgl_os_IsWindowFocused | ( | sbgl_Window * | window | ) |
| void sbgl_os_PollEvents | ( | sbgl_Window * | window | ) |
Dispatches OS events (messages/protocol requests).
| window | The window to process events for. |
Definition at line 300 of file window.c.
| void sbgl_os_SetCursorLocked | ( | sbgl_Window * | window, |
| bool | locked ) |
Locks or unlocks the cursor within the window bounds.
When locked, the cursor is typically constrained to the window center to support relative motion for 3D navigation.
| window | The native window handle. |
| locked | True to capture the cursor, false to release it. |
Definition at line 238 of file window.c.
| void sbgl_os_SetCursorVisible | ( | sbgl_Window * | window, |
| bool | visible ) |
Sets the visibility of the OS cursor for the given window.
Provides a platform-agnostic way to show or hide the mouse pointer.
| window | The native window handle. |
| visible | True to show the cursor, false to hide it. |
Definition at line 224 of file window.c.
| bool sbgl_os_WasWindowResized | ( | sbgl_Window * | window | ) |
Checks if the window has been resized since the last check.
Resets the internal resize flag to false upon returning.
| window | The window handle. |
| bool sbgl_os_WindowShouldClose | ( | sbgl_Window * | window | ) |
|
static |
Reports errors to both debugger output and stderr.
Uses OutputDebugStringW for Visual Studio debugger visibility and fprintf(stderr, ...) for console output.
Definition at line 14 of file window.c.
|
static |
Definition at line 31 of file window.c.