Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

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.


Messages - buffle

Pages: [1]
1
Window / [bug?] No antialiasing/multisampling in Linux X11 [solved]
« on: January 21, 2009, 10:16:23 am »
Thanks

2
Window / [bug?] No antialiasing/multisampling in Linux X11 [solved]
« on: January 20, 2009, 01:34:20 pm »
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:

Code: [Select]

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

Code: [Select]

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 :

Code: [Select]

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 ?

Pages: [1]