Add graphics module base

This commit is contained in:
Jérôme Leclercq
2020-09-20 14:52:44 +02:00
parent e9f3e39194
commit 95c9ad0fd8
9 changed files with 209 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
// Copyright (C) 2020 Jérôme Leclercq
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Graphics/Config.hpp>
#if NAZARA_GRAPHICS_MANAGE_MEMORY
#include <Nazara/Core/MemoryManager.hpp>
#include <new> // Nécessaire ?
void* operator new(std::size_t size)
{
return Nz::MemoryManager::Allocate(size, false);
}
void* operator new[](std::size_t size)
{
return Nz::MemoryManager::Allocate(size, true);
}
void operator delete(void* pointer) noexcept
{
Nz::MemoryManager::Free(pointer, false);
}
void operator delete[](void* pointer) noexcept
{
Nz::MemoryManager::Free(pointer, true);
}
#endif

View File

@@ -0,0 +1,26 @@
// Copyright (C) 2020 Jérôme Leclercq
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Graphics/Graphics.hpp>
#include <Nazara/Graphics/Debug.hpp>
namespace Nz
{
/*!
* \ingroup graphics
* \class Nz::Graphics
* \brief Audio class that represents the module initializer of Graphics
*/
Graphics::Graphics(Config /*config*/) :
ModuleBase("Graphics", this)
{
}
Graphics::~Graphics()
{
}
Graphics* Graphics::s_instance = nullptr;
}