Commit e07da38b authored by Jonathan Kunstwald's avatar Jonathan Kunstwald
Browse files

Change render pass type enum to bool flag

parent 3f729050
......@@ -34,14 +34,12 @@ void DebugRenderer::clear()
void DebugRenderer::renderPass(const pipeline::RenderPass& pass) const
{
render(pass.type, pass.camera->getViewMatrix(), pass.camera->getProjectionMatrix());
render(pass.type == pipeline::RenderPassType::Opaque, pass.camera->getViewMatrix(), pass.camera->getProjectionMatrix());
}
void DebugRenderer::render(RenderPassType type, const glm::mat4& view, const glm::mat4& projection) const
void DebugRenderer::render(bool opaque, const glm::mat4& view, const glm::mat4& projection) const
{
switch (type)
{
case RenderPassType::Opaque:
if (opaque)
{
auto shader = mShaderOpaque->use();
shader.setUniform("uView", view);
......@@ -56,9 +54,7 @@ void DebugRenderer::render(RenderPassType type, const glm::mat4& view, const glm
p.vao->bind().draw();
}
}
break;
case RenderPassType::Transparent:
{
else {
auto shader = mShaderTransparent->use();
shader.setUniform("uView", view);
shader.setUniform("uProj", projection);
......@@ -72,10 +68,6 @@ void DebugRenderer::render(RenderPassType type, const glm::mat4& view, const glm
p.vao->bind().draw();
}
}
break;
default:
break;
}
}
void DebugRenderer::renderLine(glm::vec3 start, glm::vec3 end, glm::vec4 color)
......
......@@ -80,7 +80,7 @@ public:
/// Renders all stored primitives
void renderPass(pipeline::RenderPass const& pass) const;
void render(pipeline::RenderPassType type, const glm::mat4& view, const glm::mat4& projection) const;
void render(bool opaque, const glm::mat4& view, const glm::mat4& projection) const;
// render functions
public:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment