X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fsound%2Fopenal_test1.cxx;h=3d055b00104d72cf7111e3e56ba68f44a234c1c8;hb=034f5db3bd9df49698dea7465a2c3419603865c2;hp=5342ddf199623e1eb00b61b718d92fd81d6de03f;hpb=9cbbe5559844317f44744788ddb308101a1e75e9;p=simgear.git diff --git a/simgear/sound/openal_test1.cxx b/simgear/sound/openal_test1.cxx index 5342ddf1..3d055b00 100644 --- a/simgear/sound/openal_test1.cxx +++ b/simgear/sound/openal_test1.cxx @@ -1,9 +1,8 @@ #include -#ifdef __MINGW32__ -// This is broken, but allows the file to compile without a POSIX -// environment. -static unsigned int sleep(unsigned int secs) { return 0; } +#ifdef _WIN32 +#include +#define sleep(x) Sleep(x*1000) #else #include // sleep() #endif @@ -13,7 +12,11 @@ static unsigned int sleep(unsigned int secs) { return 0; } # define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION # include # include -# include +# include +#elif defined(OPENALSDK) +# include +# include +# include #else # include # include @@ -46,6 +49,9 @@ int main( int argc, char *argv[] ) { ALCdevice *dev; ALCcontext *context; + alutInit(&argc, argv); + sglog().setLogLevels( SG_ALL, SG_ALERT ); + // initialize OpenAL if ( (dev = alcOpenDevice( NULL )) != NULL && ( context = alcCreateContext( dev, NULL )) != NULL ) { @@ -158,6 +164,7 @@ int main( int argc, char *argv[] ) { alSourcePlay( source ); sleep(10); + alutExit(); return 0; }