include/SDL_render.h
changeset 5297 1800dc39b74c
parent 5262 b530ef003506
child 5337 d5d312a82d40
--- a/include/SDL_render.h	Mon Feb 14 11:50:18 2011 -0600
+++ b/include/SDL_render.h	Tue Feb 15 13:59:59 2011 -0800
@@ -364,16 +364,23 @@
 extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture);
 
 /**
- *  \brief Set the clipping rectangle for rendering on the current target
+ *  \brief Set the drawing area for rendering on the current target.
  *
- *  \param rect The rectangle to clip rendering to, or NULL to disable clipping.
+ *  \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target.
+ *
+ *  The x,y of the viewport rect represents the origin for rendering.
  *
- *  The contents of the window are not defined after calling
- *  SDL_RenderPresent(), so you should clear the clip rectangle and draw
- *  over the entire window each frame.
+ *  \note When the window is resized, the current viewport is automatically
+ *        centered within the new window size.
  */
-extern DECLSPEC void SDLCALL SDL_RenderSetClipRect(SDL_Renderer * renderer,
-                                                   const SDL_Rect * rect);
+extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer,
+                                                  const SDL_Rect * rect);
+
+/**
+ *  \brief Get the drawing area for the current target.
+ */
+extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer,
+                                                   SDL_Rect * rect);
 
 /**
  *  \brief Set the color used for drawing operations (Fill and Line).
@@ -434,6 +441,8 @@
 
 /**
  *  \brief Clear the current rendering target with the drawing color
+ *
+ *  This function clears the entire rendering target, ignoring the viewport.
  */
 extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer * renderer);
 
@@ -504,7 +513,7 @@
  *  \return 0 on success, or -1 on error
  */
 extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer,
-                                                const SDL_Rect ** rects,
+                                                const SDL_Rect * rects,
                                                 int count);
 
 /**
@@ -527,7 +536,7 @@
  *  \return 0 on success, or -1 on error
  */
 extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer,
-                                                const SDL_Rect ** rect,
+                                                const SDL_Rect * rect,
                                                 int count);
 
 /**