Hi,
It seems that there is a bug in the video mode selection for Linux/X11 that prevents antialiasing from working on certain setups in SFML 1.4.
Here is the incriminated code from Window/Linux/WindowImplX11.cpp:
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]
}
}
It seems to me that
if (Score < BestScore)
{
BestScore = Score;
BestVisual = &Visuals[i];
break;
}
breaks as soon as ONE mode is found (which does not have AA), not the BEST mode available, so the code should be :
if (Score < BestScore)
{
BestScore = Score;
BestVisual = &Visuals[i];
}
I tried it myself, now AA works.
Is there a way to post a bug report on the bug tracker btw ?