src/video/SDL_video.c
changeset 1969 5d3724f64f2b
parent 1967 01e29c3e9a29
child 1970 db3ba6c0d0df
     1.1 --- a/src/video/SDL_video.c	Sat Aug 05 22:41:33 2006 +0000
     1.2 +++ b/src/video/SDL_video.c	Sun Aug 06 00:09:04 2006 +0000
     1.3 @@ -1362,7 +1362,7 @@
     1.4  }
     1.5  
     1.6  int
     1.7 -SDL_GetNumRenderers(void)
     1.8 +SDL_GetNumRenderDrivers(void)
     1.9  {
    1.10      if (_this) {
    1.11          return SDL_CurrentDisplay.num_render_drivers;
    1.12 @@ -1371,27 +1371,19 @@
    1.13  }
    1.14  
    1.15  int
    1.16 -SDL_GetRendererInfo(int index, SDL_RendererInfo * info)
    1.17 +SDL_GetRenderDriverInfo(int index, SDL_RendererInfo * info)
    1.18  {
    1.19      if (!_this) {
    1.20          SDL_UninitializedVideo();
    1.21          return -1;
    1.22      }
    1.23  
    1.24 -    if (index >= SDL_GetNumRenderers()) {
    1.25 +    if (index < 0 || index >= SDL_GetNumRenderDrivers()) {
    1.26          SDL_SetError("index must be in the range of 0 - %d",
    1.27 -                     SDL_GetNumRenderers() - 1);
    1.28 +                     SDL_GetNumRenderDrivers() - 1);
    1.29          return -1;
    1.30      }
    1.31 -    if (index < 0) {
    1.32 -        if (!SDL_CurrentDisplay.current_renderer) {
    1.33 -            SDL_SetError("There is no current renderer");
    1.34 -            return -1;
    1.35 -        }
    1.36 -        *info = SDL_CurrentDisplay.current_renderer->info;
    1.37 -    } else {
    1.38 -        *info = SDL_CurrentDisplay.render_drivers[index].info;
    1.39 -    }
    1.40 +    *info = SDL_CurrentDisplay.render_drivers[index].info;
    1.41      return 0;
    1.42  }
    1.43  
    1.44 @@ -1406,7 +1398,7 @@
    1.45  
    1.46      if (index < 0) {
    1.47          const char *override = SDL_getenv("SDL_VIDEO_RENDERER");
    1.48 -        int n = SDL_GetNumRenderers();
    1.49 +        int n = SDL_GetNumRenderDrivers();
    1.50          for (index = 0; index < n; ++index) {
    1.51              SDL_RenderDriver *driver =
    1.52                  &SDL_CurrentDisplay.render_drivers[index];
    1.53 @@ -1427,9 +1419,9 @@
    1.54          }
    1.55      }
    1.56  
    1.57 -    if (index >= SDL_GetNumRenderers()) {
    1.58 +    if (index >= SDL_GetNumRenderDrivers()) {
    1.59          SDL_SetError("index must be -1 or in the range of 0 - %d",
    1.60 -                     SDL_GetNumRenderers() - 1);
    1.61 +                     SDL_GetNumRenderDrivers() - 1);
    1.62          return -1;
    1.63      }
    1.64  
    1.65 @@ -1464,6 +1456,22 @@
    1.66      return 0;
    1.67  }
    1.68  
    1.69 +int
    1.70 +SDL_GetRendererInfo(SDL_RendererInfo * info)
    1.71 +{
    1.72 +    if (!_this) {
    1.73 +        SDL_UninitializedVideo();
    1.74 +        return -1;
    1.75 +    }
    1.76 +
    1.77 +    if (!SDL_CurrentDisplay.current_renderer) {
    1.78 +        SDL_SetError("There is no current renderer");
    1.79 +        return -1;
    1.80 +    }
    1.81 +    *info = SDL_CurrentDisplay.current_renderer->info;
    1.82 +    return 0;
    1.83 +}
    1.84 +
    1.85  SDL_TextureID
    1.86  SDL_CreateTexture(Uint32 format, int access, int w, int h)
    1.87  {