Remade instancing

Former-commit-id: b297ed84e86a714c58d42219cc1dd8337e3a732c
This commit is contained in:
Lynix
2013-08-07 01:17:20 +02:00
parent c75887f600
commit 69d150272f
6 changed files with 146 additions and 93 deletions

View File

@@ -3,6 +3,34 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Graphics/AbstractRenderTechnique.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Renderer/Renderer.hpp>
#include <Nazara/Graphics/Debug.hpp>
NzAbstractRenderTechnique::NzAbstractRenderTechnique()
{
#ifdef NAZARA_DEBUG
if (!NzRenderer::IsInitialized())
{
NazaraError("NazaraRenderer is not initialized");
return;
}
#endif
m_instancingEnabled = NzRenderer::HasCapability(nzRendererCap_Instancing);
}
NzAbstractRenderTechnique::~NzAbstractRenderTechnique() = default;
void NzAbstractRenderTechnique::EnableInstancing(bool instancing)
{
if (NzRenderer::HasCapability(nzRendererCap_Instancing))
m_instancingEnabled = instancing;
else if (instancing)
NazaraError("NazaraRenderer does not support instancing");
}
bool NzAbstractRenderTechnique::IsInstancingEnabled() const
{
return m_instancingEnabled;
}