1
Window / [bug?] No antialiasing/multisampling in Linux X11 [solved]
« on: January 21, 2009, 10:16:23 am »
Thanks
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
in WindowImplX11::CreateContext(const VideoMode& Mode, XVisualInfo& ChosenVisual, WindowSettings& Params, XVisualInfo Template, unsigned long Mask)
{
// [SNIP]
// Find the best visual
int BestScore = 0xFFFF;
XVisualInfo* BestVisual = NULL;
while (!BestVisual)
{
for (int i = 0; i < NbVisuals; ++i)
{
// Get the current visual attributes
int RGBA, DoubleBuffer, Red, Green, Blue, Alpha, Depth, Stencil, MultiSampling, Samples;
glXGetConfig(ourDisplay, &Visuals[i], GLX_RGBA, &RGBA);
//[more glXGet... calls]
glXGetConfig(ourDisplay, &Visuals[i], GLX_SAMPLES_ARB, &Samples);
//[snip]
// Evaluate the current configuration
int Color = Red + Green + Blue + Alpha;
int Score = EvaluateConfig(Mode, Params, Color, Depth, Stencil, MultiSampling ? Samples : 0);
// Keep it if it's better than the current best
if (Score < BestScore)
{
BestScore = Score;
BestVisual = &Visuals[i];
break;
}
}
//[Some code to get a visual when no best visual has been found]
}
}
if (Score < BestScore)
{
BestScore = Score;
BestVisual = &Visuals[i];
break;
}
if (Score < BestScore)
{
BestScore = Score;
BestVisual = &Visuals[i];
}