summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
authorBrad Kittenbrink <brad@lindenlab.com>2008-02-27 18:58:14 +0000
committerBrad Kittenbrink <brad@lindenlab.com>2008-02-27 18:58:14 +0000
commit6d52efe452aa8469e0343da1c7d108f3f52ab651 (patch)
treea87be48e9840d7fc1f7ee514d7c7f994e71fdb3c /indra/llwindow
parent6027ad2630b8650cabcf00628ee9b0d25bedd67f (diff)
Merge of windlight into release (QAR-286). This includes all changes in
windlight14 which have passed QA (up through r79932). svn merge -r 80831:80833 svn+ssh://svn.lindenlab.com/svn/linden/branches/merge_windlight14_r80620
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/lldxhardware.cpp2
-rw-r--r--indra/llwindow/llwindow.cpp4
-rw-r--r--indra/llwindow/llwindow.h2
-rw-r--r--indra/llwindow/llwindowmacosx.cpp29
-rw-r--r--indra/llwindow/llwindowsdl.cpp13
-rw-r--r--indra/llwindow/llwindowwin32.cpp14
-rw-r--r--indra/llwindow/llwindowwin32.h1
7 files changed, 47 insertions, 18 deletions
diff --git a/indra/llwindow/lldxhardware.cpp b/indra/llwindow/lldxhardware.cpp
index 2aff05232e..ab43e6d7d9 100644
--- a/indra/llwindow/lldxhardware.cpp
+++ b/indra/llwindow/lldxhardware.cpp
@@ -35,7 +35,9 @@
#include "linden_common.h"
+#define INITGUID
#include <dxdiag.h>
+#undef INITGUID
#include <boost/tokenizer.hpp>
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index e845afe320..fce0d055e6 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -247,7 +247,7 @@ LLWindow::LLWindow(BOOL fullscreen, U32 flags)
mFlags(flags),
mHighSurrogate(0)
{
- for (U32 i = 0; i < 6; i++)
+ for (U32 i = 0; i < 8; i++)
{
mJoyAxis[i] = 0;
}
@@ -275,7 +275,7 @@ void LLWindow::decBusyCount()
F32 LLWindow::getJoystickAxis(U32 axis)
{
- if (axis < 6)
+ if (axis < 8)
{
return mJoyAxis[axis];
}
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index 0554d3a8db..bc444ae811 100644
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -258,7 +258,7 @@ protected:
ESwapMethod mSwapMethod;
BOOL mHideCursorPermanent;
U32 mFlags;
- F32 mJoyAxis[6];
+ F32 mJoyAxis[8];
U8 mJoyButtonState[16];
U16 mHighSurrogate;
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index fe127b407e..5184a6caec 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -42,6 +42,7 @@
#include "llgl.h"
#include "llstring.h"
#include "lldir.h"
+#include "llviewercontrol.h"
#include "llglheaders.h"
@@ -800,22 +801,24 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
}
aglSetInteger(mContext, AGL_SWAP_INTERVAL, &frames_per_swap);
-#if 0 // SJB: Got a compile error. Plus I don't want to test this along with everything else ; save it for later
//enable multi-threaded OpenGL
- CGLError cgl_err;
- CGLContextObj ctx = CGLGetCurrentContext();
-
- cgl_err = CGLEnable( ctx, kCGLCEMPEngine);
-
- if (cgl_err != kCGLNoError )
- {
- llinfos << "Multi-threaded OpenGL not available." << llendl;
- }
- else
+ if (gSavedSettings.getBOOL("RenderAppleUseMultGL"))
{
- llinfos << "Multi-threaded OpenGL enabled." << llendl;
+ CGLError cgl_err;
+ CGLContextObj ctx = CGLGetCurrentContext();
+
+ cgl_err = CGLEnable( ctx, kCGLCEMPEngine);
+
+ if (cgl_err != kCGLNoError )
+ {
+ llinfos << "Multi-threaded OpenGL not available." << llendl;
+ }
+ else
+ {
+ llinfos << "Multi-threaded OpenGL enabled." << llendl;
+ }
}
-#endif
+
// Don't need to get the current gamma, since there's a call that restores it to the system defaults.
return TRUE;
}
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index e7475d577d..686be3385e 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -505,6 +505,9 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
#if !LL_SOLARIS
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, (bits <= 16) ? 16 : 24);
+ // We need stencil support for a few (minor) things.
+ if (!getenv("LL_GL_NO_STENCIL"))
+ SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
#else
// NOTE- use smaller Z-buffer to enable more graphics cards
// - This should not affect better GPUs and has been proven
@@ -587,6 +590,11 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
}
mWindow = SDL_SetVideoMode(width, height, bits, sdlflags | SDL_FULLSCREEN);
+ if (!mWindow && bits > 16)
+ {
+ SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
+ mWindow = SDL_SetVideoMode(width, height, bits, sdlflags | SDL_FULLSCREEN);
+ }
if (mWindow)
{
@@ -629,6 +637,11 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
llinfos << "createContext: creating window " << width << "x" << height << "x" << bits << llendl;
mWindow = SDL_SetVideoMode(width, height, bits, sdlflags);
+ if (!mWindow && bits > 16)
+ {
+ SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
+ mWindow = SDL_SetVideoMode(width, height, bits, sdlflags);
+ }
if (!mWindow)
{
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 3c270d9175..0bba56f74f 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -44,6 +44,7 @@
// Require DirectInput version 8
#define DIRECTINPUT_VERSION 0x0800
+
#include <dinput.h>
@@ -428,7 +429,7 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width,
mhInstance = GetModuleHandle(NULL);
mWndProc = NULL;
- mSwapMethod = SWAP_METHOD_UNDEFINED;
+ mSwapMethod = SWAP_METHOD_EXCHANGE;
// No WPARAM yet.
mLastSizeWParam = 0;
@@ -774,7 +775,7 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width,
attrib_list[cur_attrib++] = GL_TRUE;
attrib_list[cur_attrib++] = WGL_COLOR_BITS_ARB;
- attrib_list[cur_attrib++] = 24;
+ attrib_list[cur_attrib++] = 32;
attrib_list[cur_attrib++] = WGL_RED_BITS_ARB;
attrib_list[cur_attrib++] = 8;
@@ -1018,6 +1019,11 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width,
// based on the system's (or user's) default settings.
allowLanguageTextInput(NULL, FALSE);
+ initInputDevices();
+}
+
+void LLWindowWin32::initInputDevices()
+{
// Direct Input
HRESULT hr;
@@ -1753,6 +1759,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disa
SetWindowLong(mWindowHandle, GWL_USERDATA, (U32)this);
show();
+ initInputDevices();
+
// ok to post quit messages now
mPostQuit = TRUE;
return TRUE;
@@ -3199,6 +3207,8 @@ void LLWindowWin32::updateJoystick( )
mJoyAxis[3] = js.lRx/1000.f;
mJoyAxis[4] = js.lRy/1000.f;
mJoyAxis[5] = js.lRz/1000.f;
+ mJoyAxis[6] = js.rglSlider[0]/1000.f;
+ mJoyAxis[7] = js.rglSlider[1]/1000.f;
for (U32 i = 0; i < 16; i++)
{
diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h
index 9ad99b0201..b21df8981e 100644
--- a/indra/llwindow/llwindowwin32.h
+++ b/indra/llwindow/llwindowwin32.h
@@ -122,6 +122,7 @@ protected:
~LLWindowWin32();
void initCursors();
+ void initInputDevices();
HCURSOR loadColorCursor(LPCTSTR name);
BOOL isValid();
void moveWindow(const LLCoordScreen& position,const LLCoordScreen& size);