diff options
| author | ubq323 <ubq323@ubq323.website> | 2024-04-13 16:30:46 +0100 |
|---|---|---|
| committer | Drew DeVault <sir@cmpwn.com> | 2024-04-19 11:10:28 +0200 |
| commit | f2e40ecffec519e1094ed829f8735309ae67997f (patch) | |
| tree | 8168a12577b1a7f38f0a692aa049b5c3debb3e87 /sdl2/video.ha | |
| parent | Add SDL_GetRendererOutputSize. (diff) | |
| download | hare-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.ha | 11 |
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)); +}; + |
