From e02e582db89dd384fdb47ac96857bb1940476974 Mon Sep 17 00:00:00 2001
From: Manuel Alfayate Corchete <redwindwanderer@gmail.com>
Date: Wed, 10 Jul 2019 06:35:21 +0200
Subject: [PATCH] Fix building for SDL2 in GLES mode, and fix black screen on
 GLES mode. (#195)

---
 src/gapi/gl.h              | 2 +-
 src/platform/sdl2/main.cpp | 4 ----
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/gapi/gl.h b/src/gapi/gl.h
index 2a78fcd..6c34e94 100644
--- a/src/gapi/gl.h
+++ b/src/gapi/gl.h
@@ -857,7 +857,7 @@ namespace GAPI {
             glGenerateMipmap(target);
             if ((opt & (OPT_VOLUME | OPT_CUBEMAP | OPT_NEAREST)) == 0 && (Core::support.maxAniso > 0)) {
                 glTexParameteri(target, GL_TEXTURE_MAX_ANISOTROPY_EXT, min(int(Core::support.maxAniso), 8));
-            #if !defined(_OS_RPI) && !defined(_OS_CLOVER) && !defined(_GAPI_GLES2) // TODO
+            #if !defined(_OS_RPI) && !defined(_OS_CLOVER) && !(defined (__SDL2__) && defined (_GAPI_GLES))// TODO
                 glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, 3);
             #endif
             }
diff --git a/src/platform/sdl2/main.cpp b/src/platform/sdl2/main.cpp
index 424bd5a..9a098c0 100644
--- a/src/platform/sdl2/main.cpp
+++ b/src/platform/sdl2/main.cpp
@@ -439,10 +439,6 @@ int main(int argc, char **argv) {
 
     SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
     SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
-    SDL_GL_SetAttribute(SDL_GL_RED_SIZE,   8);
-    SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
-    SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE,  8);
-    SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
     SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
     SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);