Changed the concept of a render clip rect to a render viewport.

The render viewport is automatically re-centered when the window changes size, so applications that don't care will not have to handle recalculating their rendering coordinates.

Fixed API for drawing and filling multiple rectangles - the parameter should be an array of rects, not an array of pointers to rects.

Fixed API for updating window rects for consistency with other APIs - the order is pointer to array followed by count in array.
This commit is contained in:
Sam Lantinga 2011-02-15 13:59:59 -08:00
parent 32d70d6f2b
commit c804b92b9e
27 changed files with 652 additions and 443 deletions

View file

@ -78,13 +78,13 @@ struct SDL_Renderer
int (*LockTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
const SDL_Rect * rect, void **pixels, int *pitch);
void (*UnlockTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
void (*SetClipRect) (SDL_Renderer * renderer, const SDL_Rect *rect);
int (*UpdateViewport) (SDL_Renderer * renderer);
int (*RenderClear) (SDL_Renderer * renderer);
int (*RenderDrawPoints) (SDL_Renderer * renderer, const SDL_Point * points,
int count);
int (*RenderDrawLines) (SDL_Renderer * renderer, const SDL_Point * points,
int count);
int (*RenderFillRects) (SDL_Renderer * renderer, const SDL_Rect ** rects,
int (*RenderFillRects) (SDL_Renderer * renderer, const SDL_Rect * rects,
int count);
int (*RenderCopy) (SDL_Renderer * renderer, SDL_Texture * texture,
const SDL_Rect * srcrect, const SDL_Rect * dstrect);
@ -101,6 +101,9 @@ struct SDL_Renderer
/* The window associated with the renderer */
SDL_Window *window;
/* The drawable area within the window */
SDL_Rect viewport;
/* The list of textures */
SDL_Texture *textures;