summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/lldxhardware.cpp37
-rw-r--r--indra/llwindow/lldxhardware.h7
-rw-r--r--indra/llwindow/llwindow.h2
-rw-r--r--indra/llwindow/llwindowheadless.h2
-rw-r--r--indra/llwindow/llwindowmacosx.cpp2
-rw-r--r--indra/llwindow/llwindowmacosx.h2
-rw-r--r--indra/llwindow/llwindowmesaheadless.h2
-rw-r--r--indra/llwindow/llwindowsdl.cpp2
-rw-r--r--indra/llwindow/llwindowsdl.h2
-rw-r--r--indra/llwindow/llwindowwin32.cpp17
-rw-r--r--indra/llwindow/llwindowwin32.h2
11 files changed, 45 insertions, 32 deletions
diff --git a/indra/llwindow/lldxhardware.cpp b/indra/llwindow/lldxhardware.cpp
index ab43e6d7d9..be8416cc23 100644
--- a/indra/llwindow/lldxhardware.cpp
+++ b/indra/llwindow/lldxhardware.cpp
@@ -233,9 +233,10 @@ LLDXHardware::LLDXHardware()
void LLDXHardware::cleanup()
{
- for_each(mDevices.begin(), mDevices.end(), DeletePairedPointer());
+ // for_each(mDevices.begin(), mDevices.end(), DeletePairedPointer());
}
+/*
LLString LLDXHardware::dumpDevices()
{
if (gWriteDebug)
@@ -284,6 +285,7 @@ LLDXDevice *LLDXHardware::findDevice(const std::string &vendor, const std::strin
return NULL;
}
+*/
BOOL LLDXHardware::getInfo(BOOL vram_only)
{
@@ -296,7 +298,7 @@ BOOL LLDXHardware::getInfo(BOOL vram_only)
IDxDiagProvider *dx_diag_providerp = NULL;
IDxDiagContainer *dx_diag_rootp = NULL;
IDxDiagContainer *devices_containerp = NULL;
- IDxDiagContainer *system_device_containerp= NULL;
+ // IDxDiagContainer *system_device_containerp= NULL;
IDxDiagContainer *device_containerp = NULL;
IDxDiagContainer *file_containerp = NULL;
IDxDiagContainer *driver_containerp = NULL;
@@ -362,15 +364,18 @@ BOOL LLDXHardware::getInfo(BOOL vram_only)
}
// Get the English VRAM string
- std::string ram_str = get_string(device_containerp, L"szDisplayMemoryEnglish");
+ {
+ std::string ram_str = get_string(device_containerp, L"szDisplayMemoryEnglish");
- // We don't need the device any more
- SAFE_RELEASE(device_containerp);
+ // We don't need the device any more
+ SAFE_RELEASE(device_containerp);
+
+ // Dump the string as an int into the structure
+ char *stopstring;
+ mVRAM = strtol(ram_str.c_str(), &stopstring, 10);
+ llinfos << "VRAM Detected: " << mVRAM << " DX9 string: " << ram_str << llendl;
+ }
- // Dump the string as an int into the structure
- char *stopstring;
- mVRAM = strtol(ram_str.c_str(), &stopstring, 10);
- llinfos << "VRAM Detected: " << mVRAM << " DX9 string: " << ram_str << llendl;
if (vram_only)
{
@@ -378,6 +383,11 @@ BOOL LLDXHardware::getInfo(BOOL vram_only)
goto LCleanup;
}
+
+ /* for now, we ONLY do vram_only the rest of this
+ is commented out, to ensure no-one is tempted
+ to use it
+
// Now let's get device and driver information
// Get the IDxDiagContainer object called "DxDiag_SystemDevices".
// This call may take some time while dxdiag gathers the info.
@@ -504,11 +514,12 @@ BOOL LLDXHardware::getInfo(BOOL vram_only)
}
SAFE_RELEASE(device_containerp);
}
+ */
}
- dumpDevices();
- ok = TRUE;
-
+ // dumpDevices();
+ ok = TRUE;
+
LCleanup:
if (!ok)
{
@@ -526,7 +537,7 @@ LCleanup:
CoUninitialize();
return ok;
-}
+ }
LLSD LLDXHardware::getDisplayInfo()
{
diff --git a/indra/llwindow/lldxhardware.h b/indra/llwindow/lldxhardware.h
index e2a255da76..e174b322b0 100644
--- a/indra/llwindow/lldxhardware.h
+++ b/indra/llwindow/lldxhardware.h
@@ -85,6 +85,7 @@ class LLDXHardware
{
public:
LLDXHardware();
+
void setWriteDebugFunc(void (*func)(const char*));
void cleanup();
@@ -100,12 +101,12 @@ public:
// Empty strings indicate that you don't care.
// You can separate multiple devices with '|' chars to indicate you want
// ANY of them to match and return.
- LLDXDevice *findDevice(const std::string &vendor, const std::string &devices);
+ // LLDXDevice *findDevice(const std::string &vendor, const std::string &devices);
- LLString dumpDevices();
+ // LLString dumpDevices();
public:
typedef std::map<std::string, LLDXDevice *> device_map_t;
- device_map_t mDevices;
+ // device_map_t mDevices;
protected:
S32 mVRAM;
};
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index b2e9c5b51d..6b9414a301 100644
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -154,7 +154,7 @@ public:
virtual BOOL getSize(LLCoordWindow *size) = 0;
virtual BOOL setPosition(LLCoordScreen position) = 0;
virtual BOOL setSize(LLCoordScreen size) = 0;
- virtual BOOL switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync) = 0;
+ virtual BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) = 0;
virtual BOOL setCursorPosition(LLCoordWindow position) = 0;
virtual BOOL getCursorPosition(LLCoordWindow *position) = 0;
virtual void showCursor() = 0;
diff --git a/indra/llwindow/llwindowheadless.h b/indra/llwindow/llwindowheadless.h
index b7e6644674..a138814241 100644
--- a/indra/llwindow/llwindowheadless.h
+++ b/indra/llwindow/llwindowheadless.h
@@ -50,7 +50,7 @@ public:
/*virtual*/ BOOL getSize(LLCoordWindow *size) {return FALSE;};
/*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;};
/*virtual*/ BOOL setSize(LLCoordScreen size) {return FALSE;};
- /*virtual*/ BOOL switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync) {return FALSE;};
+ /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) {return FALSE;};
/*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;};
/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;};
/*virtual*/ void showCursor() {};
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index ad8a284930..9daedef1f1 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -835,7 +835,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
// changing fullscreen resolution, or switching between windowed and fullscreen mode.
-BOOL LLWindowMacOSX::switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync)
+BOOL LLWindowMacOSX::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp)
{
BOOL needsRebuild = FALSE;
BOOL result = true;
diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h
index 86b88daa3c..58bcd91381 100644
--- a/indra/llwindow/llwindowmacosx.h
+++ b/indra/llwindow/llwindowmacosx.h
@@ -59,7 +59,7 @@ public:
/*virtual*/ BOOL getSize(LLCoordWindow *size);
/*virtual*/ BOOL setPosition(LLCoordScreen position);
/*virtual*/ BOOL setSize(LLCoordScreen size);
- /*virtual*/ BOOL switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync);
+ /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL);
/*virtual*/ BOOL setCursorPosition(LLCoordWindow position);
/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position);
/*virtual*/ void showCursor();
diff --git a/indra/llwindow/llwindowmesaheadless.h b/indra/llwindow/llwindowmesaheadless.h
index 8de92bbe0e..4ed88d7b81 100644
--- a/indra/llwindow/llwindowmesaheadless.h
+++ b/indra/llwindow/llwindowmesaheadless.h
@@ -54,7 +54,7 @@ public:
/*virtual*/ BOOL getSize(LLCoordWindow *size) {return FALSE;};
/*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;};
/*virtual*/ BOOL setSize(LLCoordScreen size) {return FALSE;};
- /*virtual*/ BOOL switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync) {return FALSE;};
+ /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) {return FALSE;};
/*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;};
/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;};
/*virtual*/ void showCursor() {};
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index 122b57a497..5597ff4334 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -765,7 +765,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
// changing fullscreen resolution, or switching between windowed and fullscreen mode.
-BOOL LLWindowSDL::switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync)
+BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp)
{
const BOOL needsRebuild = TRUE; // Just nuke the context and start over.
BOOL result = true;
diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h
index 4d4d36e30a..51d34eb96f 100644
--- a/indra/llwindow/llwindowsdl.h
+++ b/indra/llwindow/llwindowsdl.h
@@ -66,7 +66,7 @@ public:
/*virtual*/ BOOL getSize(LLCoordWindow *size);
/*virtual*/ BOOL setPosition(LLCoordScreen position);
/*virtual*/ BOOL setSize(LLCoordScreen size);
- /*virtual*/ BOOL switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync);
+ /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL);
/*virtual*/ BOOL setCursorPosition(LLCoordWindow position);
/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position);
/*virtual*/ void showCursor();
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 5239da1712..c9554ce7fe 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -651,9 +651,10 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width,
//-----------------------------------------------------------------------
// Create GL drawing context
//-----------------------------------------------------------------------
- if (!switchContext(mFullscreen, LLCoordScreen(window_rect.right - window_rect.left, // width
- window_rect.bottom - window_rect.top), // height
- TRUE))
+ LLCoordScreen windowPos(x,y);
+ LLCoordScreen windowSize(window_rect.right - window_rect.left,
+ window_rect.bottom - window_rect.top);
+ if (!switchContext(mFullscreen, windowSize, TRUE, &windowPos))
{
return;
}
@@ -928,7 +929,7 @@ BOOL LLWindowWin32::setSize(const LLCoordScreen size)
}
// changing fullscreen resolution
-BOOL LLWindowWin32::switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync)
+BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp)
{
GLuint pixel_format;
DEVMODE dev_mode;
@@ -1050,10 +1051,10 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disa
else
{
mFullscreen = FALSE;
- window_rect.left = (long) 0;
- window_rect.right = (long) width; // Windows GDI rects don't include rightmost pixel
- window_rect.top = (long) 0;
- window_rect.bottom = (long) height;
+ window_rect.left = (long) (posp ? posp->mX : 0);
+ window_rect.right = (long) width + window_rect.left; // Windows GDI rects don't include rightmost pixel
+ window_rect.top = (long) (posp ? posp->mY : 0);
+ window_rect.bottom = (long) height + window_rect.top;
// Window with an edge
dw_ex_style = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
dw_style = WS_OVERLAPPEDWINDOW;
diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h
index e8eed55aee..f6e40a1c7f 100644
--- a/indra/llwindow/llwindowwin32.h
+++ b/indra/llwindow/llwindowwin32.h
@@ -59,7 +59,7 @@ public:
/*virtual*/ BOOL getSize(LLCoordWindow *size);
/*virtual*/ BOOL setPosition(LLCoordScreen position);
/*virtual*/ BOOL setSize(LLCoordScreen size);
- /*virtual*/ BOOL switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync);
+ /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL);
/*virtual*/ BOOL setCursorPosition(LLCoordWindow position);
/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position);
/*virtual*/ void showCursor();