Big config/debug update
Added config checkers Macro no longer use suffixes Moved MemoryManager to upper directory Renamed *_MEMORYMANAGER to *_MANAGE_MEMORY Renamed AUDIO_STREAMEDBUFFERCOUNT to AUDIO_STREAMED_BUFFER_COUNT Renamed CORE_REAL_PRECISION to CORE_DECIMAL_DIGITS Renamed DEBUG_MEMORYMANAGER_DISABLE_REDEFINITION to DEBUG_NEWREDEFINITION_DISABLE_REDEFINITION Renamed GRAPHICS_MAX_LIGHTPERPASS to GRAPHICS_MAX_LIGHT_PER_PASS Renamed UTILITY_FORCE_DECLARATION_STRIDE_MULTIPLE_OF_32 to UTILITY_VERTEX_DECLARATION_FORCE_STRIDE_MULTIPLE_OF_32 Former-commit-id: 81ef836ac9f092ac471f60e544bb7c7c6370593c
This commit is contained in:
@@ -32,13 +32,18 @@
|
||||
// À partir de combien d'instances d'un même mesh/matériau l'instancing doit-il être utilisé ?
|
||||
#define NAZARA_GRAPHICS_INSTANCING_MIN_INSTANCES_COUNT 10
|
||||
|
||||
// Utilise un manager de mémoire pour gérer les allocations dynamiques (détecte les leaks, ralenti l'exécution)
|
||||
#define NAZARA_GRAPHICS_MEMORYMANAGER 0
|
||||
// Utilise un manager de mémoire pour gérer les allocations dynamiques (détecte les leaks au prix d'allocations/libérations dynamiques plus lentes)
|
||||
#define NAZARA_GRAPHICS_MANAGE_MEMORY 0
|
||||
|
||||
// Active les tests de sécurité basés sur le code (Conseillé pour le développement)
|
||||
#define NAZARA_GRAPHICS_SAFE 1
|
||||
|
||||
/// Chaque modification d'un paramètre ci-dessous implique une modification (souvent mineure) du code
|
||||
|
||||
// Le nombre maximum de lumières qu'un shader standard supportera
|
||||
#define NAZARA_GRAPHICS_MAX_LIGHTPERPASS 3U // Unsigned
|
||||
#define NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS 3
|
||||
|
||||
/// Vérification des valeurs et types de certaines constantes
|
||||
#include <Nazara/Graphics/ConfigCheck.hpp>
|
||||
|
||||
#endif // NAZARA_CONFIG_GRAPHICS_HPP
|
||||
|
||||
24
include/Nazara/Graphics/ConfigCheck.hpp
Normal file
24
include/Nazara/Graphics/ConfigCheck.hpp
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright (C) 2014 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
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_CONFIG_CHECK_GRAPHICS_HPP
|
||||
#define NAZARA_CONFIG_CHECK_GRAPHICS_HPP
|
||||
|
||||
/// Ce fichier sert à vérifier la valeur des constantes du fichier Config.hpp
|
||||
|
||||
#include <type_traits>
|
||||
#define CheckTypeAndVal(name, type, op, val, err) static_assert(std::is_ ##type <decltype(name)>::value && name op val, #type err)
|
||||
|
||||
// On force la valeur de MANAGE_MEMORY en mode debug
|
||||
#if defined(NAZARA_DEBUG) && !NAZARA_GRAPHICS_MANAGE_MEMORY
|
||||
#undef NAZARA_GRAPHICS_MANAGE_MEMORY
|
||||
#define NAZARA_GRAPHICS_MANAGE_MEMORY 1
|
||||
#endif
|
||||
|
||||
CheckTypeAndVal(NAZARA_GRAPHICS_INSTANCING_MIN_INSTANCES_COUNT, integral, >, 0, " shall be a strictly positive integer");
|
||||
CheckTypeAndVal(NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS, integral, >, 0, " shall be a strictly positive integer");
|
||||
|
||||
#endif // NAZARA_CONFIG_CHECK_GRAPHICS_HPP
|
||||
@@ -3,6 +3,6 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Graphics/Config.hpp>
|
||||
#if NAZARA_GRAPHICS_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
#include <Nazara/Core/Debug/MemoryManager.hpp>
|
||||
#if NAZARA_GRAPHICS_MANAGE_MEMORY
|
||||
#include <Nazara/Core/Debug/NewRedefinition.hpp>
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
// This file is part of the "Nazara Engine - Graphics module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#if NAZARA_GRAPHICS_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
// On suppose que Debug.hpp a déjà été inclus, tout comme Config.hpp
|
||||
#if NAZARA_GRAPHICS_HPP
|
||||
#undef delete
|
||||
#undef new
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user