diff options
| author | Autumn! <autumnull@posteo.net> | 2023-05-24 20:37:00 +0000 |
|---|---|---|
| committer | Drew DeVault <sir@cmpwn.com> | 2023-06-04 09:23:18 +0200 |
| commit | 3ca5d97376151d6f1a4a1787b6609c470a05a82c (patch) | |
| tree | 624e7cdf0711f30512b9ce03c67fd9356073b1ad /sdl2/image/image.ha | |
| parent | added some missing bindings (diff) | |
| download | hare-chip8-3ca5d97376151d6f1a4a1787b6609c470a05a82c.tar.gz | |
Use types::c:: instead of char and strings::
Signed-off-by: Autumn! <autumnull@posteo.net>
Diffstat (limited to '')
| -rw-r--r-- | sdl2/image/image.ha | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sdl2/image/image.ha b/sdl2/image/image.ha index 8684f83..32f8f3d 100644 --- a/sdl2/image/image.ha +++ b/sdl2/image/image.ha @@ -1,7 +1,7 @@ // TODO: Flesh me out // TODO: SDL_RWops use sdl2; -use strings; +use types::c; // Flags for [[IMG_Init]]. export type IMG_InitFlags = enum int { @@ -23,24 +23,24 @@ export fn IMG_Init(flags: IMG_InitFlags) (void | sdl2::error) = { // Unloads libraries loaded with [[IMG_Init]] export @symbol("IMG_Quit") fn IMG_Quit() void; -@symbol("IMG_Load") fn _IMG_Load(file: const *char) nullable *sdl2::SDL_Surface; +@symbol("IMG_Load") fn _IMG_Load(file: const *c::char) nullable *sdl2::SDL_Surface; // Load an image from a file path. export fn IMG_Load(file: str) (*sdl2::SDL_Surface | sdl2::error) = { - const file = strings::to_c(file); + const file = c::fromstr(file); defer free(file); return sdl2::wrapptr(_IMG_Load(file))?: *sdl2::SDL_Surface; }; @symbol("IMG_LoadTexture") fn _IMG_LoadTexture(SDL_Renderer: *sdl2::SDL_Renderer, - file: const *char) nullable *sdl2::SDL_Texture; + file: const *c::char) nullable *sdl2::SDL_Texture; // Load an image directly into a render texture. export fn IMG_LoadTexture( SDL_Renderer: *sdl2::SDL_Renderer, file: str, ) (*sdl2::SDL_Texture | sdl2::error) = { - const file = strings::to_c(file); + const file = c::fromstr(file); defer free(file); return sdl2::wrapptr(_IMG_LoadTexture(SDL_Renderer, file))?: *sdl2::SDL_Texture; }; |
