SDL & OpenGL with multisampling

Hi all,

has anyone tried to get an OpenGL window with multisampling working on
linux? I’m running a Ubuntu 10.04 with a 2.6.32 generic kernel (64bit)
and Nvidia 280.13 driver on a GeForce GTX 560 Ti, and according to
glxinfo, the GLX_ARB_multisample is available.

However, when I add the following lines to my window creation code, the
call to SDL_CreateWindow returns a null pointer:

 SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
 SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4);

Actually, it already fails with only the first line present.

I’d appreciate any help on this.

Kind regards,

Matthias

Hi Matthias,
I use the exact same two lines of code in my game and I get a good
window with anti-aliasing. I’m running 32-bit Fedora 14 with an 8800
GTS and driver version 260.19.44. It also works on my 6600 GT. I
think your 560 should handle this just fine.

When I ask for 8 multisamples instead of 4, I don’t get a window. A
long-standing item on my to-do list is to make more robust multisample
choosing code. Maybe I would try to open windows starting at 8
multisamples and work my way down to 0 until I get a good window.

I’d also like to hear if you learn anything new about this stuff.–
Terry Welsh
mogumbo ‘at’ gmail.com
www.reallyslick.com

Message: 8
Date: Sun, 14 Aug 2011 20:26:33 +0200
From: Matthias Schweinoch <matthias.schweinoch at gmx.de>
To: sdl at lists.libsdl.org
Subject: [SDL] SDL & OpenGL with multisampling
Message-ID: <4E481359.6080506 at gmx.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi all,

has anyone tried to get an OpenGL window with multisampling working on
linux? I’m running a Ubuntu 10.04 with a 2.6.32 generic kernel (64bit)
and Nvidia 280.13 driver on a GeForce GTX 560 Ti, and according to
glxinfo, the GLX_ARB_multisample is available.

However, when I add the following lines to my window creation code, the
call to SDL_CreateWindow returns a null pointer:

? ? SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
? ? SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4);

Actually, it already fails with only the first line present.

I’d appreciate any help on this.

Kind regards,

? Matthias

Hi Terry,

I finally got multisampling working, and the culprit seems to have been
the following line in my window creation code:

SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1);

Setting this attribute leads to SDL internally passing the
GLX_VISUAL_CAVEAT_EXT attribute with the value GLX_NONE_EXT to GLX.
However, the GLX frame buffer configurations with multisampling are
marked as non-conformant on my machine (hardware/driver combination),
which leads to GLX not finding a supported frame buffer configuration,
and hence, no window.

Matthias> I use the exact same two lines of code in my game and I get a good

window with anti-aliasing. I’m running 32-bit Fedora 14 with an 8800
GTS and driver version 260.19.44. It also works on my 6600 GT. I
think your 560 should handle this just fine.

When I ask for 8 multisamples instead of 4, I don’t get a window. A
long-standing item on my to-do list is to make more robust multisample
choosing code. Maybe I would try to open windows starting at 8
multisamples and work my way down to 0 until I get a good window.

I’d also like to hear if you learn anything new about this stuff.

Terry Welsh
mogumbo ‘at’ gmail.com
www.reallyslick.com

Message: 8
Date: Sun, 14 Aug 2011 20:26:33 +0200
From: Matthias Schweinoch<@Matthias_Schweinoch>
To: sdl at lists.libsdl.org
Subject: [SDL] SDL& OpenGL with multisampling
Message-ID:<4E481359.6080506 at gmx.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi all,

has anyone tried to get an OpenGL window with multisampling working on
linux? I’m running a Ubuntu 10.04 with a 2.6.32 generic kernel (64bit)
and Nvidia 280.13 driver on a GeForce GTX 560 Ti, and according to
glxinfo, the GLX_ARB_multisample is available.

However, when I add the following lines to my window creation code, the
call to SDL_CreateWindow returns a null pointer:

? ? SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
? ? SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4);

Actually, it already fails with only the first line present.