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

Author Topic: [bug?] No antialiasing/multisampling in Linux X11 [solved]  (Read 3078 times)

0 Members and 1 Guest are viewing this topic.

buffle

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • http://www.cti.ecp.fr/~courbetc
[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 ?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
[bug?] No antialiasing/multisampling in Linux X11 [solved]
« Reply #1 on: January 20, 2009, 02:20:04 pm »
Thanks, I'll check that as soon as possible.

Quote
Is there a way to post a bug report on the bug tracker btw ?

Yes, but in fact I prefer this kind of report on the forum, so that we can discuss about it if necessary ;)
Laurent Gomila - SFML developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
[bug?] No antialiasing/multisampling in Linux X11 [solved]
« Reply #2 on: January 20, 2009, 06:39:54 pm »
It's fixed.
Laurent Gomila - SFML developer

buffle

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • http://www.cti.ecp.fr/~courbetc
[bug?] No antialiasing/multisampling in Linux X11 [solved]
« Reply #3 on: January 21, 2009, 10:16:23 am »
Thanks