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/video.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 'sdl2/video.ha')
| -rw-r--r-- | sdl2/video.ha | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sdl2/video.ha b/sdl2/video.ha index bfcb3d0..f60d915 100644 --- a/sdl2/video.ha +++ b/sdl2/video.ha @@ -1,5 +1,5 @@ // TODO: Flesh me out -use strings; +use types::c; // The type used to identify a window. (Opaque) export type SDL_Window = void; @@ -33,12 +33,12 @@ export type SDL_WindowFlags = enum u32 { export def SDL_WINDOWPOS_UNDEFINED: int = 0x1FFF0000; export def SDL_WINDOWPOS_CENTERED: int = 0x2FFF0000; -@symbol("SDL_CreateWindow") fn _SDL_CreateWindow(title: const *char, +@symbol("SDL_CreateWindow") fn _SDL_CreateWindow(title: const *c::char, x: int, y: int, w: int, h: int, flags: SDL_WindowFlags) nullable *SDL_Window; // Create a window with the specified position, dimensions, and flags. // -// 'title' is the title of the window, in UTF-8 encoding. See [[strings::to_c]] +// 'title' is the title of the window, in UTF-8 encoding. See [[types::c::fromstr]] // to prepare a suitable string. // // 'x' and 'y' set the position of the window, or use [[SDL_WINDOWPOS_CENTERED]] or @@ -78,7 +78,7 @@ export fn SDL_CreateWindow( h: int, flags: SDL_WindowFlags, ) (*SDL_Window | error) = { - let title = strings::to_c(title); + let title = c::fromstr(title); defer free(title); return wrapptr(_SDL_CreateWindow(title, x, y, w, h, flags))?: *SDL_Window; }; |
