summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowsdl.cpp
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2007-07-20 20:38:05 +0000
committerDon Kjer <don@lindenlab.com>2007-07-20 20:38:05 +0000
commitd373dcc7cbed5fdea72c6b71a5594e4e85549b43 (patch)
tree140e20f48db5dc4d7842f05ef2c24ef9e6fc3238 /indra/llwindow/llwindowsdl.cpp
parentc78f99b0b3b4b9ac99a69b63315e821d89a89a3b (diff)
svn merge -r 64548:64837 svn+ssh://svn/svn/linden/branches/maintenance into release
* WARNING *: maintenance r64837 is not the last rev to use in the next merge. use r65269
Diffstat (limited to 'indra/llwindow/llwindowsdl.cpp')
-rw-r--r--indra/llwindow/llwindowsdl.cpp46
1 files changed, 42 insertions, 4 deletions
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index 3ccf0d1250..0fdb42436e 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -27,13 +27,13 @@ extern "C" {
}
#endif // LL_GTK
-#if LL_LINUX
+#if LL_LINUX || LL_SOLARIS
// not necessarily available on random SDL platforms, so #if LL_LINUX
// for execv(), waitpid(), fork()
# include <unistd.h>
# include <sys/types.h>
# include <sys/wait.h>
-#endif // LL_LINUX
+#endif // LL_LINUX || LL_SOLARIS
extern BOOL gDebugWindowProc;
@@ -329,6 +329,13 @@ static int x11_detect_VRAM_kb_fp(FILE *fp, const char *prefix_str)
static int x11_detect_VRAM_kb()
{
+#if LL_SOLARIS
+#error Can this be done without an explicit architecture test, ie a test FOR xorg? Was followed by: && defined(__sparc)
+ // NOTE: there's no Xorg server on SPARC so just return 0
+ // and allow SDL to attempt to get the amount of VRAM
+ return(0);
+#else
+
std::string x_log_location("/var/log/");
std::string fname;
int rtn = 0; // 'could not detect'
@@ -400,6 +407,7 @@ static int x11_detect_VRAM_kb()
}
}
return rtn;
+#endif // LL_SOLARIS
}
#endif // LL_X11
@@ -469,7 +477,24 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE,8);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
+#if !LL_SOLARIS
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, (bits <= 16) ? 16 : 24);
+#else
+ // NOTE- use smaller Z-buffer to enable more graphics cards
+ // - This should not affect better GPUs and has been proven
+ // to provide 24-bit z-buffers when available.
+ //
+ // As the API states:
+ //
+ // GLX_DEPTH_SIZE Must be followed by a nonnegative
+ // minimum size specification. If this
+ // value is zero, visuals with no depth
+ // buffer are preferred. Otherwise, the
+ // largest available depth buffer of at
+ // least the minimum size is preferred.
+
+ SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
+#endif
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, (bits <= 16) ? 1 : 8);
// *FIX: try to toggle vsync here?
@@ -635,13 +660,26 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
// fixme: actually, it's REALLY important for picking that we get at
// least 8 bits each of red,green,blue. Alpha we can be a bit more
// relaxed about if we have to.
+#if LL_SOLARIS
+#error && defined(__sparc)
+ if(colorBits < 24) //HACK: on SPARC allow 24-bit color
+#else
if (colorBits < 32)
+#endif
{
close();
setupFailure(
+#if LL_SOLARIS
+#error && defined(__sparc)
+ "Second Life requires at least 24-bit color on SPARC to run in a window.\n"
+ "Please use fbconfig to set your default color depth to 24 bits.\n"
+ "You may also need to adjust the X11 setting in SMF. To do so use\n"
+ " 'svccfg -s svc:/application/x11/x11-server setprop options/default_depth=24'\n"
+#else
"Second Life requires True Color (32-bit) to run in a window.\n"
"Please go to Control Panels -> Display -> Settings and\n"
"set the screen to 32-bit color.\n"
+#endif
"Alternately, if you choose to run fullscreen, Second Life\n"
"will automatically adjust the screen each time it runs.",
"Error",
@@ -2637,7 +2675,7 @@ void spawn_web_browser(const char* escaped_url)
{
llinfos << "spawn_web_browser: " << escaped_url << llendl;
-#if LL_LINUX
+#if LL_LINUX || LL_SOLARIS
# if LL_X11
if (gWindowImplementation && gWindowImplementation->mSDL_Display)
{
@@ -2677,7 +2715,7 @@ void spawn_web_browser(const char* escaped_url)
llwarns << "fork failure." << llendl;
}
}
-#endif // LL_LINUX
+#endif // LL_LINUX || LL_SOLARIS
llinfos << "spawn_web_browser returning." << llendl;
}