Refactored mathematics module

Added AABBs
Added code examples
Added experimental support for texture arrays (1D/2D)
Added initialisers (new way of initialising modules)
Added global headers (Plus a global header generator script)
Added pattern support for directory
Added support for spinlocks critical section on Windows
Added NzRenderWindow::SetFramerateLimit
Core project now includes Mathematics files
Fixed color implementation using double
Fixed declaration needing renderer include
Fixed MLT not clearing nextFree(File/Line) after Free
Fixed move operators not being noexcept
Fixed thread-safety (Now working correctly - If I'm lucky)
Moved Resource to core
New interface for modules
New interface for the renderer
Put some global functions to anonymous namespace
Removed empty modules
Renamed ThreadCondition to ConditionVariable
Replaced redirect to cerr log option by duplicate to cout
Setting mouse position relative to a window will make this window ignore
the event
Shaders sending methods no longer takes the uniform variable name (it's
using ID instead)
Using new OpenGL 4.3 header
This commit is contained in:
Lynix
2012-08-08 04:44:17 +02:00
parent 06eda4eba9
commit b442ab0bd2
142 changed files with 6861 additions and 2326 deletions

View File

@@ -3,7 +3,9 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Utility.hpp>
#include <Nazara/Core/Core.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Log.hpp>
#include <Nazara/Utility/Buffer.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Loaders/MD2.hpp>
@@ -13,26 +15,19 @@
#include <Nazara/Utility/Window.hpp>
#include <Nazara/Utility/Debug.hpp>
NzUtility::NzUtility()
{
}
NzUtility::~NzUtility()
{
if (s_initialized)
Uninitialize();
}
bool NzUtility::Initialize()
{
#if NAZARA_UTILITY_SAFE
if (s_initialized)
{
NazaraError("Renderer already initialized");
return true;
}
#endif
if (s_moduleReferenceCouter++ != 0)
return true; // Déjà initialisé
// Initialisation des dépendances
if (!NzCore::Initialize())
{
NazaraError("Failed to initialize core module");
return false;
}
// Initialisation du module
if (!NzBuffer::Initialize())
{
NazaraError("Failed to initialize buffers");
@@ -64,21 +59,22 @@ bool NzUtility::Initialize()
// Image
NzLoaders_STB_Register(); // Loader générique (STB)
s_initialized = true;
NazaraNotice("Initialized: Utility module");
return true;
}
bool NzUtility::IsInitialized()
{
return s_moduleReferenceCouter != 0;
}
void NzUtility::Uninitialize()
{
#if NAZARA_UTILITY_SAFE
if (!s_initialized)
{
NazaraError("Utility not initialized");
return;
}
#endif
if (--s_moduleReferenceCouter != 0)
return; // Encore utili
// Libération du module
NzLoaders_MD2_Unregister();
NzLoaders_PCX_Unregister();
NzLoaders_STB_Unregister();
@@ -87,12 +83,11 @@ void NzUtility::Uninitialize()
NzPixelFormat::Uninitialize();
NzBuffer::Uninitialize();
s_initialized = false;
NazaraNotice("Uninitialized: Utility module");
// Libération des dépendances
NzCore::Uninitialize();
}
bool NzUtility::IsInitialized()
{
return s_initialized;
}
unsigned int NzUtility::s_moduleReferenceCouter = 0;
bool NzUtility::s_initialized = false;