Merged 2D and 3D modules into Graphics module

Former-commit-id: 33bf0fbe727e50e864bc52680c95a106ada508e9
This commit is contained in:
Lynix
2013-04-03 01:14:55 +02:00
parent e52412577b
commit 34dbd19385
50 changed files with 168 additions and 393 deletions

View File

@@ -1,58 +0,0 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 2D Module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/2D/2D.hpp>
#include <Nazara/2D/Config.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Log.hpp>
#include <Nazara/Renderer/Renderer.hpp>
#include <Nazara/2D/Debug.hpp>
bool Nz2D::Initialize()
{
if (s_moduleReferenceCounter++ != 0)
return true; // Déjà initialisé
// Initialisation des dépendances
if (!NzRenderer::Initialize())
{
NazaraError("Failed to initialize renderer module");
Uninitialize();
return false;
}
// Initialisation du module
NazaraNotice("Initialized: 2D module");
return true;
}
bool Nz2D::IsInitialized()
{
return s_moduleReferenceCounter != 0;
}
void Nz2D::Uninitialize()
{
if (s_moduleReferenceCounter != 1)
{
// Le module est soit encore utilisé, soit pas initialisé
if (s_moduleReferenceCounter > 1)
s_moduleReferenceCounter--;
return;
}
// Libération du module
s_moduleReferenceCounter = 0;
NazaraNotice("Uninitialized: 2D module");
// Libération des dépendances
NzRenderer::Uninitialize();
}
unsigned int Nz2D::s_moduleReferenceCounter = 0;

View File

@@ -1,29 +0,0 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 2D Module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/2D/Config.hpp>
#if NAZARA_2D_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
#include <Nazara/Core/Debug/MemoryLeakTracker.hpp>
#include <new>
void* operator new(std::size_t size)
{
return NzMemoryManager::Allocate(size, false);
}
void* operator new[](std::size_t size)
{
return NzMemoryManager::Allocate(size, true);
}
void operator delete(void* pointer) noexcept
{
NzMemoryManager::Free(pointer, false);
}
void operator delete[](void* pointer) noexcept
{
NzMemoryManager::Free(pointer, true);
}
#endif

View File

@@ -1,8 +1,8 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 2D Module"
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/2D/Background.hpp>
#include <Nazara/2D/Debug.hpp>
#include <Nazara/Graphics/Background.hpp>
#include <Nazara/Graphics/Debug.hpp>
NzBackground::~NzBackground() = default;

View File

@@ -1,12 +1,12 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 3D Module"
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/3D/Camera.hpp>
#include <Nazara/3D/Scene.hpp>
#include <Nazara/Graphics/Camera.hpp>
#include <Nazara/Graphics/Scene.hpp>
#include <Nazara/Renderer/Renderer.hpp>
#include <Nazara/Renderer/RenderTarget.hpp>
#include <Nazara/3D/Debug.hpp>
#include <Nazara/Graphics/Debug.hpp>
NzCamera::NzCamera() :
m_viewport(0.f, 0.f, 1.f, 1.f),

View File

@@ -1,10 +1,10 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 2D Module"
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/2D/ColorBackground.hpp>
#include <Nazara/Graphics/ColorBackground.hpp>
#include <Nazara/Renderer/Renderer.hpp>
#include <Nazara/2D/Debug.hpp>
#include <Nazara/Graphics/Debug.hpp>
NzColorBackground::NzColorBackground(const NzColor& color) :
m_color(color)

View File

@@ -1,9 +1,9 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 3D Module"
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/3D/Config.hpp>
#if NAZARA_3D_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
#include <Nazara/Graphics/Config.hpp>
#if NAZARA_GRAPHICS_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
#include <Nazara/Core/Debug/MemoryLeakTracker.hpp>
#include <new>

View File

@@ -1,8 +1,8 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 2D Module"
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/2D/Drawable.hpp>
#include <Nazara/2D/Debug.hpp>
#include <Nazara/Graphics/Drawable.hpp>
#include <Nazara/Graphics/Debug.hpp>
NzDrawable::~NzDrawable() = default;

View File

@@ -1,16 +1,15 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 3D Module"
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/3D/3D.hpp>
#include <Nazara/2D/2D.hpp>
#include <Nazara/3D/Config.hpp>
#include <Nazara/3D/Loaders/Mesh.hpp>
#include <Nazara/3D/Loaders/OBJ.hpp>
#include <Nazara/Graphics/Graphics.hpp>
#include <Nazara/Graphics/Config.hpp>
#include <Nazara/Graphics/Loaders/Mesh.hpp>
#include <Nazara/Graphics/Loaders/OBJ.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Log.hpp>
#include <Nazara/Renderer/Renderer.hpp>
#include <Nazara/3D/Debug.hpp>
#include <Nazara/Graphics/Debug.hpp>
bool Nz3D::Initialize()
{
@@ -18,9 +17,9 @@ bool Nz3D::Initialize()
return true; // Déjà initialisé
// Initialisation des dépendances
if (!Nz2D::Initialize())
if (!NzRenderer::Initialize())
{
NazaraError("Failed to initialize 2D module");
NazaraError("Failed to initialize Renderer module");
Uninitialize();
return false;
@@ -34,7 +33,7 @@ bool Nz3D::Initialize()
// Loader générique
NzLoaders_Mesh_Register();
NazaraNotice("Initialized: 3D module");
NazaraNotice("Initialized: Graphics module");
return true;
}
@@ -62,7 +61,7 @@ void Nz3D::Uninitialize()
NzLoaders_Mesh_Unregister();
NzLoaders_OBJ_Unregister();
NazaraNotice("Uninitialized: 3D module");
NazaraNotice("Uninitialized: Graphics module");
// Libération des dépendances
Nz2D::Uninitialize();

View File

@@ -1,15 +1,15 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 3D Module"
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/3D/Light.hpp>
#include <Nazara/Graphics/Light.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Math/Basic.hpp>
#include <Nazara/Math/Sphere.hpp>
#include <Nazara/Renderer/Renderer.hpp>
#include <Nazara/Renderer/Shader.hpp>
#include <cstring>
#include <Nazara/3D/Debug.hpp>
#include <Nazara/Graphics/Debug.hpp>
///TODO: Utilisation des UBOs

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 3D module"
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once

View File

@@ -1,13 +1,13 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 3D module"
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/3D/Loaders/Mesh.hpp>
#include <Nazara/3D/Model.hpp>
#include <Nazara/Graphics/Loaders/Mesh.hpp>
#include <Nazara/Graphics/Model.hpp>
#include <Nazara/Renderer/Material.hpp>
#include <Nazara/Utility/Mesh.hpp>
#include <memory>
#include <Nazara/3D/Debug.hpp>
#include <Nazara/Graphics/Debug.hpp>
namespace
{

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 3D module"
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once

View File

@@ -1,11 +1,11 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 3D module"
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/3D/Loaders/OBJ.hpp>
#include <Nazara/3D/Loaders/OBJ/MTLParser.hpp>
#include <Nazara/3D/Loaders/OBJ/OBJParser.hpp>
#include <Nazara/3D/Model.hpp>
#include <Nazara/Graphics/Loaders/OBJ.hpp>
#include <Nazara/Graphics/Loaders/OBJ/MTLParser.hpp>
#include <Nazara/Graphics/Loaders/OBJ/OBJParser.hpp>
#include <Nazara/Graphics/Model.hpp>
#include <Nazara/Renderer/Material.hpp>
#include <Nazara/Utility/BufferMapper.hpp>
#include <Nazara/Utility/IndexMapper.hpp>
@@ -14,7 +14,7 @@
#include <limits>
#include <memory>
#include <unordered_map>
#include <Nazara/3D/Debug.hpp>
#include <Nazara/Graphics/Debug.hpp>
namespace
{

View File

@@ -1,14 +1,14 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 3D module"
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/3D/Loaders/OBJ/MTLParser.hpp>
#include <Nazara/Graphics/Loaders/OBJ/MTLParser.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Log.hpp>
#include <Nazara/Utility/Config.hpp>
#include <cstdio>
#include <memory>
#include <Nazara/3D/Debug.hpp>
#include <Nazara/Graphics/Debug.hpp>
NzMTLParser::NzMTLParser(NzInputStream& stream) :
m_stream(stream),

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 3D module"
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once

View File

@@ -1,15 +1,15 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 3D module"
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/3D/Loaders/OBJ/OBJParser.hpp>
#include <Nazara/Graphics/Loaders/OBJ/OBJParser.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Log.hpp>
#include <Nazara/Utility/Config.hpp>
#include <cstdio>
#include <map>
#include <memory>
#include <Nazara/3D/Debug.hpp>
#include <Nazara/Graphics/Debug.hpp>
NzOBJParser::NzOBJParser(NzInputStream& stream) :
m_stream(stream),

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 3D module"
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once

View File

@@ -1,14 +1,14 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 3D Module"
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/3D/Model.hpp>
#include <Nazara/3D/Config.hpp>
#include <Nazara/Graphics/Model.hpp>
#include <Nazara/Graphics/Config.hpp>
#include <Nazara/Utility/SkeletalMesh.hpp>
#include <Nazara/Utility/StaticMesh.hpp>
#include <memory>
#include <tuple>
#include <Nazara/3D/Debug.hpp>
#include <Nazara/Graphics/Debug.hpp>
bool NzModelParameters::IsValid() const
{

View File

@@ -1,12 +1,12 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 3D Module"
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/3D/RenderQueue.hpp>
#include <Nazara/Graphics/RenderQueue.hpp>
#include <Nazara/Renderer/Material.hpp>
#include <Nazara/Utility/SkeletalMesh.hpp>
#include <Nazara/Utility/StaticMesh.hpp>
#include <Nazara/3D/Debug.hpp>
#include <Nazara/Graphics/Debug.hpp>
bool NzRenderQueue::MaterialComparator::operator()(const NzMaterial* mat1, const NzMaterial* mat2)
{

View File

@@ -1,17 +1,17 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 3D Module"
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/3D/Scene.hpp>
#include <Nazara/2D/ColorBackground.hpp>
#include <Nazara/2D/Drawable.hpp>
#include <Nazara/3D/Camera.hpp>
#include <Nazara/3D/Light.hpp>
#include <Nazara/3D/Model.hpp>
#include <Nazara/3D/RenderQueue.hpp>
#include <Nazara/3D/SceneRoot.hpp>
#include <Nazara/Graphics/Scene.hpp>
#include <Nazara/Core/Clock.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Graphics/ColorBackground.hpp>
#include <Nazara/Graphics/Drawable.hpp>
#include <Nazara/Graphics/Camera.hpp>
#include <Nazara/Graphics/Light.hpp>
#include <Nazara/Graphics/Model.hpp>
#include <Nazara/Graphics/RenderQueue.hpp>
#include <Nazara/Graphics/SceneRoot.hpp>
#include <Nazara/Renderer/Config.hpp>
#include <Nazara/Renderer/Renderer.hpp>
#include <Nazara/Renderer/Shader.hpp>

View File

@@ -1,10 +1,10 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 3D Module"
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/3D/SceneNode.hpp>
#include <Nazara/3D/Scene.hpp>
#include <Nazara/3D/Debug.hpp>
#include <Nazara/Graphics/SceneNode.hpp>
#include <Nazara/Graphics/Scene.hpp>
#include <Nazara/Graphics/Debug.hpp>
NzSceneNode::NzSceneNode() :
m_scene(nullptr),

View File

@@ -1,10 +1,10 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 3D Module"
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/3D/SceneRoot.hpp>
#include <Nazara/Graphics/SceneRoot.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/3D/Debug.hpp>
#include <Nazara/Graphics/Debug.hpp>
NzSceneRoot::NzSceneRoot(NzScene* scene)
{

View File

@@ -1,11 +1,11 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - 2D Module"
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/2D/TextureBackground.hpp>
#include <Nazara/Graphics/TextureBackground.hpp>
#include <Nazara/Renderer/Renderer.hpp>
#include <Nazara/Renderer/RenderTarget.hpp>
#include <Nazara/2D/Debug.hpp>
#include <Nazara/Graphics/Debug.hpp>
NzTextureBackground::NzTextureBackground(NzTexture* texture) :
m_texture(texture)