#include "SDL_internal.h"
#if defined(SDL_VIDEO_DRIVER_RPI) && defined(SDL_VIDEO_OPENGL_EGL)
#include "SDL_rpivideo.h"
#include "SDL_rpiopengles.h"
void RPI_GLES_DefaultProfileConfig(SDL_VideoDevice *_this, int *mask, int *major, int *minor)
{
*mask = SDL_GL_CONTEXT_PROFILE_ES;
*major = 2;
*minor = 0;
}
bool RPI_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path)
{
return SDL_EGL_LoadLibrary(_this, path, EGL_DEFAULT_DISPLAY, 0);
}
bool RPI_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window)
{
SDL_WindowData *wdata = window->internal;
if (!(_this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, wdata->egl_surface))) {
SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "eglSwapBuffers failed.");
return true;
}
if (wdata->double_buffer) {
SDL_LockMutex(wdata->vsync_cond_mutex);
SDL_WaitCondition(wdata->vsync_cond, wdata->vsync_cond_mutex);
SDL_UnlockMutex(wdata->vsync_cond_mutex);
}
return true;
}
SDL_EGL_CreateContext_impl(RPI)
SDL_EGL_MakeCurrent_impl(RPI)
#endif