25 #ifndef SFML_OPENAL_HPP
26 #define SFML_OPENAL_HPP
31 #include <SFML/Config.hpp>
33 #if defined(SFML_SYSTEM_MACOS)
34 #include <OpenAL/al.h>
35 #include <OpenAL/alc.h>
57 #define ALCheck(Func) ((Func), priv::ALCheckError(__FILE__, __LINE__))
62 #define ALCheck(Func) (Func)
71 inline void ALCheckError(
const std::string& File,
unsigned int Line)
74 ALenum ErrorCode = alGetError();
76 if (ErrorCode != AL_NO_ERROR)
78 std::string Error, Desc;
83 case AL_INVALID_NAME :
85 Error =
"AL_INVALID_NAME";
86 Desc =
"an unacceptable name has been specified";
90 case AL_INVALID_ENUM :
92 Error =
"AL_INVALID_ENUM";
93 Desc =
"an unacceptable value has been specified for an enumerated argument";
97 case AL_INVALID_VALUE :
99 Error =
"AL_INVALID_VALUE";
100 Desc =
"a numeric argument is out of range";
104 case AL_INVALID_OPERATION :
106 Error =
"AL_INVALID_OPERATION";
107 Desc =
"the specified operation is not allowed in the current state";
111 case AL_OUT_OF_MEMORY :
113 Error =
"AL_OUT_OF_MEMORY";
114 Desc =
"there is not enough memory left to execute the command";
120 std::cerr <<
"An internal OpenAL call failed in "
121 << File.substr(File.find_last_of(
"\\/") + 1) <<
" (" << Line <<
") : "
122 << Error <<
", " << Desc
132 #endif // SFML_OPENAL_HPP