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