aboutsummaryrefslogtreecommitdiff
path: root/sdl2
diff options
context:
space:
mode:
Diffstat (limited to 'sdl2')
-rw-r--r--sdl2/video.ha8
1 files changed, 8 insertions, 0 deletions
diff --git a/sdl2/video.ha b/sdl2/video.ha
index 874a8bd..bfcb3d0 100644
--- a/sdl2/video.ha
+++ b/sdl2/video.ha
@@ -98,3 +98,11 @@ export @symbol("SDL_DestroyWindow") fn SDL_DestroyWindow(window: *SDL_Window) vo
// client area size in pixels.
export @symbol("SDL_GetWindowSize") fn SDL_GetWindowSize(window: *SDL_Window,
w: nullable *int, h: nullable *int) void;
+
+// Get the SDL surface associated with the window.
+@symbol("SDL_GetWindowSurface") fn _SDL_GetWindowSurface(window: *SDL_Window)
+ *SDL_Surface;
+
+export fn SDL_GetWindowSurface(window: *SDL_Window) (*SDL_Surface | error) = {
+ return wrapptr(_SDL_GetWindowSurface(window))?: *SDL_Surface;
+};