aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llwindow
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llwindow/files.sunos5.lst4
-rw-r--r--linden/indra/llwindow/files.win32.lst2
-rw-r--r--linden/indra/llwindow/llglstubs.h2
-rw-r--r--linden/indra/llwindow/llwindowsdl.cpp46
-rw-r--r--linden/indra/llwindow/llwindowsolaris.cpp58
-rw-r--r--linden/indra/llwindow/llwindowsolaris.h116
-rw-r--r--linden/indra/llwindow/llwindowwin32.cpp12
7 files changed, 235 insertions, 5 deletions
diff --git a/linden/indra/llwindow/files.sunos5.lst b/linden/indra/llwindow/files.sunos5.lst
new file mode 100644
index 0000000..ee20b05
--- /dev/null
+++ b/linden/indra/llwindow/files.sunos5.lst
@@ -0,0 +1,4 @@
1llwindow/llkeyboardsdl.cpp
2llwindow/llwindowsdl.cpp
3llwindow/llwindowsolaris.cpp
4llwindow/llwindowmesaheadless.cpp
diff --git a/linden/indra/llwindow/files.win32.lst b/linden/indra/llwindow/files.win32.lst
new file mode 100644
index 0000000..1abcb6e
--- /dev/null
+++ b/linden/indra/llwindow/files.win32.lst
@@ -0,0 +1,2 @@
1llwindow/llkeyboardwin32.cpp
2llwindow/llwindowwin32.cpp
diff --git a/linden/indra/llwindow/llglstubs.h b/linden/indra/llwindow/llglstubs.h
index 1d70400..fbbcd1f 100644
--- a/linden/indra/llwindow/llglstubs.h
+++ b/linden/indra/llwindow/llglstubs.h
@@ -222,7 +222,7 @@ GL_FUNC(void,glArrayObjectATI,(GLenum a, GLint b, GLenum c, GLsizei d, GLuint e,
222GL_FUNC(void,glVertexAttribArrayObjectATI,(GLuint a, GLint b, GLenum c, GLboolean d, GLsizei e, GLuint f, GLuint g),(a,b,c,d,e,f,g),) 222GL_FUNC(void,glVertexAttribArrayObjectATI,(GLuint a, GLint b, GLenum c, GLboolean d, GLsizei e, GLuint f, GLuint g),(a,b,c,d,e,f,g),)
223 223
224// CgGL needs these on Linux... 224// CgGL needs these on Linux...
225#if LL_LINUX 225#if LL_LINUX || LL_SOLARIS
226GL_FUNC(void*,glXGetCurrentDisplay,(void),(),return) 226GL_FUNC(void*,glXGetCurrentDisplay,(void),(),return)
227GL_FUNC(const char *,glXQueryExtensionsString,(void *dpy, int screen),(dpy,screen),return) 227GL_FUNC(const char *,glXQueryExtensionsString,(void *dpy, int screen),(dpy,screen),return)
228GL_FUNC(void*,glXGetProcAddressARB,(const GLubyte *fn),(fn),return) 228GL_FUNC(void*,glXGetProcAddressARB,(const GLubyte *fn),(fn),return)
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
58extern BOOL gDebugWindowProc; 58extern BOOL gDebugWindowProc;
59 59
@@ -349,6 +349,13 @@ static int x11_detect_VRAM_kb_fp(FILE *fp, const char *prefix_str)
349 349
350static int x11_detect_VRAM_kb() 350static 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}
diff --git a/linden/indra/llwindow/llwindowsolaris.cpp b/linden/indra/llwindow/llwindowsolaris.cpp
new file mode 100644
index 0000000..7e3c3e6
--- /dev/null
+++ b/linden/indra/llwindow/llwindowsolaris.cpp
@@ -0,0 +1,58 @@
1/**
2 * @file fmodwrapper.cpp
3 * @brief dummy source file for building a shared library to wrap libfmod.a
4 *
5 * Copyright (c) 2005-2007, Linden Research, Inc.
6 *
7 * Second Life Viewer Source Code
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#if LL_SOLARIS
30
31#include "linden_common.h"
32#include "indra_constants.h"
33
34#include "llwindowsolaris.h"
35#include "llgl.h"
36#include "llglheaders.h"
37
38//
39// LLWindowSolaris
40//
41LLWindowSolaris::LLWindowSolaris(char *title, char *name, S32 x, S32 y, S32 width, S32 height,
42 U32 flags, BOOL fullscreen, BOOL clearBg,
43 BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth)
44 : LLWindow(fullscreen, flags)
45{
46 llerrs << "Solaris window not yet supported" << llendl;
47}
48
49
50LLWindowSolaris::~LLWindowSolaris()
51{
52}
53
54void LLWindowSolaris::swapBuffers()
55{
56}
57
58#endif // LL_SOLARIS
diff --git a/linden/indra/llwindow/llwindowsolaris.h b/linden/indra/llwindow/llwindowsolaris.h
new file mode 100644
index 0000000..57aa9b9
--- /dev/null
+++ b/linden/indra/llwindow/llwindowsolaris.h
@@ -0,0 +1,116 @@
1/**
2 * @file fmodwrapper.cpp
3 * @brief dummy source file for building a shared library to wrap libfmod.a
4 *
5 * Copyright (c) 2005-2007, Linden Research, Inc.
6 *
7 * Second Life Viewer Source Code
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#ifndef LL_LLWINDOWSOLARIS_H
30#define LL_LLWINDOWSOLARIS_H
31
32#include "llwindow.h"
33
34class LLWindowSolaris : public LLWindow
35{
36public:
37 /*virtual*/ void show() {};
38 /*virtual*/ void hide() {};
39 /*virtual*/ void close() {};
40 /*virtual*/ BOOL getVisible() {return FALSE;};
41 /*virtual*/ BOOL getMinimized() {return FALSE;};
42 /*virtual*/ BOOL getMaximized() {return FALSE;};
43 /*virtual*/ BOOL maximize() {return FALSE;};
44 /*virtual*/ BOOL getFullscreen() {return FALSE;};
45 /*virtual*/ BOOL getPosition(LLCoordScreen *position) {return FALSE;};
46 /*virtual*/ BOOL getSize(LLCoordScreen *size) {return FALSE;};
47 /*virtual*/ BOOL getSize(LLCoordWindow *size) {return FALSE;};
48 /*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;};
49 /*virtual*/ BOOL setSize(LLCoordScreen size) {return FALSE;};
50 /*virtual*/ BOOL switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync) {return FALSE;};
51 /*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;};
52 /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;};
53 /*virtual*/ void showCursor() {};
54 /*virtual*/ void hideCursor() {};
55 /*virtual*/ void showCursorFromMouseMove() {};
56 /*virtual*/ void hideCursorUntilMouseMove() {};
57 /*virtual*/ BOOL isCursorHidden() {return FALSE;};
58 /*virtual*/ void setCursor(ECursorType cursor) {};
59 //virtual ECursorType getCursor() { return mCurrentCursor; };
60 /*virtual*/ void captureMouse() {};
61 /*virtual*/ void releaseMouse() {};
62 /*virtual*/ void setMouseClipping( BOOL b ) {};
63 /*virtual*/ BOOL isClipboardTextAvailable() {return FALSE; };
64 /*virtual*/ BOOL pasteTextFromClipboard(LLWString &dst) {return FALSE; };
65 /*virtual*/ BOOL copyTextToClipboard(const LLWString &src) {return FALSE; };
66 /*virtual*/ void flashIcon(F32 seconds) {};
67 /*virtual*/ F32 getGamma() {return 1.0f; };
68 /*virtual*/ BOOL setGamma(const F32 gamma) {return FALSE; }; // Set the gamma
69 /*virtual*/ BOOL restoreGamma() {return FALSE; }; // Restore original gamma table (before updating gamma)
70 //virtual ESwapMethod getSwapMethod() { return mSwapMethod; }
71 /*virtual*/ void gatherInput() {};
72 /*virtual*/ void delayInputProcessing() {};
73 /*virtual*/ void swapBuffers();
74
75 /*virtual*/ LLString getTempFileName() {return LLString(""); };
76 /*virtual*/ void deleteFile( const char* file_name ) {};
77 /*virtual*/ S32 stat( const char* file_name, struct stat* stat_info ) {return 0; };
78 /*virtual*/ BOOL sendEmail(const char* address,const char* subject,const char* body_text,const char* attachment=NULL, const char* attachment_displayed_name=NULL) { return FALSE; };
79
80
81 // handy coordinate space conversion routines
82 /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to) { return FALSE; };
83 /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to) { return FALSE; };
84 /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordGL *to) { return FALSE; };
85 /*virtual*/ BOOL convertCoords(LLCoordGL from, LLCoordWindow *to) { return FALSE; };
86 /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordGL *to) { return FALSE; };
87 /*virtual*/ BOOL convertCoords(LLCoordGL from, LLCoordScreen *to) { return FALSE; };
88
89 /*virtual*/ LLWindowResolution* getSupportedResolutions(S32 &num_resolutions) { return NULL; };
90 /*virtual*/ F32 getNativeAspectRatio() { return 1.0f; };
91 /*virtual*/ F32 getPixelAspectRatio() { return 1.0f; };
92 /*virtual*/ void setNativeAspectRatio(F32 ratio) {}
93
94 //virtual BOOL dialog_color_picker (F32 *r, F32 *g, F32 *b );
95
96 /*virtual*/ void *getPlatformWindow() { return NULL; }
97
98 LLWindowSolaris(char *title, char *name, S32 x, S32 y, S32 width, S32 height,
99 U32 flags, BOOL fullscreen, BOOL clearBg,
100 BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth);
101 ~LLWindowSolaris();
102};
103
104class LLSplashScreenLinux : public LLSplashScreen
105{
106public:
107 LLSplashScreenLinux() {};
108 virtual ~LLSplashScreenLinux() {};
109
110 /*virtual*/ void showImpl() {};
111 /*virtual*/ void updateImpl(const char* mesg) {};
112 /*virtual*/ void hideImpl() {};
113
114};
115
116#endif //LL_LLWINDOWSOLARIS_H
diff --git a/linden/indra/llwindow/llwindowwin32.cpp b/linden/indra/llwindow/llwindowwin32.cpp
index 0b3cdd4..3a41d01 100644
--- a/linden/indra/llwindow/llwindowwin32.cpp
+++ b/linden/indra/llwindow/llwindowwin32.cpp
@@ -1585,6 +1585,11 @@ void LLWindowWin32::moveWindow( const LLCoordScreen& position, const LLCoordScre
1585 } 1585 }
1586 } 1586 }
1587 1587
1588 // if the window was already maximized, MoveWindow seems to still set the maximized flag even if
1589 // the window is smaller than maximized.
1590 // So we're going to do a restore first (which is a ShowWindow call) (SL-44655).
1591 ShowWindow(mWindowHandle, SW_RESTORE);
1592 // NOW we can call MoveWindow
1588 MoveWindow(mWindowHandle, position.mX, position.mY, size.mX, size.mY, TRUE); 1593 MoveWindow(mWindowHandle, position.mX, position.mY, size.mX, size.mY, TRUE);
1589} 1594}
1590 1595
@@ -2289,6 +2294,13 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
2289 << llendl; 2294 << llendl;
2290 } 2295 }
2291 2296
2297 // There's an odd behavior with WM_SIZE that I would call a bug. If
2298 // the window is maximized, and you call MoveWindow() with a size smaller
2299 // than a maximized window, it ends up sending WM_SIZE with w_param set
2300 // to SIZE_MAXIMIZED -- which isn't true. So the logic below doesn't work.
2301 // (SL-44655). Fixed it by calling ShowWindow(SW_RESTORE) first (see
2302 // LLWindowWin32::moveWindow in this file).
2303
2292 // If we are now restored, but we weren't before, this 2304 // If we are now restored, but we weren't before, this
2293 // means that the window was un-minimized. 2305 // means that the window was un-minimized.
2294 if (w_param == SIZE_RESTORED && window_imp->mLastSizeWParam != SIZE_RESTORED) 2306 if (w_param == SIZE_RESTORED && window_imp->mLastSizeWParam != SIZE_RESTORED)