1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 06:23:53 +00:00

Updated vfs+sound test in root/tests/

This commit is contained in:
Nicolay Korslund 2010-01-01 19:52:37 +01:00
parent f8d3a35cf8
commit fbb77478c0
2 changed files with 7 additions and 10 deletions

View file

@ -7,7 +7,7 @@ L_OGRE=$(shell pkg-config --libs OGRE)
L_OPENAL=$(shell pkg-config --libs openal) L_OPENAL=$(shell pkg-config --libs openal)
L_AUDIERE=-laudiere L_AUDIERE=-laudiere
ogrevfs_audiere_openal_test: ogrevfs_audiere_openal_test.cpp ../vfs/servers/ogre_vfs.cpp ../sound/servers/input_audiere.cpp ../sound/servers/output_openal.cpp ../stream/clients/audiere_file.cpp ogrevfs_audiere_openal_test: ogrevfs_audiere_openal_test.cpp ../vfs/servers/ogre_vfs.cpp ../sound/sources/audiere_source.cpp ../sound/outputs/openal_out.cpp ../stream/clients/audiere_file.cpp
$(GCC) $^ -o $@ $(I_OGRE) $(L_OGRE) $(L_OPENAL) $(L_AUDIERE) $(GCC) $^ -o $@ $(I_OGRE) $(L_OGRE) $(L_OPENAL) $(L_AUDIERE)
clean: clean:

View file

@ -7,7 +7,7 @@
*/ */
#include "sound/servers/openal_audiere.h" #include "sound/filters/openal_audiere.h"
#include "vfs/servers/ogre_vfs.h" #include "vfs/servers/ogre_vfs.h"
#include <Ogre.h> #include <Ogre.h>
#include <iostream> #include <iostream>
@ -32,21 +32,18 @@ int main()
// Ogre file system // Ogre file system
VFS::OgreVFS vfs; VFS::OgreVFS vfs;
Sound::OpenAL_Audiere_Manager mg; // The main sound system
Sound::Sound *snd = mg.load(vfs.open("owl.ogg")); Sound::OpenAL_Audiere_Factory mg;
Sound::SoundPtr snd = mg.load(vfs.open("owl.ogg"));
Sound::Instance *s = snd->getInstance(false, false);
cout << "Playing 'owl.ogg' from 'sound.zip'\n"; cout << "Playing 'owl.ogg' from 'sound.zip'\n";
s->play(); snd->play();
while(s->isPlaying()) while(snd->isPlaying())
{ {
usleep(10000); usleep(10000);
if(mg.needsUpdate) mg.update(); if(mg.needsUpdate) mg.update();
} }
if(s) s->drop();
if(snd) snd->drop();
return 0; return 0;
} }