summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2013-03-13 08:46:59 +0000
committerDon Kjer <don@lindenlab.com>2013-03-13 08:46:59 +0000
commit662d67e3b5f1cbf5e894f0e4af37a31faacd67e3 (patch)
tree93af533d9c1e9c027c5abc56a5de4ee207591b23 /indra/llwindow
parentf945415210f0e18c2c6d941fda6b7d45cb0f06f1 (diff)
parent0ebcdce82bffae18459ed541f05906f625ef47e2 (diff)
Merging LLCURL::Responder changes with CHUI changes. Fixed gcc 4.6 compile failures
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llwindow.cpp36
-rw-r--r--indra/llwindow/llwindow.h1
-rw-r--r--indra/llwindow/llwindowheadless.cpp2
-rw-r--r--indra/llwindow/llwindowheadless.h2
-rw-r--r--indra/llwindow/llwindowmacosx.cpp3
-rw-r--r--indra/llwindow/llwindowmacosx.h2
-rw-r--r--indra/llwindow/llwindowmesaheadless.cpp29
-rw-r--r--indra/llwindow/llwindowmesaheadless.h3
-rw-r--r--indra/llwindow/llwindowsdl.cpp16
-rw-r--r--indra/llwindow/llwindowsdl.h2
-rw-r--r--indra/llwindow/llwindowwin32.cpp2
-rw-r--r--indra/llwindow/llwindowwin32.h2
12 files changed, 58 insertions, 42 deletions
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index 300245ebc3..93b9d36939 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -257,8 +257,6 @@ std::vector<std::string> LLWindow::getDynamicFallbackFontList()
return LLWindowWin32::getDynamicFallbackFontList();
#elif LL_DARWIN
return LLWindowMacOSX::getDynamicFallbackFontList();
-#elif LL_MESA_HEADLESS
- return std::vector<std::string>();
#elif LL_SDL
return LLWindowSDL::getDynamicFallbackFontList();
#else
@@ -389,28 +387,38 @@ LLWindow* LLWindowManager::createWindow(
BOOL fullscreen,
BOOL clearBg,
BOOL disable_vsync,
+ BOOL use_gl,
BOOL ignore_pixel_depth,
U32 fsaa_samples)
{
LLWindow* new_window;
+ if (use_gl)
+ {
#if LL_MESA_HEADLESS
- new_window = new LLWindowMesaHeadless(callbacks,
- title, name, x, y, width, height, flags,
- fullscreen, clearBg, disable_vsync, ignore_pixel_depth);
+ new_window = new LLWindowMesaHeadless(callbacks,
+ title, name, x, y, width, height, flags,
+ fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth);
#elif LL_SDL
- new_window = new LLWindowSDL(callbacks,
- title, x, y, width, height, flags,
- fullscreen, clearBg, disable_vsync, ignore_pixel_depth, fsaa_samples);
+ new_window = new LLWindowSDL(callbacks,
+ title, x, y, width, height, flags,
+ fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth, fsaa_samples);
#elif LL_WINDOWS
- new_window = new LLWindowWin32(callbacks,
- title, name, x, y, width, height, flags,
- fullscreen, clearBg, disable_vsync, ignore_pixel_depth, fsaa_samples);
+ new_window = new LLWindowWin32(callbacks,
+ title, name, x, y, width, height, flags,
+ fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth, fsaa_samples);
#elif LL_DARWIN
- new_window = new LLWindowMacOSX(callbacks,
- title, name, x, y, width, height, flags,
- fullscreen, clearBg, disable_vsync, ignore_pixel_depth, fsaa_samples);
+ new_window = new LLWindowMacOSX(callbacks,
+ title, name, x, y, width, height, flags,
+ fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth, fsaa_samples);
#endif
+ }
+ else
+ {
+ new_window = new LLWindowHeadless(callbacks,
+ title, name, x, y, width, height, flags,
+ fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth);
+ }
if (FALSE == new_window->isValid())
{
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index bd3b965904..e9147d552e 100644
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -265,6 +265,7 @@ public:
BOOL fullscreen = FALSE,
BOOL clearBg = FALSE,
BOOL disable_vsync = TRUE,
+ BOOL use_gl = TRUE,
BOOL ignore_pixel_depth = FALSE,
U32 fsaa_samples = 0);
static BOOL destroyWindow(LLWindow* window);
diff --git a/indra/llwindow/llwindowheadless.cpp b/indra/llwindow/llwindowheadless.cpp
index dbdb40f5b9..e6e6bc67ff 100644
--- a/indra/llwindow/llwindowheadless.cpp
+++ b/indra/llwindow/llwindowheadless.cpp
@@ -35,7 +35,7 @@
//
LLWindowHeadless::LLWindowHeadless(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height,
U32 flags, BOOL fullscreen, BOOL clear_background,
- BOOL disable_vsync, BOOL ignore_pixel_depth)
+ BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth)
: LLWindow(callbacks, fullscreen, flags)
{
// Initialize a headless keyboard.
diff --git a/indra/llwindow/llwindowheadless.h b/indra/llwindow/llwindowheadless.h
index 72f9684ca3..1f767f4c97 100644
--- a/indra/llwindow/llwindowheadless.h
+++ b/indra/llwindow/llwindowheadless.h
@@ -96,7 +96,7 @@ public:
S32 x, S32 y,
S32 width, S32 height,
U32 flags, BOOL fullscreen, BOOL clear_background,
- BOOL disable_vsync, BOOL ignore_pixel_depth);
+ BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth);
virtual ~LLWindowHeadless();
private:
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index 413a9df616..97637c937f 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -210,7 +210,7 @@ LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks,
const std::string& title, const std::string& name, S32 x, S32 y, S32 width,
S32 height, U32 flags,
BOOL fullscreen, BOOL clearBg,
- BOOL disable_vsync,
+ BOOL disable_vsync, BOOL use_gl,
BOOL ignore_pixel_depth,
U32 fsaa_samples)
: LLWindow(NULL, fullscreen, flags)
@@ -228,6 +228,7 @@ LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks,
gKeyboard = new LLKeyboardMacOSX();
gKeyboard->setCallbacks(callbacks);
+ // Ignore use_gl for now, only used for drones on PC
mWindow = NULL;
mContext = NULL;
mPixelFormat = NULL;
diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h
index fcb738ed0f..af83b50097 100644
--- a/indra/llwindow/llwindowmacosx.h
+++ b/indra/llwindow/llwindowmacosx.h
@@ -122,7 +122,7 @@ public:
protected:
LLWindowMacOSX(LLWindowCallbacks* callbacks,
const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags,
- BOOL fullscreen, BOOL clearBg, BOOL disable_vsync,
+ BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl,
BOOL ignore_pixel_depth,
U32 fsaa_samples);
~LLWindowMacOSX();
diff --git a/indra/llwindow/llwindowmesaheadless.cpp b/indra/llwindow/llwindowmesaheadless.cpp
index 2b668d3fc4..11c22ac94e 100644
--- a/indra/llwindow/llwindowmesaheadless.cpp
+++ b/indra/llwindow/llwindowmesaheadless.cpp
@@ -41,25 +41,28 @@ U16 *gMesaBuffer = NULL;
LLWindowMesaHeadless::LLWindowMesaHeadless(LLWindowCallbacks* callbacks,
const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height,
U32 flags, BOOL fullscreen, BOOL clearBg,
- BOOL disable_vsync, BOOL ignore_pixel_depth)
+ BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth)
: LLWindow(callbacks, fullscreen, flags)
{
- llinfos << "MESA Init" << llendl;
- mMesaContext = OSMesaCreateContextExt( GL_RGBA, 32, 0, 0, NULL );
+ if (use_gl)
+ {
+ llinfos << "MESA Init" << llendl;
+ mMesaContext = OSMesaCreateContextExt( GL_RGBA, 32, 0, 0, NULL );
- /* Allocate the image buffer */
- mMesaBuffer = new unsigned char [width * height * 4 * MESA_CHANNEL_SIZE];
- llassert(mMesaBuffer);
+ /* Allocate the image buffer */
+ mMesaBuffer = new unsigned char [width * height * 4 * MESA_CHANNEL_SIZE];
+ llassert(mMesaBuffer);
- gMesaBuffer = (U16*)mMesaBuffer;
+ gMesaBuffer = (U16*)mMesaBuffer;
- /* Bind the buffer to the context and make it current */
- if (!OSMesaMakeCurrent( mMesaContext, mMesaBuffer, MESA_CHANNEL_TYPE, width, height ))
- {
- llerrs << "MESA: OSMesaMakeCurrent failed!" << llendl;
- }
+ /* Bind the buffer to the context and make it current */
+ if (!OSMesaMakeCurrent( mMesaContext, mMesaBuffer, MESA_CHANNEL_TYPE, width, height ))
+ {
+ llerrs << "MESA: OSMesaMakeCurrent failed!" << llendl;
+ }
- llverify(gGLManager.initGL());
+ llverify(gGLManager.initGL());
+ }
}
diff --git a/indra/llwindow/llwindowmesaheadless.h b/indra/llwindow/llwindowmesaheadless.h
index c8d2bf2824..8f70aee4f6 100644
--- a/indra/llwindow/llwindowmesaheadless.h
+++ b/indra/llwindow/llwindowmesaheadless.h
@@ -51,7 +51,6 @@ public:
/*virtual*/ BOOL getSize(LLCoordWindow *size) {return FALSE;};
/*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;};
/*virtual*/ BOOL setSizeImpl(LLCoordScreen size) {return FALSE;};
- /*virtual*/ BOOL setSizeImpl(LLCoordWindow size) {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;};
@@ -98,7 +97,7 @@ public:
LLWindowMesaHeadless(LLWindowCallbacks* callbacks,
const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height,
U32 flags, BOOL fullscreen, BOOL clearBg,
- BOOL disable_vsync, BOOL ignore_pixel_depth);
+ BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth);
~LLWindowMesaHeadless();
private:
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index 0d2e0f78c1..5cc4fbb2a5 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -186,7 +186,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks,
const std::string& title, S32 x, S32 y, S32 width,
S32 height, U32 flags,
BOOL fullscreen, BOOL clearBg,
- BOOL disable_vsync,
+ BOOL disable_vsync, BOOL use_gl,
BOOL ignore_pixel_depth, U32 fsaa_samples)
: LLWindow(callbacks, fullscreen, flags),
Lock_Display(NULL),
@@ -197,6 +197,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks,
gKeyboard->setCallbacks(callbacks);
// Note that we can't set up key-repeat until after SDL has init'd video
+ // Ignore use_gl for now, only used for drones on PC
mWindow = NULL;
mNeedsResize = FALSE;
mOverrideAspectRatio = 0.f;
@@ -1643,24 +1644,27 @@ void check_vm_bloat()
const long long significant_vm_difference = 250 * 1024*1024;
const long long significant_rss_difference = 50 * 1024*1024;
+ //size_t res;
size_t dummy;
char *ptr;
- size_t delim_result = 0;
- for (int i=0; i<22 && delim_result > -1; ++i) // parse past the values we don't want
+ for (int i=0; i<22; ++i) // parse past the values we don't want
{
ptr = NULL;
- delim_result = getdelim(&ptr, &dummy, ' ', fp);
+ //res = getdelim(&ptr, &dummy, ' ', fp);
+ getdelim(&ptr, &dummy, ' ', fp);
free(ptr);
}
// 23rd space-delimited entry is vsize
ptr = NULL;
- delim_result = getdelim(&ptr, &dummy, ' ', fp);
+ //res = getdelim(&ptr, &dummy, ' ', fp);
+ getdelim(&ptr, &dummy, ' ', fp);
llassert(ptr);
long long this_vm_size = atoll(ptr);
free(ptr);
// 24th space-delimited entry is RSS
ptr = NULL;
- delim_result = getdelim(&ptr, &dummy, ' ', fp);
+ //res = getdelim(&ptr, &dummy, ' ', fp);
+ getdelim(&ptr, &dummy, ' ', fp);
llassert(ptr);
long long this_rss_size = getpagesize() * atoll(ptr);
free(ptr);
diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h
index d430e3d83b..c5ce892a04 100644
--- a/indra/llwindow/llwindowsdl.h
+++ b/indra/llwindow/llwindowsdl.h
@@ -147,7 +147,7 @@ public:
protected:
LLWindowSDL(LLWindowCallbacks* callbacks,
const std::string& title, int x, int y, int width, int height, U32 flags,
- BOOL fullscreen, BOOL clearBg, BOOL disable_vsync,
+ BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl,
BOOL ignore_pixel_depth, U32 fsaa_samples);
~LLWindowSDL();
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 88c586ce5d..43c0090993 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -361,7 +361,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
const std::string& title, const std::string& name, S32 x, S32 y, S32 width,
S32 height, U32 flags,
BOOL fullscreen, BOOL clearBg,
- BOOL disable_vsync,
+ BOOL disable_vsync, BOOL use_gl,
BOOL ignore_pixel_depth,
U32 fsaa_samples)
: LLWindow(callbacks, fullscreen, flags)
diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h
index aa7e2289bb..54c9ac4d4d 100644
--- a/indra/llwindow/llwindowwin32.h
+++ b/indra/llwindow/llwindowwin32.h
@@ -118,7 +118,7 @@ public:
protected:
LLWindowWin32(LLWindowCallbacks* callbacks,
const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags,
- BOOL fullscreen, BOOL clearBg, BOOL disable_vsync,
+ BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl,
BOOL ignore_pixel_depth, U32 fsaa_samples);
~LLWindowWin32();