aboutsummaryrefslogtreecommitdiff
path: root/sdl2/image/image.ha
diff options
context:
space:
mode:
authorAutumn! <autumnull@posteo.net>2023-05-24 20:37:00 +0000
committerDrew DeVault <sir@cmpwn.com>2023-06-04 09:23:18 +0200
commit3ca5d97376151d6f1a4a1787b6609c470a05a82c (patch)
tree624e7cdf0711f30512b9ce03c67fd9356073b1ad /sdl2/image/image.ha
parentadded some missing bindings (diff)
downloadhare-chip8-3ca5d97376151d6f1a4a1787b6609c470a05a82c.tar.gz
Use types::c:: instead of char and strings::
Signed-off-by: Autumn! <autumnull@posteo.net>
Diffstat (limited to 'sdl2/image/image.ha')
-rw-r--r--sdl2/image/image.ha10
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;
};