diff include/SDL_video.h @ 3596:f638ded38b8a

Added SDL_RenderClear() as a fast method of clearing the screen to the drawing color. Renamed SDL_RenderPoint() and SDL_RenderLine() to SDL_RenderDrawPoint() and SDL_RenderDrawLine(). Added API for rectangle drawing (as opposed to filling) Added placeholder API functions for circles and ellipses ... I'm not sure whether these will stay. Optimized software line drawing quite a bit. Added support for Wu's anti-aliased line drawing, currently disabled by default.
author Sam Lantinga <slouken@libsdl.org>
date Wed, 23 Dec 2009 01:55:00 +0000
parents 0267b8b1595c
children 847549156244
line wrap: on
line diff
--- a/include/SDL_video.h	Fri Dec 18 08:19:18 2009 +0000
+++ b/include/SDL_video.h	Wed Dec 23 01:55:00 2009 +0000
@@ -1138,6 +1138,11 @@
 extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(int *blendMode);
 
 /**
+ *  \brief Clear the current rendering target with the drawing color
+ */
+extern DECLSPEC int SDLCALL SDL_RenderClear();
+
+/**
  *  \brief Draw a point on the current rendering target.
  *  
  *  \param x The x coordinate of the point.
@@ -1145,7 +1150,7 @@
  *  
  *  \return 0 on success, or -1 if there is no rendering context current.
  */
-extern DECLSPEC int SDLCALL SDL_RenderPoint(int x, int y);
+extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(int x, int y);
 
 /**
  *  \brief Draw some number of points on the current rendering target.
@@ -1155,8 +1160,8 @@
  *  
  *  \return 0 on success, or -1 if there is no rendering context current.
  */
-extern DECLSPEC int SDLCALL SDL_RenderPoints(const SDL_Point * points,
-                                             int count);
+extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(const SDL_Point * points,
+                                                 int count);
 
 /**
  *  \brief Draw a line on the current rendering target.
@@ -1168,7 +1173,7 @@
  *  
  *  \return 0 on success, or -1 if there is no rendering context current.
  */
-extern DECLSPEC int SDLCALL SDL_RenderLine(int x1, int y1, int x2, int y2);
+extern DECLSPEC int SDLCALL SDL_RenderDrawLine(int x1, int y1, int x2, int y2);
 
 /**
  *  \brief Draw a series of connected lines on the current rendering target.
@@ -1178,18 +1183,37 @@
  *  
  *  \return 0 on success, or -1 if there is no rendering context current.
  */
-extern DECLSPEC int SDLCALL SDL_RenderLines(const SDL_Point * points,
-                                            int count);
+extern DECLSPEC int SDLCALL SDL_RenderDrawLines(const SDL_Point * points,
+                                                int count);
 
 /**
- *  \brief Fill the current rendering target with the drawing color.
+ *  \brief Draw a rectangle on the current rendering target with the drawing color.
+ *  
+ *  \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
+ *  
+ *  \return 0 on success, or -1 if there is no rendering context current.
+ */
+extern DECLSPEC int SDLCALL SDL_RenderDrawRect(const SDL_Rect * rect);
+
+/**
+ *  \brief Draw some number of rectangles in the current rendering target with the drawing color.
+ *  
+ *  \param rects A pointer to an array of destination rectangles.
+ *  \param count The number of rectangles.
+ *  
+ *  \return 0 on success, or -1 if there is no rendering context current.
+ */
+extern DECLSPEC int SDLCALL SDL_RenderDrawRects(const SDL_Rect ** rect, int count);
+
+/**
+ *  \brief Fill a rectangle on the current rendering target with the drawing color.
  *  
  *  \param rect A pointer to the destination rectangle, or NULL for the entire 
  *              rendering target.
  *  
  *  \return 0 on success, or -1 if there is no rendering context current.
  */
-extern DECLSPEC int SDLCALL SDL_RenderRect(const SDL_Rect * rect);
+extern DECLSPEC int SDLCALL SDL_RenderFillRect(const SDL_Rect * rect);
 
 /**
  *  \brief Fill some number of rectangles in the current rendering target with the drawing color.
@@ -1199,7 +1223,37 @@
  *  
  *  \return 0 on success, or -1 if there is no rendering context current.
  */
-extern DECLSPEC int SDLCALL SDL_RenderRects(const SDL_Rect ** rect, int count);
+extern DECLSPEC int SDLCALL SDL_RenderFillRects(const SDL_Rect ** rect, int count);
+
+#if 0
+/**
+ *  \brief Draw a circle on the current rendering target with the drawing color.
+ *  
+ *  \return 0 on success, or -1 if there is no rendering context current.
+ */
+extern DECLSPEC int SDLCALL SDL_RenderDrawCircle(int x, int y, int radius);
+
+/**
+ *  \brief Fill a circle on the current rendering target with the drawing color.
+ *  
+ *  \return 0 on success, or -1 if there is no rendering context current.
+ */
+extern DECLSPEC int SDLCALL SDL_RenderFillCircle(int x, int y, int radius);
+
+/**
+ *  \brief Draw an ellipse on the current rendering target with the drawing color.
+ *  
+ *  \return 0 on success, or -1 if there is no rendering context current.
+ */
+extern DECLSPEC int SDLCALL SDL_RenderDrawEllipse(int x, int y, int w, int h);
+
+/**
+ *  \brief Fill an ellipse on the current rendering target with the drawing color.
+ *  
+ *  \return 0 on success, or -1 if there is no rendering context current.
+ */
+extern DECLSPEC int SDLCALL SDL_RenderFillEllipse(int x, int y, int w, int h);
+#endif // 0
 
 /**
  *  \brief Copy a portion of the texture to the current rendering target.