diff options
| author | Vlad-Stefan Harbuz <vlad@vladh.net> | 2022-02-07 13:08:52 +0100 |
|---|---|---|
| committer | Drew DeVault <sir@cmpwn.com> | 2022-02-07 18:56:08 +0100 |
| commit | 2276dc7ad067f7af7504783239103c1abd7b4433 (patch) | |
| tree | 20f2f98f4af8b2ff0efeb3b15f1a26e09702e908 /sdl2/mixer/general.ha | |
| parent | correct indentation (diff) | |
| download | hare-chip8-2276dc7ad067f7af7504783239103c1abd7b4433.tar.gz | |
refactor names from e.g. sdl2::init() to sdl2::SDL_Init()
Signed-off-by: Vlad-Stefan Harbuz <vlad@vladh.net>
Diffstat (limited to 'sdl2/mixer/general.ha')
| -rw-r--r-- | sdl2/mixer/general.ha | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/sdl2/mixer/general.ha b/sdl2/mixer/general.ha index 32c7b38..4f819bf 100644 --- a/sdl2/mixer/general.ha +++ b/sdl2/mixer/general.ha @@ -1,7 +1,7 @@ use sdl2; // Flags for [[init]]. -export type init_flags = enum { +export type MIX_InitFlags = enum { FLAC = 0x00000001, MOD = 0x00000002, MP3 = 0x00000008, @@ -11,42 +11,42 @@ export type init_flags = enum { }; // The default mixer has 8 simultaneous mixing channels -export def CHANNELS: int = 8; +export def MIX_CHANNELS: int = 8; // Good default frequency for a PC soundcard -export def DEFAULT_FREQUENCY: int = 22050; +export def MIX_DEFAULT_FREQUENCY: int = 22050; // Good default channels for a PC soundcard -export def DEFAULT_CHANNELS: int = 2; +export def MIX_DEFAULT_CHANNELS: int = 2; // XXX: This should choose MSB on a big-endian system: // Good default format for a PC soundcard -export def DEFAULT_FORMAT: sdl2::audio_format = sdl2::AUDIO_S16LSB; +export def MIX_DEFAULT_FORMAT: sdl2::SDL_AudioFormat = sdl2::AUDIO_S16LSB; -@symbol("Mix_Init") fn _init(flags: int) int; +@symbol("Mix_Init") fn _Mix_Init(flags: int) int; // Loads dynamic libraries and prepares them for use. Flags should be -// one or more flags from [[init_flags]] OR'd together. -export fn init(flags: init_flags) (void | sdl2::error) = { - return sdl2::wrapvoid(_init(flags)); +// one or more flags from [[MIX_InitFlags]] OR'd together. +export fn Mix_Init(flags: MIX_InitFlags) (void | sdl2::error) = { + return sdl2::wrapvoid(_Mix_Init(flags)); }; -// Unloads libraries loaded with [[init]]. -export @symbol("Mix_Quit") fn quit() void; +// Unloads libraries loaded with [[Mix_Init]]. +export @symbol("Mix_Quit") fn Mix_Quit() void; -@symbol("Mix_OpenAudio") fn _openaudio(frequency: int, +@symbol("Mix_OpenAudio") fn _Mix_OpenAudio(frequency: int, format: u16, channels: int, chunksize: int) int; // Open the mixer with a certain audio format -export fn open_audio( +export fn Mix_OpenAudio( frequency: int, - format: sdl2::audio_format, + format: sdl2::SDL_AudioFormat, channels: int, chunksize: int, ) (void | sdl2::error) = { - return sdl2::wrapvoid(_openaudio(frequency, format, channels, chunksize)); + return sdl2::wrapvoid(_Mix_OpenAudio(frequency, format, channels, chunksize)); }; // Close the mixer, halting all playing audio -export @symbol("Mix_CloseAudio") fn close_audio() void; +export @symbol("Mix_CloseAudio") fn Mix_CloseAudio() void; |
