I'm using SDL 2 for an OpenGL based application and I'm currently implementing anti-aliasing with code like this:

```
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, samples);

```

But I don't want to hardcode the antialising level so I want to let the user choose the value from a list of valid values. The problem is I have no idea how to find out which values are supported on the users machine. On my gaming machine I can choose a maximum value of 16 but on my laptop I can only choose 4. Any higher setting triggers the error message `Couldn't find matching GLX visual`.

So how can I find out what maximum value I can use for the `SDL_GL_MULTISAMPLESAMPLES` attribute?