aboutsummaryrefslogtreecommitdiff
path: root/sokol_audio.h
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2023-01-31 19:41:25 +0100
committerAndre Weissflog <floooh@gmail.com>2023-01-31 19:41:25 +0100
commit28c63b5473352a9d86c115da9448f61a2324c554 (patch)
tree59565d2243a4edfd3aebaf738af246db1cc963bf /sokol_audio.h
parent7d3f94cac2a3333b9269ad502f0b6eadebd2156f (diff)
sokol_audio.h, sokol_spine.h: doc and macro cleanup
Diffstat (limited to 'sokol_audio.h')
-rw-r--r--sokol_audio.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/sokol_audio.h b/sokol_audio.h
index 3ba31714..b97a7766 100644
--- a/sokol_audio.h
+++ b/sokol_audio.h
@@ -413,8 +413,15 @@
was called, so you don't need to worry about thread-safety.
- ERROR REPORTING AND LOGGING OVERRIDE
- ====================================
+ ERROR REPORTING AND LOGGING
+ ===========================
+ To get any logging information at all you need to provide a logging callback in the setup call
+ the easiest way is to use sokol_log.h:
+
+ #include "sokol_log.h"
+
+ saudio_setup(&(saudio_desc){ .logger.func = slog_func });
+
To override logging with your own callback, first write a logging function like this:
void my_log(const char* tag, // e.g. 'saudio'
@@ -587,7 +594,7 @@ typedef struct saudio_desc {
void (*stream_userdata_cb)(float* buffer, int num_frames, int num_channels, void* user_data); //... and with user data
void* user_data; // optional user data argument for stream_userdata_cb
saudio_allocator allocator; // optional allocation override functions
- saudio_logger logger; // optional log override functions
+ saudio_logger logger; // optional logging function (default: NO LOGGING!)
} saudio_desc;
/* setup sokol-audio */
@@ -1099,7 +1106,7 @@ _SOKOL_PRIVATE void _saudio_stream_callback(float* buffer, int num_frames, int n
static const char* _saudio_log_messages[] = {
_SAUDIO_LOG_ITEMS
};
-#undef _SSPINE_XMACRO
+#undef _SAUDIO_XMACRO
#endif // SOKOL_DEBUG
#define _SAUDIO_PANIC(code) _saudio_log(SAUDIO_LOGITEM_ ##code, 0, __LINE__)