This commit is contained in:
Raynaldo Rivera 2009-11-15 17:11:38 +00:00
parent 973bd33e5a
commit aabf6b9306
2 changed files with 15 additions and 7 deletions

View File

@ -51,9 +51,10 @@ namespace cAudio
//Stores the EAX attributes
ALint attribs[4] = { 0 };
//Check if device can be created
if (Device == NULL)
if (Device == NULL){
log->log(E_LOGLEVEL_4,"cAudio Failed to Initalized:");
exit(-1);
}
log->log(E_LOGLEVEL_4,"cAudio Initalized:");
@ -63,9 +64,10 @@ namespace cAudio
//Create context with eax effects for windows
#ifdef CAUDIO_EAX_ENABLED
if(alcIsExtensionPresent(Device, "ALC_EXT_EFX") == AL_FALSE)
if(alcIsExtensionPresent(Device, "ALC_EXT_EFX") == AL_FALSE){
log->log(E_LOGLEVEL_4,"cAudio: EFX isnt supported");
return;
}
Context=alcCreateContext(Device, attribs);
log->log(E_LOGLEVEL_4,"cAudio: EFX Supported and Enabled.");

View File

@ -25,11 +25,17 @@ void cLogger::setLogLevel(E_LOGLEVEL level)
void cLogger::log(E_LOGLEVEL loglevel,const char* text,...)
{
Mutex.lock();
if(logLevel <= loglevel){
std::cout<<text<<std::endl;
}
Mutex.unlock();
Mutex.lock();
char buffer[ 4096 ];
va_list marker;
va_start( marker, text );
vsprintf( buffer, text, marker );
va_end( marker );
if(logLevel <= loglevel)
{
std::cout<< buffer <<std::endl;
}
Mutex.unlock();
}
}