From 2cf57a4abcb4bb552cb805c74c19b1ad21fba411 Mon Sep 17 00:00:00 2001 From: talha Date: Mon, 3 Feb 2025 11:44:41 +0500 Subject: Added miniaudio --- source/main.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'source/main.cpp') diff --git a/source/main.cpp b/source/main.cpp index 0fcfab5..ca9e71a 100755 --- a/source/main.cpp +++ b/source/main.cpp @@ -1,8 +1,10 @@ #include #include -#define STB_IMAGE_IMPLEMENTATION -#include "stb_image.h" +#define MINIAUDIO_IMPLEMENTATION +#include "miniaudio.h" + +#include #include #include FT_FREETYPE_H @@ -1122,6 +1124,17 @@ int main(int argc, char* argv[]) FrameTimer timer = frametimer(); + // @section: audio + ma_result result; + ma_engine engine; + + result = ma_engine_init(NULL, &engine); + if (result != MA_SUCCESS) { + return -1; + } + + ma_engine_play_sound(&engine, "assets/audio/winds_of_stories.mp3", NULL); + while (game_running) { controller.jump = 0; @@ -1670,6 +1683,7 @@ int main(int argc, char* argv[]) enforce_frame_rate(&timer, 60); } + ma_engine_uninit(&engine); free(level_mem); free(batch_memory); free(renderer.ui_text.transforms); -- cgit v1.2.3