Exemple #1
0
void GraphicsGL2::DrawScene(std::ostream & error_output)
{
	renderscene.SetFSAA(fsaa);
	renderscene.SetContrast(contrast);
	renderscene.SetSunDirection(light_direction);

	postprocess.SetContrast(contrast);
	postprocess.SetSunDirection(light_direction);

	// sort the two dimentional drawlist so we get correct ordering
	std::sort(dynamic_drawlist.twodim.begin(), dynamic_drawlist.twodim.end(), &SortDraworder);

	// do fast culling queries for static geometry per pass
	std::map <std::string, PtrVector <Drawable> > culled_static_drawlist;
	for (std::vector <GraphicsConfigPass>::const_iterator i = config.passes.begin(); i != config.passes.end(); i++)
	{
		CullScenePass(*i, culled_static_drawlist, error_output);
	}

	// draw the passes
	for (std::vector <GraphicsConfigPass>::const_iterator i = config.passes.begin(); i != config.passes.end(); i++)
	{
		assert(!i->draw.empty());
		if (i->draw.back() != "postprocess")
			DrawScenePass(*i, culled_static_drawlist, error_output);
		else
			DrawScenePassPost(*i, error_output);
	}

	// reset texture and draw buffer
	glstate.BindTexture(0, GL_TEXTURE_2D, 0);
	glstate.BindFramebuffer(GL_FRAMEBUFFER, 0);
}
void GraphicsGL2::DrawScene(std::ostream & error_output)
{

	// vertex object might have been modified ouside, reset it
	glstate.ResetVertexObject();

	// draw the passes
	for (std::vector <GraphicsConfigPass>::const_iterator i = config.passes.begin(); i != config.passes.end(); i++)
	{
		assert(!i->draw.empty());
		if (i->draw.back() != "postprocess")
			DrawScenePass(*i, error_output);
		else
			DrawScenePassPost(*i, error_output);
	}

	// reset texture and draw buffer
	glstate.BindTexture(0, GL_TEXTURE_2D, 0);
	glstate.BindFramebuffer(GL_FRAMEBUFFER, 0);
}