src/video/pandora/SDL_pandora.c
changeset 7037 3fedf1f25b94
parent 6885 700f1b25f77f
child 7191 75360622e65f
     1.1 --- a/src/video/pandora/SDL_pandora.c	Fri Mar 29 21:29:57 2013 -0400
     1.2 +++ b/src/video/pandora/SDL_pandora.c	Sun Mar 31 12:48:50 2013 -0400
     1.3 @@ -211,8 +211,7 @@
     1.4      /* Allocate window internal data */
     1.5      wdata = (SDL_WindowData *) SDL_calloc(1, sizeof(SDL_WindowData));
     1.6      if (wdata == NULL) {
     1.7 -        SDL_OutOfMemory();
     1.8 -        return -1;
     1.9 +        return SDL_OutOfMemory();
    1.10      }
    1.11  
    1.12      /* Setup driver data for this window */
    1.13 @@ -230,14 +229,12 @@
    1.14          if (phdata->egl_display == EGL_NO_DISPLAY) {
    1.15              phdata->egl_display = eglGetDisplay((NativeDisplayType) 0);
    1.16              if (phdata->egl_display == EGL_NO_DISPLAY) {
    1.17 -                SDL_SetError("PND: Can't get connection to OpenGL ES");
    1.18 -                return -1;
    1.19 +                return SDL_SetError("PND: Can't get connection to OpenGL ES");
    1.20              }
    1.21  
    1.22              initstatus = eglInitialize(phdata->egl_display, NULL, NULL);
    1.23              if (initstatus != EGL_TRUE) {
    1.24 -                SDL_SetError("PND: Can't init OpenGL ES library");
    1.25 -                return -1;
    1.26 +                return SDL_SetError("PND: Can't init OpenGL ES library");
    1.27              }
    1.28          }
    1.29  
    1.30 @@ -356,8 +353,7 @@
    1.31      _this->gl_config.dll_handle = SDL_LoadObject(path);
    1.32      if (!_this->gl_config.dll_handle) {
    1.33          /* Failed to load new GL ES library */
    1.34 -        SDL_SetError("PND: Failed to locate OpenGL ES library");
    1.35 -        return -1;
    1.36 +        return SDL_SetError("PND: Failed to locate OpenGL ES library");
    1.37      }
    1.38  
    1.39      /* Store OpenGL ES library path and name */
    1.40 @@ -726,8 +722,7 @@
    1.41      EGLBoolean status;
    1.42  
    1.43      if (phdata->egl_initialized != SDL_TRUE) {
    1.44 -        SDL_SetError("PND: GF initialization failed, no OpenGL ES support");
    1.45 -        return -1;
    1.46 +        return SDL_SetError("PND: GF initialization failed, no OpenGL ES support");
    1.47      }
    1.48  
    1.49      if ((window == NULL) && (context == NULL)) {
    1.50 @@ -736,33 +731,28 @@
    1.51                             EGL_NO_SURFACE, EGL_NO_CONTEXT);
    1.52          if (status != EGL_TRUE) {
    1.53              /* Failed to set current GL ES context */
    1.54 -            SDL_SetError("PND: Can't set OpenGL ES context");
    1.55 -            return -1;
    1.56 +            return SDL_SetError("PND: Can't set OpenGL ES context");
    1.57          }
    1.58      } else {
    1.59          wdata = (SDL_WindowData *) window->driverdata;
    1.60          if (wdata->gles_surface == EGL_NO_SURFACE) {
    1.61 -            SDL_SetError
    1.62 +            return SDL_SetError
    1.63                  ("PND: OpenGL ES surface is not initialized for this window");
    1.64 -            return -1;
    1.65          }
    1.66          if (wdata->gles_context == EGL_NO_CONTEXT) {
    1.67 -            SDL_SetError
    1.68 +            return SDL_SetError
    1.69                  ("PND: OpenGL ES context is not initialized for this window");
    1.70 -            return -1;
    1.71          }
    1.72          if (wdata->gles_context != context) {
    1.73 -            SDL_SetError
    1.74 +            return SDL_SetError
    1.75                  ("PND: OpenGL ES context is not belong to this window");
    1.76 -            return -1;
    1.77          }
    1.78          status =
    1.79              eglMakeCurrent(phdata->egl_display, wdata->gles_surface,
    1.80                             wdata->gles_surface, wdata->gles_context);
    1.81          if (status != EGL_TRUE) {
    1.82              /* Failed to set current GL ES context */
    1.83 -            SDL_SetError("PND: Can't set OpenGL ES context");
    1.84 -            return -1;
    1.85 +            return SDL_SetError("PND: Can't set OpenGL ES context");
    1.86          }
    1.87      }
    1.88      return 0;
    1.89 @@ -775,8 +765,7 @@
    1.90      EGLBoolean status;
    1.91  
    1.92      if (phdata->egl_initialized != SDL_TRUE) {
    1.93 -        SDL_SetError("PND: EGL initialization failed, no OpenGL ES support");
    1.94 -        return -1;
    1.95 +        return SDL_SetError("PND: EGL initialization failed, no OpenGL ES support");
    1.96      }
    1.97  
    1.98      /* Check if OpenGL ES connection has been initialized */
    1.99 @@ -791,8 +780,7 @@
   1.100      }
   1.101  
   1.102      /* Failed to set swap interval */
   1.103 -    SDL_SetError("PND: Cannot set swap interval");
   1.104 -    return -1;
   1.105 +    return SDL_SetError("PND: Cannot set swap interval");
   1.106  }
   1.107  
   1.108  int