#include "llviewerprecompiledheaders.h"
#include "llviewerdisplay.h"
#include "llgl.h"
#include "llglimmediate.h"
#include "llglheaders.h"
#include "llagent.h"
#include "llviewercontrol.h"
#include "llcoord.h"
#include "llcriticaldamp.h"
#include "lldir.h"
#include "lldynamictexture.h"
#include "lldrawpoolalpha.h"
#include "llfeaturemanager.h"
#include "llframestats.h"
#include "llhudmanager.h"
#include "llimagebmp.h"
#include "llimagegl.h"
#include "llselectmgr.h"
#include "llsky.h"
#include "llstartup.h"
#include "lltoolfocus.h"
#include "lltoolmgr.h"
#include "lltooldraganddrop.h"
#include "lltoolpie.h"
#include "lltracker.h"
#include "llui.h"
#include "llviewercamera.h"
#include "llviewerobjectlist.h"
#include "llviewerparcelmgr.h"
#include "llviewerwindow.h"
#include "llvoavatar.h"
#include "llvograss.h"
#include "llworld.h"
#include "pipeline.h"
#include "llspatialpartition.h"
#include "llappviewer.h"
#include "llfasttimer.h"
#include "llfloatertools.h"
#include "llviewerimagelist.h"
#include "llfocusmgr.h"
#include "llcubemap.h"
#include "llviewerregion.h"
#include "lldrawpoolwater.h"
#include "lldrawpoolbump.h"
#include "llwlparammanager.h"
#include "llwaterparammanager.h"
#include "llpostprocess.h"
Go to the source code of this file.
Functions | |
void | pre_show_depth_buffer () |
void | post_show_depth_buffer () |
void | render_ui_and_swap () |
void | render_ui_and_swap_if_needed () |
void | render_hud_attachments () |
void | render_ui_3d () |
void | render_ui_2d () |
void | render_disconnected_background () |
void | render_hud_elements () |
void | process_keystrokes_async () |
void | display_startup () |
void | display_update_camera () |
void | display (BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) |
BOOL | setup_hud_matrices (BOOL for_select) |
void | renderCoordinateAxes () |
void | draw_axes () |
void | display_cleanup () |
Variables | |
LLPointer< LLImageGL > | gStartImageGL |
BOOL | gDisplaySwapBuffers = FALSE |
LLPointer< LLImageGL > | gDisconnectedImagep = NULL |
const F32 | TELEPORT_RENDER_DELAY = 20.f |
const F32 | TELEPORT_ARRIVAL_DELAY = 2.f |
BOOL | gTeleportDisplay = FALSE |
LLFrameTimer | gTeleportDisplayTimer |
LLFrameTimer | gTeleportArrivalTimer |
const F32 | RESTORE_GL_TIME = 5.f |
BOOL | gForceRenderLandFence = FALSE |
BOOL | gResizeScreenTexture = FALSE |
BOOL | gSnapshot = FALSE |
Copyright (c) 2004-2008, Linden Research, Inc.
Second Life Viewer Source Code The source code in this file ("Source Code") is provided by Linden Lab to you under the terms of the GNU General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other License"), formally executed by you and Linden Lab. Terms of the GPL can be found in doc/GPL-license.txt in this distribution, or online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
There are special exceptions to the terms and conditions of the GPL as it is applied to this Source Code. View the full text of the exception in the file doc/FLOSS-exception.txt in this software distribution, or online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
By copying, modifying or distributing this software, you acknowledge that you have read and understood your obligations described above, and agree to abide by those obligations.
ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, COMPLETENESS OR PERFORMANCE. $/LicenseInfo$
Definition in file llviewerdisplay.cpp.
We copy the frame buffer straight into a texture here, and then display it again with compositor effects. Using render to texture would be faster/better, but I don't have a grasp of their full display stack just yet.
Definition at line 186 of file llviewerdisplay.cpp.
References LLRenderTarget::bindTarget(), LLViewerCamera::cameraUnderWater(), LLPipeline::canUseVertexShaders(), LLViewerWindow::checkSettings(), LLGLState::checkStates(), LLGLState::checkTextureChannels(), LLVertexBuffer::clientCopy(), LLPipeline::disableLights(), display_startup(), display_update_camera(), FALSE, LLRenderTarget::flush(), LLFastTimer::FTM_CLIENT_COPY, LLFastTimer::FTM_IMAGE_UPDATE, LLFastTimer::FTM_RENDER, LLFastTimer::FTM_UPDATE_SKY, LLFastTimer::FTM_UPDATE_TEXTURES, gAgent, gBumpImageList, gDisconnected, gDisplaySwapBuffers, LLPipeline::generateWaterReflection(), LLViewerWindow::getActive(), LLFocusMgr::getAppHasFocus(), LLVOAvatar::getAttachmentCount(), LLAgent::getAvatarObject(), LLControlGroup::getBOOL(), LLTimer::getElapsedTimeF32(), LLFrameTimer::getElapsedTimeF32(), LLSingleton< LLFeatureManager >::getInstance(), LLSingleton< LLHUDManager >::getInstance(), LLSingleton< LLViewerCamera >::getInstance(), LLWindow::getMinimized(), LLViewerWindow::getPlatformWindow(), LLControlGroup::getS32(), LLStartUp::getStartupState(), LLAgent::getTeleportMessage(), LLAgent::getTeleportState(), LLShaderMgr::getVertexShaderLevel(), LLWindow::getVisible(), gFocusMgr, gForegroundFrameCount, gFrameCount, gFrameIntervalSeconds, gFrameStats, gFrameTimeSeconds, gGLLastModelView, gGLManager, gGLModelView, gHandleKeysAsync, gImageList, glh_get_current_modelview(), glh_get_current_projection(), glh_set_current_modelview(), glh_set_current_projection(), gLogoutMaxTime, gLogoutTimer, gNoRender, gPipeline, gResizeScreenTexture, gRestoreGL, gRestoreGLTimer, gSavedSettings, gSky, gSnapshot, gTeleportDisplay, gUseWireframe, gViewerWindow, LLPipeline::hasRenderDebugFeatureMask(), LLPipeline::hasRenderType(), i, LLFrameStats::IMAGE_UPDATE, LLDrawable::incrementVisible(), LLAppViewer::instance(), LLApp::isExiting(), LLFeatureList::isFeatureAvailable(), llmin(), LLPipeline::mBackfaceCull, LLViewerImageList::mForceResetTextureStats, LLGLManager::mHasOcclusionQuery, MIN_NEAR_PLANE, LLFrameStats::MISC_END, LLPipeline::mScreen, LLViewerWindow::mWindow, NULL, LLViewerWindow::performPick(), pre_show_depth_buffer(), process_keystrokes_async(), LLPipeline::processImagery(), LLFrameStats::REBUILD, LLPipeline::rebuildPools(), LLPipeline::RENDER_DEBUG_FEATURE_DYNAMIC_TEXTURES, render_disconnected_background(), LLPipeline::RENDER_TYPE_HUD, LLPipeline::RENDER_TYPE_WATER, LLFrameStats::RENDER_UI, render_ui_and_swap_if_needed(), LLPipeline::renderGeom(), LLFrameTimer::reset(), LLPipeline::resizeScreenTexture(), RESTORE_GL_TIME, S32, send_agent_pause(), send_agent_resume(), LLCamera::setNear(), LLViewerWindow::setProgressCancelButtonVisible(), LLViewerWindow::setProgressPercent(), LLViewerWindow::setProgressString(), LLViewerWindow::setShowProgress(), LLAgent::setTeleportMessage(), LLAgent::setTeleportState(), LLViewerWindow::setupViewport(), LLViewerCamera::setZoomParameters(), LLPipeline::sFastAlpha, LLShaderMgr::SHADER_ENVIRONMENT, LLVOAvatar::sMaxVisible, LLPipeline::sRenderFrameTest, LLPipeline::sRenderGlow, LLVOAvatar::sRenderGroupTitles, LLVOAvatar::sRenderName, LLFrameStats::start(), LLFrameStats::STATE_SORT, STATE_STARTED, LLPipeline::stateSort(), LLAgent::sTeleportProgressMessages, stop_glerror, LLPipeline::sUnderWaterRender, LLPipeline::sUseFarClip, LLPipeline::sUseOcclusion, TELEPORT_ARRIVAL_DELAY, LLAgent::TELEPORT_ARRIVING, TELEPORT_EXPIRY, TELEPORT_EXPIRY_PER_ATTACHMENT, LLAgent::TELEPORT_MOVING, LLAgent::TELEPORT_NONE, LLAgent::TELEPORT_REQUESTED, LLAgent::TELEPORT_START, LLAgent::TELEPORT_START_ARRIVAL, LLPipeline::toggleRenderType(), TRUE, LLVertexBuffer::unbind(), LLFrameStats::UPDATE_CULL, LLFrameStats::UPDATE_GEOM, LLFrameStats::UPDATE_TEX_STATS, LLHUDObject::updateAll(), LLDynamicTexture::updateAllInstances(), LLViewerImage::updateClass(), LLPipeline::updateCull(), LLHUDManager::updateEffects(), LLVOAvatar::updateFreezeCounter(), LLPipeline::updateGeom(), LLViewerImageList::updateImages(), LLBumpImageList::updateImages(), LLVOAvatar::updateImpostors(), LLSky::updateSky(), LLImageGL::updateStats(), and LLGLNamePool::upkeepPools().
Referenced by LLAppViewer::mainLoop(), LLViewerWindow::rawSnapshot(), and LLViewerWindow::thumbnailSnapshot().
void display_cleanup | ( | ) |
Definition at line 1182 of file llviewerdisplay.cpp.
References NULL.
Referenced by LLAppViewer::cleanup().
void display_startup | ( | ) |
Definition at line 114 of file llviewerdisplay.cpp.
References LLGLState::checkStates(), LLGLState::checkTextureChannels(), LLGLImmediate::color4f(), LLPipeline::disableLights(), LLViewerWindow::draw(), LLGLImmediate::flush(), LLViewerWindow::getActive(), LLWindow::getMinimized(), LLWindow::getVisible(), gGL, gNoRender, gPipeline, gViewerWindow, LLViewerWindow::mWindow, S32, LLViewerWindow::setup2DRender(), LLWindow::swapBuffers(), LLVertexBuffer::unbind(), and LLDynamicTexture::updateAllInstances().
Referenced by display(), and idle_startup().
void display_update_camera | ( | ) |
Definition at line 161 of file llviewerdisplay.cpp.
References CAMERA_MODE_CUSTOMIZE_AVATAR, gAgent, LLAgent::getCameraMode(), LLSingleton< LLWorld >::getInstance(), LLSingleton< LLViewerCamera >::getInstance(), gViewerWindow, LLWaterParamManager::instance(), LLWLParamManager::instance(), LLAgent::mDrawDistance, LLCamera::setFar(), LLWorld::setLandFarClip(), LLViewerWindow::setup3DRender(), LLWaterParamManager::update(), and LLWLParamManager::update().
Referenced by display().
void draw_axes | ( | ) |
Definition at line 994 of file llviewerdisplay.cpp.
References LLGLImmediate::begin(), LLGLImmediate::color3f(), LLGLImmediate::end(), gAgent, LLAgent::getPositionAgent(), gGL, LLVertexBuffer::LINES, LLVector3::mV, renderCoordinateAxes(), LLGLImmediate::vertex3f(), VX, VY, and VZ.
Referenced by render_ui_3d().
void post_show_depth_buffer | ( | ) |
Definition at line 1122 of file llglsandbox.cpp.
Referenced by render_ui_3d().
void pre_show_depth_buffer | ( | ) |
Definition at line 1114 of file llglsandbox.cpp.
Referenced by display().
void process_keystrokes_async | ( | ) |
Definition at line 1187 of file llviewerdisplay.cpp.
References LLFocusMgr::focusLocked(), LLViewerWindow::getActive(), LLWindow::getMinimized(), LLViewerWindow::getShowProgress(), LLStartUp::getStartupState(), LLWindow::getVisible(), gFocusMgr, gKeyboard, gViewerWindow, LLViewerWindow::mWindow, NULL, LLKeyboard::scanKeyboard(), and STATE_STARTED.
Referenced by display().
void render_disconnected_background | ( | ) |
Definition at line 1104 of file llviewerdisplay.cpp.
References LLViewerImage::bindTexture(), LLGLImmediate::color4f(), FALSE, LLGLImmediate::flush(), gDirUtilp, gDisconnected, LLDir::getDirDelimiter(), LLViewerWindow::getDisplayScale(), LLDir::getLindenUserDir(), LLViewerWindow::getWindowHeight(), LLViewerWindow::getWindowWidth(), gGL, gl_rect_2d_simple_tex(), gViewerWindow, i, llendl, llinfos, LLVector2::mV, NULL, S32, SCREEN_LAST_FILENAME, LLViewerWindow::setup2DRender(), LLImageGL::unbindTexture(), VX, and VY.
Referenced by display().
void render_hud_attachments | ( | ) |
Definition at line 737 of file llviewerdisplay.cpp.
References FALSE, gDisconnected, LLSingleton< LLViewerCamera >::getInstance(), LLCoordFrame::getOrigin(), LLPipeline::getRenderTypeMask(), glh_get_current_modelview(), glh_get_current_projection(), glh_set_current_modelview(), glh_set_current_projection(), gPipeline, LLPipeline::hasRenderDebugFeatureMask(), LLPipeline::RENDER_DEBUG_FEATURE_UI, render_hud_elements(), LLPipeline::RENDER_TYPE_ALPHA, LLPipeline::RENDER_TYPE_BUMP, LLPipeline::RENDER_TYPE_HUD, LLPipeline::RENDER_TYPE_SIMPLE, LLPipeline::RENDER_TYPE_VOLUME, LLPipeline::renderGeom(), S32, LLPipeline::sDisableShaders, LLCoordFrame::setAxes(), LLCoordFrame::setOrigin(), LLPipeline::setRenderTypeMask(), setup_hud_matrices(), LLPipeline::sShowHUDAttachments, LLPipeline::stateSort(), LLPipeline::sUseOcclusion, LLPipeline::toggleRenderDebugFeature(), LLPipeline::toggleRenderType(), TRUE, LLPipeline::updateCull(), and LLViewerCamera::updateFrustumPlanes().
Referenced by render_ui_and_swap().
void render_hud_elements | ( | ) |
Definition at line 2123 of file pipeline.cpp.
References LLGLImmediate::color4f(), LLPipeline::disableLights(), FALSE, LLGLImmediate::flush(), LLFastTimer::FTM_RENDER_UI, LLSingleton< LLViewerParcelMgr >::getInstance(), LLSingleton< LLWorld >::getInstance(), gForceRenderLandFence, gGL, gViewerWindow, LLPipeline::hasRenderDebugFeatureMask(), LLPipeline::hasRenderType(), LLViewerParcelMgr::render(), LLTracker::render3D(), LLPipeline::RENDER_DEBUG_FEATURE_UI, LLPipeline::RENDER_TYPE_HUD, LLHUDText::renderAllHUD(), LLViewerParcelMgr::renderParcelCollision(), LLWorld::renderPropertyLines(), LLViewerWindow::renderSelections(), and LLPipeline::sReflectionRender.
Referenced by render_hud_attachments(), and render_ui_and_swap().
void render_ui_2d | ( | ) |
Definition at line 1048 of file llviewerdisplay.cpp.
References LLGLImmediate::color4fv(), LLViewerWindow::draw(), LLViewerWindow::drawPickBuffer(), FALSE, gAgent, gDebugSelect, LLAgent::getAvatarObject(), LLSingleton< LLViewerCamera >::getInstance(), LLViewerWindow::getWindowHeight(), LLViewerWindow::getWindowWidth(), LLViewerCamera::getZoomFactor(), LLViewerCamera::getZoomSubRegion(), gGL, gl_rect_2d(), gViewerWindow, llceil(), llround(), LLVOAvatar::mHUDCurZoom, LLCoord::mX, LLCoord::mY, S32, LLFontGL::sCurOrigin, LLCoordFont::set(), LLViewerWindow::setup2DRender(), LLUI::sGLScaleFactor, stop_glerror, and LLColor4::white.
Referenced by render_ui_and_swap().
void render_ui_3d | ( | ) |
Definition at line 1012 of file llviewerdisplay.cpp.
References draw_axes(), FALSE, LLControlGroup::getBOOL(), gSavedSettings, gViewerWindow, post_show_depth_buffer(), LLViewerWindow::renderSelections(), stop_glerror, and TRUE.
Referenced by render_ui_and_swap().
void render_ui_and_swap | ( | ) |
Definition at line 872 of file llviewerdisplay.cpp.
References LLPipeline::canUseVertexShaders(), LLGLState::checkStates(), LLGLImmediate::color4f(), LLPipeline::disableLights(), LLViewerWindow::drawDebugText(), LLGLImmediate::flush(), LLFastTimer::FTM_RENDER_UI, gDisconnected, gGL, gGLLastModelView, glh_copy_matrix(), glh_get_current_modelview(), glh_set_current_modelview(), gPipeline, gSnapshot, gViewerWindow, LLPipeline::hasRenderDebugFeatureMask(), LLPipeline::RENDER_DEBUG_FEATURE_UI, render_hud_attachments(), render_hud_elements(), render_ui_2d(), render_ui_3d(), LLPipeline::renderBloom(), LLViewerWindow::setup2DRender(), LLPipeline::sRenderGlow, LLVertexBuffer::unbind(), and LLViewerWindow::updateDebugText().
Referenced by LLViewerWindow::rawSnapshot(), render_ui_and_swap_if_needed(), and LLViewerWindow::thumbnailSnapshot().
void render_ui_and_swap_if_needed | ( | ) |
void renderCoordinateAxes | ( | ) |
Definition at line 944 of file llviewerdisplay.cpp.
References LLGLImmediate::begin(), LLGLImmediate::color3f(), LLGLImmediate::end(), gGL, LLVertexBuffer::LINES, and LLGLImmediate::vertex3f().
Referenced by draw_axes().
Definition at line 802 of file llviewerdisplay.cpp.
References FALSE, gAgent, LLAgent::getAvatarObject(), LLBBox::getCenterLocal(), LLBBox::getExtentLocal(), LLVOAvatar::getHUDBBox(), LLSingleton< LLViewerCamera >::getInstance(), LLCriticalDamp::getInterpolant(), LLViewerCamera::getZoomFactor(), LLViewerCamera::getZoomSubRegion(), gl_ortho(), glh_set_current_modelview(), glh_set_current_projection(), gViewerWindow, LLVOAvatar::hasHUDAttachment(), lerp(), llceil(), llclamp(), llmax(), LLVOAvatar::mHUDCurZoom, LLVOAvatar::mHUDTargetZoom, LLVector3::mV, OGL_TO_CFR_ROTATION, LLViewerWindow::setupViewport(), TRUE, and VX.
Referenced by render_hud_attachments(), and LLPipeline::renderForSelect().
LLPointer<LLImageGL> gDisconnectedImagep = NULL |
Definition at line 87 of file llviewerdisplay.cpp.
BOOL gDisplaySwapBuffers = FALSE |
Definition at line 98 of file llviewerdisplay.cpp.
Referenced by display(), LLViewerWindow::hitObjectOrLandGlobalAsync(), idle_startup(), LLViewerWindow::rawSnapshot(), render_ui_and_swap_if_needed(), LLPipeline::shiftObjects(), LLViewerWindow::thumbnailSnapshot(), and LLDynamicTexture::updateAllInstances().
BOOL gForceRenderLandFence = FALSE |
Definition at line 97 of file llviewerdisplay.cpp.
Referenced by LLFloaterAuction::onClickSnapshot(), and render_hud_elements().
BOOL gResizeScreenTexture = FALSE |
Definition at line 99 of file llviewerdisplay.cpp.
Referenced by LLViewerWindow::changeDisplaySettings(), display(), handleRenderResolutionDivisorChanged(), LLViewerWindow::reshape(), LLViewerWindow::restoreGL(), and LLViewerWindow::thumbnailSnapshot().
Definition at line 100 of file llviewerdisplay.cpp.
Referenced by display(), and render_ui_and_swap().
Definition at line 94 of file llviewerdisplay.cpp.
BOOL gTeleportDisplay = FALSE |
Definition at line 92 of file llviewerdisplay.cpp.
Referenced by display(), LLNotifyBox::draw(), process_teleport_start(), LLAgent::teleportCancel(), and LLAgent::teleportCore().
Definition at line 93 of file llviewerdisplay.cpp.
const F32 RESTORE_GL_TIME = 5.f |
const F32 TELEPORT_ARRIVAL_DELAY = 2.f |
const F32 TELEPORT_RENDER_DELAY = 20.f |
Definition at line 90 of file llviewerdisplay.cpp.