diff options
| author | Carlos Une <une@fastmail.fm> | 2022-10-25 01:26:09 -0300 |
|---|---|---|
| committer | Drew DeVault <sir@cmpwn.com> | 2022-11-07 12:24:39 +0100 |
| commit | 6150540090fddde83cef08b020bd786db2d0e724 (patch) | |
| tree | 912288462b255c4c5231f151bd03f9e655083d66 /sdl2 | |
| parent | Add SDL_CreateTexture, SDL_UpdateTexture wrappers (diff) | |
| download | hare-chip8-6150540090fddde83cef08b020bd786db2d0e724.tar.gz | |
Add SDL_CreateRGBSurface wrapper
Signed-off-by: Carlos Une <une@fastmail.fm>
Diffstat (limited to '')
| -rw-r--r-- | sdl2/surface.ha | 12 |
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; +}; |
