|
SBgl 0.1.0
A graphics framework in C99
|
#include "linux_internal.h"#include "core/sbgl_platform.h"#include "core/sbl_arena.h"#include <string.h>#include <time.h>#include <poll.h>
Go to the source code of this file.
Macros | |
| #define | _POSIX_C_SOURCE 199309L |
Functions | |
| static void | wm_base_ping (void *data, struct xdg_wm_base *wm_base, uint32_t serial) |
| static void | registry_handle_global (void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) |
| static void | toplevel_handle_configure (void *data, struct xdg_toplevel *t, int32_t w, int32_t h, struct wl_array *s) |
| static void | toplevel_handle_close (void *data, struct xdg_toplevel *t) |
| static void | xdg_surface_handle_configure (void *data, struct xdg_surface *surf, uint32_t serial) |
| static void | locked_pointer_locked (void *data, struct zwp_locked_pointer_v1 *locked_pointer) |
| static void | locked_pointer_unlocked (void *data, struct zwp_locked_pointer_v1 *locked_pointer) |
| sbgl_platform_Result | sbgl_os_CreateWindow (struct SblArena *arena, sbgl_InputState *input, int width, int height, const char *title, sbgl_Window **outWindow) |
| Creates a native OS window. | |
| void | sbgl_os_PollEvents (sbgl_Window *window) |
| Dispatches OS events (messages/protocol requests). | |
| 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. | |
| bool | sbgl_os_IsWindowFocused (sbgl_Window *window) |
| Checks if the window currently has input focus. | |
| 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. | |
| 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_GetNativeDisplayHandle (sbgl_Window *window) |
| Retrieves the native display handle (Linux specific). | |
| void | sbgl_os_DestroyWindow (sbgl_Window *window) |
| Destroys a native window. | |
Variables | |
| static const struct xdg_wm_base_listener | wm_base_listener = { .ping = wm_base_ping } |
| static const struct wl_registry_listener | registry_listener = { .global = registry_handle_global } |
| static const struct xdg_toplevel_listener | toplevel_listener = { .configure = toplevel_handle_configure, .close = toplevel_handle_close } |
| static const struct xdg_surface_listener | xdg_surface_listener = { .configure = xdg_surface_handle_configure } |
| static const struct zwp_locked_pointer_v1_listener | locked_pointer_listener = { .locked = locked_pointer_locked, .unlocked = locked_pointer_unlocked } |
| const struct zwp_relative_pointer_v1_listener | relative_pointer_listener |
| #define _POSIX_C_SOURCE 199309L |
Definition at line 1 of file window_wayland.c.
|
static |
Definition at line 63 of file window_wayland.c.
|
static |
Definition at line 64 of file window_wayland.c.
|
static |
Definition at line 18 of file window_wayland.c.
| sbgl_platform_Result sbgl_os_CreateWindow | ( | struct SblArena * | arena, |
| sbgl_InputState * | input, | ||
| int | width, | ||
| int | height, | ||
| const char * | title, | ||
| sbgl_Window ** | outWindow ) |
Creates a native OS window.
| arena | Arena to allocate the window state from. |
| input | Pointer to input state. |
| width | Initial width. |
| height | Initial height. |
| title | Window title. |
| outWindow | Pointer to store the created window. |
Definition at line 68 of file window_wayland.c.
| void sbgl_os_DestroyWindow | ( | sbgl_Window * | window | ) |
Destroys a native window.
| window | The window to destroy. |
Definition at line 205 of file window_wayland.c.
| void * sbgl_os_GetNativeDisplayHandle | ( | sbgl_Window * | window | ) |
Retrieves the native display handle (Linux specific).
| window | The window handle. |
Definition at line 204 of file window_wayland.c.
| void * sbgl_os_GetNativeWindowHandle | ( | sbgl_Window * | window | ) |
Retrieves the raw window handle for Vulkan surface creation.
| window | The window handle. |
Definition at line 203 of file window_wayland.c.
| uint64_t sbgl_os_GetPerfCount | ( | sbgl_Window * | window | ) |
Gets the high-resolution performance counter.
| window | The window handle. |
Definition at line 201 of file window_wayland.c.
| uint64_t sbgl_os_GetPerfFreq | ( | sbgl_Window * | window | ) |
Gets the performance counter frequency.
| window | The window handle. |
Definition at line 202 of file window_wayland.c.
| 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. |
Definition at line 150 of file window_wayland.c.
| bool sbgl_os_IsWindowFocused | ( | sbgl_Window * | window | ) |
Checks if the window currently has input focus.
| window | The native window handle. |
Definition at line 158 of file window_wayland.c.
| void sbgl_os_PollEvents | ( | sbgl_Window * | window | ) |
Dispatches OS events (messages/protocol requests).
| window | The window to process events for. |
Definition at line 122 of file window_wayland.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 175 of file window_wayland.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 160 of file window_wayland.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. |
Definition at line 152 of file window_wayland.c.
| bool sbgl_os_WindowShouldClose | ( | sbgl_Window * | window | ) |
Checks the window's close flag.
| window | The window to check. |
Definition at line 149 of file window_wayland.c.
|
static |
Definition at line 48 of file window_wayland.c.
|
static |
Definition at line 37 of file window_wayland.c.
|
static |
Definition at line 11 of file window_wayland.c.
|
static |
Definition at line 55 of file window_wayland.c.
|
static |
Definition at line 65 of file window_wayland.c.
|
static |
Definition at line 34 of file window_wayland.c.
|
extern |
Definition at line 118 of file input_wayland.c.
|
static |
Definition at line 53 of file window_wayland.c.
|
static |
Definition at line 15 of file window_wayland.c.
|
static |
Definition at line 60 of file window_wayland.c.