diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b7d640..f468251 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,7 @@ add_library(blah src/blah_font.cpp src/blah_image.cpp src/blah_packer.cpp + src/blah_audio.cpp src/internal/blah_renderer_opengl.cpp src/internal/blah_renderer_d3d11.cpp src/internal/blah_platform_sdl2.cpp diff --git a/include/blah.h b/include/blah.h index 554bae1..9590b39 100644 --- a/include/blah.h +++ b/include/blah.h @@ -1,6 +1,7 @@ #pragma once #include "blah_app.h" #include "blah_aseprite.h" +#include "blah_audio.h" #include "blah_batch.h" #include "blah_calc.h" #include "blah_color.h" diff --git a/include/blah_app.h b/include/blah_app.h index 3ebbf7a..1b9b285 100644 --- a/include/blah_app.h +++ b/include/blah_app.h @@ -47,6 +47,9 @@ namespace Blah // defaults to 60. int target_framerate = 60; + // The expected freqeuncy of audio files and how quickly to play audio. + int audio_frequency_in_Hz = 44100; + // default starting flags u32 flags = Flags::VSync | Flags::Resizable | Flags::FixedTimestep; diff --git a/include/blah_audio.h b/include/blah_audio.h new file mode 100644 index 0000000..967008e --- /dev/null +++ b/include/blah_audio.h @@ -0,0 +1,139 @@ +#pragma once + +#include +#include +#include + +namespace Blah +{ + class Audio; + class Sound; + using AudioRef = Ref