Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed a bunch of SwapWindow calls that needed their return value updated
  • Loading branch information
slouken committed Dec 9, 2016
1 parent 7a39681 commit 97d05b0
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/video/android/SDL_androidgl.c
Expand Up @@ -39,7 +39,7 @@
SDL_EGL_CreateContext_impl(Android)
SDL_EGL_MakeCurrent_impl(Android)

void
int
Android_GLES_SwapWindow(_THIS, SDL_Window * window)
{
/* The following two calls existed in the original Java code
Expand All @@ -49,7 +49,7 @@ Android_GLES_SwapWindow(_THIS, SDL_Window * window)

/*_this->egl_data->eglWaitNative(EGL_CORE_NATIVE_ENGINE);
_this->egl_data->eglWaitGL();*/
SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
return SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
}

int
Expand Down
2 changes: 1 addition & 1 deletion src/video/android/SDL_androidgl.h
Expand Up @@ -25,7 +25,7 @@

SDL_GLContext Android_GLES_CreateContext(_THIS, SDL_Window * window);
int Android_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
void Android_GLES_SwapWindow(_THIS, SDL_Window * window);
int Android_GLES_SwapWindow(_THIS, SDL_Window * window);
int Android_GLES_LoadLibrary(_THIS, const char *path);


Expand Down
2 changes: 1 addition & 1 deletion src/video/emscripten/SDL_emscriptenopengles.h
Expand Up @@ -38,7 +38,7 @@
extern int Emscripten_GLES_LoadLibrary(_THIS, const char *path);
extern void Emscripten_GLES_DeleteContext(_THIS, SDL_GLContext context);
extern SDL_GLContext Emscripten_GLES_CreateContext(_THIS, SDL_Window * window);
extern void Emscripten_GLES_SwapWindow(_THIS, SDL_Window * window);
extern int Emscripten_GLES_SwapWindow(_THIS, SDL_Window * window);
extern int Emscripten_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
extern void Emscripten_GLES_GetDrawableSize(_THIS, SDL_Window * window, int * w, int * h);

Expand Down
7 changes: 5 additions & 2 deletions src/video/nacl/SDL_naclopengles.c
Expand Up @@ -151,12 +151,15 @@ NACL_GLES_GetSwapInterval(_THIS)
return 0;
}

void
int
NACL_GLES_SwapWindow(_THIS, SDL_Window * window)
{
SDL_VideoData *driverdata = (SDL_VideoData *) _this->driverdata;
struct PP_CompletionCallback callback = { NULL, 0, PP_COMPLETIONCALLBACK_FLAG_NONE };
driverdata->ppb_graphics->SwapBuffers((PP_Resource) SDL_GL_GetCurrentContext(), callback );
if (driverdata->ppb_graphics->SwapBuffers((PP_Resource) SDL_GL_GetCurrentContext(), callback ) != PP_OK) {
return SDL_SetError("SwapBuffers failed");
}
return 0;
}

void
Expand Down
2 changes: 1 addition & 1 deletion src/video/nacl/SDL_naclopengles.h
Expand Up @@ -30,7 +30,7 @@ extern SDL_GLContext NACL_GLES_CreateContext(_THIS, SDL_Window * window);
extern int NACL_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
extern int NACL_GLES_SetSwapInterval(_THIS, int interval);
extern int NACL_GLES_GetSwapInterval(_THIS);
extern void NACL_GLES_SwapWindow(_THIS, SDL_Window * window);
extern int NACL_GLES_SwapWindow(_THIS, SDL_Window * window);
extern void NACL_GLES_DeleteContext(_THIS, SDL_GLContext context);

#endif /* _SDL_naclgl_h */
Expand Down
4 changes: 3 additions & 1 deletion src/video/psp/SDL_pspgl.c
Expand Up @@ -177,7 +177,9 @@ PSP_GL_GetSwapInterval(_THIS)
int
PSP_GL_SwapWindow(_THIS, SDL_Window * window)
{
eglSwapBuffers(_this->gl_data->display, _this->gl_data->surface);
if (!eglSwapBuffers(_this->gl_data->display, _this->gl_data->surface)) {
return SDL_SetError("!eglSwapBuffers() failed");
}
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/video/raspberry/SDL_rpiopengles.h
Expand Up @@ -38,7 +38,7 @@

extern int RPI_GLES_LoadLibrary(_THIS, const char *path);
extern SDL_GLContext RPI_GLES_CreateContext(_THIS, SDL_Window * window);
extern void RPI_GLES_SwapWindow(_THIS, SDL_Window * window);
extern int RPI_GLES_SwapWindow(_THIS, SDL_Window * window);
extern int RPI_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);

#endif /* SDL_VIDEO_DRIVER_RPI && SDL_VIDEO_OPENGL_EGL */
Expand Down
2 changes: 1 addition & 1 deletion src/video/raspberry/SDL_rpivideo.h
Expand Up @@ -90,7 +90,7 @@ SDL_GLContext RPI_GLES_CreateContext(_THIS, SDL_Window * window);
int RPI_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
int RPI_GLES_SetSwapInterval(_THIS, int interval);
int RPI_GLES_GetSwapInterval(_THIS);
void RPI_GLES_SwapWindow(_THIS, SDL_Window * window);
int RPI_GLES_SwapWindow(_THIS, SDL_Window * window);
void RPI_GLES_DeleteContext(_THIS, SDL_GLContext context);

#endif /* __SDL_RPIVIDEO_H__ */
Expand Down
2 changes: 1 addition & 1 deletion src/video/vivante/SDL_vivanteopengles.h
Expand Up @@ -38,7 +38,7 @@

extern int VIVANTE_GLES_LoadLibrary(_THIS, const char *path);
extern SDL_GLContext VIVANTE_GLES_CreateContext(_THIS, SDL_Window * window);
extern void VIVANTE_GLES_SwapWindow(_THIS, SDL_Window * window);
extern int VIVANTE_GLES_SwapWindow(_THIS, SDL_Window * window);
extern int VIVANTE_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);

#endif /* SDL_VIDEO_DRIVER_VIVANTE && SDL_VIDEO_OPENGL_EGL */
Expand Down
8 changes: 5 additions & 3 deletions src/video/wayland/SDL_waylandopengles.c
Expand Up @@ -54,14 +54,16 @@ Wayland_GLES_CreateContext(_THIS, SDL_Window * window)
return context;
}

void
int
Wayland_GLES_SwapWindow(_THIS, SDL_Window *window)
{
SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
if (SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface) < 0) {
return -1;
}
WAYLAND_wl_display_flush( ((SDL_VideoData*)_this->driverdata)->display );
return 0;
}


int
Wayland_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
{
Expand Down
2 changes: 1 addition & 1 deletion src/video/wayland/SDL_waylandopengles.h
Expand Up @@ -39,7 +39,7 @@ typedef struct SDL_PrivateGLESData

extern int Wayland_GLES_LoadLibrary(_THIS, const char *path);
extern SDL_GLContext Wayland_GLES_CreateContext(_THIS, SDL_Window * window);
extern void Wayland_GLES_SwapWindow(_THIS, SDL_Window * window);
extern int Wayland_GLES_SwapWindow(_THIS, SDL_Window * window);
extern int Wayland_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
extern void Wayland_GLES_DeleteContext(_THIS, SDL_GLContext context);

Expand Down
2 changes: 1 addition & 1 deletion src/video/windows/SDL_windowsopengles.h
Expand Up @@ -39,7 +39,7 @@ extern int WIN_GLES_SetSwapInterval(_THIS, int interval);

extern int WIN_GLES_LoadLibrary(_THIS, const char *path);
extern SDL_GLContext WIN_GLES_CreateContext(_THIS, SDL_Window * window);
extern void WIN_GLES_SwapWindow(_THIS, SDL_Window * window);
extern int WIN_GLES_SwapWindow(_THIS, SDL_Window * window);
extern int WIN_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
extern void WIN_GLES_DeleteContext(_THIS, SDL_GLContext context);
extern int WIN_GLES_SetupWindow(_THIS, SDL_Window * window);
Expand Down
2 changes: 1 addition & 1 deletion src/video/winrt/SDL_winrtopengles.h
Expand Up @@ -38,7 +38,7 @@
extern int WINRT_GLES_LoadLibrary(_THIS, const char *path);
extern void WINRT_GLES_UnloadLibrary(_THIS);
extern SDL_GLContext WINRT_GLES_CreateContext(_THIS, SDL_Window * window);
extern void WINRT_GLES_SwapWindow(_THIS, SDL_Window * window);
extern int WINRT_GLES_SwapWindow(_THIS, SDL_Window * window);
extern int WINRT_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);


Expand Down

0 comments on commit 97d05b0

Please sign in to comment.