src/video/windows/SDL_windowsopengl.c
changeset 7037 3fedf1f25b94
parent 6885 700f1b25f77f
child 7191 75360622e65f
     1.1 --- a/src/video/windows/SDL_windowsopengl.c	Fri Mar 29 21:29:57 2013 -0400
     1.2 +++ b/src/video/windows/SDL_windowsopengl.c	Sun Mar 31 12:48:50 2013 -0400
     1.3 @@ -91,8 +91,7 @@
     1.4          char message[1024];
     1.5          SDL_snprintf(message, SDL_arraysize(message), "LoadLibrary(\"%s\")",
     1.6                       path);
     1.7 -        WIN_SetError(message);
     1.8 -        return -1;
     1.9 +        return WIN_SetError(message);
    1.10      }
    1.11      SDL_strlcpy(_this->gl_config.driver_path, path,
    1.12                  SDL_arraysize(_this->gl_config.driver_path));
    1.13 @@ -103,8 +102,7 @@
    1.14                                                 sizeof(struct
    1.15                                                        SDL_GLDriverData));
    1.16      if (!_this->gl_data) {
    1.17 -        SDL_OutOfMemory();
    1.18 -        return -1;
    1.19 +        return SDL_OutOfMemory();
    1.20      }
    1.21  
    1.22      /* Load function pointers */
    1.23 @@ -124,9 +122,8 @@
    1.24          !_this->gl_data->wglCreateContext ||
    1.25          !_this->gl_data->wglDeleteContext ||
    1.26          !_this->gl_data->wglMakeCurrent) {
    1.27 -        SDL_SetError("Could not retrieve OpenGL functions");
    1.28          SDL_UnloadObject(handle);
    1.29 -        return -1;
    1.30 +        return SDL_SetError("Could not retrieve OpenGL functions");
    1.31      }
    1.32  
    1.33      return 0;
    1.34 @@ -512,12 +509,10 @@
    1.35          pixel_format = WIN_GL_ChoosePixelFormat(hdc, &pfd);
    1.36      }
    1.37      if (!pixel_format) {
    1.38 -        SDL_SetError("No matching GL pixel format available");
    1.39 -        return -1;
    1.40 +        return SDL_SetError("No matching GL pixel format available");
    1.41      }
    1.42      if (!SetPixelFormat(hdc, pixel_format, &pfd)) {
    1.43 -        WIN_SetError("SetPixelFormat()");
    1.44 -        return (-1);
    1.45 +        return WIN_SetError("SetPixelFormat()");
    1.46      }
    1.47      return 0;
    1.48  }
    1.49 @@ -611,11 +606,9 @@
    1.50  WIN_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
    1.51  {
    1.52      HDC hdc;
    1.53 -    int status;
    1.54  
    1.55      if (!_this->gl_data) {
    1.56 -        SDL_SetError("OpenGL not initialized");
    1.57 -        return -1;
    1.58 +        return SDL_SetError("OpenGL not initialized");
    1.59      }
    1.60  
    1.61      if (window) {
    1.62 @@ -624,30 +617,24 @@
    1.63          hdc = NULL;
    1.64      }
    1.65      if (!_this->gl_data->wglMakeCurrent(hdc, (HGLRC) context)) {
    1.66 -        WIN_SetError("wglMakeCurrent()");
    1.67 -        status = -1;
    1.68 -    } else {
    1.69 -        status = 0;
    1.70 +        return WIN_SetError("wglMakeCurrent()");
    1.71      }
    1.72 -    return status;
    1.73 +    return 0;
    1.74  }
    1.75  
    1.76  int
    1.77  WIN_GL_SetSwapInterval(_THIS, int interval)
    1.78  {
    1.79 -    int retval = -1;
    1.80      if ((interval < 0) && (!_this->gl_data->HAS_WGL_EXT_swap_control_tear)) {
    1.81 -        SDL_SetError("Negative swap interval unsupported in this GL");
    1.82 +        return SDL_SetError("Negative swap interval unsupported in this GL");
    1.83      } else if (_this->gl_data->wglSwapIntervalEXT) {
    1.84 -        if (_this->gl_data->wglSwapIntervalEXT(interval) == TRUE) {
    1.85 -            retval = 0;
    1.86 -        } else {
    1.87 -            WIN_SetError("wglSwapIntervalEXT()");
    1.88 +        if (_this->gl_data->wglSwapIntervalEXT(interval) != TRUE) {
    1.89 +            return WIN_SetError("wglSwapIntervalEXT()");
    1.90          }
    1.91      } else {
    1.92 -        SDL_Unsupported();
    1.93 +        return SDL_Unsupported();
    1.94      }
    1.95 -    return retval;
    1.96 +    return 0;
    1.97  }
    1.98  
    1.99  int