comparison include/SDL_video.h @ 1735:8dd28c4ef746 SDL-1.3

SDL_Rect now uses int for position and size. Added a few more rectangle functions. Added a dirty rectangle list implementation.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 10 Jul 2006 07:34:50 +0000
parents f7c667ded87d
children
comparison
equal deleted inserted replaced
1734:f7c667ded87d 1735:8dd28c4ef746
51 * 51 *
52 * \brief A rectangle, with the origin at the upper left. 52 * \brief A rectangle, with the origin at the upper left.
53 */ 53 */
54 typedef struct SDL_Rect 54 typedef struct SDL_Rect
55 { 55 {
56 Sint16 x, y; 56 int x, y;
57 Uint16 w, h; 57 int w, h;
58 } SDL_Rect; 58 } SDL_Rect;
59 59
60 /** 60 /**
61 * \struct SDL_DisplayMode 61 * \struct SDL_DisplayMode
62 * 62 *
175 SDL_Renderer_PresentFlip2 = 0x00000004, /**< Present uses a flip, swapping back buffer and front buffer */ 175 SDL_Renderer_PresentFlip2 = 0x00000004, /**< Present uses a flip, swapping back buffer and front buffer */
176 SDL_Renderer_PresentFlip3 = 0x00000008, /**< Present uses a flip, rotating between two back buffers and a front buffer */ 176 SDL_Renderer_PresentFlip3 = 0x00000008, /**< Present uses a flip, rotating between two back buffers and a front buffer */
177 SDL_Renderer_PresentVSync = 0x00000010, /**< Present is synchronized with the refresh rate */ 177 SDL_Renderer_PresentVSync = 0x00000010, /**< Present is synchronized with the refresh rate */
178 SDL_Renderer_RenderTarget = 0x00000020, /**< The renderer can create texture render targets */ 178 SDL_Renderer_RenderTarget = 0x00000020, /**< The renderer can create texture render targets */
179 SDL_Renderer_Accelerated = 0x00000040, /**< The renderer uses hardware acceleration */ 179 SDL_Renderer_Accelerated = 0x00000040, /**< The renderer uses hardware acceleration */
180 SDL_Renderer_Minimal = 0x00000080, /**< The renderer only supports the read/write pixel and present functions */ 180 SDL_Renderer_ = 0x00000080, /**< The renderer uses hardware acceleration */
181 SDL_Renderer_Minimal = 0x00000100, /**< The renderer only supports the read/write pixel and present functions */
181 } SDL_RendererFlags; 182 } SDL_RendererFlags;
182 183
183 /** 184 /**
184 * \struct SDL_RendererInfo 185 * \struct SDL_RendererInfo
185 * 186 *
1523 * 1524 *
1524 * \sa SDL_GL_CreateContext() 1525 * \sa SDL_GL_CreateContext()
1525 */ 1526 */
1526 extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context); 1527 extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context);
1527 1528
1528 /* 1529 /**
1529 * Calculate the intersection of two rectangles 1530 * \def SDL_RectEmpty()
1531 *
1532 * \brief Returns true if the rectangle has no area.
1533 */
1534 #define SDL_RectEmpty(X) (((X)->w <= 0) || ((X)->h <= 0))
1535
1536 /**
1537 * \def SDL_RectEquals()
1538 *
1539 * \brief Returns true if the two rectangles are equal.
1540 */
1541 #define SDL_RectEquals(A, B) (((A)->x == (B)->x) && ((A)->y == (B)->y) && \
1542 ((A)->w == (B)->w) && ((A)->h == (B)->h))
1543
1544 /**
1545 * \fn SDL_bool SDL_HasIntersection(const SDL_Rect * A, const SDL_Rect * B);
1546 *
1547 * \brief Determine whether two rectangles intersect.
1548 *
1549 * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
1550 */
1551 extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A,
1552 const SDL_Rect * B);
1553
1554 /**
1555 * \fn SDL_bool SDL_IntersectRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result)
1556 *
1557 * \brief Calculate the intersection of two rectangles.
1558 *
1559 * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
1530 */ 1560 */
1531 extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A, 1561 extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A,
1532 const SDL_Rect * B, 1562 const SDL_Rect * B,
1533 SDL_Rect * intersection); 1563 SDL_Rect * result);
1564
1565 /**
1566 * \fn void SDL_UnionRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result)
1567 *
1568 * \brief Calculate the union of two rectangles
1569 */
1570 extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A,
1571 const SDL_Rect * B,
1572 SDL_Rect * result);
1534 1573
1535 /* Ends C function definitions when using C++ */ 1574 /* Ends C function definitions when using C++ */
1536 #ifdef __cplusplus 1575 #ifdef __cplusplus
1537 /* *INDENT-OFF* */ 1576 /* *INDENT-OFF* */
1538 } 1577 }