Renamed SetTargetTexture() to SetRenderTarget()
authorSam Lantinga <slouken@libsdl.org>
Sun, 22 Jan 2012 01:26:28 -0500
changeset 6247 b6212690f78d
parent 6246 c70ec935a4bb
child 6248 7fe4b2b78acc
Renamed SetTargetTexture() to SetRenderTarget()
include/SDL_render.h
src/render/SDL_render.c
src/render/SDL_sysrender.h
src/render/direct3d/SDL_render_d3d.c
src/render/opengl/SDL_render_gl.c
src/render/opengles/SDL_render_gles.c
src/render/opengles2/SDL_render_gles2.c
src/render/software/SDL_render_sw.c
test/testrendertarget.c
--- a/include/SDL_render.h	Sat Jan 21 22:22:30 2012 -0500
+++ b/include/SDL_render.h	Sun Jan 22 01:26:28 2012 -0500
@@ -373,6 +373,25 @@
 extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture);
 
 /**
+ * \brief Determines whether a window supports the use of render targets
+ *
+ * \param renderer The renderer that will be checked
+ *
+ * \return SDL_TRUE if supported, SDL_FALSE if not.
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer);
+
+/**
+ * \brief Set a texture as the current rendering target.
+ *
+ * \param texture The targeted texture, or NULL for the default render target
+ *
+ * \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer,
+                                                SDL_Texture *texture);
+
+/**
  *  \brief Set the drawing area for rendering on the current target.
  *
  *  \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target.
@@ -566,30 +585,6 @@
 
 
 /**
- * \fn SDL_bool SDL_RenderTargetSupported(SDL_Renderer *renderer)
- *
- * \brief Determines whether a window supports the use of render targets
- *
- * \param renderer The renderer that will be checked
- *
- * \return SDL_TRUE if supported, SDL_FALSE if not.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer);
-
-/**
- * \fn int SDL_SetTargetTexture(SDL_Renderer *renderer, SDL_Texture *texture)
- *
- * \brief Set a texture as the current rendering target.
- *
- * \param renderer The renderer that will be checked
- *
- * \param texture The targeted texture, or NULL for the default render target
- *
- * \return 0 on success, or -1 if there is no rendering context current, or the driver doesn't support the requested operation.
- */
-extern DECLSPEC int SDLCALL SDL_SetTargetTexture(SDL_Renderer *renderer, SDL_Texture *texture);
-
-/**
  *  \brief Read pixels from the current rendering target.
  *  
  *  \param rect   A pointer to the rectangle to read, or NULL for the entire 
--- a/src/render/SDL_render.c	Sat Jan 21 22:22:30 2012 -0500
+++ b/src/render/SDL_render.c	Sun Jan 22 01:26:28 2012 -0500
@@ -804,14 +804,14 @@
 SDL_bool
 SDL_RenderTargetSupported(SDL_Renderer *renderer)
 {
-    if (!renderer || !renderer->SetTargetTexture) {
+    if (!renderer || !renderer->SetRenderTarget) {
         return SDL_FALSE;
     }
     return (renderer->info.flags & SDL_RENDERER_TARGETTEXTURE) != 0;
 }
 
 int
-SDL_SetTargetTexture(SDL_Renderer *renderer, SDL_Texture *texture)
+SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture)
 {
     SDL_Rect viewport;
 
@@ -847,7 +847,7 @@
     }
     renderer->target = texture;
 
-    if (renderer->SetTargetTexture(renderer, texture) < 0) {
+    if (renderer->SetRenderTarget(renderer, texture) < 0) {
         return -1;
     }
 
--- a/src/render/SDL_sysrender.h	Sat Jan 21 22:22:30 2012 -0500
+++ b/src/render/SDL_sysrender.h	Sun Jan 22 01:26:28 2012 -0500
@@ -77,7 +77,7 @@
     int (*LockTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
                         const SDL_Rect * rect, void **pixels, int *pitch);
     void (*UnlockTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
-    int (*SetTargetTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
+    int (*SetRenderTarget) (SDL_Renderer * renderer, SDL_Texture * texture);
     int (*UpdateViewport) (SDL_Renderer * renderer);
     int (*RenderClear) (SDL_Renderer * renderer);
     int (*RenderDrawPoints) (SDL_Renderer * renderer, const SDL_Point * points,
--- a/src/render/direct3d/SDL_render_d3d.c	Sat Jan 21 22:22:30 2012 -0500
+++ b/src/render/direct3d/SDL_render_d3d.c	Sun Jan 22 01:26:28 2012 -0500
@@ -99,7 +99,7 @@
 static int D3D_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
                            const SDL_Rect * rect, void **pixels, int *pitch);
 static void D3D_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture);
-static int D3D_SetTargetTexture(SDL_Renderer * renderer, SDL_Texture * texture);
+static int D3D_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture);
 static int D3D_UpdateViewport(SDL_Renderer * renderer);
 static int D3D_RenderClear(SDL_Renderer * renderer);
 static int D3D_RenderDrawPoints(SDL_Renderer * renderer,
@@ -388,7 +388,7 @@
     renderer->UpdateTexture = D3D_UpdateTexture;
     renderer->LockTexture = D3D_LockTexture;
     renderer->UnlockTexture = D3D_UnlockTexture;
-    renderer->SetTargetTexture = D3D_SetTargetTexture;
+    renderer->SetRenderTarget = D3D_SetRenderTarget;
     renderer->UpdateViewport = D3D_UpdateViewport;
     renderer->RenderClear = D3D_RenderClear;
     renderer->RenderDrawPoints = D3D_RenderDrawPoints;
@@ -734,7 +734,7 @@
 }
 
 static int
-D3D_SetTargetTexture(SDL_Renderer * renderer, SDL_Texture * texture)
+D3D_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
 {
     D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
     D3D_TextureData *texturedata;
--- a/src/render/opengl/SDL_render_gl.c	Sat Jan 21 22:22:30 2012 -0500
+++ b/src/render/opengl/SDL_render_gl.c	Sun Jan 22 01:26:28 2012 -0500
@@ -54,7 +54,7 @@
 static int GL_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
                           const SDL_Rect * rect, void **pixels, int *pitch);
 static void GL_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture);
-static int GL_SetTargetTexture(SDL_Renderer * renderer, SDL_Texture * texture);
+static int GL_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture);
 static int GL_UpdateViewport(SDL_Renderer * renderer);
 static int GL_RenderClear(SDL_Renderer * renderer);
 static int GL_RenderDrawPoints(SDL_Renderer * renderer,
@@ -307,7 +307,7 @@
     renderer->UpdateTexture = GL_UpdateTexture;
     renderer->LockTexture = GL_LockTexture;
     renderer->UnlockTexture = GL_UnlockTexture;
-    renderer->SetTargetTexture = GL_SetTargetTexture;
+    renderer->SetRenderTarget = GL_SetRenderTarget;
     renderer->UpdateViewport = GL_UpdateViewport;
     renderer->RenderClear = GL_RenderClear;
     renderer->RenderDrawPoints = GL_RenderDrawPoints;
@@ -707,7 +707,7 @@
 }
 
 static int
-GL_SetTargetTexture(SDL_Renderer * renderer, SDL_Texture * texture)
+GL_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
 {
     GL_RenderData *data = (GL_RenderData *) renderer->driverdata;    
     GL_TextureData *texturedata;
--- a/src/render/opengles/SDL_render_gles.c	Sat Jan 21 22:22:30 2012 -0500
+++ b/src/render/opengles/SDL_render_gles.c	Sun Jan 22 01:26:28 2012 -0500
@@ -56,7 +56,7 @@
                             const SDL_Rect * rect, void **pixels, int *pitch);
 static void GLES_UnlockTexture(SDL_Renderer * renderer,
                                SDL_Texture * texture);
-static int GLES_SetTargetTexture(SDL_Renderer * renderer,
+static int GLES_SetRenderTarget(SDL_Renderer * renderer,
                                  SDL_Texture * texture);
 static int GLES_UpdateViewport(SDL_Renderer * renderer);
 static int GLES_RenderClear(SDL_Renderer * renderer);
@@ -295,7 +295,7 @@
     renderer->UpdateTexture = GLES_UpdateTexture;
     renderer->LockTexture = GLES_LockTexture;
     renderer->UnlockTexture = GLES_UnlockTexture;
-    renderer->SetTargetTexture = GLES_SetTargetTexture;
+    renderer->SetRenderTarget = GLES_SetRenderTarget;
     renderer->UpdateViewport = GLES_UpdateViewport;
     renderer->RenderClear = GLES_RenderClear;
     renderer->RenderDrawPoints = GLES_RenderDrawPoints;
@@ -575,7 +575,7 @@
 }
 
 static int
-GLES_SetTargetTexture(SDL_Renderer * renderer, SDL_Texture * texture)
+GLES_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
 {
     GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
     GLES_TextureData *texturedata = NULL;
--- a/src/render/opengles2/SDL_render_gles2.c	Sat Jan 21 22:22:30 2012 -0500
+++ b/src/render/opengles2/SDL_render_gles2.c	Sun Jan 22 01:26:28 2012 -0500
@@ -327,7 +327,7 @@
 static void GLES2_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture);
 static int GLES2_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect,
                                const void *pixels, int pitch);
-static int GLES2_SetTargetTexture(SDL_Renderer * renderer, SDL_Texture * texture);
+static int GLES2_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture);
 
 static GLenum
 GetScaleQuality(void)
@@ -533,7 +533,7 @@
 }
 
 static int
-GLES2_SetTargetTexture(SDL_Renderer * renderer, SDL_Texture * texture)
+GLES2_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
 {
     GLES2_DriverContext *data = (GLES2_DriverContext *) renderer->driverdata;
     GLES2_TextureData *texturedata = NULL;
@@ -1489,7 +1489,7 @@
     renderer->UpdateTexture       = &GLES2_UpdateTexture;
     renderer->LockTexture         = &GLES2_LockTexture;
     renderer->UnlockTexture       = &GLES2_UnlockTexture;
-    renderer->SetTargetTexture    = &GLES2_SetTargetTexture;
+    renderer->SetRenderTarget     = &GLES2_SetRenderTarget;
     renderer->UpdateViewport      = &GLES2_UpdateViewport;
     renderer->RenderClear         = &GLES2_RenderClear;
     renderer->RenderDrawPoints    = &GLES2_RenderDrawPoints;
--- a/src/render/software/SDL_render_sw.c	Sat Jan 21 22:22:30 2012 -0500
+++ b/src/render/software/SDL_render_sw.c	Sun Jan 22 01:26:28 2012 -0500
@@ -51,7 +51,7 @@
 static int SW_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
                           const SDL_Rect * rect, void **pixels, int *pitch);
 static void SW_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture);
-static int SW_SetTargetTexture(SDL_Renderer * renderer, SDL_Texture * texture);
+static int SW_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture);
 static int SW_UpdateViewport(SDL_Renderer * renderer);
 static int SW_RenderClear(SDL_Renderer * renderer);
 static int SW_RenderDrawPoints(SDL_Renderer * renderer,
@@ -145,7 +145,7 @@
     renderer->UpdateTexture = SW_UpdateTexture;
     renderer->LockTexture = SW_LockTexture;
     renderer->UnlockTexture = SW_UnlockTexture;
-    renderer->SetTargetTexture = SW_SetTargetTexture;
+    renderer->SetRenderTarget = SW_SetRenderTarget;
     renderer->UpdateViewport = SW_UpdateViewport;
     renderer->RenderClear = SW_RenderClear;
     renderer->RenderDrawPoints = SW_RenderDrawPoints;
@@ -283,7 +283,7 @@
 }
 
 static int
-SW_SetTargetTexture(SDL_Renderer * renderer, SDL_Texture * texture)
+SW_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
 {
     SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
 
--- a/test/testrendertarget.c	Sat Jan 21 22:22:30 2012 -0500
+++ b/test/testrendertarget.c	Sun Jan 22 01:26:28 2012 -0500
@@ -99,7 +99,7 @@
     SDL_RenderGetViewport(s->renderer, &viewport);
 
     target = SDL_CreateTexture(s->renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_TARGET, viewport.w, viewport.h);
-    SDL_SetTargetTexture(s->renderer, target);
+    SDL_SetRenderTarget(s->renderer, target);
 
     /* Draw the background */
     SDL_RenderCopy(s->renderer, s->background, NULL, NULL);
@@ -121,7 +121,7 @@
 
     SDL_RenderCopy(s->renderer, s->sprite, NULL, &s->sprite_rect);
 
-    SDL_SetTargetTexture(s->renderer, NULL);
+    SDL_SetRenderTarget(s->renderer, NULL);
     SDL_RenderCopy(s->renderer, target, NULL, NULL);
     SDL_DestroyTexture(target);