OpenGLRenderer: Implement face filling

This commit is contained in:
Jérôme Leclercq
2021-06-17 23:57:01 +02:00
parent 8625c0a7ac
commit b13c5c950a
8 changed files with 36 additions and 6 deletions

View File

@@ -500,13 +500,11 @@ namespace Nz::GL
m_state.renderStates.frontFace = targetFrontFace;
}
/*
TODO: Use glPolyonMode if available (OpenGL)
if (m_state.renderStates.faceFilling != renderStates.faceFilling)
if (glPolygonMode && m_state.renderStates.faceFilling != renderStates.faceFilling)
{
glPolygonMode(GL_FRONT_AND_BACK, FaceFilling[states.faceFilling]);
glPolygonMode(GL_FRONT_AND_BACK, ToOpenGL(renderStates.faceFilling));
m_state.renderStates.faceFilling = renderStates.faceFilling;
}*/
}
if (renderStates.stencilTest)
{
@@ -663,6 +661,12 @@ namespace Nz::GL
return true;
}
else if (function == "glPolygonMode")
{
constexpr std::size_t functionIndex = UnderlyingCast(FunctionIndex::glPolygonMode);
return loader.Load<PFNGLPOLYGONMODENVPROC, functionIndex>(glPolygonMode, "glPolygonModeNV", false, false);
}
return false;
}