aboutsummaryrefslogtreecommitdiff
path: root/sdl2/video.ha
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-04-13 16:30:46 +0100
committerDrew DeVault <sir@cmpwn.com>2024-04-19 11:10:28 +0200
commitf2e40ecffec519e1094ed829f8735309ae67997f (patch)
tree8168a12577b1a7f38f0a692aa049b5c3debb3e87 /sdl2/video.ha
parentAdd SDL_GetRendererOutputSize. (diff)
downloadhare-chip8-f2e40ecffec519e1094ed829f8735309ae67997f.tar.gz
add a few functions
these are some sdl functions i needed for a project. there is not much structure beyond that.
Diffstat (limited to 'sdl2/video.ha')
-rw-r--r--sdl2/video.ha11
1 files changed, 10 insertions, 1 deletions
diff --git a/sdl2/video.ha b/sdl2/video.ha
index 466052e..2627b48 100644
--- a/sdl2/video.ha
+++ b/sdl2/video.ha
@@ -99,10 +99,19 @@ export @symbol("SDL_DestroyWindow") fn SDL_DestroyWindow(window: *SDL_Window) vo
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;
+// Get the SDL surface associated with the window.
export fn SDL_GetWindowSurface(window: *SDL_Window) (*SDL_Surface | error) = {
return wrapptr(_SDL_GetWindowSurface(window))?: *SDL_Surface;
};
+
+// Copy the window surface to the screen.
+@symbol("SDL_UpdateWindowSurface") fn _SDL_UpdateWindowSurface(window: *SDL_Window)
+ int;
+
+export fn SDL_UpdateWindowSurface(window: *SDL_Window) (void | error) = {
+ return wrapvoid(_SDL_UpdateWindowSurface(window));
+};
+