diff options
author | Jacek Antonelli | 2008-08-15 23:45:04 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:04 -0500 |
commit | 117e22047c5752352342d64e3fb7ce00a4eb8113 (patch) | |
tree | e32de2cfba0dda8705ae528fcd1fbe23ba075685 /linden/indra/llwindow/llwindowsdl.cpp | |
parent | Second Life viewer sources 1.18.0.6 (diff) | |
download | meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.zip meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.gz meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.bz2 meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.xz |
Second Life viewer sources 1.18.1.2
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llwindow/llwindowsdl.cpp | 46 |
1 files changed, 42 insertions, 4 deletions
diff --git a/linden/indra/llwindow/llwindowsdl.cpp b/linden/indra/llwindow/llwindowsdl.cpp index 94111e7..b38d4d1 100644 --- a/linden/indra/llwindow/llwindowsdl.cpp +++ b/linden/indra/llwindow/llwindowsdl.cpp | |||
@@ -47,13 +47,13 @@ extern "C" { | |||
47 | } | 47 | } |
48 | #endif // LL_GTK | 48 | #endif // LL_GTK |
49 | 49 | ||
50 | #if LL_LINUX | 50 | #if LL_LINUX || LL_SOLARIS |
51 | // not necessarily available on random SDL platforms, so #if LL_LINUX | 51 | // not necessarily available on random SDL platforms, so #if LL_LINUX |
52 | // for execv(), waitpid(), fork() | 52 | // for execv(), waitpid(), fork() |
53 | # include <unistd.h> | 53 | # include <unistd.h> |
54 | # include <sys/types.h> | 54 | # include <sys/types.h> |
55 | # include <sys/wait.h> | 55 | # include <sys/wait.h> |
56 | #endif // LL_LINUX | 56 | #endif // LL_LINUX || LL_SOLARIS |
57 | 57 | ||
58 | extern BOOL gDebugWindowProc; | 58 | extern BOOL gDebugWindowProc; |
59 | 59 | ||
@@ -349,6 +349,13 @@ static int x11_detect_VRAM_kb_fp(FILE *fp, const char *prefix_str) | |||
349 | 349 | ||
350 | static int x11_detect_VRAM_kb() | 350 | static int x11_detect_VRAM_kb() |
351 | { | 351 | { |
352 | #if LL_SOLARIS | ||
353 | #error Can this be done without an explicit architecture test, ie a test FOR xorg? Was followed by: && defined(__sparc) | ||
354 | // NOTE: there's no Xorg server on SPARC so just return 0 | ||
355 | // and allow SDL to attempt to get the amount of VRAM | ||
356 | return(0); | ||
357 | #else | ||
358 | |||
352 | std::string x_log_location("/var/log/"); | 359 | std::string x_log_location("/var/log/"); |
353 | std::string fname; | 360 | std::string fname; |
354 | int rtn = 0; // 'could not detect' | 361 | int rtn = 0; // 'could not detect' |
@@ -420,6 +427,7 @@ static int x11_detect_VRAM_kb() | |||
420 | } | 427 | } |
421 | } | 428 | } |
422 | return rtn; | 429 | return rtn; |
430 | #endif // LL_SOLARIS | ||
423 | } | 431 | } |
424 | #endif // LL_X11 | 432 | #endif // LL_X11 |
425 | 433 | ||
@@ -489,7 +497,24 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B | |||
489 | SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); | 497 | SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); |
490 | SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE,8); | 498 | SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE,8); |
491 | SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); | 499 | SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); |
500 | #if !LL_SOLARIS | ||
492 | SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, (bits <= 16) ? 16 : 24); | 501 | SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, (bits <= 16) ? 16 : 24); |
502 | #else | ||
503 | // NOTE- use smaller Z-buffer to enable more graphics cards | ||
504 | // - This should not affect better GPUs and has been proven | ||
505 | // to provide 24-bit z-buffers when available. | ||
506 | // | ||
507 | // As the API states: | ||
508 | // | ||
509 | // GLX_DEPTH_SIZE Must be followed by a nonnegative | ||
510 | // minimum size specification. If this | ||
511 | // value is zero, visuals with no depth | ||
512 | // buffer are preferred. Otherwise, the | ||
513 | // largest available depth buffer of at | ||
514 | // least the minimum size is preferred. | ||
515 | |||
516 | SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); | ||
517 | #endif | ||
493 | SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, (bits <= 16) ? 1 : 8); | 518 | SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, (bits <= 16) ? 1 : 8); |
494 | 519 | ||
495 | // *FIX: try to toggle vsync here? | 520 | // *FIX: try to toggle vsync here? |
@@ -655,13 +680,26 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B | |||
655 | // fixme: actually, it's REALLY important for picking that we get at | 680 | // fixme: actually, it's REALLY important for picking that we get at |
656 | // least 8 bits each of red,green,blue. Alpha we can be a bit more | 681 | // least 8 bits each of red,green,blue. Alpha we can be a bit more |
657 | // relaxed about if we have to. | 682 | // relaxed about if we have to. |
683 | #if LL_SOLARIS | ||
684 | #error && defined(__sparc) | ||
685 | if(colorBits < 24) //HACK: on SPARC allow 24-bit color | ||
686 | #else | ||
658 | if (colorBits < 32) | 687 | if (colorBits < 32) |
688 | #endif | ||
659 | { | 689 | { |
660 | close(); | 690 | close(); |
661 | setupFailure( | 691 | setupFailure( |
692 | #if LL_SOLARIS | ||
693 | #error && defined(__sparc) | ||
694 | "Second Life requires at least 24-bit color on SPARC to run in a window.\n" | ||
695 | "Please use fbconfig to set your default color depth to 24 bits.\n" | ||
696 | "You may also need to adjust the X11 setting in SMF. To do so use\n" | ||
697 | " 'svccfg -s svc:/application/x11/x11-server setprop options/default_depth=24'\n" | ||
698 | #else | ||
662 | "Second Life requires True Color (32-bit) to run in a window.\n" | 699 | "Second Life requires True Color (32-bit) to run in a window.\n" |
663 | "Please go to Control Panels -> Display -> Settings and\n" | 700 | "Please go to Control Panels -> Display -> Settings and\n" |
664 | "set the screen to 32-bit color.\n" | 701 | "set the screen to 32-bit color.\n" |
702 | #endif | ||
665 | "Alternately, if you choose to run fullscreen, Second Life\n" | 703 | "Alternately, if you choose to run fullscreen, Second Life\n" |
666 | "will automatically adjust the screen each time it runs.", | 704 | "will automatically adjust the screen each time it runs.", |
667 | "Error", | 705 | "Error", |
@@ -2657,7 +2695,7 @@ void spawn_web_browser(const char* escaped_url) | |||
2657 | { | 2695 | { |
2658 | llinfos << "spawn_web_browser: " << escaped_url << llendl; | 2696 | llinfos << "spawn_web_browser: " << escaped_url << llendl; |
2659 | 2697 | ||
2660 | #if LL_LINUX | 2698 | #if LL_LINUX || LL_SOLARIS |
2661 | # if LL_X11 | 2699 | # if LL_X11 |
2662 | if (gWindowImplementation && gWindowImplementation->mSDL_Display) | 2700 | if (gWindowImplementation && gWindowImplementation->mSDL_Display) |
2663 | { | 2701 | { |
@@ -2697,7 +2735,7 @@ void spawn_web_browser(const char* escaped_url) | |||
2697 | llwarns << "fork failure." << llendl; | 2735 | llwarns << "fork failure." << llendl; |
2698 | } | 2736 | } |
2699 | } | 2737 | } |
2700 | #endif // LL_LINUX | 2738 | #endif // LL_LINUX || LL_SOLARIS |
2701 | 2739 | ||
2702 | llinfos << "spawn_web_browser returning." << llendl; | 2740 | llinfos << "spawn_web_browser returning." << llendl; |
2703 | } | 2741 | } |