Added a Library to most reference-counted classes

Former-commit-id: 3ed409a71dcd5ce4eec7672ac26f8fff00e3b136
This commit is contained in:
Lynix
2015-01-28 18:06:05 +01:00
parent e18e490c59
commit 53162c1722
34 changed files with 438 additions and 32 deletions

View File

@@ -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");

View File

@@ -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;