#include <stdio.h>
-#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 <windows.h>
+#define sleep(x) Sleep(x*1000)
#else
#include <unistd.h> // sleep()
#endif
# include <OpenAL/al.h>
# include <OpenAL/alc.h>
# include <OpenAL/alut.h>
+#elif defined(OPENALSDK)
+# include <al.h>
+# include <alc.h>
+# include <AL/alut.h>
#else
# include <AL/al.h>
# include <AL/alc.h>
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 ) {
alSourcePlay( source );
sleep(10);
+ alutExit();
return 0;
}