vita: fix PVR_PSP2 (GLES) + gl4es4fita (GL)
parent
ec3234ea21
commit
3cb819ac48
|
@ -2460,6 +2460,7 @@ elseif(VITA)
|
||||||
list(APPEND SDL_EXTRA_LIBS
|
list(APPEND SDL_EXTRA_LIBS
|
||||||
libgpu_es4_ext_stub_weak
|
libgpu_es4_ext_stub_weak
|
||||||
libIMGEGL_stub_weak
|
libIMGEGL_stub_weak
|
||||||
|
SceIme_stub
|
||||||
)
|
)
|
||||||
|
|
||||||
set(HAVE_VIDEO_VITA_PVR ON)
|
set(HAVE_VIDEO_VITA_PVR ON)
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
#if !defined(_MSC_VER) && !defined(__ANDROID__) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS)
|
#if !defined(_MSC_VER) && !defined(__ANDROID__) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS)
|
||||||
|
|
||||||
#if defined(__vita__) || defined(__psp2__)
|
#if defined(__vita__) || defined(__psp2__)
|
||||||
|
#include <psp2/display.h>
|
||||||
|
#include <psp2/gxm.h>
|
||||||
#include <psp2/types.h>
|
#include <psp2/types.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,9 @@
|
||||||
#if SDL_VIDEO_DRIVER_RPI
|
#if SDL_VIDEO_DRIVER_RPI
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
#if SDL_VIDEO_VITA_PVR_OGL
|
||||||
|
#include <GLES2/gl2.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "SDL_sysvideo.h"
|
#include "SDL_sysvideo.h"
|
||||||
#include "SDL_egl_c.h"
|
#include "SDL_egl_c.h"
|
||||||
|
|
|
@ -34,10 +34,10 @@
|
||||||
#define MAX_PATH 256 // vita limits are somehow wrong
|
#define MAX_PATH 256 // vita limits are somehow wrong
|
||||||
|
|
||||||
/* Defaults */
|
/* Defaults */
|
||||||
int FB_WIDTH = 960;
|
static int FB_WIDTH = 960;
|
||||||
int FB_HEIGHT = 544;
|
static int FB_HEIGHT = 544;
|
||||||
|
|
||||||
void getFBSize(int *width, int *height)
|
static void getFBSize(int *width, int *height)
|
||||||
{
|
{
|
||||||
*width = FB_WIDTH;
|
*width = FB_WIDTH;
|
||||||
*height = FB_HEIGHT;
|
*height = FB_HEIGHT;
|
||||||
|
@ -51,7 +51,7 @@ int VITA_GL_LoadLibrary(_THIS, const char *path)
|
||||||
char *default_path = "app0:module";
|
char *default_path = "app0:module";
|
||||||
char target_path[MAX_PATH];
|
char target_path[MAX_PATH];
|
||||||
|
|
||||||
if (skip_init == NULL) // we don't care about actual value {
|
if (skip_init == NULL) { // we don't care about actual value
|
||||||
if (override != NULL) {
|
if (override != NULL) {
|
||||||
default_path = override;
|
default_path = override;
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ VITA_GL_CreateContext(_THIS, SDL_Window *window)
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
SDL_FunctionPointer
|
||||||
VITA_GL_GetProcAddress(_THIS, const char *proc)
|
VITA_GL_GetProcAddress(_THIS, const char *proc)
|
||||||
{
|
{
|
||||||
return gl4es_GetProcAddress(proc);
|
return gl4es_GetProcAddress(proc);
|
||||||
|
|
|
@ -177,9 +177,10 @@ int VITA_GLES_SetSwapInterval(_THIS, int interval)
|
||||||
return SDL_SetError("Unable to set the EGL swap interval");
|
return SDL_SetError("Unable to set the EGL swap interval");
|
||||||
}
|
}
|
||||||
|
|
||||||
int VITA_GLES_GetSwapInterval(_THIS)
|
int VITA_GLES_GetSwapInterval(_THIS, int *interval)
|
||||||
{
|
{
|
||||||
return _this->gl_data->swapinterval;
|
*interval = _this->gl_data->swapinterval;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int VITA_GLES_SwapWindow(_THIS, SDL_Window *window)
|
int VITA_GLES_SwapWindow(_THIS, SDL_Window *window)
|
||||||
|
|
|
@ -48,6 +48,6 @@ extern SDL_GLContext VITA_GLES_CreateContext(_THIS, SDL_Window *window);
|
||||||
extern int VITA_GLES_LoadLibrary(_THIS, const char *path);
|
extern int VITA_GLES_LoadLibrary(_THIS, const char *path);
|
||||||
extern void VITA_GLES_UnloadLibrary(_THIS);
|
extern void VITA_GLES_UnloadLibrary(_THIS);
|
||||||
extern int VITA_GLES_SetSwapInterval(_THIS, int interval);
|
extern int VITA_GLES_SetSwapInterval(_THIS, int interval);
|
||||||
extern int VITA_GLES_GetSwapInterval(_THIS);
|
extern int VITA_GLES_GetSwapInterval(_THIS, int *interval);
|
||||||
|
|
||||||
#endif /* SDL_vitagles_c_h_ */
|
#endif /* SDL_vitagles_c_h_ */
|
||||||
|
|
|
@ -97,7 +97,7 @@ void VITA_GLES_UnloadLibrary(_THIS);
|
||||||
SDL_GLContext VITA_GLES_CreateContext(_THIS, SDL_Window *window);
|
SDL_GLContext VITA_GLES_CreateContext(_THIS, SDL_Window *window);
|
||||||
int VITA_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context);
|
int VITA_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context);
|
||||||
int VITA_GLES_SetSwapInterval(_THIS, int interval);
|
int VITA_GLES_SetSwapInterval(_THIS, int interval);
|
||||||
int VITA_GLES_GetSwapInterval(_THIS);
|
int VITA_GLES_GetSwapInterval(_THIS, int *interval);
|
||||||
int VITA_GLES_SwapWindow(_THIS, SDL_Window *window);
|
int VITA_GLES_SwapWindow(_THIS, SDL_Window *window);
|
||||||
void VITA_GLES_DeleteContext(_THIS, SDL_GLContext context);
|
void VITA_GLES_DeleteContext(_THIS, SDL_GLContext context);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue