diff options
| author | Drew DeVault <sir@cmpwn.com> | 2021-12-12 12:40:47 +0100 |
|---|---|---|
| committer | Drew DeVault <sir@cmpwn.com> | 2021-12-12 13:04:42 +0100 |
| commit | e5ad22498ca893e96557486a808213b05601e25f (patch) | |
| tree | 8929b40773af11371cb961379daa8cb3be22b8b2 /cmd | |
| parent | Add blend modes (diff) | |
| download | hare-chip8-e5ad22498ca893e96557486a808213b05601e25f.tar.gz | |
sdl2::mixer: initial commit
Diffstat (limited to '')
| -rw-r--r-- | cmd/demo/main.ha | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd/demo/main.ha b/cmd/demo/main.ha index 081134a..73a5517 100644 --- a/cmd/demo/main.ha +++ b/cmd/demo/main.ha @@ -2,6 +2,7 @@ use fmt; use sdl2; use sdl2::{ controller_axis, event_type, renderer_flags, window_flags }; use sdl2::image; +use sdl2::mixer; use strings; type object = struct { @@ -34,6 +35,12 @@ fn run() (void | sdl2::error) = { image::init(image::init_flags::PNG | image::init_flags::JPG); defer image::quit(); + mixer::init(mixer::init_flags::OGG)!; + defer mixer::quit(); + mixer::open_audio(mixer::DEFAULT_FREQUENCY, mixer::DEFAULT_FORMAT, + mixer::DEFAULT_CHANNELS, 1024)!; + defer mixer::close_audio(); + const win = sdl2::create_window("Hare SDL2 demo", sdl2::WINDOWPOS_UNDEFINED, sdl2::WINDOWPOS_UNDEFINED, 640, 480, window_flags::NONE)?; |
