Files
NazaraEngine/src/Nazara/Graphics/AbstractRenderTechnique.cpp
Lynix df8da275c4 Switch from Nz prefix to namespace Nz
What a huge commit


Former-commit-id: 38ac5eebf70adc1180f571f6006192d28fb99897
2015-09-25 19:20:05 +02:00

46 lines
1.2 KiB
C++

// Copyright (C) 2015 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/AbstractRenderTechnique.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Graphics/RenderTechniques.hpp>
#include <Nazara/Renderer/Renderer.hpp>
#include <Nazara/Graphics/Debug.hpp>
namespace Nz
{
AbstractRenderTechnique::AbstractRenderTechnique()
{
#ifdef NAZARA_DEBUG
if (!Renderer::IsInitialized())
{
NazaraError("NazaraRenderer is not initialized");
return;
}
#endif
m_instancingEnabled = Renderer::HasCapability(RendererCap_Instancing);
}
AbstractRenderTechnique::~AbstractRenderTechnique() = default;
void AbstractRenderTechnique::EnableInstancing(bool instancing)
{
if (Renderer::HasCapability(RendererCap_Instancing))
m_instancingEnabled = instancing;
else if (instancing)
NazaraError("NazaraRenderer does not support instancing");
}
String AbstractRenderTechnique::GetName() const
{
return RenderTechniques::ToString(GetType());
}
bool AbstractRenderTechnique::IsInstancingEnabled() const
{
return m_instancingEnabled;
}
}