Mercurial > sdl-ios-xcode
diff include/SDL_rect.h @ 5157:fb424691cfc7
Moved the rendering code out to a separate directory in the hope that it can someday be completely decoupled from the rest of the library and be expanded to an awesome 2D on 3D library.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 02 Feb 2011 14:34:54 -0800 |
parents | f7b03b6838cb |
children | 307ccc9c135e |
line wrap: on
line diff
--- a/include/SDL_rect.h Wed Feb 02 14:34:24 2011 -0800 +++ b/include/SDL_rect.h Wed Feb 02 14:34:54 2011 -0800 @@ -70,6 +70,25 @@ } SDL_Rect; /** + * \brief A structure used to track dirty rectangles + * + * \sa SDL_AddDirtyRect + * \sa SDL_ClearDirtyRects + * \sa SDL_FreeDirtyRects + */ +typedef struct SDL_DirtyRect +{ + SDL_Rect rect; + struct SDL_DirtyRect *next; +} SDL_DirtyRect; + +typedef struct SDL_DirtyRectList +{ + SDL_DirtyRect *list; + SDL_DirtyRect *free; +} SDL_DirtyRectList; + +/** * \brief Returns true if the rectangle has no area. */ #define SDL_RectEmpty(X) (((X)->w <= 0) || ((X)->h <= 0)) @@ -124,6 +143,22 @@ int *Y1, int *X2, int *Y2); +/** + * \brief Add a rectangle to a dirty rectangle list + */ +extern DECLSPEC void SDLCALL SDL_AddDirtyRect(SDL_DirtyRectList * list, const SDL_Rect * rect); + +/** + * \brief Remove all rectangles associated with a dirty rectangle list + */ +extern DECLSPEC void SDLCALL SDL_ClearDirtyRects(SDL_DirtyRectList * list); + +/** + * \brief Free memory associated with a dirty rectangle list + */ +extern DECLSPEC void SDLCALL SDL_FreeDirtyRects(SDL_DirtyRectList * list); + + /* Ends C function definitions when using C++ */ #ifdef __cplusplus /* *INDENT-OFF* */