aboutsummaryrefslogtreecommitdiff
path: root/sdl2/video.ha
diff options
context:
space:
mode:
authorCarlos Une <une@fastmail.fm>2022-10-25 01:26:11 -0300
committerDrew DeVault <sir@cmpwn.com>2022-11-07 12:24:39 +0100
commit15af98a8adaae42e689f777b466cecfc0699c3de (patch)
treebc99e9ba9b42db1cdc71e8242f2c9ff0e6217d6b /sdl2/video.ha
parentAdd SDL_PIXELFORMAT_ARGB8888 def (diff)
downloadhare-chip8-15af98a8adaae42e689f777b466cecfc0699c3de.tar.gz
Add SDL_GetWindowSurface wrapper
Signed-off-by: Carlos Une <une@fastmail.fm>
Diffstat (limited to '')
-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;
+};