PickingPass now sets state and clear it when done.

PickingState now it's own class so renderer is a bit cleaner.
This commit is contained in:
Tleety
2015-12-11 11:18:30 +01:00
parent cefc4e5257
commit 91edab34bc
9 changed files with 264 additions and 104 deletions
+9 -1
View File
@@ -48,13 +48,21 @@ void FrameBuffer::Generate()
switch ((*it)->m_ResourceType) {
case GL_TEXTURE_2D:
glFramebufferTexture2D(GL_FRAMEBUFFER, (*it)->m_Attachment, (*it)->m_ResourceType, *(*it)->m_ResourceHandle, 0);
GLERROR("FrameBuffer generate: glFramebufferTexture2D");
break;
case GL_RENDERBUFFER:
glFramebufferRenderbuffer(GL_FRAMEBUFFER, (*it)->m_Attachment, (*it)->m_ResourceType, *(*it)->m_ResourceHandle);
GLERROR("FrameBuffer generate: glFramebufferRenderbuffer");
if ( (*it)->m_Attachment != GL_COLOR_ATTACHMENT0 ||
(*it)->m_Attachment != GL_DEPTH_ATTACHMENT ||
(*it)->m_Attachment != GL_STENCIL_ATTACHMENT)
{
LOG_ERROR("RenderBuffer Attachment not valid.");
}
break;
}
GLERROR("FrameBuffer generate");
if ((*it)->m_Attachment != GL_DEPTH_ATTACHMENT) {
attachments.push_back((*it)->m_Attachment);