aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llwindow/llwindowmacosx.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:42 -0500
committerJacek Antonelli2008-08-15 23:45:42 -0500
commitce28e056c20bf2723f565bbf464b87781ec248a2 (patch)
treeef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/llwindow/llwindowmacosx.cpp
parentSecond Life viewer sources 1.19.1.4b (diff)
downloadmeta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz
Second Life viewer sources 1.20.2
Diffstat (limited to '')
-rw-r--r--linden/indra/llwindow/llwindowmacosx.cpp30
1 files changed, 26 insertions, 4 deletions
diff --git a/linden/indra/llwindow/llwindowmacosx.cpp b/linden/indra/llwindow/llwindowmacosx.cpp
index 5c91cc0..f5cc8c6 100644
--- a/linden/indra/llwindow/llwindowmacosx.cpp
+++ b/linden/indra/llwindow/llwindowmacosx.cpp
@@ -246,7 +246,8 @@ LLWindowMacOSX::LLWindowMacOSX(char *title, char *name, S32 x, S32 y, S32 width,
246 S32 height, U32 flags, 246 S32 height, U32 flags,
247 BOOL fullscreen, BOOL clearBg, 247 BOOL fullscreen, BOOL clearBg,
248 BOOL disable_vsync, BOOL use_gl, 248 BOOL disable_vsync, BOOL use_gl,
249 BOOL ignore_pixel_depth) 249 BOOL ignore_pixel_depth,
250 U32 fsaa_samples)
250 : LLWindow(fullscreen, flags) 251 : LLWindow(fullscreen, flags)
251{ 252{
252 // Voodoo for calling cocoa from carbon (see llwindowmacosx-objc.mm). 253 // Voodoo for calling cocoa from carbon (see llwindowmacosx-objc.mm).
@@ -277,6 +278,8 @@ LLWindowMacOSX::LLWindowMacOSX(char *title, char *name, S32 x, S32 y, S32 width,
277 mTSMScriptCode = 0; 278 mTSMScriptCode = 0;
278 mTSMLangCode = 0; 279 mTSMLangCode = 0;
279 mPreeditor = NULL; 280 mPreeditor = NULL;
281 mFSAASamples = fsaa_samples;
282 mForceRebuild = FALSE;
280 283
281 // For reasons that aren't clear to me, LLTimers seem to be created in the "started" state. 284 // For reasons that aren't clear to me, LLTimers seem to be created in the "started" state.
282 // Since the started state of this one is used to track whether the NMRec has been installed, it wants to start out in the "stopped" state. 285 // Since the started state of this one is used to track whether the NMRec has been installed, it wants to start out in the "stopped" state.
@@ -558,6 +561,8 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
558 AGL_RGBA, 561 AGL_RGBA,
559 AGL_FULLSCREEN, 562 AGL_FULLSCREEN,
560 // AGL_NO_RECOVERY, // MBW -- XXX -- Not sure if we want this attribute 563 // AGL_NO_RECOVERY, // MBW -- XXX -- Not sure if we want this attribute
564 AGL_SAMPLE_BUFFERS_ARB, mFSAASamples > 0 ? 1 : 0,
565 AGL_SAMPLES_ARB, mFSAASamples,
561 AGL_DOUBLEBUFFER, 566 AGL_DOUBLEBUFFER,
562 AGL_CLOSEST_POLICY, 567 AGL_CLOSEST_POLICY,
563 AGL_ACCELERATED, 568 AGL_ACCELERATED,
@@ -586,6 +591,8 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
586 AGL_DOUBLEBUFFER, 591 AGL_DOUBLEBUFFER,
587 AGL_CLOSEST_POLICY, 592 AGL_CLOSEST_POLICY,
588 AGL_ACCELERATED, 593 AGL_ACCELERATED,
594 AGL_SAMPLE_BUFFERS_ARB, mFSAASamples > 0 ? 1 : 0,
595 AGL_SAMPLES_ARB, mFSAASamples,
589 AGL_RED_SIZE, 8, 596 AGL_RED_SIZE, 8,
590 AGL_GREEN_SIZE, 8, 597 AGL_GREEN_SIZE, 8,
591 AGL_BLUE_SIZE, 8, 598 AGL_BLUE_SIZE, 8,
@@ -819,13 +826,16 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
819 } 826 }
820 } 827 }
821 828
829 //make sure multisample starts off disabled
830 glDisable(GL_MULTISAMPLE_ARB);
831
822 // Don't need to get the current gamma, since there's a call that restores it to the system defaults. 832 // Don't need to get the current gamma, since there's a call that restores it to the system defaults.
823 return TRUE; 833 return TRUE;
824} 834}
825 835
826 836
827// changing fullscreen resolution, or switching between windowed and fullscreen mode. 837// changing fullscreen resolution, or switching between windowed and fullscreen mode.
828BOOL LLWindowMacOSX::switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync) 838BOOL LLWindowMacOSX::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp)
829{ 839{
830 BOOL needsRebuild = FALSE; 840 BOOL needsRebuild = FALSE;
831 BOOL result = true; 841 BOOL result = true;
@@ -897,8 +907,9 @@ BOOL LLWindowMacOSX::switchContext(BOOL fullscreen, LLCoordScreen size, BOOL dis
897 } 907 }
898 908
899 stop_glerror(); 909 stop_glerror();
900 if(needsRebuild) 910 if(needsRebuild || mForceRebuild)
901 { 911 {
912 mForceRebuild = FALSE;
902 destroyContext(); 913 destroyContext();
903 result = createContext(0, 0, size.mX, size.mY, 0, fullscreen, disable_vsync); 914 result = createContext(0, 0, size.mX, size.mY, 0, fullscreen, disable_vsync);
904 if (result) 915 if (result)
@@ -1318,6 +1329,17 @@ F32 LLWindowMacOSX::getGamma()
1318 return result; 1329 return result;
1319} 1330}
1320 1331
1332U32 LLWindowMacOSX::getFSAASamples()
1333{
1334 return mFSAASamples;
1335}
1336
1337void LLWindowMacOSX::setFSAASamples(const U32 samples)
1338{
1339 mFSAASamples = samples;
1340 mForceRebuild = TRUE;
1341}
1342
1321BOOL LLWindowMacOSX::restoreGamma() 1343BOOL LLWindowMacOSX::restoreGamma()
1322{ 1344{
1323 CGDisplayRestoreColorSyncSettings(); 1345 CGDisplayRestoreColorSyncSettings();
@@ -2031,7 +2053,7 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
2031 { 2053 {
2032 for (LLWString::const_iterator i = fix_string.begin(); i != fix_string.end(); i++) 2054 for (LLWString::const_iterator i = fix_string.begin(); i != fix_string.end(); i++)
2033 { 2055 {
2034 mPreeditor->handleUnicodeCharHere(*i, FALSE); 2056 mPreeditor->handleUnicodeCharHere(*i);
2035 } 2057 }
2036 } 2058 }
2037 2059