diff options
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)); +}; + |
