~sircmpwn/hare-users

Add SDL_CreateTextureFromSurface() v1 APPLIED

francorbacho: 1
 Add SDL_CreateTextureFromSurface()

 1 files changed, 11 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/hare-users/patches/43535/mbox | git am -3
Learn more about email & git

[PATCH] Add SDL_CreateTextureFromSurface() Export this patch

Signed-off-by: francorbacho <francorbacho@proton.me>
---
 sdl2/render.ha | 11 +++++++++++
 1 file changed, 11 insertions(+)

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;

-- 
2.41.0
Thanks!

To git@git.sr.ht:~sircmpwn/hare-sdl2
   0c96e49..2095913  master -> master