From f2e40ecffec519e1094ed829f8735309ae67997f Mon Sep 17 00:00:00 2001 From: ubq323 Date: Sat, 13 Apr 2024 16:30:46 +0100 Subject: add a few functions these are some sdl functions i needed for a project. there is not much structure beyond that. --- sdl2/surface.ha | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sdl2/surface.ha') diff --git a/sdl2/surface.ha b/sdl2/surface.ha index 24153c3..7b6438e 100644 --- a/sdl2/surface.ha +++ b/sdl2/surface.ha @@ -35,3 +35,12 @@ export fn SDL_CreateRGBSurface(flags: u32, return wrapptr(_SDL_CreateRGBSurface(flags, width, height, depth, Rmask, Gmask, Bmask, Amask))?: *SDL_Surface; }; + +// NB SDL_BlitSurface is aliased to SDL_UpperBlit via a macro in the SDL header +@symbol("SDL_UpperBlit") fn _SDL_BlitSurface(src: *SDL_Surface, + srcrect: nullable *SDL_Rect, dst: *SDL_Surface, dstrect: nullable *SDL_Rect) int; + +// Perform a fast surface copy to a destination surface. +export fn SDL_BlitSurface(src: *SDL_Surface, srcrect: nullable *SDL_Rect, dst: *SDL_Surface, dstrect: nullable *SDL_Rect) (void | error) = { + return wrapvoid(_SDL_BlitSurface(src, srcrect, dst, dstrect)); +}; -- cgit v1.2.3