summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowwin32.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2011-08-31 14:35:41 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2011-08-31 14:35:41 -0400
commit822d521e46d70359985e4d6e8ccb34766492a980 (patch)
tree4f9aefc823d6e6840cf6ec55561a502261c4ca93 /indra/llwindow/llwindowwin32.cpp
parente58d50e509d060320174c80af647da6ff9a3839f (diff)
parent5e5869c63a05e3d773fc4d19deaff171efa5014c (diff)
merge
Diffstat (limited to 'indra/llwindow/llwindowwin32.cpp')
-rw-r--r--indra/llwindow/llwindowwin32.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 551d487cc8..121c7880df 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -1172,8 +1172,39 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
// First we try and get a 32 bit depth pixel format
BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, NULL, 256, pixel_formats, &num_formats);
+
+ while(!result && mFSAASamples > 0)
+ {
+ llwarns << "FSAASamples: " << mFSAASamples << " not supported." << llendl ;
+
+ mFSAASamples /= 2 ; //try to decrease sample pixel number until to disable anti-aliasing
+ if(mFSAASamples < 2)
+ {
+ mFSAASamples = 0 ;
+ }
+
+ if (mFSAASamples > 0)
+ {
+ attrib_list[end_attrib + 3] = mFSAASamples;
+ }
+ else
+ {
+ cur_attrib = end_attrib ;
+ end_attrib = 0 ;
+ attrib_list[cur_attrib++] = 0 ; //end
+ }
+ result = wglChoosePixelFormatARB(mhDC, attrib_list, NULL, 256, pixel_formats, &num_formats);
+
+ if(result)
+ {
+ llwarns << "Only support FSAASamples: " << mFSAASamples << llendl ;
+ }
+ }
+
if (!result)
{
+ llwarns << "mFSAASamples: " << mFSAASamples << llendl ;
+
close();
show_window_creation_error("Error after wglChoosePixelFormatARB 32-bit");
return FALSE;
@@ -2865,6 +2896,7 @@ BOOL LLWindowWin32::resetDisplayResolution()
void LLWindowWin32::swapBuffers()
{
+ glFinish();
SwapBuffers(mhDC);
}