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/surface.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 '')
| -rw-r--r-- | sdl2/surface.ha | 9 |
1 files changed, 9 insertions, 0 deletions
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)); +}; |
