Added a Library to most reference-counted classes
Former-commit-id: 3ed409a71dcd5ce4eec7672ac26f8fff00e3b136
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <Nazara/Audio/Config.hpp>
|
||||
#include <Nazara/Audio/Enums.hpp>
|
||||
#include <Nazara/Audio/OpenAL.hpp>
|
||||
#include <Nazara/Audio/SoundBuffer.hpp>
|
||||
#include <Nazara/Audio/Loaders/sndfile.hpp>
|
||||
#include <Nazara/Core/CallOnExit.hpp>
|
||||
#include <Nazara/Core/Core.hpp>
|
||||
@@ -103,13 +104,19 @@ bool NzAudio::Initialize()
|
||||
// Initialisation du module
|
||||
NzCallOnExit onExit(NzAudio::Uninitialize);
|
||||
|
||||
// Initialisation d'OpenGL
|
||||
// Initialisation d'OpenAL
|
||||
if (!NzOpenAL::Initialize())
|
||||
{
|
||||
NazaraError("Failed to initialize OpenAL");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!NzSoundBuffer::Initialize())
|
||||
{
|
||||
NazaraError("Failed to initialize sound buffers");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Définition de l'orientation par défaut
|
||||
SetListenerDirection(NzVector3f::Forward());
|
||||
|
||||
@@ -227,6 +234,7 @@ void NzAudio::Uninitialize()
|
||||
// Loaders
|
||||
NzLoaders_sndfile_Unregister();
|
||||
|
||||
NzSoundBuffer::Uninitialize();
|
||||
NzOpenAL::Uninitialize();
|
||||
|
||||
NazaraNotice("Uninitialized: Audio module");
|
||||
|
||||
@@ -226,4 +226,21 @@ unsigned int NzSoundBuffer::GetOpenALBuffer() const
|
||||
return m_impl->buffer;
|
||||
}
|
||||
|
||||
bool NzSoundBuffer::Initialize()
|
||||
{
|
||||
if (!NzSoundBufferLibrary::Initialize())
|
||||
{
|
||||
NazaraError("Failed to initialise library");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void NzSoundBuffer::Uninitialize()
|
||||
{
|
||||
NzSoundBufferLibrary::Uninitialize();
|
||||
}
|
||||
|
||||
NzSoundBufferLibrary::LibraryMap NzSoundBuffer::s_library;
|
||||
NzSoundBufferLoader::LoaderList NzSoundBuffer::s_loaders;
|
||||
|
||||
Reference in New Issue
Block a user