From 15af98a8adaae42e689f777b466cecfc0699c3de Mon Sep 17 00:00:00 2001 From: Carlos Une Date: Tue, 25 Oct 2022 01:26:11 -0300 Subject: Add SDL_GetWindowSurface wrapper Signed-off-by: Carlos Une --- sdl2/video.ha | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sdl2') 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; +}; -- cgit v1.2.3