diff options
| author | francorbacho <francorbacho@proton.me> | 2023-08-12 12:05:05 +0000 |
|---|---|---|
| committer | Drew DeVault <sir@cmpwn.com> | 2023-08-14 13:44:58 +0200 |
| commit | 2095913461ae7e6d65848948c55d2d979e665621 (patch) | |
| tree | 5b795fa011eb59e3dec9870efa0bf3d97f69ceaf | |
| parent | cmd/demo: fix call to fmt::fatal() (diff) | |
| download | hare-chip8-2095913461ae7e6d65848948c55d2d979e665621.tar.gz | |
Add SDL_CreateTextureFromSurface()
Signed-off-by: francorbacho <francorbacho@proton.me>
| -rw-r--r-- | sdl2/render.ha | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sdl2/render.ha b/sdl2/render.ha index 545aae5..66571b1 100644 --- a/sdl2/render.ha +++ b/sdl2/render.ha @@ -315,6 +315,17 @@ export fn SDL_CreateTexture( )?: *SDL_Texture; }; +@symbol("SDL_CreateTextureFromSurface") fn _SDL_CreateTextureFromSurface( + renderer: *SDL_Renderer, + surface: *SDL_Surface) nullable *SDL_Texture; + +export fn SDL_CreateTextureFromSurface( + renderer: *SDL_Renderer, + surface: *SDL_Surface +) (*SDL_Texture | error) = { + return wrapptr(_SDL_CreateTextureFromSurface(renderer, surface))?: *SDL_Texture; +}; + @symbol("SDL_UpdateTexture") fn _SDL_UpdateTexture(texture: *SDL_Texture, rect: const nullable *SDL_Rect, pixels: const nullable *void, pitch: int) int; |
