Ejemplo n.º 1
0
void CDebugDrawer::draw()
{
	unsigned int i;
	CNode *node;

	m_debugShader->bind();
	m_debugShapes->bind();

	for(i = 0; i < m_partitioner->m_visiblePropNodes.size(); i++)
	{
		node = m_partitioner->m_visiblePropNodes[i];
		node->drawDebug(m_debugShapes);
	}

	for(i = 0; i < m_partitioner->m_visibleLightNodes.size(); i++)
	{
		node = m_partitioner->m_visibleLightNodes[i];
		node->drawDebug(m_debugShapes);
	}

	for(i = 0; i < m_partitioner->m_visibleLogicNodes.size(); i++)
	{
		node = m_partitioner->m_visibleLogicNodes[i];
		node->drawDebug(m_debugShapes);
	}

	m_pickShader->bind();

	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_fboId);

	glDrawBuffers(1, m_fboDrawBuffers);
	glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	for(i = 0; i < m_partitioner->m_visiblePropNodes.size(); i++)
	{
		node = m_partitioner->m_visiblePropNodes[i];
		CShaderResource::glslSendInt("id", node->getId());
		node->drawDebug(m_debugShapes);
	}

	for(i = 0; i < m_partitioner->m_visibleLightNodes.size(); i++)
	{
		node = m_partitioner->m_visibleLightNodes[i];
		CShaderResource::glslSendInt("id", node->getId());
		node->drawDebug(m_debugShapes);
	}

	for(i = 0; i < m_partitioner->m_visibleLogicNodes.size(); i++)
	{
		node = m_partitioner->m_visibleLogicNodes[i];
		CShaderResource::glslSendInt("id", node->getId());
		node->drawDebug(m_debugShapes);
	}

	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
}