22 #include <OpenAL/al.h>
23 #include <OpenAL/alc.h>
37void check_al_errors(
const char* filename,
const sizetype line);
41template<
typename alFunction,
typename... Params>
42auto alCallImpl(
const char* filename,
const std::uint_fast32_t line, alFunction function, Params... params)
43->typename std::enable_if<std::is_same<
void,
decltype(function(params...))>::value,
decltype(function(params...))>::type
45 function(std::forward<Params>(params)...);
46 check_al_errors(filename,line);
49template<
typename alFunction,
typename... Params>
50auto alCallImpl(
const char* filename,
const std::uint_fast32_t line, alFunction function, Params... params)
51->typename std::enable_if<!std::is_same<
void,
decltype(function(params...))>::value,
decltype(function(params...))>::type
53 auto ret = function(std::forward<Params>(params)...);
54 check_al_errors(filename,line);
59#define alCall(function, ...) alCallImpl(__FILE__, __LINE__, function, __VA_ARGS__)
60#define alcCall(function, device, ...) alcCallImpl(__FILE__, __LINE__, function, device, __VA_ARGS__)
64#define alCall(function, ...) function(__VA_ARGS__); check_al_errors(__FILE__, __LINE__);
65#define alcCall(function, device, ...) return function(__VA_ARGS__);
Library types, macros, defines and enums header.