diff -r 995f6cd966a7 src/video/SDL_egl.c --- a/src/video/SDL_egl.c Tue Jul 08 00:42:14 2014 -0700 +++ b/src/video/SDL_egl.c Tue Jul 08 20:45:52 2014 +0200 @@ -291,7 +291,7 @@ EGLint found_configs = 0, value; /* 128 seems even nicer here */ EGLConfig configs[128]; - int i, j, best_bitdiff = -1, bitdiff; + int i, j, bitdiff; if (!_this->egl_data) { /* The EGL library wasn't loaded, SDL_GetError() should have info */ @@ -381,15 +381,13 @@ } } - if (bitdiff < best_bitdiff || best_bitdiff == -1) { + if (bitdiff == 0) { _this->egl_data->egl_config = configs[i]; - - best_bitdiff = bitdiff; + return 0; } - - if (bitdiff == 0) break; /* we found an exact match! */ } + _this->egl_data->egl_config = configs[0]; return 0; }