summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerdisplay.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2007-11-07 22:55:27 +0000
committerSteven Bennetts <steve@lindenlab.com>2007-11-07 22:55:27 +0000
commit050dad0ce35207a4ac1562175e853590ad9b7681 (patch)
treebe5dc291d2313112e5733d8c004edfe67da6fc54 /indra/newview/llviewerdisplay.cpp
parent6fd04521d720a3a4904069d10e8ed970d870ba7f (diff)
merge svn+ssh://steve@svn/svn/linden/branches/viewer-cleanup-3 -r 73026:73079
Diffstat (limited to 'indra/newview/llviewerdisplay.cpp')
-rw-r--r--indra/newview/llviewerdisplay.cpp199
1 files changed, 121 insertions, 78 deletions
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 24b8105916..60184312a7 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -62,7 +62,7 @@
#include "llvograss.h"
#include "llworld.h"
#include "pipeline.h"
-#include "viewer.h"
+#include "llappviewer.h"
#include "llstartup.h"
#include "llfasttimer.h"
#include "llfloatertools.h"
@@ -72,14 +72,11 @@
#include "llviewerregion.h"
#include "lldrawpoolwater.h"
-extern U32 gFrameCount;
extern LLPointer<LLImageGL> gStartImageGL;
-extern LLPointer<LLImageGL> gDisconnectedImagep;
-extern BOOL gLogoutRequestSent;
-extern LLTimer gLogoutTimer;
-extern BOOL gHaveSavedSnapshot;
extern BOOL gDisplaySwapBuffers;
+LLPointer<LLImageGL> gDisconnectedImagep = NULL;
+
// used to toggle renderer back on after teleport
const F32 TELEPORT_RENDER_DELAY = 20.f; // Max time a teleport is allowed to take before we raise the curtain
const F32 TELEPORT_ARRIVAL_DELAY = 2.f; // Time to preload the world before raising the curtain after we've actually already arrived.
@@ -99,7 +96,7 @@ void render_ui_3d();
void render_ui_2d();
void render_disconnected_background();
-void process_keystrokes_async(); // in viewer.cpp
+void process_keystrokes_async();
void display_startup()
{
@@ -331,7 +328,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield)
break;
}
}
- else if(gLogoutRequestSent)
+ else if(LLAppViewer::instance()->logoutRequestSent())
{
F32 percent_done = gLogoutTimer.getElapsedTimeF32() * 100.f / gLogoutMaxTime;
if (percent_done > 100.f)
@@ -339,7 +336,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield)
percent_done = 100.f;
}
- if( gQuit )
+ if( LLApp::isExiting() )
{
percent_done = 100.f;
}
@@ -358,7 +355,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield)
else
{
- if( gQuit )
+ if( LLApp::isExiting() )
{
percent_done = 100.f;
}
@@ -554,7 +551,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield)
// glPopMatrix();
//}
- if (!(gLogoutRequestSent && gHaveSavedSnapshot)
+ if (!(LLAppViewer::instance()->logoutRequestSent() && LLAppViewer::instance()->hasSavedFinalSnapshot())
&& !gRestoreGL
&& !gDisconnected)
{
@@ -745,6 +742,74 @@ void render_ui_and_swap()
}
}
+void renderCoordinateAxes()
+{
+ LLGLSNoTexture gls_no_texture;
+ glBegin(GL_LINES);
+ glColor3f(1.0f, 0.0f, 0.0f); // i direction = X-Axis = red
+ glVertex3f(0.0f, 0.0f, 0.0f);
+ glVertex3f(2.0f, 0.0f, 0.0f);
+ glVertex3f(3.0f, 0.0f, 0.0f);
+ glVertex3f(5.0f, 0.0f, 0.0f);
+ glVertex3f(6.0f, 0.0f, 0.0f);
+ glVertex3f(8.0f, 0.0f, 0.0f);
+ // Make an X
+ glVertex3f(11.0f, 1.0f, 1.0f);
+ glVertex3f(11.0f, -1.0f, -1.0f);
+ glVertex3f(11.0f, 1.0f, -1.0f);
+ glVertex3f(11.0f, -1.0f, 1.0f);
+
+ glColor3f(0.0f, 1.0f, 0.0f); // j direction = Y-Axis = green
+ glVertex3f(0.0f, 0.0f, 0.0f);
+ glVertex3f(0.0f, 2.0f, 0.0f);
+ glVertex3f(0.0f, 3.0f, 0.0f);
+ glVertex3f(0.0f, 5.0f, 0.0f);
+ glVertex3f(0.0f, 6.0f, 0.0f);
+ glVertex3f(0.0f, 8.0f, 0.0f);
+ // Make a Y
+ glVertex3f(1.0f, 11.0f, 1.0f);
+ glVertex3f(0.0f, 11.0f, 0.0f);
+ glVertex3f(-1.0f, 11.0f, 1.0f);
+ glVertex3f(0.0f, 11.0f, 0.0f);
+ glVertex3f(0.0f, 11.0f, 0.0f);
+ glVertex3f(0.0f, 11.0f, -1.0f);
+
+ glColor3f(0.0f, 0.0f, 1.0f); // Z-Axis = blue
+ glVertex3f(0.0f, 0.0f, 0.0f);
+ glVertex3f(0.0f, 0.0f, 2.0f);
+ glVertex3f(0.0f, 0.0f, 3.0f);
+ glVertex3f(0.0f, 0.0f, 5.0f);
+ glVertex3f(0.0f, 0.0f, 6.0f);
+ glVertex3f(0.0f, 0.0f, 8.0f);
+ // Make a Z
+ glVertex3f(-1.0f, 1.0f, 11.0f);
+ glVertex3f(1.0f, 1.0f, 11.0f);
+ glVertex3f(1.0f, 1.0f, 11.0f);
+ glVertex3f(-1.0f, -1.0f, 11.0f);
+ glVertex3f(-1.0f, -1.0f, 11.0f);
+ glVertex3f(1.0f, -1.0f, 11.0f);
+ glEnd();
+}
+
+
+void draw_axes()
+{
+ LLGLSUIDefault gls_ui;
+ LLGLSNoTexture gls_no_texture;
+ // A vertical white line at origin
+ LLVector3 v = gAgent.getPositionAgent();
+ glBegin(GL_LINES);
+ glColor3f(1.0f, 1.0f, 1.0f);
+ glVertex3f(0.0f, 0.0f, 0.0f);
+ glVertex3f(0.0f, 0.0f, 40.0f);
+ glEnd();
+ // Some coordinate axes
+ glPushMatrix();
+ glTranslatef( v.mV[VX], v.mV[VY], v.mV[VZ] );
+ renderCoordinateAxes();
+ glPopMatrix();
+}
+
void render_ui_3d()
{
LLGLSPipeline gls_pipeline;
@@ -841,73 +906,6 @@ void render_ui_2d()
LLFontGL::sCurOrigin.set(0, 0);
}
-void renderCoordinateAxes()
-{
- LLGLSNoTexture gls_no_texture;
- glBegin(GL_LINES);
- glColor3f(1.0f, 0.0f, 0.0f); // i direction = X-Axis = red
- glVertex3f(0.0f, 0.0f, 0.0f);
- glVertex3f(2.0f, 0.0f, 0.0f);
- glVertex3f(3.0f, 0.0f, 0.0f);
- glVertex3f(5.0f, 0.0f, 0.0f);
- glVertex3f(6.0f, 0.0f, 0.0f);
- glVertex3f(8.0f, 0.0f, 0.0f);
- // Make an X
- glVertex3f(11.0f, 1.0f, 1.0f);
- glVertex3f(11.0f, -1.0f, -1.0f);
- glVertex3f(11.0f, 1.0f, -1.0f);
- glVertex3f(11.0f, -1.0f, 1.0f);
-
- glColor3f(0.0f, 1.0f, 0.0f); // j direction = Y-Axis = green
- glVertex3f(0.0f, 0.0f, 0.0f);
- glVertex3f(0.0f, 2.0f, 0.0f);
- glVertex3f(0.0f, 3.0f, 0.0f);
- glVertex3f(0.0f, 5.0f, 0.0f);
- glVertex3f(0.0f, 6.0f, 0.0f);
- glVertex3f(0.0f, 8.0f, 0.0f);
- // Make a Y
- glVertex3f(1.0f, 11.0f, 1.0f);
- glVertex3f(0.0f, 11.0f, 0.0f);
- glVertex3f(-1.0f, 11.0f, 1.0f);
- glVertex3f(0.0f, 11.0f, 0.0f);
- glVertex3f(0.0f, 11.0f, 0.0f);
- glVertex3f(0.0f, 11.0f, -1.0f);
-
- glColor3f(0.0f, 0.0f, 1.0f); // Z-Axis = blue
- glVertex3f(0.0f, 0.0f, 0.0f);
- glVertex3f(0.0f, 0.0f, 2.0f);
- glVertex3f(0.0f, 0.0f, 3.0f);
- glVertex3f(0.0f, 0.0f, 5.0f);
- glVertex3f(0.0f, 0.0f, 6.0f);
- glVertex3f(0.0f, 0.0f, 8.0f);
- // Make a Z
- glVertex3f(-1.0f, 1.0f, 11.0f);
- glVertex3f(1.0f, 1.0f, 11.0f);
- glVertex3f(1.0f, 1.0f, 11.0f);
- glVertex3f(-1.0f, -1.0f, 11.0f);
- glVertex3f(-1.0f, -1.0f, 11.0f);
- glVertex3f(1.0f, -1.0f, 11.0f);
- glEnd();
-}
-
-void draw_axes()
-{
- LLGLSUIDefault gls_ui;
- LLGLSNoTexture gls_no_texture;
- // A vertical white line at origin
- LLVector3 v = gAgent.getPositionAgent();
- glBegin(GL_LINES);
- glColor3f(1.0f, 1.0f, 1.0f);
- glVertex3f(0.0f, 0.0f, 0.0f);
- glVertex3f(0.0f, 0.0f, 40.0f);
- glEnd();
- // Some coordinate axes
- glPushMatrix();
- glTranslatef( v.mV[VX], v.mV[VY], v.mV[VZ] );
- renderCoordinateAxes();
- glPopMatrix();
-}
-
void render_disconnected_background()
{
@@ -984,3 +982,48 @@ void render_disconnected_background()
glPopMatrix();
}
}
+
+void display_cleanup()
+{
+ gDisconnectedImagep = NULL;
+}
+
+void process_keystrokes_async()
+{
+#if LL_WINDOWS
+ MSG msg;
+ // look through all input messages, leaving them in the event queue
+ while( PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE | PM_NOYIELD))
+ {
+ // on first mouse message, break out
+ if (msg.message >= WM_MOUSEFIRST &&
+ msg.message <= WM_MOUSELAST ||
+ msg.message == WM_QUIT)
+ {
+ break;
+ }
+
+ // this is a message we want to handle now, so remove it from the event queue
+ PeekMessage(&msg, NULL, msg.message, msg.message, PM_REMOVE | PM_NOYIELD);
+ // if (msg.message == WM_KEYDOWN)
+ // {
+ // llinfos << "Process async key down " << (U32)msg.wParam << llendl;
+ // }
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+
+ // Scan keyboard for movement keys. Command keys and typing
+ // are handled by windows callbacks. Don't do this until we're
+ // done initializing. JC
+ if (gViewerWindow->mWindow->getVisible()
+ && gViewerWindow->getActive()
+ && !gViewerWindow->mWindow->getMinimized()
+ && LLStartUp::getStartupState() == STATE_STARTED
+ && !gViewerWindow->getShowProgress()
+ && !gFocusMgr.focusLocked())
+ {
+ gKeyboard->scanKeyboard();
+ }
+#endif
+}