Fixed a bunch of SwapWindow calls that needed their return value updated
authorSam Lantinga <slouken@libsdl.org>
Fri, 09 Dec 2016 05:12:27 -0800
changeset 10695e54fce44f677
parent 10694 9834cdff44f9
child 10696 24c95c8f6a9a
Fixed a bunch of SwapWindow calls that needed their return value updated
src/video/android/SDL_androidgl.c
src/video/android/SDL_androidgl.h
src/video/emscripten/SDL_emscriptenopengles.h
src/video/nacl/SDL_naclopengles.c
src/video/nacl/SDL_naclopengles.h
src/video/psp/SDL_pspgl.c
src/video/raspberry/SDL_rpiopengles.h
src/video/raspberry/SDL_rpivideo.h
src/video/vivante/SDL_vivanteopengles.h
src/video/wayland/SDL_waylandopengles.c
src/video/wayland/SDL_waylandopengles.h
src/video/windows/SDL_windowsopengles.h
src/video/winrt/SDL_winrtopengles.h
     1.1 --- a/src/video/android/SDL_androidgl.c	Fri Dec 09 05:04:18 2016 -0800
     1.2 +++ b/src/video/android/SDL_androidgl.c	Fri Dec 09 05:12:27 2016 -0800
     1.3 @@ -39,7 +39,7 @@
     1.4  SDL_EGL_CreateContext_impl(Android)
     1.5  SDL_EGL_MakeCurrent_impl(Android)
     1.6  
     1.7 -void
     1.8 +int
     1.9  Android_GLES_SwapWindow(_THIS, SDL_Window * window)
    1.10  {
    1.11      /* The following two calls existed in the original Java code
    1.12 @@ -49,7 +49,7 @@
    1.13      
    1.14      /*_this->egl_data->eglWaitNative(EGL_CORE_NATIVE_ENGINE);
    1.15      _this->egl_data->eglWaitGL();*/
    1.16 -    SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
    1.17 +    return SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
    1.18  }
    1.19  
    1.20  int
     2.1 --- a/src/video/android/SDL_androidgl.h	Fri Dec 09 05:04:18 2016 -0800
     2.2 +++ b/src/video/android/SDL_androidgl.h	Fri Dec 09 05:12:27 2016 -0800
     2.3 @@ -25,7 +25,7 @@
     2.4  
     2.5  SDL_GLContext Android_GLES_CreateContext(_THIS, SDL_Window * window);
     2.6  int Android_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
     2.7 -void Android_GLES_SwapWindow(_THIS, SDL_Window * window);
     2.8 +int Android_GLES_SwapWindow(_THIS, SDL_Window * window);
     2.9  int Android_GLES_LoadLibrary(_THIS, const char *path);
    2.10  
    2.11  
     3.1 --- a/src/video/emscripten/SDL_emscriptenopengles.h	Fri Dec 09 05:04:18 2016 -0800
     3.2 +++ b/src/video/emscripten/SDL_emscriptenopengles.h	Fri Dec 09 05:12:27 2016 -0800
     3.3 @@ -38,7 +38,7 @@
     3.4  extern int Emscripten_GLES_LoadLibrary(_THIS, const char *path);
     3.5  extern void Emscripten_GLES_DeleteContext(_THIS, SDL_GLContext context);
     3.6  extern SDL_GLContext Emscripten_GLES_CreateContext(_THIS, SDL_Window * window);
     3.7 -extern void Emscripten_GLES_SwapWindow(_THIS, SDL_Window * window);
     3.8 +extern int Emscripten_GLES_SwapWindow(_THIS, SDL_Window * window);
     3.9  extern int Emscripten_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
    3.10  extern void Emscripten_GLES_GetDrawableSize(_THIS, SDL_Window * window, int * w, int * h);
    3.11  
     4.1 --- a/src/video/nacl/SDL_naclopengles.c	Fri Dec 09 05:04:18 2016 -0800
     4.2 +++ b/src/video/nacl/SDL_naclopengles.c	Fri Dec 09 05:12:27 2016 -0800
     4.3 @@ -151,12 +151,15 @@
     4.4      return 0;
     4.5  }
     4.6  
     4.7 -void
     4.8 +int
     4.9  NACL_GLES_SwapWindow(_THIS, SDL_Window * window)
    4.10  {
    4.11      SDL_VideoData *driverdata = (SDL_VideoData *) _this->driverdata;
    4.12      struct PP_CompletionCallback callback = { NULL, 0, PP_COMPLETIONCALLBACK_FLAG_NONE };
    4.13 -    driverdata->ppb_graphics->SwapBuffers((PP_Resource) SDL_GL_GetCurrentContext(), callback );
    4.14 +    if (driverdata->ppb_graphics->SwapBuffers((PP_Resource) SDL_GL_GetCurrentContext(), callback ) != PP_OK) {
    4.15 +        return SDL_SetError("SwapBuffers failed");
    4.16 +    }
    4.17 +    return 0;
    4.18  }
    4.19  
    4.20  void
     5.1 --- a/src/video/nacl/SDL_naclopengles.h	Fri Dec 09 05:04:18 2016 -0800
     5.2 +++ b/src/video/nacl/SDL_naclopengles.h	Fri Dec 09 05:12:27 2016 -0800
     5.3 @@ -30,7 +30,7 @@
     5.4  extern int NACL_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
     5.5  extern int NACL_GLES_SetSwapInterval(_THIS, int interval);
     5.6  extern int NACL_GLES_GetSwapInterval(_THIS);
     5.7 -extern void NACL_GLES_SwapWindow(_THIS, SDL_Window * window);
     5.8 +extern int NACL_GLES_SwapWindow(_THIS, SDL_Window * window);
     5.9  extern void NACL_GLES_DeleteContext(_THIS, SDL_GLContext context);
    5.10  
    5.11  #endif /* _SDL_naclgl_h */
     6.1 --- a/src/video/psp/SDL_pspgl.c	Fri Dec 09 05:04:18 2016 -0800
     6.2 +++ b/src/video/psp/SDL_pspgl.c	Fri Dec 09 05:12:27 2016 -0800
     6.3 @@ -177,7 +177,9 @@
     6.4  int
     6.5  PSP_GL_SwapWindow(_THIS, SDL_Window * window)
     6.6  {
     6.7 -    eglSwapBuffers(_this->gl_data->display, _this->gl_data->surface);
     6.8 +    if (!eglSwapBuffers(_this->gl_data->display, _this->gl_data->surface)) {
     6.9 +        return SDL_SetError("!eglSwapBuffers() failed");
    6.10 +    }
    6.11      return 0;
    6.12  }
    6.13  
     7.1 --- a/src/video/raspberry/SDL_rpiopengles.h	Fri Dec 09 05:04:18 2016 -0800
     7.2 +++ b/src/video/raspberry/SDL_rpiopengles.h	Fri Dec 09 05:12:27 2016 -0800
     7.3 @@ -38,7 +38,7 @@
     7.4  
     7.5  extern int RPI_GLES_LoadLibrary(_THIS, const char *path);
     7.6  extern SDL_GLContext RPI_GLES_CreateContext(_THIS, SDL_Window * window);
     7.7 -extern void RPI_GLES_SwapWindow(_THIS, SDL_Window * window);
     7.8 +extern int RPI_GLES_SwapWindow(_THIS, SDL_Window * window);
     7.9  extern int RPI_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
    7.10  
    7.11  #endif /* SDL_VIDEO_DRIVER_RPI && SDL_VIDEO_OPENGL_EGL */
     8.1 --- a/src/video/raspberry/SDL_rpivideo.h	Fri Dec 09 05:04:18 2016 -0800
     8.2 +++ b/src/video/raspberry/SDL_rpivideo.h	Fri Dec 09 05:12:27 2016 -0800
     8.3 @@ -90,7 +90,7 @@
     8.4  int RPI_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
     8.5  int RPI_GLES_SetSwapInterval(_THIS, int interval);
     8.6  int RPI_GLES_GetSwapInterval(_THIS);
     8.7 -void RPI_GLES_SwapWindow(_THIS, SDL_Window * window);
     8.8 +int RPI_GLES_SwapWindow(_THIS, SDL_Window * window);
     8.9  void RPI_GLES_DeleteContext(_THIS, SDL_GLContext context);
    8.10  
    8.11  #endif /* __SDL_RPIVIDEO_H__ */
     9.1 --- a/src/video/vivante/SDL_vivanteopengles.h	Fri Dec 09 05:04:18 2016 -0800
     9.2 +++ b/src/video/vivante/SDL_vivanteopengles.h	Fri Dec 09 05:12:27 2016 -0800
     9.3 @@ -38,7 +38,7 @@
     9.4  
     9.5  extern int VIVANTE_GLES_LoadLibrary(_THIS, const char *path);
     9.6  extern SDL_GLContext VIVANTE_GLES_CreateContext(_THIS, SDL_Window * window);
     9.7 -extern void VIVANTE_GLES_SwapWindow(_THIS, SDL_Window * window);
     9.8 +extern int VIVANTE_GLES_SwapWindow(_THIS, SDL_Window * window);
     9.9  extern int VIVANTE_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
    9.10  
    9.11  #endif /* SDL_VIDEO_DRIVER_VIVANTE && SDL_VIDEO_OPENGL_EGL */
    10.1 --- a/src/video/wayland/SDL_waylandopengles.c	Fri Dec 09 05:04:18 2016 -0800
    10.2 +++ b/src/video/wayland/SDL_waylandopengles.c	Fri Dec 09 05:12:27 2016 -0800
    10.3 @@ -54,14 +54,16 @@
    10.4      return context;
    10.5  }
    10.6  
    10.7 -void
    10.8 +int
    10.9  Wayland_GLES_SwapWindow(_THIS, SDL_Window *window)
   10.10  {
   10.11 -    SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
   10.12 +    if (SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface) < 0) {
   10.13 +        return -1;
   10.14 +    }
   10.15      WAYLAND_wl_display_flush( ((SDL_VideoData*)_this->driverdata)->display );
   10.16 +    return 0;
   10.17  }
   10.18  
   10.19 -
   10.20  int
   10.21  Wayland_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
   10.22  {
    11.1 --- a/src/video/wayland/SDL_waylandopengles.h	Fri Dec 09 05:04:18 2016 -0800
    11.2 +++ b/src/video/wayland/SDL_waylandopengles.h	Fri Dec 09 05:12:27 2016 -0800
    11.3 @@ -39,7 +39,7 @@
    11.4  
    11.5  extern int Wayland_GLES_LoadLibrary(_THIS, const char *path);
    11.6  extern SDL_GLContext Wayland_GLES_CreateContext(_THIS, SDL_Window * window);
    11.7 -extern void Wayland_GLES_SwapWindow(_THIS, SDL_Window * window);
    11.8 +extern int Wayland_GLES_SwapWindow(_THIS, SDL_Window * window);
    11.9  extern int Wayland_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
   11.10  extern void Wayland_GLES_DeleteContext(_THIS, SDL_GLContext context);
   11.11  
    12.1 --- a/src/video/windows/SDL_windowsopengles.h	Fri Dec 09 05:04:18 2016 -0800
    12.2 +++ b/src/video/windows/SDL_windowsopengles.h	Fri Dec 09 05:12:27 2016 -0800
    12.3 @@ -39,7 +39,7 @@
    12.4  
    12.5  extern int WIN_GLES_LoadLibrary(_THIS, const char *path);
    12.6  extern SDL_GLContext WIN_GLES_CreateContext(_THIS, SDL_Window * window);
    12.7 -extern void WIN_GLES_SwapWindow(_THIS, SDL_Window * window);
    12.8 +extern int WIN_GLES_SwapWindow(_THIS, SDL_Window * window);
    12.9  extern int WIN_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
   12.10  extern void WIN_GLES_DeleteContext(_THIS, SDL_GLContext context);
   12.11  extern int WIN_GLES_SetupWindow(_THIS, SDL_Window * window);
    13.1 --- a/src/video/winrt/SDL_winrtopengles.h	Fri Dec 09 05:04:18 2016 -0800
    13.2 +++ b/src/video/winrt/SDL_winrtopengles.h	Fri Dec 09 05:12:27 2016 -0800
    13.3 @@ -38,7 +38,7 @@
    13.4  extern int WINRT_GLES_LoadLibrary(_THIS, const char *path);
    13.5  extern void WINRT_GLES_UnloadLibrary(_THIS);
    13.6  extern SDL_GLContext WINRT_GLES_CreateContext(_THIS, SDL_Window * window);
    13.7 -extern void WINRT_GLES_SwapWindow(_THIS, SDL_Window * window);
    13.8 +extern int WINRT_GLES_SwapWindow(_THIS, SDL_Window * window);
    13.9  extern int WINRT_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
   13.10  
   13.11