summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSam Lantinga <slouken@libsdl.org>2013-05-04 04:46:00 -0700
committerSam Lantinga <slouken@libsdl.org>2013-05-04 04:46:00 -0700
commit7253832be189f7fdc4a60ccc1c318d36c722b646 (patch)
tree84b38b10e87ba9fcd94c012a998d6cf64733b044 /include
parent80d6f659b2bdde25ebdf707972d27650adefbe46 (diff)
First pass on SDL render clip rect functionality
Diffstat (limited to 'include')
-rw-r--r--include/SDL_render.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/SDL_render.h b/include/SDL_render.h
index 591de81b07..fea64f617d 100644
--- a/include/SDL_render.h
+++ b/include/SDL_render.h
@@ -469,6 +469,8 @@ extern DECLSPEC void SDLCALL SDL_RenderGetLogicalSize(SDL_Renderer * renderer, i
*
* The x,y of the viewport rect represents the origin for rendering.
*
+ * \return 0 on success, or -1 on error
+ *
* \note When the window is resized, the current viewport is automatically
* centered within the new window size.
*
@@ -487,6 +489,30 @@ extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer,
SDL_Rect * rect);
/**
+ * \brief Set the clip rectangle for the current target.
+ *
+ * \param rect A pointer to the rectangle to set as the clip rectangle, or
+ * NULL to disable clipping.
+ *
+ * \return 0 on success, or -1 on error
+ *
+ * \sa SDL_RenderGetClipRect()
+ */
+extern DECLSPEC int SDLCALL SDL_RenderSetClipRect(SDL_Renderer * renderer,
+ const SDL_Rect * rect);
+
+/**
+ * \brief Get the clip rectangle for the current target.
+ *
+ * \param rect A pointer filled in with the current clip rectangle, or
+ * an empty rectangle if clipping is disabled.
+ *
+ * \sa SDL_RenderSetClipRect()
+ */
+extern DECLSPEC void SDLCALL SDL_RenderGetClipRect(SDL_Renderer * renderer,
+ SDL_Rect * rect);
+
+/**
* \brief Set the drawing scale for rendering on the current target.
*
* \param scaleX The horizontal scaling factor