Commit 95c0fec5189537b323bde670c1a37cb0892ec142

Ivan Epifanov 2022-03-31T12:35:17

Vita: PVROGL: fix indentation and ifdef guards

diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c
index 89d2124..e7c5169 100644
--- a/src/render/opengl/SDL_render_gl.c
+++ b/src/render/opengl/SDL_render_gl.c
@@ -30,7 +30,7 @@
 #include <OpenGL/OpenGL.h>
 #endif
 
-#ifdef __psp2__
+#ifdef SDL_VIDEO_VITA_PVR_OGL
 #include <GL/gl.h>
 #include <GL/glext.h>
 #endif
@@ -1738,7 +1738,7 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags)
     SDL_GL_GetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, &major);
     SDL_GL_GetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, &minor);
 
-#ifndef __psp2__
+#ifndef SDL_VIDEO_VITA_PVR_OGL
     window_flags = SDL_GetWindowFlags(window);
     if (!(window_flags & SDL_WINDOW_OPENGL) ||
         profile_mask == SDL_GL_CONTEXT_PROFILE_ES || major != RENDERER_CONTEXT_MAJOR || minor != RENDERER_CONTEXT_MINOR) {
diff --git a/src/video/vita/SDL_vitagl_pvr.c b/src/video/vita/SDL_vitagl_pvr.c
index 3d5f600..d51150c 100644
--- a/src/video/vita/SDL_vitagl_pvr.c
+++ b/src/video/vita/SDL_vitagl_pvr.c
@@ -94,9 +94,9 @@ VITA_GL_CreateContext(_THIS, SDL_Window * window)
     int temp_minor = _this->gl_config.minor_version;
     int temp_profile = _this->gl_config.profile_mask;
 
-    /* Set version to 2.1 and PROFILE to ES */
+    /* Set version to 2.0 and PROFILE to ES */
     _this->gl_config.major_version = 2;
-    _this->gl_config.minor_version = 1;
+    _this->gl_config.minor_version = 0;
     _this->gl_config.profile_mask = SDL_GL_CONTEXT_PROFILE_ES;
 
     context = SDL_EGL_CreateContext(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
@@ -106,11 +106,11 @@ VITA_GL_CreateContext(_THIS, SDL_Window * window)
         FB_WIDTH = window->w;
         FB_HEIGHT = window->h;
         set_getprocaddress((void *(*)(const char *))eglGetProcAddress);
-	set_getmainfbsize(getFBSize);
+        set_getmainfbsize(getFBSize);
         SDL_snprintf(gl_version, 3, "%d%d", temp_major, temp_minor);
         gl4es_setenv("LIBGL_NOTEXRECT", "1", 1); /* Currently broken in driver */
-	gl4es_setenv("LIBGL_GL", gl_version, 1);
-	initialize_gl4es();
+        gl4es_setenv("LIBGL_GL", gl_version, 1);
+        initialize_gl4es();
     }
 
     /* Restore gl_config */
diff --git a/src/video/vita/SDL_vitavideo.c b/src/video/vita/SDL_vitavideo.c
index 0a7e5d4..60bd18f 100644
--- a/src/video/vita/SDL_vitavideo.c
+++ b/src/video/vita/SDL_vitavideo.c
@@ -142,16 +142,20 @@ VITA_Create()
 */
 
 #if defined(SDL_VIDEO_VITA_PIB) || defined(SDL_VIDEO_VITA_PVR)
+#if defined(SDL_VIDEO_VITA_PVR_OGL)
 if(SDL_getenv("VITA_PVR_OGL") != NULL) {
     device->GL_LoadLibrary = VITA_GL_LoadLibrary;
     device->GL_CreateContext = VITA_GL_CreateContext;
     device->GL_GetProcAddress = VITA_GL_GetProcAddress;
-}
-else {
+} else {
+#endif
     device->GL_LoadLibrary = VITA_GLES_LoadLibrary;
     device->GL_CreateContext = VITA_GLES_CreateContext;
     device->GL_GetProcAddress = VITA_GLES_GetProcAddress;
+#if defined(SDL_VIDEO_VITA_PVR_OGL)
 }
+#endif
+
     device->GL_UnloadLibrary = VITA_GLES_UnloadLibrary;
     device->GL_MakeCurrent = VITA_GLES_MakeCurrent;
     device->GL_SetSwapInterval = VITA_GLES_SetSwapInterval;