mirror of https://github.com/encounter/SDL.git
kmsdrm: Implement GL_DefaultProfileConfig for Raspberry Pi compatibility.
If we think this might be a Raspberry Pi device, default to ES2. Otherwise, accept SDL's higher-level defaults.
This commit is contained in:
parent
092162ede7
commit
224aa45b59
|
@ -34,6 +34,19 @@
|
||||||
|
|
||||||
/* EGL implementation of SDL OpenGL support */
|
/* EGL implementation of SDL OpenGL support */
|
||||||
|
|
||||||
|
void
|
||||||
|
KMSDRM_GLES_DefaultProfileConfig(_THIS, int *mask, int *major, int *minor)
|
||||||
|
{
|
||||||
|
/* if SDL was _also_ built with the Raspberry Pi driver (so we're
|
||||||
|
definitely a Pi device), default to GLES2. */
|
||||||
|
#if SDL_VIDEO_DRIVER_RPI
|
||||||
|
*mask = SDL_GL_CONTEXT_PROFILE_ES;
|
||||||
|
*major = 2;
|
||||||
|
*minor = 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
KMSDRM_GLES_LoadLibrary(_THIS, const char *path) {
|
KMSDRM_GLES_LoadLibrary(_THIS, const char *path) {
|
||||||
NativeDisplayType display = (NativeDisplayType)((SDL_VideoData *)_this->driverdata)->gbm_dev;
|
NativeDisplayType display = (NativeDisplayType)((SDL_VideoData *)_this->driverdata)->gbm_dev;
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
#define KMSDRM_GLES_DeleteContext SDL_EGL_DeleteContext
|
#define KMSDRM_GLES_DeleteContext SDL_EGL_DeleteContext
|
||||||
#define KMSDRM_GLES_GetSwapInterval SDL_EGL_GetSwapInterval
|
#define KMSDRM_GLES_GetSwapInterval SDL_EGL_GetSwapInterval
|
||||||
|
|
||||||
|
extern void KMSDRM_GLES_DefaultProfileConfig(_THIS, int *mask, int *major, int *minor);
|
||||||
extern int KMSDRM_GLES_SetSwapInterval(_THIS, int interval);
|
extern int KMSDRM_GLES_SetSwapInterval(_THIS, int interval);
|
||||||
extern int KMSDRM_GLES_LoadLibrary(_THIS, const char *path);
|
extern int KMSDRM_GLES_LoadLibrary(_THIS, const char *path);
|
||||||
extern SDL_GLContext KMSDRM_GLES_CreateContext(_THIS, SDL_Window * window);
|
extern SDL_GLContext KMSDRM_GLES_CreateContext(_THIS, SDL_Window * window);
|
||||||
|
|
|
@ -784,6 +784,7 @@ KMSDRM_CreateDevice(int devindex)
|
||||||
device->DestroyWindow = KMSDRM_DestroyWindow;
|
device->DestroyWindow = KMSDRM_DestroyWindow;
|
||||||
device->GetWindowWMInfo = KMSDRM_GetWindowWMInfo;
|
device->GetWindowWMInfo = KMSDRM_GetWindowWMInfo;
|
||||||
#if SDL_VIDEO_OPENGL_EGL
|
#if SDL_VIDEO_OPENGL_EGL
|
||||||
|
device->GL_DefaultProfileConfig = KMSDRM_GLES_DefaultProfileConfig;
|
||||||
device->GL_LoadLibrary = KMSDRM_GLES_LoadLibrary;
|
device->GL_LoadLibrary = KMSDRM_GLES_LoadLibrary;
|
||||||
device->GL_GetProcAddress = KMSDRM_GLES_GetProcAddress;
|
device->GL_GetProcAddress = KMSDRM_GLES_GetProcAddress;
|
||||||
device->GL_UnloadLibrary = KMSDRM_GLES_UnloadLibrary;
|
device->GL_UnloadLibrary = KMSDRM_GLES_UnloadLibrary;
|
||||||
|
|
Loading…
Reference in New Issue