Remade instancing
Former-commit-id: b297ed84e86a714c58d42219cc1dd8337e3a732c
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user