aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Une <une@fastmail.fm>2022-10-25 01:26:09 -0300
committerDrew DeVault <sir@cmpwn.com>2022-11-07 12:24:39 +0100
commit6150540090fddde83cef08b020bd786db2d0e724 (patch)
tree912288462b255c4c5231f151bd03f9e655083d66
parentAdd SDL_CreateTexture, SDL_UpdateTexture wrappers (diff)
downloadhare-chip8-6150540090fddde83cef08b020bd786db2d0e724.tar.gz
Add SDL_CreateRGBSurface wrapper
Signed-off-by: Carlos Une <une@fastmail.fm>
Diffstat (limited to '')
-rw-r--r--sdl2/surface.ha12
1 files changed, 12 insertions, 0 deletions
diff --git a/sdl2/surface.ha b/sdl2/surface.ha
index 39d4d2a..572bdcc 100644
--- a/sdl2/surface.ha
+++ b/sdl2/surface.ha
@@ -23,3 +23,15 @@ export type SDL_Surface = struct {
};
export type SDL_BlitMap = void;
+
+@symbol("SDL_CreateRGBSurface") fn _SDL_CreateRGBSurface(flags: u32,
+ width: int, height: int, depth: int, Rmask: u32, Gmask: u32, Bmask: u32,
+ Amask: u32) *SDL_Surface;
+
+// Allocate a new RGB surface.
+export fn SDL_CreateRGBSurface(flags: u32,
+ width: int, height: int, depth: int, Rmask: u32, Gmask: u32, Bmask: u32,
+ Amask: u32) (*SDL_Surface | error) = {
+ return wrapptr(_SDL_CreateRGBSurface(flags, width, height, depth, Rmask,
+ Gmask, Bmask, Amask))?: *SDL_Surface;
+};