changeset 4929:aa8888658021

Use the enumerated type for blend and scale mode instead of int Renamed SDL_TextureScaleMode to SDL_ScaleMode
author Sam Lantinga <slouken@libsdl.org>
date Sun, 12 Dec 2010 15:19:05 -0800
parents d716dff4b13e
children 719dbb5afce8
files Makefile.in include/SDL_blendmode.h include/SDL_compat.h include/SDL_scalemode.h include/SDL_surface.h include/SDL_video.h src/video/SDL_blendfillrect.c src/video/SDL_blendline.c src/video/SDL_blendpoint.c src/video/SDL_blendrect.c src/video/SDL_renderer_gl.c src/video/SDL_renderer_gles.c src/video/SDL_renderer_sw.c src/video/SDL_surface.c src/video/SDL_sysvideo.h src/video/SDL_video.c src/video/directfb/SDL_DirectFB_render.c src/video/nds/SDL_ndsrender.c src/video/photon/SDL_photon_render.c src/video/ps3/SDL_ps3render.c src/video/qnxgf/SDL_gf_render.c src/video/win32/SDL_ceddrawrender.c src/video/win32/SDL_d3drender.c src/video/win32/SDL_gapirender.c src/video/win32/SDL_gdirender.c src/video/x11/SDL_x11render.c test/common.c test/testsprite2.c
diffstat 28 files changed, 355 insertions(+), 282 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.in	Thu Dec 02 11:56:23 2010 -0800
+++ b/Makefile.in	Sun Dec 12 15:19:05 2010 -0800
@@ -44,7 +44,52 @@
 
 DIST = acinclude autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS include INSTALL Makefile.minimal Makefile.in README* sdl-config.in sdl.m4 sdl.pc.in SDL.spec SDL.spec.in src test TODO VisualC.html VisualC VisualCE Watcom-Win32.zip WhatsNew Xcode Xcode-iPhoneOS
 
-HDRS = SDL.h SDL_assert.h SDL_atomic.h SDL_audio.h SDL_clipboard.h SDL_compat.h SDL_cpuinfo.h SDL_endian.h SDL_error.h SDL_events.h SDL_gesture.h SDL_haptic.h SDL_input.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_opengles.h SDL_pixels.h SDL_platform.h SDL_power.h SDL_quit.h SDL_rect.h SDL_revision.h SDL_rwops.h SDL_scancode.h SDL_shape.h SDL_stdinc.h SDL_surface.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_touch.h SDL_types.h SDL_version.h SDL_video.h begin_code.h close_code.h
+HDRS = \
+	SDL.h \
+	SDL_assert.h \
+	SDL_atomic.h \
+	SDL_audio.h \
+	SDL_blendmode.h \
+	SDL_clipboard.h \
+	SDL_compat.h \
+	SDL_cpuinfo.h \
+	SDL_endian.h \
+	SDL_error.h \
+	SDL_events.h \
+	SDL_gesture.h \
+	SDL_haptic.h \
+	SDL_input.h \
+	SDL_joystick.h \
+	SDL_keyboard.h \
+	SDL_keysym.h \
+	SDL_loadso.h \
+	SDL_main.h \
+	SDL_mouse.h \
+	SDL_mutex.h \
+	SDL_name.h \
+	SDL_opengl.h \
+	SDL_opengles.h \
+	SDL_pixels.h \
+	SDL_platform.h \
+	SDL_power.h \
+	SDL_quit.h \
+	SDL_rect.h \
+	SDL_revision.h \
+	SDL_rwops.h \
+	SDL_scalemode.h \
+	SDL_scancode.h \
+	SDL_shape.h \
+	SDL_stdinc.h \
+	SDL_surface.h \
+	SDL_syswm.h \
+	SDL_thread.h \
+	SDL_timer.h \
+	SDL_touch.h \
+	SDL_types.h \
+	SDL_version.h \
+	SDL_video.h \
+	begin_code.h \
+	close_code.h
 
 LT_AGE      = @LT_AGE@
 LT_CURRENT  = @LT_CURRENT@
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/SDL_blendmode.h	Sun Dec 12 15:19:05 2010 -0800
@@ -0,0 +1,64 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/**
+ *  \file SDL_blendmode.h
+ *  
+ *  Header file declaring the SDL_BlendMode enumeration
+ */
+
+#ifndef _SDL_blendmode_h
+#define _SDL_blendmode_h
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+extern "C" {
+/* *INDENT-ON* */
+#endif
+
+/**
+ *  \brief The blend mode used in SDL_RenderCopy() and drawing operations.
+ */
+typedef enum
+{
+    SDL_BLENDMODE_NONE = 0x00000000,     /**< No blending */
+    SDL_BLENDMODE_MASK = 0x00000001,     /**< dst = A ? src : dst 
+                                              (alpha is mask) */
+    
+    SDL_BLENDMODE_BLEND = 0x00000002,    /**< dst = (src * A) + (dst * (1-A)) */
+    SDL_BLENDMODE_ADD = 0x00000004,      /**< dst = (src * A) + dst */
+    SDL_BLENDMODE_MOD = 0x00000008       /**< dst = src * dst */
+} SDL_BlendMode;
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+}
+/* *INDENT-ON* */
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_video_h */
+
+/* vi: set ts=4 sw=4 expandtab: */
--- a/include/SDL_compat.h	Thu Dec 02 11:56:23 2010 -0800
+++ b/include/SDL_compat.h	Sun Dec 12 15:19:05 2010 -0800
@@ -202,6 +202,14 @@
     SDL_GRAB_ON = 1
 } SDL_GrabMode;
 
+typedef enum
+{
+    SDL_TEXTURESCALEMODE_NONE = SDL_SCALEMODE_NONE,
+    SDL_TEXTURESCALEMODE_FAST = SDL_SCALEMODE_FAST,
+    SDL_TEXTURESCALEMODE_SLOW = SDL_SCALEMODE_SLOW,
+    SDL_TEXTURESCALEMODE_BEST = SDL_SCALEMODE_BEST
+} SDL_TextureScaleMode;
+
 struct SDL_SysWMinfo;
 
 /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/SDL_scalemode.h	Sun Dec 12 15:19:05 2010 -0800
@@ -0,0 +1,69 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/**
+ *  \file SDL_scalemode.h
+ *  
+ *  Header file declaring the SDL_ScaleMode enumeration
+ */
+
+#ifndef _SDL_scalemode_h
+#define _SDL_scalemode_h
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+extern "C" {
+/* *INDENT-ON* */
+#endif
+
+/**
+ *  \brief The texture scale mode used in SDL_RenderCopy().
+ */
+typedef enum
+{
+    SDL_SCALEMODE_NONE = 0x00000000,     /**< No scaling, rectangles must
+                                              match dimensions */
+    
+    SDL_SCALEMODE_FAST = 0x00000001,     /**< Point sampling or 
+                                              equivalent algorithm */
+    
+    SDL_SCALEMODE_SLOW = 0x00000002,     /**< Linear filtering or 
+                                              equivalent algorithm */
+    
+    SDL_SCALEMODE_BEST = 0x00000004      /**< Bicubic filtering or 
+                                              equivalent algorithm */
+} SDL_ScaleMode;
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+}
+/* *INDENT-ON* */
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_video_h */
+
+/* vi: set ts=4 sw=4 expandtab: */
--- a/include/SDL_surface.h	Thu Dec 02 11:56:23 2010 -0800
+++ b/include/SDL_surface.h	Sun Dec 12 15:19:05 2010 -0800
@@ -32,6 +32,8 @@
 #include "SDL_stdinc.h"
 #include "SDL_pixels.h"
 #include "SDL_rect.h"
+#include "SDL_blendmode.h"
+#include "SDL_scalemode.h"
 #include "SDL_rwops.h"
 
 #include "begin_code.h"
@@ -88,7 +90,7 @@
     struct SDL_BlitMap *map;    /**< Private */
 
     /** format version, bumped at every change to invalidate blit maps */
-    unsigned int format_version;        /**< Private */
+    int format_version;         /**< Private */
 
     /** Reference count -- used when freeing surface */
     int refcount;               /**< Read-mostly */
@@ -300,7 +302,7 @@
  *  \sa SDL_GetSurfaceBlendMode()
  */
 extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface,
-                                                    int blendMode);
+                                                    SDL_BlendMode blendMode);
 
 /**
  *  \brief Get the blend mode used for blit operations.
@@ -313,13 +315,13 @@
  *  \sa SDL_SetSurfaceBlendMode()
  */
 extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface,
-                                                    int *blendMode);
+                                                    SDL_BlendMode *blendMode);
 
 /**
  *  \brief Set the scale mode used for blit operations.
  *  
  *  \param surface   The surface to update.
- *  \param scaleMode ::SDL_TextureScaleMode to use for blit scaling.
+ *  \param scaleMode ::SDL_ScaleMode to use for blit scaling.
  *  
  *  \return 0 on success, or -1 if the surface is not valid or the scale mode is
  *          not supported.
@@ -331,7 +333,7 @@
  *  \sa SDL_GetSurfaceScaleMode()
  */
 extern DECLSPEC int SDLCALL SDL_SetSurfaceScaleMode(SDL_Surface * surface,
-                                                    int scaleMode);
+                                                    SDL_ScaleMode scaleMode);
 
 /**
  *  \brief Get the scale mode used for blit operations.
@@ -344,7 +346,7 @@
  *  \sa SDL_SetSurfaceScaleMode()
  */
 extern DECLSPEC int SDLCALL SDL_GetSurfaceScaleMode(SDL_Surface * surface,
-                                                    int *scaleMode);
+                                                    SDL_ScaleMode *scaleMode);
 
 /**
  *  Sets the clipping rectangle for the destination surface in a blit.
@@ -413,10 +415,10 @@
  */
 extern DECLSPEC int SDLCALL SDL_BlendPoint
     (SDL_Surface * dst, int x, int y,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+     SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
 extern DECLSPEC int SDLCALL SDL_BlendPoints
     (SDL_Surface * dst, const SDL_Point * points, int count,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+     SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
 
 /**
  *  Draws a line with \c color.
@@ -438,10 +440,10 @@
  */
 extern DECLSPEC int SDLCALL SDL_BlendLine
     (SDL_Surface * dst, int x1, int y1, int x2, int y2,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+     SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
 extern DECLSPEC int SDLCALL SDL_BlendLines
     (SDL_Surface * dst, const SDL_Point * points, int count,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+     SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
 
 /**
  *  Draws the given rectangle with \c color.
@@ -467,10 +469,10 @@
  */
 extern DECLSPEC int SDLCALL SDL_BlendRect
     (SDL_Surface * dst, const SDL_Rect * rect,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+     SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
 extern DECLSPEC int SDLCALL SDL_BlendRects
     (SDL_Surface * dst, const SDL_Rect ** rects, int count,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+     SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
 
 /**
  *  Performs a fast fill of the given rectangle with \c color.
@@ -496,92 +498,10 @@
  */
 extern DECLSPEC int SDLCALL SDL_BlendFillRect
     (SDL_Surface * dst, const SDL_Rect * rect,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+     SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
 extern DECLSPEC int SDLCALL SDL_BlendFillRects
     (SDL_Surface * dst, const SDL_Rect ** rects, int count,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-
-#if 0
-/**
- *  Draws the given circle with \c color.
- *  
- *  The color should be a pixel of the format used by the surface, and 
- *  can be generated by the SDL_MapRGB() function.
- *  
- *  \return 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_DrawCircle
-    (SDL_Surface * dst, int x, int y, int radius, Uint32 color);
-
-/**
- *  Blends an RGBA value into the outline of the given circle.
- *  
- *  \return 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_BlendCircle
-    (SDL_Surface * dst, int x, int y, int radius,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-
-/**
- *  Fills the given circle with \c color.
- *  
- *  The color should be a pixel of the format used by the surface, and 
- *  can be generated by the SDL_MapRGB() function.
- *  
- *  \return 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_FillCircle
-    (SDL_Surface * dst, int x, int y, int radius, Uint32 color);
-
-/**
- *  Blends an RGBA value into the given circle.
- *  
- *  \return This function returns 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_BlendFillCircle
-    (SDL_Surface * dst, int x, int y, int radius,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-
-/**
- *  Draws the given ellipse with \c color.
- *  
- *  The color should be a pixel of the format used by the surface, and 
- *  can be generated by the SDL_MapRGB() function.
- *  
- *  \return 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_DrawEllipse
-    (SDL_Surface * dst, int x, int y, int w, int h, Uint32 color);
-
-/**
- *  Blends an RGBA value into the outline of the given ellipse.
- *  
- *  \return 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_BlendEllipse
-    (SDL_Surface * dst, int x, int y, int w, int h,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-
-/**
- *  Fills the given ellipse with \c color.
- *  
- *  The color should be a pixel of the format used by the surface, and 
- *  can be generated by the SDL_MapRGB() function.
- *  
- *  \return 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_FillEllipse
-    (SDL_Surface * dst, int x, int y, int w, int h, Uint32 color);
-
-/**
- *  Blends an RGBA value into the given ellipse.
- *  
- *  \return This function returns 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_BlendFillEllipse
-    (SDL_Surface * dst, int x, int y, int w, int h,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-#endif // 0
+     SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
 
 /**
  *  Performs a fast blit from the source surface to the destination surface.
--- a/include/SDL_video.h	Thu Dec 02 11:56:23 2010 -0800
+++ b/include/SDL_video.h	Sun Dec 12 15:19:05 2010 -0800
@@ -32,6 +32,8 @@
 #include "SDL_stdinc.h"
 #include "SDL_pixels.h"
 #include "SDL_rect.h"
+#include "SDL_blendmode.h"
+#include "SDL_scalemode.h"
 #include "SDL_surface.h"
 
 #include "begin_code.h"
@@ -214,38 +216,6 @@
 } SDL_TextureModulate;
 
 /**
- *  \brief The blend mode used in SDL_RenderCopy() and drawing operations.
- */
-typedef enum
-{
-    SDL_BLENDMODE_NONE = 0x00000000,     /**< No blending */
-    SDL_BLENDMODE_MASK = 0x00000001,     /**< dst = A ? src : dst 
-                                              (alpha is mask) */
-    
-    SDL_BLENDMODE_BLEND = 0x00000002,    /**< dst = (src * A) + (dst * (1-A)) */
-    SDL_BLENDMODE_ADD = 0x00000004,      /**< dst = (src * A) + dst */
-    SDL_BLENDMODE_MOD = 0x00000008       /**< dst = src * dst */
-} SDL_BlendMode;
-
-/**
- *  \brief The texture scale mode used in SDL_RenderCopy().
- */
-typedef enum
-{
-    SDL_TEXTURESCALEMODE_NONE = 0x00000000,     /**< No scaling, rectangles must
-                                                     match dimensions */
-    
-    SDL_TEXTURESCALEMODE_FAST = 0x00000001,     /**< Point sampling or 
-                                                     equivalent algorithm */
-    
-    SDL_TEXTURESCALEMODE_SLOW = 0x00000002,     /**< Linear filtering or 
-                                                     equivalent algorithm */
-    
-    SDL_TEXTURESCALEMODE_BEST = 0x00000004      /**< Bicubic filtering or 
-                                                     equivalent algorithm */
-} SDL_TextureScaleMode;
-
-/**
  *  \brief An efficient driver-specific representation of pixel data
  */
 struct SDL_Texture;
@@ -986,7 +956,7 @@
  *  \sa SDL_GetTextureBlendMode()
  */
 extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture,
-                                                    int blendMode);
+                                                    SDL_BlendMode blendMode);
 
 /**
  *  \brief Get the blend mode used for texture copy operations.
@@ -999,13 +969,13 @@
  *  \sa SDL_SetTextureBlendMode()
  */
 extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture,
-                                                    int *blendMode);
+                                                    SDL_BlendMode *blendMode);
 
 /**
  *  \brief Set the scale mode used for texture copy operations.
  *  
  *  \param texture The texture to update.
- *  \param scaleMode ::SDL_TextureScaleMode to use for texture scaling.
+ *  \param scaleMode ::SDL_ScaleMode to use for texture scaling.
  *  
  *  \return 0 on success, or -1 if the texture is not valid or the scale mode is
  *          not supported.
@@ -1016,7 +986,7 @@
  *  \sa SDL_GetTextureScaleMode()
  */
 extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture * texture,
-                                                    int scaleMode);
+                                                    SDL_ScaleMode scaleMode);
 
 /**
  *  \brief Get the scale mode used for texture copy operations.
@@ -1029,7 +999,7 @@
  *  \sa SDL_SetTextureScaleMode()
  */
 extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture * texture,
-                                                    int *scaleMode);
+                                                    SDL_ScaleMode *scaleMode);
 
 /**
  *  \brief Update the given texture rectangle with new pixel data.
@@ -1135,7 +1105,7 @@
  *  
  *  \sa SDL_GetRenderDrawBlendMode()
  */
-extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(int blendMode);
+extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_BlendMode blendMode);
 
 /**
  *  \brief Get the blend mode used for drawing operations.
@@ -1146,7 +1116,7 @@
  *  
  *  \sa SDL_SetRenderDrawBlendMode()
  */
-extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(int *blendMode);
+extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_BlendMode *blendMode);
 
 /**
  *  \brief Clear the current rendering target with the drawing color
--- a/src/video/SDL_blendfillrect.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/src/video/SDL_blendfillrect.c	Sun Dec 12 15:19:05 2010 -0800
@@ -26,7 +26,7 @@
 
 static int
 SDL_BlendFillRect_RGB555(SDL_Surface * dst, const SDL_Rect * rect,
-                         int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+                         SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 {
     unsigned inva = 0xff - a;
 
@@ -49,7 +49,7 @@
 
 static int
 SDL_BlendFillRect_RGB565(SDL_Surface * dst, const SDL_Rect * rect,
-                         int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+                         SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 {
     unsigned inva = 0xff - a;
 
@@ -72,7 +72,7 @@
 
 static int
 SDL_BlendFillRect_RGB888(SDL_Surface * dst, const SDL_Rect * rect,
-                         int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+                         SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 {
     unsigned inva = 0xff - a;
 
@@ -95,7 +95,7 @@
 
 static int
 SDL_BlendFillRect_ARGB8888(SDL_Surface * dst, const SDL_Rect * rect,
-                           int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+                           SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 {
     unsigned inva = 0xff - a;
 
@@ -118,7 +118,7 @@
 
 static int
 SDL_BlendFillRect_RGB(SDL_Surface * dst, const SDL_Rect * rect,
-                      int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+                      SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 {
     SDL_PixelFormat *fmt = dst->format;
     unsigned inva = 0xff - a;
@@ -164,7 +164,7 @@
 
 static int
 SDL_BlendFillRect_RGBA(SDL_Surface * dst, const SDL_Rect * rect,
-                       int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+                       SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 {
     SDL_PixelFormat *fmt = dst->format;
     unsigned inva = 0xff - a;
@@ -194,7 +194,7 @@
 
 int
 SDL_BlendFillRect(SDL_Surface * dst, const SDL_Rect * rect,
-                  int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+                  SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 {
     SDL_Rect clipped;
 
@@ -263,12 +263,12 @@
 
 int
 SDL_BlendFillRects(SDL_Surface * dst, const SDL_Rect ** rects, int count,
-                   int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+                   SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 {
     SDL_Rect clipped;
     int i;
     int (*func)(SDL_Surface * dst, const SDL_Rect * rect,
-                int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) = NULL;
+                SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) = NULL;
     int status = 0;
 
     if (!dst) {
--- a/src/video/SDL_blendline.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/src/video/SDL_blendline.c	Sun Dec 12 15:19:05 2010 -0800
@@ -26,7 +26,7 @@
 
 static void
 SDL_BlendLine_RGB2(SDL_Surface * dst, int x1, int y1, int x2, int y2,
-                   int blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
+                   SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
                    SDL_bool draw_end)
 {
     const SDL_PixelFormat *fmt = dst->format;
@@ -118,7 +118,7 @@
 
 static void
 SDL_BlendLine_RGB555(SDL_Surface * dst, int x1, int y1, int x2, int y2,
-                     int blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
+                     SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
                      SDL_bool draw_end)
 {
     const SDL_PixelFormat *fmt = dst->format;
@@ -210,7 +210,7 @@
 
 static void
 SDL_BlendLine_RGB565(SDL_Surface * dst, int x1, int y1, int x2, int y2,
-                     int blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
+                     SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
                      SDL_bool draw_end)
 {
     const SDL_PixelFormat *fmt = dst->format;
@@ -302,7 +302,7 @@
 
 static void
 SDL_BlendLine_RGB4(SDL_Surface * dst, int x1, int y1, int x2, int y2,
-                   int blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
+                   SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
                    SDL_bool draw_end)
 {
     const SDL_PixelFormat *fmt = dst->format;
@@ -394,7 +394,7 @@
 
 static void
 SDL_BlendLine_RGBA4(SDL_Surface * dst, int x1, int y1, int x2, int y2,
-                    int blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
+                    SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
                     SDL_bool draw_end)
 {
     const SDL_PixelFormat *fmt = dst->format;
@@ -486,7 +486,7 @@
 
 static void
 SDL_BlendLine_RGB888(SDL_Surface * dst, int x1, int y1, int x2, int y2,
-                     int blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
+                     SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
                      SDL_bool draw_end)
 {
     const SDL_PixelFormat *fmt = dst->format;
@@ -578,7 +578,7 @@
 
 static void
 SDL_BlendLine_ARGB8888(SDL_Surface * dst, int x1, int y1, int x2, int y2,
-                       int blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
+                       SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
                        SDL_bool draw_end)
 {
     const SDL_PixelFormat *fmt = dst->format;
@@ -670,7 +670,7 @@
 
 typedef void (*BlendLineFunc) (SDL_Surface * dst,
                                int x1, int y1, int x2, int y2,
-                               int blendMode,
+                               SDL_BlendMode blendMode,
                                Uint8 r, Uint8 g, Uint8 b, Uint8 a,
                                SDL_bool draw_end);
 
@@ -707,7 +707,7 @@
 
 int
 SDL_BlendLine(SDL_Surface * dst, int x1, int y1, int x2, int y2,
-              int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+              SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 {
     BlendLineFunc func;
 
@@ -734,7 +734,7 @@
 
 int
 SDL_BlendLines(SDL_Surface * dst, const SDL_Point * points, int count,
-               int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+               SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 {
     int i;
     int x1, y1;
--- a/src/video/SDL_blendpoint.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/src/video/SDL_blendpoint.c	Sun Dec 12 15:19:05 2010 -0800
@@ -24,7 +24,7 @@
 #include "SDL_draw.h"
 
 static int
-SDL_BlendPoint_RGB555(SDL_Surface * dst, int x, int y, int blendMode, Uint8 r,
+SDL_BlendPoint_RGB555(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r,
                       Uint8 g, Uint8 b, Uint8 a)
 {
     unsigned inva = 0xff - a;
@@ -47,7 +47,7 @@
 }
 
 static int
-SDL_BlendPoint_RGB565(SDL_Surface * dst, int x, int y, int blendMode, Uint8 r,
+SDL_BlendPoint_RGB565(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r,
                       Uint8 g, Uint8 b, Uint8 a)
 {
     unsigned inva = 0xff - a;
@@ -70,7 +70,7 @@
 }
 
 static int
-SDL_BlendPoint_RGB888(SDL_Surface * dst, int x, int y, int blendMode, Uint8 r,
+SDL_BlendPoint_RGB888(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r,
                       Uint8 g, Uint8 b, Uint8 a)
 {
     unsigned inva = 0xff - a;
@@ -93,7 +93,7 @@
 }
 
 static int
-SDL_BlendPoint_ARGB8888(SDL_Surface * dst, int x, int y, int blendMode,
+SDL_BlendPoint_ARGB8888(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode,
                         Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 {
     unsigned inva = 0xff - a;
@@ -116,7 +116,7 @@
 }
 
 static int
-SDL_BlendPoint_RGB(SDL_Surface * dst, int x, int y, int blendMode, Uint8 r,
+SDL_BlendPoint_RGB(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r,
                    Uint8 g, Uint8 b, Uint8 a)
 {
     SDL_PixelFormat *fmt = dst->format;
@@ -162,7 +162,7 @@
 }
 
 static int
-SDL_BlendPoint_RGBA(SDL_Surface * dst, int x, int y, int blendMode, Uint8 r,
+SDL_BlendPoint_RGBA(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r,
                     Uint8 g, Uint8 b, Uint8 a)
 {
     SDL_PixelFormat *fmt = dst->format;
@@ -192,7 +192,7 @@
 }
 
 int
-SDL_BlendPoint(SDL_Surface * dst, int x, int y, int blendMode, Uint8 r,
+SDL_BlendPoint(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r,
                Uint8 g, Uint8 b, Uint8 a)
 {
     if (!dst) {
@@ -258,14 +258,14 @@
 
 int
 SDL_BlendPoints(SDL_Surface * dst, const SDL_Point * points, int count,
-                int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+                SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 {
     int minx, miny;
     int maxx, maxy;
     int i;
     int x, y;
     int (*func)(SDL_Surface * dst, int x, int y,
-                int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) = NULL;
+                SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) = NULL;
     int status = 0;
 
     if (!dst) {
--- a/src/video/SDL_blendrect.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/src/video/SDL_blendrect.c	Sun Dec 12 15:19:05 2010 -0800
@@ -26,7 +26,7 @@
 
 int
 SDL_BlendRect(SDL_Surface * dst, const SDL_Rect * rect,
-              int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+              SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 {
     SDL_Rect full_rect;
     SDL_Point points[5];
@@ -60,7 +60,7 @@
 
 int
 SDL_BlendRects(SDL_Surface * dst, const SDL_Rect ** rects, int count,
-               int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
+               SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 {
     int i;
 
--- a/src/video/SDL_renderer_gl.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/src/video/SDL_renderer_gl.c	Sun Dec 12 15:19:05 2010 -0800
@@ -126,8 +126,7 @@
       SDL_TEXTUREMODULATE_ALPHA),
      (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
       SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
-     (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST |
-      SDL_TEXTURESCALEMODE_SLOW),
+     (SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST | SDL_SCALEMODE_SLOW),
      15,
      {
       SDL_PIXELFORMAT_INDEX1LSB,
@@ -1004,17 +1003,17 @@
 GL_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
 {
     switch (texture->scaleMode) {
-    case SDL_TEXTURESCALEMODE_NONE:
-    case SDL_TEXTURESCALEMODE_FAST:
-    case SDL_TEXTURESCALEMODE_SLOW:
+    case SDL_SCALEMODE_NONE:
+    case SDL_SCALEMODE_FAST:
+    case SDL_SCALEMODE_SLOW:
         return 0;
-    case SDL_TEXTURESCALEMODE_BEST:
+    case SDL_SCALEMODE_BEST:
         SDL_Unsupported();
-        texture->scaleMode = SDL_TEXTURESCALEMODE_SLOW;
+        texture->scaleMode = SDL_SCALEMODE_SLOW;
         return -1;
     default:
         SDL_Unsupported();
-        texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
+        texture->scaleMode = SDL_SCALEMODE_NONE;
         return -1;
     }
 }
@@ -1365,15 +1364,15 @@
 
     if (texture->scaleMode != data->scaleMode) {
         switch (texture->scaleMode) {
-        case SDL_TEXTURESCALEMODE_NONE:
-        case SDL_TEXTURESCALEMODE_FAST:
+        case SDL_SCALEMODE_NONE:
+        case SDL_SCALEMODE_FAST:
             data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
                                   GL_NEAREST);
             data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
                                   GL_NEAREST);
             break;
-        case SDL_TEXTURESCALEMODE_SLOW:
-        case SDL_TEXTURESCALEMODE_BEST:
+        case SDL_SCALEMODE_SLOW:
+        case SDL_SCALEMODE_BEST:
             data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
                                   GL_LINEAR);
             data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
--- a/src/video/SDL_renderer_gles.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/src/video/SDL_renderer_gles.c	Sun Dec 12 15:19:05 2010 -0800
@@ -112,8 +112,7 @@
       SDL_TEXTUREMODULATE_ALPHA),
      (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
       SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
-     (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST |
-      SDL_TEXTURESCALEMODE_SLOW), 5,
+     (SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST | SDL_SCALEMODE_SLOW), 5,
      {
       /* OpenGL ES 1.x supported formats list */
       SDL_PIXELFORMAT_ABGR4444,
@@ -533,17 +532,17 @@
 GLES_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
 {
     switch (texture->scaleMode) {
-    case SDL_TEXTURESCALEMODE_NONE:
-    case SDL_TEXTURESCALEMODE_FAST:
-    case SDL_TEXTURESCALEMODE_SLOW:
+    case SDL_SCALEMODE_NONE:
+    case SDL_SCALEMODE_FAST:
+    case SDL_SCALEMODE_SLOW:
         return 0;
-    case SDL_TEXTURESCALEMODE_BEST:
+    case SDL_SCALEMODE_BEST:
         SDL_Unsupported();
-        texture->scaleMode = SDL_TEXTURESCALEMODE_SLOW;
+        texture->scaleMode = SDL_SCALEMODE_SLOW;
         return -1;
     default:
         SDL_Unsupported();
-        texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
+        texture->scaleMode = SDL_SCALEMODE_NONE;
         return -1;
     }
 }
@@ -859,15 +858,15 @@
     GLES_SetBlendMode(data, texture->blendMode, 0);
 
     switch (texture->scaleMode) {
-    case SDL_TEXTURESCALEMODE_NONE:
-    case SDL_TEXTURESCALEMODE_FAST:
+    case SDL_SCALEMODE_NONE:
+    case SDL_SCALEMODE_FAST:
         data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
                               GL_NEAREST);
         data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
                               GL_NEAREST);
         break;
-    case SDL_TEXTURESCALEMODE_SLOW:
-    case SDL_TEXTURESCALEMODE_BEST:
+    case SDL_SCALEMODE_SLOW:
+    case SDL_SCALEMODE_BEST:
         data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
                               GL_LINEAR);
         data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
--- a/src/video/SDL_renderer_sw.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/src/video/SDL_renderer_sw.c	Sun Dec 12 15:19:05 2010 -0800
@@ -90,7 +90,7 @@
       SDL_TEXTUREMODULATE_ALPHA),
      (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
       SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
-     (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST),
+     (SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST),
      14,
      {
       SDL_PIXELFORMAT_INDEX8,
--- a/src/video/SDL_surface.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/src/video/SDL_surface.c	Sun Dec 12 15:19:05 2010 -0800
@@ -438,7 +438,7 @@
 }
 
 int
-SDL_SetSurfaceBlendMode(SDL_Surface * surface, int blendMode)
+SDL_SetSurfaceBlendMode(SDL_Surface * surface, SDL_BlendMode blendMode)
 {
     int flags, status;
 
@@ -486,7 +486,7 @@
 }
 
 int
-SDL_GetSurfaceBlendMode(SDL_Surface * surface, int *blendMode)
+SDL_GetSurfaceBlendMode(SDL_Surface * surface, SDL_BlendMode *blendMode)
 {
     if (!surface) {
         return -1;
@@ -519,7 +519,7 @@
 }
 
 int
-SDL_SetSurfaceScaleMode(SDL_Surface * surface, int scaleMode)
+SDL_SetSurfaceScaleMode(SDL_Surface * surface, SDL_ScaleMode scaleMode)
 {
     int flags, status;
 
@@ -531,13 +531,13 @@
     flags = surface->map->info.flags;
     surface->map->info.flags &= ~(SDL_COPY_NEAREST);
     switch (scaleMode) {
-    case SDL_TEXTURESCALEMODE_NONE:
+    case SDL_SCALEMODE_NONE:
         break;
-    case SDL_TEXTURESCALEMODE_FAST:
+    case SDL_SCALEMODE_FAST:
         surface->map->info.flags |= SDL_COPY_NEAREST;
         break;
-    case SDL_TEXTURESCALEMODE_SLOW:
-    case SDL_TEXTURESCALEMODE_BEST:
+    case SDL_SCALEMODE_SLOW:
+    case SDL_SCALEMODE_BEST:
         SDL_Unsupported();
         surface->map->info.flags |= SDL_COPY_NEAREST;
         status = -1;
@@ -555,7 +555,7 @@
 }
 
 int
-SDL_GetSurfaceScaleMode(SDL_Surface * surface, int *scaleMode)
+SDL_GetSurfaceScaleMode(SDL_Surface * surface, SDL_ScaleMode *scaleMode)
 {
     if (!surface) {
         return -1;
@@ -567,10 +567,10 @@
 
     switch (surface->map->info.flags & SDL_COPY_NEAREST) {
     case SDL_COPY_NEAREST:
-        *scaleMode = SDL_TEXTURESCALEMODE_FAST;
+        *scaleMode = SDL_SCALEMODE_FAST;
         break;
     default:
-        *scaleMode = SDL_TEXTURESCALEMODE_NONE;
+        *scaleMode = SDL_SCALEMODE_NONE;
         break;
     }
     return 0;
--- a/src/video/SDL_sysvideo.h	Thu Dec 02 11:56:23 2010 -0800
+++ b/src/video/SDL_sysvideo.h	Sun Dec 12 15:19:05 2010 -0800
@@ -46,8 +46,8 @@
     int w;                      /**< The width of the texture */
     int h;                      /**< The height of the texture */
     int modMode;                /**< The texture modulation mode */
-    int blendMode;              /**< The texture blend mode */
-    int scaleMode;              /**< The texture scale mode */
+    SDL_BlendMode blendMode;    /**< The texture blend mode */
+    SDL_ScaleMode scaleMode;    /**< The texture scale mode */
     Uint8 r, g, b, a;           /**< Texture modulation values */
 
     SDL_Renderer *renderer;
@@ -121,7 +121,7 @@
     SDL_Texture *textures;
 
     Uint8 r, g, b, a;                   /**< Color for drawing operations values */
-    int blendMode;                      /**< The drawing blend mode */
+    SDL_BlendMode blendMode;            /**< The drawing blend mode */
 
     void *driverdata;
 };
--- a/src/video/SDL_video.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/src/video/SDL_video.c	Sun Dec 12 15:19:05 2010 -0800
@@ -1959,8 +1959,8 @@
 
     {
         Uint8 r, g, b, a;
-        int blendMode;
-        int scaleMode;
+        SDL_BlendMode blendMode;
+        SDL_ScaleMode scaleMode;
 
         SDL_GetSurfaceColorMod(surface, &r, &g, &b);
         SDL_SetTextureColorMod(texture, r, g, b);
@@ -2129,7 +2129,7 @@
 }
 
 int
-SDL_SetTextureBlendMode(SDL_Texture * texture, int blendMode)
+SDL_SetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode blendMode)
 {
     SDL_Renderer *renderer;
 
@@ -2145,7 +2145,7 @@
 }
 
 int
-SDL_GetTextureBlendMode(SDL_Texture * texture, int *blendMode)
+SDL_GetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode *blendMode)
 {
     CHECK_TEXTURE_MAGIC(texture, -1);
 
@@ -2156,7 +2156,7 @@
 }
 
 int
-SDL_SetTextureScaleMode(SDL_Texture * texture, int scaleMode)
+SDL_SetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode scaleMode)
 {
     SDL_Renderer *renderer;
 
@@ -2172,7 +2172,7 @@
 }
 
 int
-SDL_GetTextureScaleMode(SDL_Texture * texture, int *scaleMode)
+SDL_GetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode *scaleMode)
 {
     CHECK_TEXTURE_MAGIC(texture, -1);
 
@@ -2315,7 +2315,7 @@
 }
 
 int
-SDL_SetRenderDrawBlendMode(int blendMode)
+SDL_SetRenderDrawBlendMode(SDL_BlendMode blendMode)
 {
     SDL_Renderer *renderer;
 
@@ -2332,7 +2332,7 @@
 }
 
 int
-SDL_GetRenderDrawBlendMode(int *blendMode)
+SDL_GetRenderDrawBlendMode(SDL_BlendMode *blendMode)
 {
     SDL_Renderer *renderer;
 
@@ -2354,7 +2354,7 @@
         return -1;
     }
     if (!renderer->RenderClear) {
-        int blendMode = renderer->blendMode;
+        SDL_BlendMode blendMode = renderer->blendMode;
         int status;
 
         if (blendMode >= SDL_BLENDMODE_BLEND) {
--- a/src/video/directfb/SDL_DirectFB_render.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/src/video/directfb/SDL_DirectFB_render.c	Sun Dec 12 15:19:05 2010 -0800
@@ -104,8 +104,8 @@
       SDL_TEXTUREMODULATE_ALPHA),
      (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | SDL_BLENDMODE_BLEND |
       SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
-     (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST |
-      SDL_TEXTURESCALEMODE_SLOW | SDL_TEXTURESCALEMODE_BEST),
+     (SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST |
+      SDL_SCALEMODE_SLOW | SDL_SCALEMODE_BEST),
      14,
      {
       SDL_PIXELFORMAT_INDEX4LSB,
@@ -711,21 +711,21 @@
     DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata;
 
     switch (texture->scaleMode) {
-    case SDL_TEXTURESCALEMODE_NONE:
-    case SDL_TEXTURESCALEMODE_FAST:
+    case SDL_SCALEMODE_NONE:
+    case SDL_SCALEMODE_FAST:
         data->render_options = DSRO_NONE;
         break;
-    case SDL_TEXTURESCALEMODE_SLOW:
+    case SDL_SCALEMODE_SLOW:
         data->render_options = DSRO_SMOOTH_UPSCALE | DSRO_SMOOTH_DOWNSCALE;
         break;
-    case SDL_TEXTURESCALEMODE_BEST:
+    case SDL_SCALEMODE_BEST:
         data->render_options =
             DSRO_SMOOTH_UPSCALE | DSRO_SMOOTH_DOWNSCALE | DSRO_ANTIALIAS;
         break;
     default:
         SDL_Unsupported();
         data->render_options = DSRO_NONE;
-        texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
+        texture->scaleMode = SDL_SCALEMODE_NONE;
         return -1;
     }
 #endif
--- a/src/video/nds/SDL_ndsrender.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/src/video/nds/SDL_ndsrender.c	Sun Dec 12 15:19:05 2010 -0800
@@ -82,7 +82,7 @@
      (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_PRESENTVSYNC),  /* u32 flags */
      (SDL_TEXTUREMODULATE_NONE),        /* u32 mod_modes */
      (SDL_BLENDMODE_MASK),      /* u32 blend_modes */
-     (SDL_TEXTURESCALEMODE_FAST),       /* u32 scale_modes */
+     (SDL_SCALEMODE_FAST),       /* u32 scale_modes */
      3,                         /* u32 num_texture_formats */
      {
       SDL_PIXELFORMAT_INDEX8,
--- a/src/video/photon/SDL_photon_render.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/src/video/photon/SDL_photon_render.c	Sun Dec 12 15:19:05 2010 -0800
@@ -104,8 +104,7 @@
      (SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_ALPHA),
      (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | SDL_BLENDMODE_BLEND |
       SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
-     (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_SLOW |
-      SDL_TEXTURESCALEMODE_FAST),
+     (SDL_SCALEMODE_NONE | SDL_SCALEMODE_SLOW | SDL_SCALEMODE_FAST),
      10,
      {SDL_PIXELFORMAT_INDEX8,
       SDL_PIXELFORMAT_RGB555,
@@ -254,17 +253,17 @@
     /* Set current scale blitting capabilities */
     if (rdata->surfaces_type==SDL_PHOTON_SURFTYPE_OFFSCREEN)
     {
-       renderer->info.scale_modes=SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_SLOW;
+       renderer->info.scale_modes=SDL_SCALEMODE_NONE | SDL_SCALEMODE_SLOW;
        if ((didata->mode_2dcaps & SDL_VIDEO_PHOTON_CAP_SCALED_BLIT)==SDL_VIDEO_PHOTON_CAP_SCALED_BLIT)
        {
           /* This video mode supports hardware scaling */
-          renderer->info.scale_modes|=SDL_TEXTURESCALEMODE_FAST;
+          renderer->info.scale_modes|=SDL_SCALEMODE_FAST;
        }
     }
     else
     {
        /* PhImage blit functions do not support scaling */
-       renderer->info.scale_modes=SDL_TEXTURESCALEMODE_NONE;
+       renderer->info.scale_modes=SDL_SCALEMODE_NONE;
     }
 
     return renderer;
@@ -984,39 +983,39 @@
 
    switch (texture->scaleMode)
    {
-      case SDL_TEXTURESCALEMODE_NONE:
+      case SDL_SCALEMODE_NONE:
            return 0;
-      case SDL_TEXTURESCALEMODE_FAST:
-           if ((renderer->info.scale_modes & SDL_TEXTURESCALEMODE_FAST)==SDL_TEXTURESCALEMODE_FAST)
+      case SDL_SCALEMODE_FAST:
+           if ((renderer->info.scale_modes & SDL_SCALEMODE_FAST)==SDL_SCALEMODE_FAST)
            {
               return 0;
            }
            else
            {
               SDL_Unsupported();
-              texture->scaleMode = SDL_TEXTURESCALEMODE_FAST;
+              texture->scaleMode = SDL_SCALEMODE_FAST;
               return -1;
            }
            break;
-      case SDL_TEXTURESCALEMODE_SLOW:
-           if ((renderer->info.scale_modes & SDL_TEXTURESCALEMODE_SLOW)==SDL_TEXTURESCALEMODE_SLOW)
+      case SDL_SCALEMODE_SLOW:
+           if ((renderer->info.scale_modes & SDL_SCALEMODE_SLOW)==SDL_SCALEMODE_SLOW)
            {
               return 0;
            }
            else
            {
               SDL_Unsupported();
-              texture->scaleMode = SDL_TEXTURESCALEMODE_SLOW;
+              texture->scaleMode = SDL_SCALEMODE_SLOW;
               return -1;
            }
            break;
-      case SDL_TEXTURESCALEMODE_BEST:
+      case SDL_SCALEMODE_BEST:
            SDL_Unsupported();
-           texture->scaleMode = SDL_TEXTURESCALEMODE_SLOW;
+           texture->scaleMode = SDL_SCALEMODE_SLOW;
            return -1;
       default:
            SDL_Unsupported();
-           texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
+           texture->scaleMode = SDL_SCALEMODE_NONE;
            return -1;
    }
 
--- a/src/video/ps3/SDL_ps3render.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/src/video/ps3/SDL_ps3render.c	Sun Dec 12 15:19:05 2010 -0800
@@ -79,7 +79,7 @@
      (SDL_BLENDMODE_NONE),
      /* We use bilinear scaling on the SPE for YV12 & IYUV
       * (width and height % 8 = 0) */
-     (SDL_TEXTURESCALEMODE_SLOW)
+     (SDL_SCALEMODE_SLOW)
      }
 };
 
--- a/src/video/qnxgf/SDL_gf_render.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/src/video/qnxgf/SDL_gf_render.c	Sun Dec 12 15:19:05 2010 -0800
@@ -87,7 +87,7 @@
       SDL_TEXTUREMODULATE_ALPHA),
      (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
       SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
-     (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_SLOW),
+     (SDL_SCALEMODE_NONE | SDL_SCALEMODE_SLOW),
      13,
      {
       SDL_PIXELFORMAT_INDEX8,
--- a/src/video/win32/SDL_ceddrawrender.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/src/video/win32/SDL_ceddrawrender.c	Sun Dec 12 15:19:05 2010 -0800
@@ -85,7 +85,7 @@
       SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED),
      (SDL_TEXTUREMODULATE_NONE),
      (SDL_BLENDMODE_NONE),
-     (SDL_TEXTURESCALEMODE_NONE),
+     (SDL_SCALEMODE_NONE),
      0,
      {0},
      0,
@@ -666,10 +666,10 @@
 DDRAW_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
 {
     switch (texture->scaleMode) {
-    case SDL_TEXTURESCALEMODE_NONE:
+    case SDL_SCALEMODE_NONE:
     default:
         SDL_Unsupported();
-        texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
+        texture->scaleMode = SDL_SCALEMODE_NONE;
         return -1;
     }
     return 0;
--- a/src/video/win32/SDL_d3drender.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/src/video/win32/SDL_d3drender.c	Sun Dec 12 15:19:05 2010 -0800
@@ -150,8 +150,8 @@
       SDL_TEXTUREMODULATE_ALPHA),
      (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
       SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
-     (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST |
-      SDL_TEXTURESCALEMODE_SLOW | SDL_TEXTURESCALEMODE_BEST),
+     (SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST |
+      SDL_SCALEMODE_SLOW | SDL_SCALEMODE_BEST),
      0,
      {0},
      0,
@@ -807,14 +807,14 @@
 D3D_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
 {
     switch (texture->scaleMode) {
-    case SDL_TEXTURESCALEMODE_NONE:
-    case SDL_TEXTURESCALEMODE_FAST:
-    case SDL_TEXTURESCALEMODE_SLOW:
-    case SDL_TEXTURESCALEMODE_BEST:
+    case SDL_SCALEMODE_NONE:
+    case SDL_SCALEMODE_FAST:
+    case SDL_SCALEMODE_SLOW:
+    case SDL_SCALEMODE_BEST:
         return 0;
     default:
         SDL_Unsupported();
-        texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
+        texture->scaleMode = SDL_SCALEMODE_NONE;
         return -1;
     }
     return 0;
@@ -1343,20 +1343,20 @@
     }
 
     switch (texture->scaleMode) {
-    case SDL_TEXTURESCALEMODE_NONE:
-    case SDL_TEXTURESCALEMODE_FAST:
+    case SDL_SCALEMODE_NONE:
+    case SDL_SCALEMODE_FAST:
         IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER,
                                          D3DTEXF_POINT);
         IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER,
                                          D3DTEXF_POINT);
         break;
-    case SDL_TEXTURESCALEMODE_SLOW:
+    case SDL_SCALEMODE_SLOW:
         IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER,
                                          D3DTEXF_LINEAR);
         IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER,
                                          D3DTEXF_LINEAR);
         break;
-    case SDL_TEXTURESCALEMODE_BEST:
+    case SDL_SCALEMODE_BEST:
         IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER,
                                          D3DTEXF_GAUSSIANQUAD);
         IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER,
--- a/src/video/win32/SDL_gapirender.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/src/video/win32/SDL_gapirender.c	Sun Dec 12 15:19:05 2010 -0800
@@ -210,7 +210,7 @@
 	(SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD),
 	(SDL_TEXTUREMODULATE_NONE),
 	(SDL_BLENDMODE_NONE),
-	(SDL_TEXTURESCALEMODE_NONE),
+	(SDL_SCALEMODE_NONE),
 	7,
 	{
 	    SDL_PIXELFORMAT_RGB555,
@@ -233,7 +233,7 @@
 	(SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD),
 	(SDL_TEXTUREMODULATE_NONE),
 	(SDL_BLENDMODE_NONE),
-	(SDL_TEXTURESCALEMODE_NONE),
+	(SDL_SCALEMODE_NONE),
 	7,
 	{
 	    SDL_PIXELFORMAT_RGB555,
--- a/src/video/win32/SDL_gdirender.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/src/video/win32/SDL_gdirender.c	Sun Dec 12 15:19:05 2010 -0800
@@ -90,7 +90,7 @@
       SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED),
      (SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_ALPHA),
      (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK),
-     (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST),
+     (SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST),
      14,
      {
       SDL_PIXELFORMAT_INDEX8,
@@ -580,17 +580,17 @@
 GDI_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
 {
     switch (texture->scaleMode) {
-    case SDL_TEXTURESCALEMODE_NONE:
-    case SDL_TEXTURESCALEMODE_FAST:
+    case SDL_SCALEMODE_NONE:
+    case SDL_SCALEMODE_FAST:
         return 0;
-    case SDL_TEXTURESCALEMODE_SLOW:
-    case SDL_TEXTURESCALEMODE_BEST:
+    case SDL_SCALEMODE_SLOW:
+    case SDL_SCALEMODE_BEST:
         SDL_Unsupported();
-        texture->scaleMode = SDL_TEXTURESCALEMODE_FAST;
+        texture->scaleMode = SDL_SCALEMODE_FAST;
         return -1;
     default:
         SDL_Unsupported();
-        texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
+        texture->scaleMode = SDL_SCALEMODE_NONE;
         return -1;
     }
     return 0;
--- a/src/video/x11/SDL_x11render.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/src/video/x11/SDL_x11render.c	Sun Dec 12 15:19:05 2010 -0800
@@ -83,7 +83,7 @@
       SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED),
      SDL_TEXTUREMODULATE_NONE,
      SDL_BLENDMODE_NONE,
-     SDL_TEXTURESCALEMODE_NONE,
+     SDL_SCALEMODE_NONE,
      0,
      {0},
      0,
@@ -331,8 +331,8 @@
         /* Update the capabilities of the renderer. */
         info->blend_modes |= (SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD |
                              SDL_BLENDMODE_MOD | SDL_BLENDMODE_MASK);
-        info->scale_modes |= (SDL_TEXTURESCALEMODE_FAST | SDL_TEXTURESCALEMODE_SLOW |
-                             SDL_TEXTURESCALEMODE_BEST);
+        info->scale_modes |= (SDL_SCALEMODE_FAST | SDL_SCALEMODE_SLOW |
+                             SDL_SCALEMODE_BEST);
         info->mod_modes |= (SDL_TEXTUREMODULATE_COLOR | SDL_TEXTUREMODULATE_ALPHA);
     }
 #endif
@@ -1078,7 +1078,7 @@
         // FIXME: Is the following required?
         /* Set the default blending and scaling modes. */
         texture->blendMode = SDL_BLENDMODE_NONE;
-        texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
+        texture->scaleMode = SDL_SCALEMODE_NONE;
         data->blend_op = PictOpSrc;
         data->filter = NULL;
     }
@@ -1216,14 +1216,14 @@
     X11_RenderData *renderdata = (X11_RenderData *) renderer->driverdata;
 
     switch (texture->scaleMode) {
-    case SDL_TEXTURESCALEMODE_NONE:
+    case SDL_SCALEMODE_NONE:
 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER
         if (renderdata->use_xrender) {
             data->filter = NULL;
         }
 #endif
         return 0;
-    case SDL_TEXTURESCALEMODE_FAST:
+    case SDL_SCALEMODE_FAST:
         /* We can sort of fake it for streaming textures */
         if (data->yuv || texture->access == SDL_TEXTUREACCESS_STREAMING) {
             return 0;
@@ -1233,12 +1233,12 @@
             data->filter = FilterFast;
             return 0;
         }
-    case SDL_TEXTURESCALEMODE_SLOW:
+    case SDL_SCALEMODE_SLOW:
         if (renderdata->use_xrender) {
             data->filter = FilterGood;
             return 0;
         }
-    case SDL_TEXTURESCALEMODE_BEST:
+    case SDL_SCALEMODE_BEST:
         if (renderdata->use_xrender) {
             data->filter = FilterBest;
             return 0;
@@ -1249,12 +1249,12 @@
         SDL_Unsupported();
 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER
         if (renderdata->use_xrender) {
-            texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
+            texture->scaleMode = SDL_SCALEMODE_NONE;
             data->filter = NULL;
         }
         else
 #endif
-            texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
+            texture->scaleMode = SDL_SCALEMODE_NONE;
         return -1;
     }
     return 0;
@@ -2012,7 +2012,7 @@
             }
 
             /* Set the picture filter only if a scaling mode is set. */
-            if (texture->scaleMode != SDL_TEXTURESCALEMODE_NONE) {
+            if (texture->scaleMode != SDL_SCALEMODE_NONE) {
                 XRenderSetPictureFilter(data->display, src,
                                         texturedata->filter, 0, 0);
             }
--- a/test/common.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/test/common.c	Sun Dec 12 15:19:05 2010 -0800
@@ -437,16 +437,16 @@
 PrintScaleMode(Uint32 flag)
 {
     switch (flag) {
-    case SDL_TEXTURESCALEMODE_NONE:
+    case SDL_SCALEMODE_NONE:
         fprintf(stderr, "None");
         break;
-    case SDL_TEXTURESCALEMODE_FAST:
+    case SDL_SCALEMODE_FAST:
         fprintf(stderr, "Fast");
         break;
-    case SDL_TEXTURESCALEMODE_SLOW:
+    case SDL_SCALEMODE_SLOW:
         fprintf(stderr, "Slow");
         break;
-    case SDL_TEXTURESCALEMODE_BEST:
+    case SDL_SCALEMODE_BEST:
         fprintf(stderr, "Best");
         break;
     default:
--- a/test/testsprite2.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/test/testsprite2.c	Sun Dec 12 15:19:05 2010 -0800
@@ -21,7 +21,7 @@
 static SDL_Rect *velocities;
 static int sprite_w, sprite_h;
 static SDL_BlendMode blendMode = SDL_BLENDMODE_MASK;
-static SDL_TextureScaleMode scaleMode = SDL_TEXTURESCALEMODE_NONE;
+static SDL_ScaleMode scaleMode = SDL_SCALEMODE_NONE;
 
 /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
 static void
@@ -256,16 +256,16 @@
             } else if (SDL_strcasecmp(argv[i], "--scale") == 0) {
                 if (argv[i + 1]) {
                     if (SDL_strcasecmp(argv[i + 1], "none") == 0) {
-                        scaleMode = SDL_TEXTURESCALEMODE_NONE;
+                        scaleMode = SDL_SCALEMODE_NONE;
                         consumed = 2;
                     } else if (SDL_strcasecmp(argv[i + 1], "fast") == 0) {
-                        scaleMode = SDL_TEXTURESCALEMODE_FAST;
+                        scaleMode = SDL_SCALEMODE_FAST;
                         consumed = 2;
                     } else if (SDL_strcasecmp(argv[i + 1], "slow") == 0) {
-                        scaleMode = SDL_TEXTURESCALEMODE_SLOW;
+                        scaleMode = SDL_SCALEMODE_SLOW;
                         consumed = 2;
                     } else if (SDL_strcasecmp(argv[i + 1], "best") == 0) {
-                        scaleMode = SDL_TEXTURESCALEMODE_BEST;
+                        scaleMode = SDL_SCALEMODE_BEST;
                         consumed = 2;
                     }
                 }
@@ -316,7 +316,7 @@
         quit(2);
     }
     srand((unsigned int)time(NULL));
-    if (scaleMode != SDL_TEXTURESCALEMODE_NONE) {
+    if (scaleMode != SDL_SCALEMODE_NONE) {
         sprite_w += sprite_w / 2;
         sprite_h += sprite_h / 2;
     }