예제 #1
0
void render_ui_and_swap()
{
#ifndef LL_RELEASE_FOR_DOWNLOAD
	LLGLState::checkStates();
#endif

	LLGLSDefault gls_default;
	{
		LLGLSUIDefault gls_ui;
		gPipeline.disableLights();
		LLVertexBuffer::startRender();
		if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
		{
			LLFastTimer t(LLFastTimer::FTM_RENDER_UI);
			if (!gDisconnected)
			{
				render_ui_3d();
#ifndef LL_RELEASE_FOR_DOWNLOAD
				LLGLState::checkStates();
#endif
			}

			render_ui_2d();
#ifndef LL_RELEASE_FOR_DOWNLOAD
			LLGLState::checkStates();
#endif
		}
		LLVertexBuffer::stopRender();
		glFlush();

		// now do the swap buffer
		if (gDisplaySwapBuffers)
		{
			LLFastTimer t(LLFastTimer::FTM_SWAP);
			gViewerWindow->mWindow->swapBuffers();
		}

		{
 			LLFastTimer ftm(LLFastTimer::FTM_CLIENT_COPY);
			LLVertexBuffer::clientCopy(0.016);
		}

	}
}
void render_ui(F32 zoom_factor, int subfield, bool tiling)
{
	LLGLState::checkStates();
	
	const LLMatrix4a saved_view = glh_get_current_modelview();

	if (!gSnapshot)
	{
		gGL.pushMatrix();
		gGL.loadMatrix(gGLLastModelView);
		glh_set_current_modelview(gGLLastModelView);
	}
	
	{
		BOOL to_texture = gPipeline.canUseVertexShaders() &&
							LLPipeline::sRenderGlow;

		if (to_texture)
		{
			gPipeline.renderBloom(gSnapshot, zoom_factor, subfield, tiling);
		}

		if(gPipeline.canUseVertexShaders())
		{
			LLPostProcess::getInstance()->renderEffects(gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight());
		}
		
		render_hud_elements();
		render_hud_attachments();
	}

	LLGLSDefault gls_default;
	LLGLSUIDefault gls_ui;
	{
		gPipeline.disableLights();
	}

	{
		gGL.color4f(1,1,1,1);
		if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
		{
			LLFastTimer t(FTM_RENDER_UI);

			if (!gDisconnected)
			{
				render_ui_3d();
				LLGLState::checkStates();
			}
			else
			{
				render_disconnected_background();
			}

			render_ui_2d();
			LLGLState::checkStates();
		}
		gGL.flush();

		{
			gViewerWindow->setup2DRender();
			gViewerWindow->updateDebugText();
			gViewerWindow->drawDebugText();
		}

		LLVertexBuffer::unbind();
	}

	if (!gSnapshot)
	{
		glh_set_current_modelview(saved_view);
		gGL.popMatrix();
	}

	if (gDisplaySwapBuffers)
	{
		LLFastTimer t(FTM_SWAP);
		gViewerWindow->getWindow()->swapBuffers();
	}
	gDisplaySwapBuffers = TRUE;
}
예제 #3
0
void render_ui(F32 zoom_factor, int subfield)
{
	LLGLState::checkStates();
	
	glPushMatrix();
	glLoadMatrixd(gGLLastModelView);
	glh::matrix4f saved_view = glh_get_current_modelview();
	glh_set_current_modelview(glh_copy_matrix(gGLLastModelView));
	
	{
		BOOL to_texture = gPipeline.canUseVertexShaders() &&
							LLPipeline::sRenderGlow;

		if (to_texture)
		{
			gPipeline.renderBloom(gSnapshot, zoom_factor, subfield);
		}

		render_hud_elements();
		render_hud_attachments();
	}

	LLGLSDefault gls_default;
	LLGLSUIDefault gls_ui;
	{
		gPipeline.disableLights();
	}

	{
		
		gGL.color4f(1,1,1,1);
		if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
		{
			LLFastTimer t(LLFastTimer::FTM_RENDER_UI);

			if (!gDisconnected)
			{
				render_ui_3d();
				LLGLState::checkStates();
			}

			render_ui_2d();
			LLGLState::checkStates();
		}
		gGL.flush();

		{
			gViewerWindow->setup2DRender();
			gViewerWindow->updateDebugText();
			gViewerWindow->drawDebugText();
		}

		LLVertexBuffer::unbind();
	}

	glh_set_current_modelview(saved_view);
	glPopMatrix();

	if (gDisplaySwapBuffers)
	{
		LLFastTimer t(LLFastTimer::FTM_SWAP);
		gViewerWindow->mWindow->swapBuffers();
	}
	gDisplaySwapBuffers = TRUE;
}