|
From: <c99...@us...> - 2007-05-08 00:10:44
|
Revision: 403
http://svn.sourceforge.net/cadcdev/?rev=403&view=rev
Author: c99koder
Date: 2007-05-07 17:10:41 -0700 (Mon, 07 May 2007)
Log Message:
-----------
Tiki: win32: initialize OpenAL without ALUT
Modified Paths:
--------------
tiki/win32/src/init_shutdown.cpp
Modified: tiki/win32/src/init_shutdown.cpp
===================================================================
--- tiki/win32/src/init_shutdown.cpp 2007-05-06 15:15:21 UTC (rev 402)
+++ tiki/win32/src/init_shutdown.cpp 2007-05-08 00:10:41 UTC (rev 403)
@@ -6,18 +6,28 @@
#include "Tiki/stream.h"
#include <al.h>
-#include <alut.h>
+#include <alc.h>
#include <MMSystem.h>
#pragma comment(lib, "winmm.lib")
-#pragma comment(lib, "ALut.lib")
#pragma comment(lib, "OpenAL32.lib")
bool Tiki::init(int argc, char **argv) {
// Let us run with millisecond precision if possible.
timeBeginPeriod(1);
- alutInit(&argc, argv);
+ ALCdevice *dev = NULL;
+ ALCcontext *ctx = NULL;
+
+ dev = alcOpenDevice(getenv("OPENAL_DEVICE")); // getenv()==NULL is okay.
+ if (dev != NULL) {
+ ctx = alcCreateContext(dev, 0);
+ if (ctx != NULL) {
+ alcMakeContextCurrent(ctx);
+ alcProcessContext(ctx);
+ } // if
+ } // if
+
Audio::Stream::initGlobal();
Audio::Sound::initGlobal();
@@ -31,7 +41,6 @@
Hid::shutdown();
Audio::Sound::shutdownGlobal();
Audio::Stream::shutdownGlobal();
- alutExit();
timeEndPeriod(1);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|