[client] egl: query maximum multisample support for MSAA context

Based on @rLink234's work in 4ac781b4516678b6c59d9ecf4a61df64a01ec8c1

Fixes #128
This commit is contained in:
Geoffrey McRae 2019-05-23 16:56:13 +10:00
parent 78a6af8dae
commit d2d427b533
2 changed files with 12 additions and 3 deletions

View File

@ -1 +1 @@
a12-219-g3585e02993+1 a12-221-g40853e088f+1

View File

@ -21,6 +21,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#include "common/debug.h" #include "common/debug.h"
#include "common/option.h" #include "common/option.h"
#include "common/sysinfo.h"
#include "utils.h" #include "utils.h"
#include "dynamic/fonts.h" #include "dynamic/fonts.h"
@ -168,10 +169,18 @@ bool egl_initialize(void * opaque, Uint32 * sdlFlags)
{ {
*sdlFlags = SDL_WINDOW_OPENGL; *sdlFlags = SDL_WINDOW_OPENGL;
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER , 1); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER , 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS , 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES , 4);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
int maxSamples = sysinfo_gfx_max_multisample();
if (maxSamples > 1)
{
if (maxSamples > 4)
maxSamples = 4;
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, maxSamples);
}
return true; return true;
} }