Vita: PVROGL: fix indentation and ifdef guards

main
Ivan Epifanov 2022-03-31 12:35:17 +03:00 committed by Sam Lantinga
parent b5700ab31e
commit 95c0fec518
3 changed files with 13 additions and 9 deletions

View File

@ -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) {

View File

@ -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 */

View File

@ -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;