Added SDL_RenderSetScale() and SDL_RenderGetScale()

This commit is contained in:
Sam Lantinga 2012-10-01 20:59:33 -07:00
parent 0b35b7b0bf
commit f366b098d4
10 changed files with 603 additions and 353 deletions

View file

@ -31,6 +31,20 @@
typedef struct SDL_RenderDriver SDL_RenderDriver;
typedef struct
{
float x;
float y;
} SDL_FPoint;
typedef struct
{
float x;
float y;
float w;
float h;
} SDL_FRect;
/* Define the SDL texture structure */
struct SDL_Texture
{
@ -80,17 +94,17 @@ struct SDL_Renderer
int (*SetRenderTarget) (SDL_Renderer * renderer, SDL_Texture * texture);
int (*UpdateViewport) (SDL_Renderer * renderer);
int (*RenderClear) (SDL_Renderer * renderer);
int (*RenderDrawPoints) (SDL_Renderer * renderer, const SDL_Point * points,
int (*RenderDrawPoints) (SDL_Renderer * renderer, const SDL_FPoint * points,
int count);
int (*RenderDrawLines) (SDL_Renderer * renderer, const SDL_Point * points,
int (*RenderDrawLines) (SDL_Renderer * renderer, const SDL_FPoint * points,
int count);
int (*RenderFillRects) (SDL_Renderer * renderer, const SDL_Rect * rects,
int (*RenderFillRects) (SDL_Renderer * renderer, const SDL_FRect * rects,
int count);
int (*RenderCopy) (SDL_Renderer * renderer, SDL_Texture * texture,
const SDL_Rect * srcrect, const SDL_Rect * dstrect);
const SDL_Rect * srcrect, const SDL_FRect * dstrect);
int (*RenderCopyEx) (SDL_Renderer * renderer, SDL_Texture * texture,
const SDL_Rect * srcquad, const SDL_Rect * dstrect,
const double angle, const SDL_Point *center, const SDL_RendererFlip flip);
const SDL_Rect * srcquad, const SDL_FRect * dstrect,
const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip);
int (*RenderReadPixels) (SDL_Renderer * renderer, const SDL_Rect * rect,
Uint32 format, void * pixels, int pitch);
void (*RenderPresent) (SDL_Renderer * renderer);
@ -113,6 +127,10 @@ struct SDL_Renderer
SDL_Rect viewport;
SDL_Rect viewport_backup;
/* The render output coordinate scale */
SDL_FPoint scale;
SDL_FPoint scale_backup;
/* The list of textures */
SDL_Texture *textures;
SDL_Texture *target;