|
|
Line 2: |
Line 2: |
| {| border="0" | | {| border="0" |
| | {{ContentBlock|width=800|color=white |content= | | | {{ContentBlock|width=800|color=white |content= |
− | The Sound Extension extends Horde3D with the capability of 3D positional audio with the help of OpenAL. It was designed to integrate as nicely as possible with Horde3D, therefore it comes with some limitations, such as the lack of streaming sound support. This means the whole audio file will be read and decoded all at once, which can be quite time consuming for larger files. | + | The Sound Extension extends Horde3D with the capability of 3D positional audio with the help of OpenAL. It was designed to integrate as nicely as possible with Horde3D, therefore it lacks support for streaming resources. This means the whole audio file will be read and decoded all at once, which can be quite time consuming for larger files. |
| | | |
| The extension currently decodes ogg vorbis and wave audio files but decoders for more formats can quite easily be implemented. See the decoder.h file for documentation on how to implement more audio decoders. | | The extension currently decodes ogg vorbis and wave audio files but decoders for more formats can quite easily be implemented. See the decoder.h file for documentation on how to implement more audio decoders. |
Line 8: |
Line 8: |
| = Installation Windows = | | = Installation Windows = |
| To install the extension, copy the Extensions directory to the path where the Horde3D SDK resides. | | To install the extension, copy the Extensions directory to the path where the Horde3D SDK resides. |
− | | + | In Visual Studio, add the extension, sample, ogg, vorbis and vorbisfile projects to the Horde3D solution. Then add the extension project to the project dependencies of the Horde3D Engine and the Horde3D Engine to the dependencies of the Sound Sample. After that, include 'Sound/Source/extension.h' in 'egExtensions.cpp' of the engine and add '#pragma comment( lib, "Extension_Sound.lib" )' to link against the sound extension. |
− | If your version of Horde3D SDK is <= 1.0.0 Beta 2 you will need to apply this patch:
| |
− | | |
− | <pre>
| |
− | --- Bindings/C++/Horde3D.h Sun Sep 14 21:50:46 2008
| |
− | +++ Bindings/C++/Horde3D.h Tue Dec 09 08:44:13 2008
| |
− | @@ -791,11 +791,11 @@
| |
− | res - handle to the resource
| |
− |
| |
− | Returns:
| |
− | type of the resource
| |
− | */
| |
− | - DLL ResourceTypes::List getResourceType( ResHandle res );
| |
− | + DLL int getResourceType( ResHandle res );
| |
− |
| |
− | /* Function: getResourceName
| |
− | Returns the name of a resource.
| |
− |
| |
− | This function returns a pointer to the name of a specified resource. If the resource handle
| |
− | @@ -823,11 +823,11 @@
| |
− | name - name of the resource
| |
− |
| |
− | Returns:
| |
− | handle to the resource or 0 if not found
| |
− | */
| |
− | - DLL ResHandle findResource( ResourceTypes::List type, const char *name );
| |
− | + DLL ResHandle findResource( int type, const char *name );
| |
− |
| |
− | /* Function: addResource
| |
− | Adds a resource.
| |
− |
| |
− | This function tries to add a resource of a specified type and name to the resource manager. If
| |
− | @@ -842,11 +842,11 @@
| |
− | flags - flags used for creating the resource
| |
− |
| |
− | Returns:
| |
− | handle to the resource to be added or 0 in case of failure
| |
− | */
| |
− | - DLL ResHandle addResource( ResourceTypes::List type, const char *name, int flags );
| |
− | + DLL ResHandle addResource( int type, const char *name, int flags );
| |
− |
| |
− | /* Function: cloneResource
| |
− | Duplicates a resource.
| |
− |
| |
− | This function duplicates a specified resource. In the cloning process a new resource with the
| |
− | --- Source/Horde3DEngine/egMain.cpp Wed Sep 03 00:28:10 2008
| |
− | +++ Source/Horde3DEngine/egMain.cpp Tue Dec 09 08:44:13 2008
| |
− | @@ -236,11 +236,11 @@
| |
− |
| |
− | // *********************************************************************************************
| |
− | // Resource functions
| |
− | // *********************************************************************************************
| |
− |
| |
− | - DLLEXP ResourceTypes::List getResourceType( ResHandle res )
| |
− | + DLLEXP int getResourceType( ResHandle res )
| |
− | {
| |
− | Resource *r = Modules::resMan().resolveResHandle( res );
| |
− |
| |
− | if( r != 0x0 ) return r->getType();
| |
− | else
| |
− | @@ -264,20 +264,20 @@
| |
− | return &emptyString;
| |
− | }
| |
− | }
| |
− |
| |
− |
| |
− | - DLLEXP ResHandle findResource( ResourceTypes::List type, const char *name )
| |
− | + DLLEXP ResHandle findResource( int type, const char *name )
| |
− | {
| |
− | Resource *res = Modules::resMan().findResource( type, safeStr( name ) );
| |
− |
| |
− | if( res != 0x0 ) return res->getHandle();
| |
− | else return 0;
| |
− | }
| |
− |
| |
− |
| |
− | - DLLEXP ResHandle addResource( ResourceTypes::List type, const char *name, int flags )
| |
− | + DLLEXP ResHandle addResource( int type, const char *name, int flags )
| |
− | {
| |
− | return Modules::resMan().addResource( type, safeStr( name ), flags, true );
| |
− | }
| |
− |
| |
− |
| |
− | --- Source/Horde3DEngine/egResource.cpp Wed Sep 03 00:28:10 2008
| |
− | +++ Source/Horde3DEngine/egResource.cpp Tue Dec 09 08:42:30 2008
| |
− | @@ -37,11 +37,11 @@
| |
− |
| |
− | // **********************************************************************************
| |
− | // Class Resource
| |
− | // **********************************************************************************
| |
− |
| |
− | -Resource::Resource( ResourceTypes::List type, const string &name, int flags )
| |
− | +Resource::Resource( int type, const string &name, int flags )
| |
− | {
| |
− | _type = type;
| |
− | _name = name;
| |
− | _handle = 0;
| |
− | _loaded = false;
| |
− | @@ -192,11 +192,11 @@
| |
− | // Initialize resource type
| |
− | if( inf != 0 ) (*inf)();
| |
− | }
| |
− |
| |
− |
| |
− | -Resource *ResourceManager::findResource( ResourceTypes::List type, const string &name )
| |
− | +Resource *ResourceManager::findResource( int type, const string &name )
| |
− | {
| |
− | for( uint32 i = 0; i < _resources.size(); ++i )
| |
− | {
| |
− | if( _resources[i] != 0x0 && _resources[i]->_type == type && _resources[i]->_name == name )
| |
− | {
| |
− | @@ -226,11 +226,11 @@
| |
− | _resources.push_back( &resource );
| |
− | return resource._handle;
| |
− | }
| |
− |
| |
− |
| |
− | -ResHandle ResourceManager::addResource( ResourceTypes::List type, const string &name,
| |
− | +ResHandle ResourceManager::addResource( int type, const string &name,
| |
− | int flags, bool userCall )
| |
− | {
| |
− | if( name == "" || name.find( ":" ) != string::npos )
| |
− | {
| |
− | Modules::log().writeDebugInfo( "Invalid name for added resource of type %i", type );
| |
− | --- Source/Horde3DEngine/egResource.h Wed Sep 03 00:28:10 2008
| |
− | +++ Source/Horde3DEngine/egResource.h Tue Dec 09 08:42:30 2008
| |
− | @@ -65,11 +65,11 @@
| |
− |
| |
− | class Resource
| |
− | {
| |
− | protected:
| |
− |
| |
− | - ResourceTypes::List _type;
| |
− | + int _type;
| |
− | string _name;
| |
− | ResHandle _handle;
| |
− | bool _loaded;
| |
− | bool _noQuery;
| |
− | int _flags;
| |
− | @@ -77,11 +77,11 @@
| |
− | uint32 _refCount; // Number of other objects referencing to this resource
| |
− | uint32 _userRefCount; // Number of handles created by user
| |
− |
| |
− | public:
| |
− |
| |
− | - Resource( ResourceTypes::List type, const string &name, int flags );
| |
− | + Resource( int type, const string &name, int flags );
| |
− | virtual ~Resource();
| |
− | virtual Resource *clone(); // TODO: Implement this for all resource types
| |
− |
| |
− | virtual void initDefault();
| |
− | virtual void release();
| |
− | @@ -96,11 +96,11 @@
| |
− | virtual bool setParamstr( int param, const char *value );
| |
− |
| |
− | virtual const void *getData( int param );
| |
− | virtual bool updateData( int param, const void *data, int size );
| |
− |
| |
− | - ResourceTypes::List &getType() { return _type; }
| |
− | + int &getType() { return _type; }
| |
− | const string &getName() { return _name; }
| |
− | ResHandle getHandle() { return _handle; }
| |
− | bool isLoaded() { return _loaded; }
| |
− | void addRef() { ++_refCount; }
| |
− | void subRef() { --_refCount; }
| |
− | @@ -169,12 +169,12 @@
| |
− | ~ResourceManager();
| |
− |
| |
− | void registerType( int type, const string &typeString, ResTypeInitializationFunc inf,
| |
− | ResTypeReleaseFunc rf, ResTypeFactoryFunc ff );
| |
− |
| |
− | - Resource *findResource( ResourceTypes::List type, const string &name );
| |
− | - ResHandle addResource( ResourceTypes::List type, const string &name, int flags, bool userCall );
| |
− | + Resource *findResource( int type, const string &name );
| |
− | + ResHandle addResource( int type, const string &name, int flags, bool userCall );
| |
− | ResHandle addNonExistingResource( Resource &resource, bool userCall );
| |
− | ResHandle cloneResource( ResHandle sourceRes, const string &name );
| |
− | int removeResource( ResHandle handle, bool userCall );
| |
− | void clear();
| |
− | ResHandle queryUnloadedResource( int index );
| |
− | </pre>
| |
− | | |
− | In Visual Studio, add the extension, sample, ogg, vorbis and vorbisfile projects to the Horde3D solution. Then add the extension project to the project dependencies of the Horde3D Engine and the Horde3D Engine to the dependencies of the Sound Sample. After that, include 'Sound/Source/extension.h' in 'egExtensions.cpp' of the engine and add '#pragma comment( lib, "Extension_Sound.lib" )' to link against the sound extension (under Windows). | |
| Finally, add the following line to ExtensionManager::installExtensions to register the extension: | | Finally, add the following line to ExtensionManager::installExtensions to register the extension: |
| | | |
Line 200: |
Line 18: |
| | | |
| = Using the extension = | | = Using the extension = |
− | When using the extension a sound device needs to be opened for playback, then a listener node needs to be created and activated. The activated listener node will act as the ears and all 3D sound calculations will be based on that node's position and orientation. Then you can start creating sound resources, attaching them to sound nodes and start playing the nodes.
| + | To use the extension a sound device needs to be opened for playback, then a listener node needs to be created and activated. The activated listener node will act as the ears and all 3D sound calculations will be based on that node's position and orientation. Then you can start creating sound resources, attaching them to sound nodes and start playing the nodes. |
| | | |
| OpenAL will need to be installed to be able to run any applications using the Sound Extension. | | OpenAL will need to be installed to be able to run any applications using the Sound Extension. |
| | | |
| = Obtaining the extension = | | = Obtaining the extension = |
− | The extension can either be downloaded [http://mm-werkstatt.informatik.uni-augsburg.de/downloads/Horde3D_ExtSound_1.0.zip here] or from the community svn. | + | The extension can either be downloaded [http://mm-werkstatt.informatik.uni-augsburg.de/downloads/Horde3D_ExtSound_1.0.1.zip here] or from the community svn. |
| + | |
| + | = Changelog = |
| + | 1.0.1 - Adapted to Horde3D 1.0.0 Beta3<br /> |
| + | 1.0 - Initial release |
| | | |
| }} <!-- Right panel --> | | }} <!-- Right panel --> |
Line 212: |
Line 34: |
| screenshot = H3Dsound.jpg| | | screenshot = H3Dsound.jpg| |
| description = The Sound Extension extends Horde3D with the capability of 3D positional audio.| | | description = The Sound Extension extends Horde3D with the capability of 3D positional audio.| |
− | version = 1.0| | + | version = 1.0.1| |
− | horde3dversion = 1.0.0 Beta 2| | + | horde3dversion = 1.0.0 Beta 3| |
− | released = 2009-01-27| | + | released = 2009-03-17| |
| author = Ulf Nilsson Tännström| | | author = Ulf Nilsson Tännström| |
| }} | | }} |
| |} | | |} |