]> git.mxchange.org Git - simgear.git/blobdiff - simgear/sound/openal_test1.cxx
Merge branch 'fredb/winfix'
[simgear.git] / simgear / sound / openal_test1.cxx
index dd2a77f01620e813c6ba6b1026bf4518719557e9..e563753a9e5e9c785e6d8bd1b99de23df34e52d1 100644 (file)
@@ -1,9 +1,8 @@
 #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
@@ -50,6 +49,7 @@ int main( int argc, char *argv[] ) {
     ALCdevice *dev;
     ALCcontext *context;
 
+    alutInit(&argc, argv);
     sglog().setLogLevels( SG_ALL, SG_ALERT );
 
     // initialize OpenAL
@@ -164,6 +164,7 @@ int main( int argc, char *argv[] ) {
     alSourcePlay( source );
 
     sleep(10);
+    alutExit();
 
     return 0;
 }