indent
authorSam Lantinga <slouken@libsdl.org>
Mon, 15 Sep 2008 04:32:36 +0000
changeset 27530969758c8809
parent 2752 edd2839b36f7
child 2754 703d7746f6c7
indent
Xcode/SDL/SDL.xcodeproj/project.pbxproj
include/SDL_opengles.h
src/video/SDL_glesfuncs.h
src/video/SDL_renderer_gles.c
src/video/SDL_sysvideo.h
src/video/SDL_video.c
src/video/Xext/Xxf86vm/XF86VMode.c
     1.1 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj	Mon Sep 15 04:31:30 2008 +0000
     1.2 +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj	Mon Sep 15 04:32:36 2008 +0000
     1.3 @@ -673,7 +673,7 @@
     1.4  		0014B89A09C0DAAE003A99D5 /* Xvlibint.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Xvlibint.h; sourceTree = "<group>"; };
     1.5  		0014B89F09C0DAB9003A99D5 /* Xinerama.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = Xinerama.c; sourceTree = "<group>"; };
     1.6  		0014B8A209C0DAC4003A99D5 /* xme.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = xme.c; sourceTree = "<group>"; };
     1.7 -		0014B9A909C0E585003A99D5 /* Info-FrameworkNoX11.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "Info-FrameworkNoX11.plist"; sourceTree = "<group>"; };
     1.8 +		0014B9A909C0E585003A99D5 /* Info-FrameworkNoX11.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-FrameworkNoX11.plist"; sourceTree = "<group>"; };
     1.9  		00162D3409BD1FA90037C8D0 /* SDL_config_macosx.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_config_macosx.h; path = ../../include/SDL_config_macosx.h; sourceTree = SOURCE_ROOT; };
    1.10  		00162D3709BD1FA90037C8D0 /* SDL_config.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_config.h; path = ../../include/SDL_config.h; sourceTree = SOURCE_ROOT; };
    1.11  		00162D3809BD1FA90037C8D0 /* SDL_platform.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_platform.h; path = ../../include/SDL_platform.h; sourceTree = SOURCE_ROOT; };
    1.12 @@ -791,7 +791,7 @@
    1.13  		B2CF8DC705C4450500E5DC7F /* SDL_name.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_name.h; path = ../../include/SDL_name.h; sourceTree = SOURCE_ROOT; };
    1.14  		BECDF5D50761B759005FE872 /* SDL_coreaudio.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_coreaudio.c; sourceTree = "<group>"; };
    1.15  		BECDF5D60761B759005FE872 /* SDL_coreaudio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_coreaudio.h; sourceTree = "<group>"; };
    1.16 -		BECDF66B0761BA81005FE872 /* Info-Framework.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "Info-Framework.plist"; sourceTree = "<group>"; };
    1.17 +		BECDF66B0761BA81005FE872 /* Info-Framework.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-Framework.plist"; sourceTree = "<group>"; };
    1.18  		BECDF66C0761BA81005FE872 /* SDL.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDL.framework; sourceTree = BUILT_PRODUCTS_DIR; };
    1.19  		BECDF6B30761BA81005FE872 /* libSDL.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL.a; sourceTree = BUILT_PRODUCTS_DIR; };
    1.20  		BECDF6BE0761BA81005FE872 /* Standard DMG */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "Standard DMG"; sourceTree = BUILT_PRODUCTS_DIR; };
     2.1 --- a/include/SDL_opengles.h	Mon Sep 15 04:31:30 2008 +0000
     2.2 +++ b/include/SDL_opengles.h	Mon Sep 15 04:32:36 2008 +0000
     2.3 @@ -32,19 +32,20 @@
     2.4  /* $Id: gl.h 4533 2007-11-26 11:19:35Z markc $ */
     2.5  
     2.6  #ifdef __cplusplus
     2.7 -extern "C" {
     2.8 +extern "C"
     2.9 +{
    2.10  #endif
    2.11  
    2.12 -	
    2.13 +
    2.14  #ifndef APIENTRY
    2.15  #define APIENTRY
    2.16 -#endif	
    2.17 -	
    2.18 +#endif
    2.19 +
    2.20  #ifndef GL_APIENTRY
    2.21  #define GL_APIENTRY
    2.22 -#endif	
    2.23 -	
    2.24 -	
    2.25 +#endif
    2.26 +
    2.27 +
    2.28  /*
    2.29  ** License Applicability. Except to the extent portions of this file are
    2.30  ** made subject to an alternative license as permitted in the SGI Free
    2.31 @@ -79,24 +80,24 @@
    2.32  ** compliant with the OpenGL(R) version 1.2.1 Specification.
    2.33  */
    2.34  
    2.35 -typedef unsigned int    GLenum;
    2.36 -typedef unsigned char   GLboolean;
    2.37 -typedef unsigned int    GLbitfield;
    2.38 -typedef signed char     GLbyte;
    2.39 -typedef short           GLshort;
    2.40 -typedef int             GLint;
    2.41 -typedef int             GLsizei;
    2.42 -typedef unsigned char   GLubyte;
    2.43 -typedef unsigned short  GLushort;
    2.44 -typedef unsigned int    GLuint;
    2.45 -typedef float           GLfloat;
    2.46 -typedef float           GLclampf;
    2.47 -typedef void            GLvoid;
    2.48 -typedef int             GLfixed;
    2.49 -typedef int             GLclampx;
    2.50 +    typedef unsigned int GLenum;
    2.51 +    typedef unsigned char GLboolean;
    2.52 +    typedef unsigned int GLbitfield;
    2.53 +    typedef signed char GLbyte;
    2.54 +    typedef short GLshort;
    2.55 +    typedef int GLint;
    2.56 +    typedef int GLsizei;
    2.57 +    typedef unsigned char GLubyte;
    2.58 +    typedef unsigned short GLushort;
    2.59 +    typedef unsigned int GLuint;
    2.60 +    typedef float GLfloat;
    2.61 +    typedef float GLclampf;
    2.62 +    typedef void GLvoid;
    2.63 +    typedef int GLfixed;
    2.64 +    typedef int GLclampx;
    2.65  
    2.66 -typedef int             GLintptr;
    2.67 -typedef int             GLsizeiptr;
    2.68 +    typedef int GLintptr;
    2.69 +    typedef int GLsizeiptr;
    2.70  
    2.71  
    2.72  /*************************************************************/
    2.73 @@ -654,152 +655,262 @@
    2.74  /*************************************************************/
    2.75  
    2.76  /* Available only in Common profile */
    2.77 -GL_API void GL_APIENTRY glAlphaFunc (GLenum func, GLclampf ref);
    2.78 -GL_API void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
    2.79 -GL_API void GL_APIENTRY glClearDepthf (GLclampf depth);
    2.80 -GL_API void GL_APIENTRY glClipPlanef (GLenum plane, const GLfloat *equation);
    2.81 -GL_API void GL_APIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
    2.82 -GL_API void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
    2.83 -GL_API void GL_APIENTRY glFogf (GLenum pname, GLfloat param);
    2.84 -GL_API void GL_APIENTRY glFogfv (GLenum pname, const GLfloat *params);
    2.85 -GL_API void GL_APIENTRY glFrustumf (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
    2.86 -GL_API void GL_APIENTRY glGetClipPlanef (GLenum pname, GLfloat eqn[4]);
    2.87 -GL_API void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *params);
    2.88 -GL_API void GL_APIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params);
    2.89 -GL_API void GL_APIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params);
    2.90 -GL_API void GL_APIENTRY glGetTexEnvfv (GLenum env, GLenum pname, GLfloat *params);
    2.91 -GL_API void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
    2.92 -GL_API void GL_APIENTRY glLightModelf (GLenum pname, GLfloat param);
    2.93 -GL_API void GL_APIENTRY glLightModelfv (GLenum pname, const GLfloat *params);
    2.94 -GL_API void GL_APIENTRY glLightf (GLenum light, GLenum pname, GLfloat param);
    2.95 -GL_API void GL_APIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params);
    2.96 -GL_API void GL_APIENTRY glLineWidth (GLfloat width);
    2.97 -GL_API void GL_APIENTRY glLoadMatrixf (const GLfloat *m);
    2.98 -GL_API void GL_APIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param);
    2.99 -GL_API void GL_APIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params);
   2.100 -GL_API void GL_APIENTRY glMultMatrixf (const GLfloat *m);
   2.101 -GL_API void GL_APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
   2.102 -GL_API void GL_APIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz);
   2.103 -GL_API void GL_APIENTRY glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
   2.104 -GL_API void GL_APIENTRY glPointParameterf (GLenum pname, GLfloat param);
   2.105 -GL_API void GL_APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params);
   2.106 -GL_API void GL_APIENTRY glPointSize (GLfloat size);
   2.107 -GL_API void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
   2.108 -GL_API void GL_APIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
   2.109 -GL_API void GL_APIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z);
   2.110 -GL_API void GL_APIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param);
   2.111 -GL_API void GL_APIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params);
   2.112 -GL_API void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
   2.113 -GL_API void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
   2.114 -GL_API void GL_APIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z);
   2.115 +    GL_API void GL_APIENTRY glAlphaFunc(GLenum func, GLclampf ref);
   2.116 +    GL_API void GL_APIENTRY glClearColor(GLclampf red, GLclampf green,
   2.117 +                                         GLclampf blue, GLclampf alpha);
   2.118 +    GL_API void GL_APIENTRY glClearDepthf(GLclampf depth);
   2.119 +    GL_API void GL_APIENTRY glClipPlanef(GLenum plane,
   2.120 +                                         const GLfloat * equation);
   2.121 +    GL_API void GL_APIENTRY glColor4f(GLfloat red, GLfloat green,
   2.122 +                                      GLfloat blue, GLfloat alpha);
   2.123 +    GL_API void GL_APIENTRY glDepthRangef(GLclampf zNear, GLclampf zFar);
   2.124 +    GL_API void GL_APIENTRY glFogf(GLenum pname, GLfloat param);
   2.125 +    GL_API void GL_APIENTRY glFogfv(GLenum pname, const GLfloat * params);
   2.126 +    GL_API void GL_APIENTRY glFrustumf(GLfloat left, GLfloat right,
   2.127 +                                       GLfloat bottom, GLfloat top,
   2.128 +                                       GLfloat zNear, GLfloat zFar);
   2.129 +    GL_API void GL_APIENTRY glGetClipPlanef(GLenum pname, GLfloat eqn[4]);
   2.130 +    GL_API void GL_APIENTRY glGetFloatv(GLenum pname, GLfloat * params);
   2.131 +    GL_API void GL_APIENTRY glGetLightfv(GLenum light, GLenum pname,
   2.132 +                                         GLfloat * params);
   2.133 +    GL_API void GL_APIENTRY glGetMaterialfv(GLenum face, GLenum pname,
   2.134 +                                            GLfloat * params);
   2.135 +    GL_API void GL_APIENTRY glGetTexEnvfv(GLenum env, GLenum pname,
   2.136 +                                          GLfloat * params);
   2.137 +    GL_API void GL_APIENTRY glGetTexParameterfv(GLenum target, GLenum pname,
   2.138 +                                                GLfloat * params);
   2.139 +    GL_API void GL_APIENTRY glLightModelf(GLenum pname, GLfloat param);
   2.140 +    GL_API void GL_APIENTRY glLightModelfv(GLenum pname,
   2.141 +                                           const GLfloat * params);
   2.142 +    GL_API void GL_APIENTRY glLightf(GLenum light, GLenum pname,
   2.143 +                                     GLfloat param);
   2.144 +    GL_API void GL_APIENTRY glLightfv(GLenum light, GLenum pname,
   2.145 +                                      const GLfloat * params);
   2.146 +    GL_API void GL_APIENTRY glLineWidth(GLfloat width);
   2.147 +    GL_API void GL_APIENTRY glLoadMatrixf(const GLfloat * m);
   2.148 +    GL_API void GL_APIENTRY glMaterialf(GLenum face, GLenum pname,
   2.149 +                                        GLfloat param);
   2.150 +    GL_API void GL_APIENTRY glMaterialfv(GLenum face, GLenum pname,
   2.151 +                                         const GLfloat * params);
   2.152 +    GL_API void GL_APIENTRY glMultMatrixf(const GLfloat * m);
   2.153 +    GL_API void GL_APIENTRY glMultiTexCoord4f(GLenum target, GLfloat s,
   2.154 +                                              GLfloat t, GLfloat r,
   2.155 +                                              GLfloat q);
   2.156 +    GL_API void GL_APIENTRY glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz);
   2.157 +    GL_API void GL_APIENTRY glOrthof(GLfloat left, GLfloat right,
   2.158 +                                     GLfloat bottom, GLfloat top,
   2.159 +                                     GLfloat zNear, GLfloat zFar);
   2.160 +    GL_API void GL_APIENTRY glPointParameterf(GLenum pname, GLfloat param);
   2.161 +    GL_API void GL_APIENTRY glPointParameterfv(GLenum pname,
   2.162 +                                               const GLfloat * params);
   2.163 +    GL_API void GL_APIENTRY glPointSize(GLfloat size);
   2.164 +    GL_API void GL_APIENTRY glPolygonOffset(GLfloat factor, GLfloat units);
   2.165 +    GL_API void GL_APIENTRY glRotatef(GLfloat angle, GLfloat x, GLfloat y,
   2.166 +                                      GLfloat z);
   2.167 +    GL_API void GL_APIENTRY glScalef(GLfloat x, GLfloat y, GLfloat z);
   2.168 +    GL_API void GL_APIENTRY glTexEnvf(GLenum target, GLenum pname,
   2.169 +                                      GLfloat param);
   2.170 +    GL_API void GL_APIENTRY glTexEnvfv(GLenum target, GLenum pname,
   2.171 +                                       const GLfloat * params);
   2.172 +    GL_API void GL_APIENTRY glTexParameterf(GLenum target, GLenum pname,
   2.173 +                                            GLfloat param);
   2.174 +    GL_API void GL_APIENTRY glTexParameterfv(GLenum target, GLenum pname,
   2.175 +                                             const GLfloat * params);
   2.176 +    GL_API void GL_APIENTRY glTranslatef(GLfloat x, GLfloat y, GLfloat z);
   2.177  
   2.178  /* Available in both Common and Common-Lite profiles */
   2.179 -GL_API void GL_APIENTRY glActiveTexture (GLenum texture);
   2.180 -GL_API void GL_APIENTRY glAlphaFuncx (GLenum func, GLclampx ref);
   2.181 -GL_API void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
   2.182 -GL_API void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
   2.183 -GL_API void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
   2.184 -GL_API void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
   2.185 -GL_API void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
   2.186 -GL_API void GL_APIENTRY glClear (GLbitfield mask);
   2.187 -GL_API void GL_APIENTRY glClearColorx (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
   2.188 -GL_API void GL_APIENTRY glClearDepthx (GLclampx depth);
   2.189 -GL_API void GL_APIENTRY glClearStencil (GLint s);
   2.190 -GL_API void GL_APIENTRY glClientActiveTexture (GLenum texture);
   2.191 -GL_API void GL_APIENTRY glClipPlanex (GLenum plane, const GLfixed *equation);
   2.192 -GL_API void GL_APIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
   2.193 -GL_API void GL_APIENTRY glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
   2.194 -GL_API void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
   2.195 -GL_API void GL_APIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
   2.196 -GL_API void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
   2.197 -GL_API void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
   2.198 -GL_API void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
   2.199 -GL_API void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
   2.200 -GL_API void GL_APIENTRY glCullFace (GLenum mode);
   2.201 -GL_API void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
   2.202 -GL_API void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
   2.203 -GL_API void GL_APIENTRY glDepthFunc (GLenum func);
   2.204 -GL_API void GL_APIENTRY glDepthMask (GLboolean flag);
   2.205 -GL_API void GL_APIENTRY glDepthRangex (GLclampx zNear, GLclampx zFar);
   2.206 -GL_API void GL_APIENTRY glDisable (GLenum cap);
   2.207 -GL_API void GL_APIENTRY glDisableClientState (GLenum array);
   2.208 -GL_API void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
   2.209 -GL_API void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
   2.210 -GL_API void GL_APIENTRY glEnable (GLenum cap);
   2.211 -GL_API void GL_APIENTRY glEnableClientState (GLenum array);
   2.212 -GL_API void GL_APIENTRY glFinish (void);
   2.213 -GL_API void GL_APIENTRY glFlush (void);
   2.214 -GL_API void GL_APIENTRY glFogx (GLenum pname, GLfixed param);
   2.215 -GL_API void GL_APIENTRY glFogxv (GLenum pname, const GLfixed *params);
   2.216 -GL_API void GL_APIENTRY glFrontFace (GLenum mode);
   2.217 -GL_API void GL_APIENTRY glFrustumx (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
   2.218 -GL_API void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *params);
   2.219 -GL_API void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
   2.220 -GL_API void GL_APIENTRY glGetClipPlanex (GLenum pname, GLfixed eqn[4]);
   2.221 -GL_API void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
   2.222 -GL_API void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
   2.223 -GL_API GLenum GL_APIENTRY glGetError (void);
   2.224 -GL_API void GL_APIENTRY glGetFixedv (GLenum pname, GLfixed *params);
   2.225 -GL_API void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *params);
   2.226 -GL_API void GL_APIENTRY glGetLightxv (GLenum light, GLenum pname, GLfixed *params);
   2.227 -GL_API void GL_APIENTRY glGetMaterialxv (GLenum face, GLenum pname, GLfixed *params);
   2.228 -GL_API void GL_APIENTRY glGetPointerv (GLenum pname, void **params);
   2.229 -GL_API const GLubyte * GL_APIENTRY glGetString (GLenum name);
   2.230 -GL_API void GL_APIENTRY glGetTexEnviv (GLenum env, GLenum pname, GLint *params);
   2.231 -GL_API void GL_APIENTRY glGetTexEnvxv (GLenum env, GLenum pname, GLfixed *params);
   2.232 -GL_API void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
   2.233 -GL_API void GL_APIENTRY glGetTexParameterxv (GLenum target, GLenum pname, GLfixed *params);
   2.234 -GL_API void GL_APIENTRY glHint (GLenum target, GLenum mode);
   2.235 -GL_API GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
   2.236 -GL_API GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
   2.237 -GL_API GLboolean GL_APIENTRY glIsTexture (GLuint texture);
   2.238 -GL_API void GL_APIENTRY glLightModelx (GLenum pname, GLfixed param);
   2.239 -GL_API void GL_APIENTRY glLightModelxv (GLenum pname, const GLfixed *params);
   2.240 -GL_API void GL_APIENTRY glLightx (GLenum light, GLenum pname, GLfixed param);
   2.241 -GL_API void GL_APIENTRY glLightxv (GLenum light, GLenum pname, const GLfixed *params);
   2.242 -GL_API void GL_APIENTRY glLineWidthx (GLfixed width);
   2.243 -GL_API void GL_APIENTRY glLoadIdentity (void);
   2.244 -GL_API void GL_APIENTRY glLoadMatrixx (const GLfixed *m);
   2.245 -GL_API void GL_APIENTRY glLogicOp (GLenum opcode);
   2.246 -GL_API void GL_APIENTRY glMaterialx (GLenum face, GLenum pname, GLfixed param);
   2.247 -GL_API void GL_APIENTRY glMaterialxv (GLenum face, GLenum pname, const GLfixed *params);
   2.248 -GL_API void GL_APIENTRY glMatrixMode (GLenum mode);
   2.249 -GL_API void GL_APIENTRY glMultMatrixx (const GLfixed *m);
   2.250 -GL_API void GL_APIENTRY glMultiTexCoord4x (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
   2.251 -GL_API void GL_APIENTRY glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz);
   2.252 -GL_API void GL_APIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
   2.253 -GL_API void GL_APIENTRY glOrthox (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
   2.254 -GL_API void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
   2.255 -GL_API void GL_APIENTRY glPointParameterx (GLenum pname, GLfixed param);
   2.256 -GL_API void GL_APIENTRY glPointParameterxv (GLenum pname, const GLfixed *params);
   2.257 -GL_API void GL_APIENTRY glPointSizex (GLfixed size);
   2.258 -GL_API void GL_APIENTRY glPolygonOffsetx (GLfixed factor, GLfixed units);
   2.259 -GL_API void GL_APIENTRY glPopMatrix (void);
   2.260 -GL_API void GL_APIENTRY glPushMatrix (void);
   2.261 -GL_API void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
   2.262 -GL_API void GL_APIENTRY glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
   2.263 -GL_API void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
   2.264 -GL_API void GL_APIENTRY glSampleCoveragex (GLclampx value, GLboolean invert);
   2.265 -GL_API void GL_APIENTRY glScalex (GLfixed x, GLfixed y, GLfixed z);
   2.266 -GL_API void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
   2.267 -GL_API void GL_APIENTRY glShadeModel (GLenum mode);
   2.268 -GL_API void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
   2.269 -GL_API void GL_APIENTRY glStencilMask (GLuint mask);
   2.270 -GL_API void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
   2.271 -GL_API void GL_APIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
   2.272 -GL_API void GL_APIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param);
   2.273 -GL_API void GL_APIENTRY glTexEnvx (GLenum target, GLenum pname, GLfixed param);
   2.274 -GL_API void GL_APIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params);
   2.275 -GL_API void GL_APIENTRY glTexEnvxv (GLenum target, GLenum pname, const GLfixed *params);
   2.276 -GL_API void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
   2.277 -GL_API void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
   2.278 -GL_API void GL_APIENTRY glTexParameterx (GLenum target, GLenum pname, GLfixed param);
   2.279 -GL_API void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
   2.280 -GL_API void GL_APIENTRY glTexParameterxv (GLenum target, GLenum pname, const GLfixed *params);
   2.281 -GL_API void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
   2.282 -GL_API void GL_APIENTRY glTranslatex (GLfixed x, GLfixed y, GLfixed z);
   2.283 -GL_API void GL_APIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
   2.284 -GL_API void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
   2.285 +    GL_API void GL_APIENTRY glActiveTexture(GLenum texture);
   2.286 +    GL_API void GL_APIENTRY glAlphaFuncx(GLenum func, GLclampx ref);
   2.287 +    GL_API void GL_APIENTRY glBindBuffer(GLenum target, GLuint buffer);
   2.288 +    GL_API void GL_APIENTRY glBindTexture(GLenum target, GLuint texture);
   2.289 +    GL_API void GL_APIENTRY glBlendFunc(GLenum sfactor, GLenum dfactor);
   2.290 +    GL_API void GL_APIENTRY glBufferData(GLenum target, GLsizeiptr size,
   2.291 +                                         const GLvoid * data, GLenum usage);
   2.292 +    GL_API void GL_APIENTRY glBufferSubData(GLenum target, GLintptr offset,
   2.293 +                                            GLsizeiptr size,
   2.294 +                                            const GLvoid * data);
   2.295 +    GL_API void GL_APIENTRY glClear(GLbitfield mask);
   2.296 +    GL_API void GL_APIENTRY glClearColorx(GLclampx red, GLclampx green,
   2.297 +                                          GLclampx blue, GLclampx alpha);
   2.298 +    GL_API void GL_APIENTRY glClearDepthx(GLclampx depth);
   2.299 +    GL_API void GL_APIENTRY glClearStencil(GLint s);
   2.300 +    GL_API void GL_APIENTRY glClientActiveTexture(GLenum texture);
   2.301 +    GL_API void GL_APIENTRY glClipPlanex(GLenum plane,
   2.302 +                                         const GLfixed * equation);
   2.303 +    GL_API void GL_APIENTRY glColor4ub(GLubyte red, GLubyte green,
   2.304 +                                       GLubyte blue, GLubyte alpha);
   2.305 +    GL_API void GL_APIENTRY glColor4x(GLfixed red, GLfixed green,
   2.306 +                                      GLfixed blue, GLfixed alpha);
   2.307 +    GL_API void GL_APIENTRY glColorMask(GLboolean red, GLboolean green,
   2.308 +                                        GLboolean blue, GLboolean alpha);
   2.309 +    GL_API void GL_APIENTRY glColorPointer(GLint size, GLenum type,
   2.310 +                                           GLsizei stride,
   2.311 +                                           const GLvoid * pointer);
   2.312 +    GL_API void GL_APIENTRY glCompressedTexImage2D(GLenum target, GLint level,
   2.313 +                                                   GLenum internalformat,
   2.314 +                                                   GLsizei width,
   2.315 +                                                   GLsizei height,
   2.316 +                                                   GLint border,
   2.317 +                                                   GLsizei imageSize,
   2.318 +                                                   const GLvoid * data);
   2.319 +    GL_API void GL_APIENTRY glCompressedTexSubImage2D(GLenum target,
   2.320 +                                                      GLint level,
   2.321 +                                                      GLint xoffset,
   2.322 +                                                      GLint yoffset,
   2.323 +                                                      GLsizei width,
   2.324 +                                                      GLsizei height,
   2.325 +                                                      GLenum format,
   2.326 +                                                      GLsizei imageSize,
   2.327 +                                                      const GLvoid * data);
   2.328 +    GL_API void GL_APIENTRY glCopyTexImage2D(GLenum target, GLint level,
   2.329 +                                             GLenum internalformat, GLint x,
   2.330 +                                             GLint y, GLsizei width,
   2.331 +                                             GLsizei height, GLint border);
   2.332 +    GL_API void GL_APIENTRY glCopyTexSubImage2D(GLenum target, GLint level,
   2.333 +                                                GLint xoffset, GLint yoffset,
   2.334 +                                                GLint x, GLint y,
   2.335 +                                                GLsizei width,
   2.336 +                                                GLsizei height);
   2.337 +    GL_API void GL_APIENTRY glCullFace(GLenum mode);
   2.338 +    GL_API void GL_APIENTRY glDeleteBuffers(GLsizei n,
   2.339 +                                            const GLuint * buffers);
   2.340 +    GL_API void GL_APIENTRY glDeleteTextures(GLsizei n,
   2.341 +                                             const GLuint * textures);
   2.342 +    GL_API void GL_APIENTRY glDepthFunc(GLenum func);
   2.343 +    GL_API void GL_APIENTRY glDepthMask(GLboolean flag);
   2.344 +    GL_API void GL_APIENTRY glDepthRangex(GLclampx zNear, GLclampx zFar);
   2.345 +    GL_API void GL_APIENTRY glDisable(GLenum cap);
   2.346 +    GL_API void GL_APIENTRY glDisableClientState(GLenum array);
   2.347 +    GL_API void GL_APIENTRY glDrawArrays(GLenum mode, GLint first,
   2.348 +                                         GLsizei count);
   2.349 +    GL_API void GL_APIENTRY glDrawElements(GLenum mode, GLsizei count,
   2.350 +                                           GLenum type,
   2.351 +                                           const GLvoid * indices);
   2.352 +    GL_API void GL_APIENTRY glEnable(GLenum cap);
   2.353 +    GL_API void GL_APIENTRY glEnableClientState(GLenum array);
   2.354 +    GL_API void GL_APIENTRY glFinish(void);
   2.355 +    GL_API void GL_APIENTRY glFlush(void);
   2.356 +    GL_API void GL_APIENTRY glFogx(GLenum pname, GLfixed param);
   2.357 +    GL_API void GL_APIENTRY glFogxv(GLenum pname, const GLfixed * params);
   2.358 +    GL_API void GL_APIENTRY glFrontFace(GLenum mode);
   2.359 +    GL_API void GL_APIENTRY glFrustumx(GLfixed left, GLfixed right,
   2.360 +                                       GLfixed bottom, GLfixed top,
   2.361 +                                       GLfixed zNear, GLfixed zFar);
   2.362 +    GL_API void GL_APIENTRY glGetBooleanv(GLenum pname, GLboolean * params);
   2.363 +    GL_API void GL_APIENTRY glGetBufferParameteriv(GLenum target,
   2.364 +                                                   GLenum pname,
   2.365 +                                                   GLint * params);
   2.366 +    GL_API void GL_APIENTRY glGetClipPlanex(GLenum pname, GLfixed eqn[4]);
   2.367 +    GL_API void GL_APIENTRY glGenBuffers(GLsizei n, GLuint * buffers);
   2.368 +    GL_API void GL_APIENTRY glGenTextures(GLsizei n, GLuint * textures);
   2.369 +    GL_API GLenum GL_APIENTRY glGetError(void);
   2.370 +    GL_API void GL_APIENTRY glGetFixedv(GLenum pname, GLfixed * params);
   2.371 +    GL_API void GL_APIENTRY glGetIntegerv(GLenum pname, GLint * params);
   2.372 +    GL_API void GL_APIENTRY glGetLightxv(GLenum light, GLenum pname,
   2.373 +                                         GLfixed * params);
   2.374 +    GL_API void GL_APIENTRY glGetMaterialxv(GLenum face, GLenum pname,
   2.375 +                                            GLfixed * params);
   2.376 +    GL_API void GL_APIENTRY glGetPointerv(GLenum pname, void **params);
   2.377 +    GL_API const GLubyte *GL_APIENTRY glGetString(GLenum name);
   2.378 +    GL_API void GL_APIENTRY glGetTexEnviv(GLenum env, GLenum pname,
   2.379 +                                          GLint * params);
   2.380 +    GL_API void GL_APIENTRY glGetTexEnvxv(GLenum env, GLenum pname,
   2.381 +                                          GLfixed * params);
   2.382 +    GL_API void GL_APIENTRY glGetTexParameteriv(GLenum target, GLenum pname,
   2.383 +                                                GLint * params);
   2.384 +    GL_API void GL_APIENTRY glGetTexParameterxv(GLenum target, GLenum pname,
   2.385 +                                                GLfixed * params);
   2.386 +    GL_API void GL_APIENTRY glHint(GLenum target, GLenum mode);
   2.387 +    GL_API GLboolean GL_APIENTRY glIsBuffer(GLuint buffer);
   2.388 +    GL_API GLboolean GL_APIENTRY glIsEnabled(GLenum cap);
   2.389 +    GL_API GLboolean GL_APIENTRY glIsTexture(GLuint texture);
   2.390 +    GL_API void GL_APIENTRY glLightModelx(GLenum pname, GLfixed param);
   2.391 +    GL_API void GL_APIENTRY glLightModelxv(GLenum pname,
   2.392 +                                           const GLfixed * params);
   2.393 +    GL_API void GL_APIENTRY glLightx(GLenum light, GLenum pname,
   2.394 +                                     GLfixed param);
   2.395 +    GL_API void GL_APIENTRY glLightxv(GLenum light, GLenum pname,
   2.396 +                                      const GLfixed * params);
   2.397 +    GL_API void GL_APIENTRY glLineWidthx(GLfixed width);
   2.398 +    GL_API void GL_APIENTRY glLoadIdentity(void);
   2.399 +    GL_API void GL_APIENTRY glLoadMatrixx(const GLfixed * m);
   2.400 +    GL_API void GL_APIENTRY glLogicOp(GLenum opcode);
   2.401 +    GL_API void GL_APIENTRY glMaterialx(GLenum face, GLenum pname,
   2.402 +                                        GLfixed param);
   2.403 +    GL_API void GL_APIENTRY glMaterialxv(GLenum face, GLenum pname,
   2.404 +                                         const GLfixed * params);
   2.405 +    GL_API void GL_APIENTRY glMatrixMode(GLenum mode);
   2.406 +    GL_API void GL_APIENTRY glMultMatrixx(const GLfixed * m);
   2.407 +    GL_API void GL_APIENTRY glMultiTexCoord4x(GLenum target, GLfixed s,
   2.408 +                                              GLfixed t, GLfixed r,
   2.409 +                                              GLfixed q);
   2.410 +    GL_API void GL_APIENTRY glNormal3x(GLfixed nx, GLfixed ny, GLfixed nz);
   2.411 +    GL_API void GL_APIENTRY glNormalPointer(GLenum type, GLsizei stride,
   2.412 +                                            const GLvoid * pointer);
   2.413 +    GL_API void GL_APIENTRY glOrthox(GLfixed left, GLfixed right,
   2.414 +                                     GLfixed bottom, GLfixed top,
   2.415 +                                     GLfixed zNear, GLfixed zFar);
   2.416 +    GL_API void GL_APIENTRY glPixelStorei(GLenum pname, GLint param);
   2.417 +    GL_API void GL_APIENTRY glPointParameterx(GLenum pname, GLfixed param);
   2.418 +    GL_API void GL_APIENTRY glPointParameterxv(GLenum pname,
   2.419 +                                               const GLfixed * params);
   2.420 +    GL_API void GL_APIENTRY glPointSizex(GLfixed size);
   2.421 +    GL_API void GL_APIENTRY glPolygonOffsetx(GLfixed factor, GLfixed units);
   2.422 +    GL_API void GL_APIENTRY glPopMatrix(void);
   2.423 +    GL_API void GL_APIENTRY glPushMatrix(void);
   2.424 +    GL_API void GL_APIENTRY glReadPixels(GLint x, GLint y, GLsizei width,
   2.425 +                                         GLsizei height, GLenum format,
   2.426 +                                         GLenum type, GLvoid * pixels);
   2.427 +    GL_API void GL_APIENTRY glRotatex(GLfixed angle, GLfixed x, GLfixed y,
   2.428 +                                      GLfixed z);
   2.429 +    GL_API void GL_APIENTRY glSampleCoverage(GLclampf value,
   2.430 +                                             GLboolean invert);
   2.431 +    GL_API void GL_APIENTRY glSampleCoveragex(GLclampx value,
   2.432 +                                              GLboolean invert);
   2.433 +    GL_API void GL_APIENTRY glScalex(GLfixed x, GLfixed y, GLfixed z);
   2.434 +    GL_API void GL_APIENTRY glScissor(GLint x, GLint y, GLsizei width,
   2.435 +                                      GLsizei height);
   2.436 +    GL_API void GL_APIENTRY glShadeModel(GLenum mode);
   2.437 +    GL_API void GL_APIENTRY glStencilFunc(GLenum func, GLint ref,
   2.438 +                                          GLuint mask);
   2.439 +    GL_API void GL_APIENTRY glStencilMask(GLuint mask);
   2.440 +    GL_API void GL_APIENTRY glStencilOp(GLenum fail, GLenum zfail,
   2.441 +                                        GLenum zpass);
   2.442 +    GL_API void GL_APIENTRY glTexCoordPointer(GLint size, GLenum type,
   2.443 +                                              GLsizei stride,
   2.444 +                                              const GLvoid * pointer);
   2.445 +    GL_API void GL_APIENTRY glTexEnvi(GLenum target, GLenum pname,
   2.446 +                                      GLint param);
   2.447 +    GL_API void GL_APIENTRY glTexEnvx(GLenum target, GLenum pname,
   2.448 +                                      GLfixed param);
   2.449 +    GL_API void GL_APIENTRY glTexEnviv(GLenum target, GLenum pname,
   2.450 +                                       const GLint * params);
   2.451 +    GL_API void GL_APIENTRY glTexEnvxv(GLenum target, GLenum pname,
   2.452 +                                       const GLfixed * params);
   2.453 +    GL_API void GL_APIENTRY glTexImage2D(GLenum target, GLint level,
   2.454 +                                         GLint internalformat, GLsizei width,
   2.455 +                                         GLsizei height, GLint border,
   2.456 +                                         GLenum format, GLenum type,
   2.457 +                                         const GLvoid * pixels);
   2.458 +    GL_API void GL_APIENTRY glTexParameteri(GLenum target, GLenum pname,
   2.459 +                                            GLint param);
   2.460 +    GL_API void GL_APIENTRY glTexParameterx(GLenum target, GLenum pname,
   2.461 +                                            GLfixed param);
   2.462 +    GL_API void GL_APIENTRY glTexParameteriv(GLenum target, GLenum pname,
   2.463 +                                             const GLint * params);
   2.464 +    GL_API void GL_APIENTRY glTexParameterxv(GLenum target, GLenum pname,
   2.465 +                                             const GLfixed * params);
   2.466 +    GL_API void GL_APIENTRY glTexSubImage2D(GLenum target, GLint level,
   2.467 +                                            GLint xoffset, GLint yoffset,
   2.468 +                                            GLsizei width, GLsizei height,
   2.469 +                                            GLenum format, GLenum type,
   2.470 +                                            const GLvoid * pixels);
   2.471 +    GL_API void GL_APIENTRY glTranslatex(GLfixed x, GLfixed y, GLfixed z);
   2.472 +    GL_API void GL_APIENTRY glVertexPointer(GLint size, GLenum type,
   2.473 +                                            GLsizei stride,
   2.474 +                                            const GLvoid * pointer);
   2.475 +    GL_API void GL_APIENTRY glViewport(GLint x, GLint y, GLsizei width,
   2.476 +                                       GLsizei height);
   2.477  
   2.478  /*------------------------------------------------------------------------*
   2.479   * Required OES extension functions
   2.480 @@ -818,7 +929,8 @@
   2.481  /* GL_OES_point_size_array */
   2.482  #ifndef GL_OES_point_size_array
   2.483  #define GL_OES_point_size_array 1
   2.484 -GL_API void GL_APIENTRY glPointSizePointerOES (GLenum type, GLsizei stride, const GLvoid *pointer);
   2.485 +    GL_API void GL_APIENTRY glPointSizePointerOES(GLenum type, GLsizei stride,
   2.486 +                                                  const GLvoid * pointer);
   2.487  #endif
   2.488  
   2.489  /* GL_OES_point_sprite */
   2.490 @@ -830,5 +942,4 @@
   2.491  }
   2.492  #endif
   2.493  
   2.494 -#endif /* __gles_h_ */
   2.495 -
   2.496 +#endif                          /* __gles_h_ */
     3.1 --- a/src/video/SDL_glesfuncs.h	Mon Sep 15 04:31:30 2008 +0000
     3.2 +++ b/src/video/SDL_glesfuncs.h	Mon Sep 15 04:32:36 2008 +0000
     3.3 @@ -5,42 +5,59 @@
     3.4  #define SDL_PROC_UNUSED(ret,func,params)
     3.5  
     3.6  SDL_PROC_UNUSED(void, glAlphaFunc, (GLenum func, GLclampf ref))
     3.7 -SDL_PROC(void, glClearColor, (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha))
     3.8 +SDL_PROC(void, glClearColor,
     3.9 +         (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha))
    3.10  SDL_PROC_UNUSED(void, glClearDepthf, (GLclampf depth))
    3.11 -SDL_PROC_UNUSED(void, glClipPlanef, (GLenum plane, const GLfloat *equation))
    3.12 -SDL_PROC(void, glColor4f, (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha))
    3.13 +SDL_PROC_UNUSED(void, glClipPlanef, (GLenum plane, const GLfloat * equation))
    3.14 +SDL_PROC(void, glColor4f,
    3.15 +         (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha))
    3.16  SDL_PROC_UNUSED(void, glDepthRangef, (GLclampf zNear, GLclampf zFar))
    3.17  SDL_PROC_UNUSED(void, glFogf, (GLenum pname, GLfloat param))
    3.18 -SDL_PROC_UNUSED(void, glFogfv, (GLenum pname, const GLfloat *params))
    3.19 -SDL_PROC_UNUSED(void, glFrustumf, (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar))
    3.20 +SDL_PROC_UNUSED(void, glFogfv, (GLenum pname, const GLfloat * params))
    3.21 +SDL_PROC_UNUSED(void, glFrustumf,
    3.22 +                (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top,
    3.23 +                 GLfloat zNear, GLfloat zFar))
    3.24  SDL_PROC_UNUSED(void, glGetClipPlanef, (GLenum pname, GLfloat eqn[4]))
    3.25 -SDL_PROC(void, glGetFloatv, (GLenum pname, GLfloat *params))
    3.26 -SDL_PROC_UNUSED(void, glGetLightfv, (GLenum light, GLenum pname, GLfloat *params))
    3.27 -SDL_PROC_UNUSED(void, glGetMaterialfv, (GLenum face, GLenum pname, GLfloat *params))
    3.28 -SDL_PROC_UNUSED(void, glGetTexEnvfv, (GLenum env, GLenum pname, GLfloat *params))
    3.29 -SDL_PROC_UNUSED(void, glGetTexParameterfv, (GLenum target, GLenum pname, GLfloat *params))
    3.30 +SDL_PROC(void, glGetFloatv, (GLenum pname, GLfloat * params))
    3.31 +SDL_PROC_UNUSED(void, glGetLightfv,
    3.32 +                (GLenum light, GLenum pname, GLfloat * params))
    3.33 +SDL_PROC_UNUSED(void, glGetMaterialfv,
    3.34 +                (GLenum face, GLenum pname, GLfloat * params))
    3.35 +SDL_PROC_UNUSED(void, glGetTexEnvfv,
    3.36 +                (GLenum env, GLenum pname, GLfloat * params))
    3.37 +SDL_PROC_UNUSED(void, glGetTexParameterfv,
    3.38 +                (GLenum target, GLenum pname, GLfloat * params))
    3.39  SDL_PROC_UNUSED(void, glLightModelf, (GLenum pname, GLfloat param))
    3.40 -SDL_PROC_UNUSED(void, glLightModelfv, (GLenum pname, const GLfloat *params))
    3.41 +SDL_PROC_UNUSED(void, glLightModelfv, (GLenum pname, const GLfloat * params))
    3.42  SDL_PROC_UNUSED(void, glLightf, (GLenum light, GLenum pname, GLfloat param))
    3.43 -SDL_PROC_UNUSED(void, glLightfv, (GLenum light, GLenum pname, const GLfloat *params))
    3.44 +SDL_PROC_UNUSED(void, glLightfv,
    3.45 +                (GLenum light, GLenum pname, const GLfloat * params))
    3.46  SDL_PROC_UNUSED(void, glLineWidth, (GLfloat width))
    3.47 -SDL_PROC_UNUSED(void, glLoadMatrixf, (const GLfloat *m))
    3.48 +SDL_PROC_UNUSED(void, glLoadMatrixf, (const GLfloat * m))
    3.49  SDL_PROC_UNUSED(void, glMaterialf, (GLenum face, GLenum pname, GLfloat param))
    3.50 -SDL_PROC_UNUSED(void, glMaterialfv, (GLenum face, GLenum pname, const GLfloat *params))
    3.51 -SDL_PROC_UNUSED(void, glMultMatrixf, (const GLfloat *m))
    3.52 -SDL_PROC_UNUSED(void, glMultiTexCoord4f, (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q))
    3.53 +SDL_PROC_UNUSED(void, glMaterialfv,
    3.54 +                (GLenum face, GLenum pname, const GLfloat * params))
    3.55 +SDL_PROC_UNUSED(void, glMultMatrixf, (const GLfloat * m))
    3.56 +SDL_PROC_UNUSED(void, glMultiTexCoord4f,
    3.57 +                (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q))
    3.58  SDL_PROC_UNUSED(void, glNormal3f, (GLfloat nx, GLfloat ny, GLfloat nz))
    3.59 -SDL_PROC(void, glOrthof, (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar))
    3.60 +SDL_PROC(void, glOrthof,
    3.61 +         (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top,
    3.62 +          GLfloat zNear, GLfloat zFar))
    3.63  SDL_PROC_UNUSED(void, glPointParameterf, (GLenum pname, GLfloat param))
    3.64 -SDL_PROC_UNUSED(void, glPointParameterfv, (GLenum pname, const GLfloat *params))
    3.65 +SDL_PROC_UNUSED(void, glPointParameterfv,
    3.66 +                (GLenum pname, const GLfloat * params))
    3.67  SDL_PROC_UNUSED(void, glPointSize, (GLfloat size))
    3.68  SDL_PROC_UNUSED(void, glPolygonOffset, (GLfloat factor, GLfloat units))
    3.69 -SDL_PROC_UNUSED(void, glRotatef, (GLfloat angle, GLfloat x, GLfloat y, GLfloat z))
    3.70 +SDL_PROC_UNUSED(void, glRotatef,
    3.71 +                (GLfloat angle, GLfloat x, GLfloat y, GLfloat z))
    3.72  SDL_PROC_UNUSED(void, glScalef, (GLfloat x, GLfloat y, GLfloat z))
    3.73  SDL_PROC(void, glTexEnvf, (GLenum target, GLenum pname, GLfloat param))
    3.74 -SDL_PROC_UNUSED(void, glTexEnvfv, (GLenum target, GLenum pname, const GLfloat *params))
    3.75 +SDL_PROC_UNUSED(void, glTexEnvfv,
    3.76 +                (GLenum target, GLenum pname, const GLfloat * params))
    3.77  SDL_PROC(void, glTexParameterf, (GLenum target, GLenum pname, GLfloat param))
    3.78 -SDL_PROC_UNUSED(void, glTexParameterfv, (GLenum target, GLenum pname, const GLfloat *params))
    3.79 +SDL_PROC_UNUSED(void, glTexParameterfv,
    3.80 +                (GLenum target, GLenum pname, const GLfloat * params))
    3.81  SDL_PROC_UNUSED(void, glTranslatef, (GLfloat x, GLfloat y, GLfloat z))
    3.82  
    3.83  /* Available in both Common and Common-Lite profiles */
    3.84 @@ -49,85 +66,127 @@
    3.85  SDL_PROC_UNUSED(void, glBindBuffer, (GLenum target, GLuint buffer))
    3.86  SDL_PROC(void, glBindTexture, (GLenum target, GLuint texture))
    3.87  SDL_PROC(void, glBlendFunc, (GLenum sfactor, GLenum dfactor))
    3.88 -SDL_PROC_UNUSED(void, glBufferData, (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage))
    3.89 -SDL_PROC_UNUSED(void, glBufferSubData, (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data))
    3.90 +SDL_PROC_UNUSED(void, glBufferData,
    3.91 +                (GLenum target, GLsizeiptr size, const GLvoid * data,
    3.92 +                 GLenum usage))
    3.93 +SDL_PROC_UNUSED(void, glBufferSubData,
    3.94 +                (GLenum target, GLintptr offset, GLsizeiptr size,
    3.95 +                 const GLvoid * data))
    3.96  SDL_PROC(void, glClear, (GLbitfield mask))
    3.97 -SDL_PROC_UNUSED(void, glClearColorx, (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha))
    3.98 +SDL_PROC_UNUSED(void, glClearColorx,
    3.99 +                (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha))
   3.100  SDL_PROC_UNUSED(void, glClearDepthx, (GLclampx depth))
   3.101  SDL_PROC_UNUSED(void, glClearStencil, (GLint s))
   3.102  SDL_PROC_UNUSED(void, glClientActiveTexture, (GLenum texture))
   3.103 -SDL_PROC_UNUSED(void, glClipPlanex, (GLenum plane, const GLfixed *equation))
   3.104 -SDL_PROC_UNUSED(void, glColor4ub, (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha))
   3.105 -SDL_PROC_UNUSED(void, glColor4x, (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha))
   3.106 -SDL_PROC_UNUSED(void, glColorMask, (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha))
   3.107 -SDL_PROC_UNUSED(void, glColorPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer))
   3.108 -SDL_PROC_UNUSED(void, glCompressedTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data))
   3.109 -SDL_PROC_UNUSED(void, glCompressedTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data))
   3.110 -SDL_PROC_UNUSED(void, glCopyTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border))
   3.111 -SDL_PROC_UNUSED(void, glCopyTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height))
   3.112 +SDL_PROC_UNUSED(void, glClipPlanex, (GLenum plane, const GLfixed * equation))
   3.113 +SDL_PROC_UNUSED(void, glColor4ub,
   3.114 +                (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha))
   3.115 +SDL_PROC_UNUSED(void, glColor4x,
   3.116 +                (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha))
   3.117 +SDL_PROC_UNUSED(void, glColorMask,
   3.118 +                (GLboolean red, GLboolean green, GLboolean blue,
   3.119 +                 GLboolean alpha))
   3.120 +SDL_PROC_UNUSED(void, glColorPointer,
   3.121 +                (GLint size, GLenum type, GLsizei stride,
   3.122 +                 const GLvoid * pointer))
   3.123 +SDL_PROC_UNUSED(void, glCompressedTexImage2D,
   3.124 +                (GLenum target, GLint level, GLenum internalformat,
   3.125 +                 GLsizei width, GLsizei height, GLint border,
   3.126 +                 GLsizei imageSize, const GLvoid * data))
   3.127 +SDL_PROC_UNUSED(void, glCompressedTexSubImage2D,
   3.128 +                (GLenum target, GLint level, GLint xoffset, GLint yoffset,
   3.129 +                 GLsizei width, GLsizei height, GLenum format,
   3.130 +                 GLsizei imageSize, const GLvoid * data))
   3.131 +SDL_PROC_UNUSED(void, glCopyTexImage2D,
   3.132 +                (GLenum target, GLint level, GLenum internalformat, GLint x,
   3.133 +                 GLint y, GLsizei width, GLsizei height, GLint border))
   3.134 +SDL_PROC_UNUSED(void, glCopyTexSubImage2D,
   3.135 +                (GLenum target, GLint level, GLint xoffset, GLint yoffset,
   3.136 +                 GLint x, GLint y, GLsizei width, GLsizei height))
   3.137  SDL_PROC_UNUSED(void, glCullFace, (GLenum mode))
   3.138 -SDL_PROC_UNUSED(void, glDeleteBuffers, (GLsizei n, const GLuint *buffers))
   3.139 -SDL_PROC_UNUSED(void, glDeleteTextures, (GLsizei n, const GLuint *textures))
   3.140 +SDL_PROC_UNUSED(void, glDeleteBuffers, (GLsizei n, const GLuint * buffers))
   3.141 +SDL_PROC_UNUSED(void, glDeleteTextures, (GLsizei n, const GLuint * textures))
   3.142  SDL_PROC_UNUSED(void, glDepthFunc, (GLenum func))
   3.143  SDL_PROC_UNUSED(void, glDepthMask, (GLboolean flag))
   3.144  SDL_PROC_UNUSED(void, glDepthRangex, (GLclampx zNear, GLclampx zFar))
   3.145  SDL_PROC(void, glDisable, (GLenum cap))
   3.146  SDL_PROC_UNUSED(void, glDisableClientState, (GLenum array))
   3.147  SDL_PROC(void, glDrawArrays, (GLenum mode, GLint first, GLsizei count))
   3.148 -SDL_PROC_UNUSED(void, glDrawElements, (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices))
   3.149 +SDL_PROC_UNUSED(void, glDrawElements,
   3.150 +                (GLenum mode, GLsizei count, GLenum type,
   3.151 +                 const GLvoid * indices))
   3.152  SDL_PROC(void, glEnable, (GLenum cap))
   3.153  SDL_PROC(void, glEnableClientState, (GLenum array))
   3.154  SDL_PROC_UNUSED(void, glFinish, (void))
   3.155  SDL_PROC_UNUSED(void, glFlush, (void))
   3.156  SDL_PROC_UNUSED(void, glFogx, (GLenum pname, GLfixed param))
   3.157 -SDL_PROC_UNUSED(void, glFogxv, (GLenum pname, const GLfixed *params))
   3.158 +SDL_PROC_UNUSED(void, glFogxv, (GLenum pname, const GLfixed * params))
   3.159  SDL_PROC_UNUSED(void, glFrontFace, (GLenum mode))
   3.160 -SDL_PROC_UNUSED(void, glFrustumx, (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar))
   3.161 -SDL_PROC_UNUSED(void, glGetBooleanv, (GLenum pname, GLboolean *params))
   3.162 -SDL_PROC_UNUSED(void, glGetBufferParameteriv, (GLenum target, GLenum pname, GLint *params))
   3.163 +SDL_PROC_UNUSED(void, glFrustumx,
   3.164 +                (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top,
   3.165 +                 GLfixed zNear, GLfixed zFar))
   3.166 +SDL_PROC_UNUSED(void, glGetBooleanv, (GLenum pname, GLboolean * params))
   3.167 +SDL_PROC_UNUSED(void, glGetBufferParameteriv,
   3.168 +                (GLenum target, GLenum pname, GLint * params))
   3.169  SDL_PROC_UNUSED(void, glGetClipPlanex, (GLenum pname, GLfixed eqn[4]))
   3.170 -SDL_PROC_UNUSED(void, glGenBuffers, (GLsizei n, GLuint *buffers))
   3.171 -SDL_PROC(void, glGenTextures, (GLsizei n, GLuint *textures))
   3.172 +SDL_PROC_UNUSED(void, glGenBuffers, (GLsizei n, GLuint * buffers))
   3.173 +SDL_PROC(void, glGenTextures, (GLsizei n, GLuint * textures))
   3.174  SDL_PROC(GLenum, glGetError, (void))
   3.175 -SDL_PROC_UNUSED(void, glGetFixedv, (GLenum pname, GLfixed *params))
   3.176 -SDL_PROC(void, glGetIntegerv, (GLenum pname, GLint *params))
   3.177 -SDL_PROC_UNUSED(void, glGetLightxv, (GLenum light, GLenum pname, GLfixed *params))
   3.178 -SDL_PROC_UNUSED(void, glGetMaterialxv, (GLenum face, GLenum pname, GLfixed *params))
   3.179 +SDL_PROC_UNUSED(void, glGetFixedv, (GLenum pname, GLfixed * params))
   3.180 +SDL_PROC(void, glGetIntegerv, (GLenum pname, GLint * params))
   3.181 +SDL_PROC_UNUSED(void, glGetLightxv,
   3.182 +                (GLenum light, GLenum pname, GLfixed * params))
   3.183 +SDL_PROC_UNUSED(void, glGetMaterialxv,
   3.184 +                (GLenum face, GLenum pname, GLfixed * params))
   3.185  SDL_PROC_UNUSED(void, glGetPointerv, (GLenum pname, void **params))
   3.186  SDL_PROC_UNUSED(const GLubyte *, glGetString, (GLenum name))
   3.187 -SDL_PROC_UNUSED(void, glGetTexEnviv, (GLenum env, GLenum pname, GLint *params))
   3.188 -SDL_PROC_UNUSED(void, glGetTexEnvxv, (GLenum env, GLenum pname, GLfixed *params))
   3.189 -SDL_PROC_UNUSED(void, glGetTexParameteriv, (GLenum target, GLenum pname, GLint *params))
   3.190 -SDL_PROC_UNUSED(void, glGetTexParameterxv, (GLenum target, GLenum pname, GLfixed *params))
   3.191 +SDL_PROC_UNUSED(void, glGetTexEnviv,
   3.192 +                (GLenum env, GLenum pname, GLint * params))
   3.193 +SDL_PROC_UNUSED(void, glGetTexEnvxv,
   3.194 +                (GLenum env, GLenum pname, GLfixed * params))
   3.195 +SDL_PROC_UNUSED(void, glGetTexParameteriv,
   3.196 +                (GLenum target, GLenum pname, GLint * params))
   3.197 +SDL_PROC_UNUSED(void, glGetTexParameterxv,
   3.198 +                (GLenum target, GLenum pname, GLfixed * params))
   3.199  SDL_PROC_UNUSED(void, glHint, (GLenum target, GLenum mode))
   3.200  SDL_PROC_UNUSED(GLboolean, glIsBuffer, (GLuint buffer))
   3.201  SDL_PROC_UNUSED(GLboolean, glIsEnabled, (GLenum cap))
   3.202  SDL_PROC_UNUSED(GLboolean, glIsTexture, (GLuint texture))
   3.203  SDL_PROC_UNUSED(void, glLightModelx, (GLenum pname, GLfixed param))
   3.204 -SDL_PROC_UNUSED(void, glLightModelxv, (GLenum pname, const GLfixed *params))
   3.205 +SDL_PROC_UNUSED(void, glLightModelxv, (GLenum pname, const GLfixed * params))
   3.206  SDL_PROC_UNUSED(void, glLightx, (GLenum light, GLenum pname, GLfixed param))
   3.207 -SDL_PROC_UNUSED(void, glLightxv, (GLenum light, GLenum pname, const GLfixed *params))
   3.208 +SDL_PROC_UNUSED(void, glLightxv,
   3.209 +                (GLenum light, GLenum pname, const GLfixed * params))
   3.210  SDL_PROC_UNUSED(void, glLineWidthx, (GLfixed width))
   3.211  SDL_PROC(void, glLoadIdentity, (void))
   3.212 -SDL_PROC_UNUSED(void, glLoadMatrixx, (const GLfixed *m))
   3.213 +SDL_PROC_UNUSED(void, glLoadMatrixx, (const GLfixed * m))
   3.214  SDL_PROC_UNUSED(void, glLogicOp, (GLenum opcode))
   3.215  SDL_PROC_UNUSED(void, glMaterialx, (GLenum face, GLenum pname, GLfixed param))
   3.216 -SDL_PROC_UNUSED(void, glMaterialxv, (GLenum face, GLenum pname, const GLfixed *params))
   3.217 +SDL_PROC_UNUSED(void, glMaterialxv,
   3.218 +                (GLenum face, GLenum pname, const GLfixed * params))
   3.219  SDL_PROC(void, glMatrixMode, (GLenum mode))
   3.220 -SDL_PROC_UNUSED(void, glMultMatrixx, (const GLfixed *m))
   3.221 -SDL_PROC_UNUSED(void, glMultiTexCoord4x, (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q))
   3.222 +SDL_PROC_UNUSED(void, glMultMatrixx, (const GLfixed * m))
   3.223 +SDL_PROC_UNUSED(void, glMultiTexCoord4x,
   3.224 +                (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q))
   3.225  SDL_PROC_UNUSED(void, glNormal3x, (GLfixed nx, GLfixed ny, GLfixed nz))
   3.226 -SDL_PROC_UNUSED(void, glNormalPointer, (GLenum type, GLsizei stride, const GLvoid *pointer))
   3.227 -SDL_PROC_UNUSED(void, glOrthox, (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar))
   3.228 +SDL_PROC_UNUSED(void, glNormalPointer,
   3.229 +                (GLenum type, GLsizei stride, const GLvoid * pointer))
   3.230 +SDL_PROC_UNUSED(void, glOrthox,
   3.231 +                (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top,
   3.232 +                 GLfixed zNear, GLfixed zFar))
   3.233  SDL_PROC(void, glPixelStorei, (GLenum pname, GLint param))
   3.234  SDL_PROC_UNUSED(void, glPointParameterx, (GLenum pname, GLfixed param))
   3.235 -SDL_PROC_UNUSED(void, glPointParameterxv, (GLenum pname, const GLfixed *params))
   3.236 +SDL_PROC_UNUSED(void, glPointParameterxv,
   3.237 +                (GLenum pname, const GLfixed * params))
   3.238  SDL_PROC_UNUSED(void, glPointSizex, (GLfixed size))
   3.239  SDL_PROC_UNUSED(void, glPolygonOffsetx, (GLfixed factor, GLfixed units))
   3.240  SDL_PROC_UNUSED(void, glPopMatrix, (void))
   3.241  SDL_PROC_UNUSED(void, glPushMatrix, (void))
   3.242 -SDL_PROC_UNUSED(void, glReadPixels, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels))
   3.243 -SDL_PROC_UNUSED(void, glRotatex, (GLfixed angle, GLfixed x, GLfixed y, GLfixed z))
   3.244 +SDL_PROC_UNUSED(void, glReadPixels,
   3.245 +                (GLint x, GLint y, GLsizei width, GLsizei height,
   3.246 +                 GLenum format, GLenum type, GLvoid * pixels))
   3.247 +SDL_PROC_UNUSED(void, glRotatex,
   3.248 +                (GLfixed angle, GLfixed x, GLfixed y, GLfixed z))
   3.249  SDL_PROC_UNUSED(void, glSampleCoverage, (GLclampf value, GLboolean invert))
   3.250  SDL_PROC_UNUSED(void, glSampleCoveragex, (GLclampx value, GLboolean invert))
   3.251  SDL_PROC_UNUSED(void, glScalex, (GLfixed x, GLfixed y, GLfixed z))
   3.252 @@ -136,22 +195,36 @@
   3.253  SDL_PROC_UNUSED(void, glStencilFunc, (GLenum func, GLint ref, GLuint mask))
   3.254  SDL_PROC_UNUSED(void, glStencilMask, (GLuint mask))
   3.255  SDL_PROC_UNUSED(void, glStencilOp, (GLenum fail, GLenum zfail, GLenum zpass))
   3.256 -SDL_PROC(void, glTexCoordPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer))
   3.257 +SDL_PROC(void, glTexCoordPointer,
   3.258 +         (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer))
   3.259  SDL_PROC_UNUSED(void, glTexEnvi, (GLenum target, GLenum pname, GLint param))
   3.260  SDL_PROC_UNUSED(void, glTexEnvx, (GLenum target, GLenum pname, GLfixed param))
   3.261 -SDL_PROC_UNUSED(void, glTexEnviv, (GLenum target, GLenum pname, const GLint *params))
   3.262 -SDL_PROC_UNUSED(void, glTexEnvxv, (GLenum target, GLenum pname, const GLfixed *params))
   3.263 -SDL_PROC(void, glTexImage2D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels))
   3.264 +SDL_PROC_UNUSED(void, glTexEnviv,
   3.265 +                (GLenum target, GLenum pname, const GLint * params))
   3.266 +SDL_PROC_UNUSED(void, glTexEnvxv,
   3.267 +                (GLenum target, GLenum pname, const GLfixed * params))
   3.268 +SDL_PROC(void, glTexImage2D,
   3.269 +         (GLenum target, GLint level, GLint internalformat, GLsizei width,
   3.270 +          GLsizei height, GLint border, GLenum format, GLenum type,
   3.271 +          const GLvoid * pixels))
   3.272  SDL_PROC(void, glTexParameteri, (GLenum target, GLenum pname, GLint param))
   3.273 -SDL_PROC_UNUSED(void, glTexParameterx, (GLenum target, GLenum pname, GLfixed param))
   3.274 -SDL_PROC(void, glTexParameteriv, (GLenum target, GLenum pname, const GLint *params))
   3.275 -SDL_PROC_UNUSED(void, glTexParameterxv, (GLenum target, GLenum pname, const GLfixed *params))
   3.276 -SDL_PROC(void, glTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels))
   3.277 +SDL_PROC_UNUSED(void, glTexParameterx,
   3.278 +                (GLenum target, GLenum pname, GLfixed param))
   3.279 +SDL_PROC(void, glTexParameteriv,
   3.280 +         (GLenum target, GLenum pname, const GLint * params))
   3.281 +SDL_PROC_UNUSED(void, glTexParameterxv,
   3.282 +                (GLenum target, GLenum pname, const GLfixed * params))
   3.283 +SDL_PROC(void, glTexSubImage2D,
   3.284 +         (GLenum target, GLint level, GLint xoffset, GLint yoffset,
   3.285 +          GLsizei width, GLsizei height, GLenum format, GLenum type,
   3.286 +          const GLvoid * pixels))
   3.287  SDL_PROC_UNUSED(void, glTranslatex, (GLfixed x, GLfixed y, GLfixed z))
   3.288 -SDL_PROC(void, glVertexPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer))
   3.289 +SDL_PROC(void, glVertexPointer,
   3.290 +         (GLint size, GLenum type, GLsizei stride, const GLvoid * pointer))
   3.291  SDL_PROC(void, glViewport, (GLint x, GLint y, GLsizei width, GLsizei height))
   3.292  
   3.293  /* extension functions used */
   3.294 -SDL_PROC(void, glDrawTexiOES, (GLint x, GLint y, GLint z, GLint width, GLint height))
   3.295 +SDL_PROC(void, glDrawTexiOES,
   3.296 +         (GLint x, GLint y, GLint z, GLint width, GLint height))
   3.297  
   3.298  /* vi: set ts=4 sw=4 expandtab: */
     4.1 --- a/src/video/SDL_renderer_gles.c	Mon Sep 15 04:31:30 2008 +0000
     4.2 +++ b/src/video/SDL_renderer_gles.c	Mon Sep 15 04:32:36 2008 +0000
     4.3 @@ -39,38 +39,41 @@
     4.4  static int GLES_DisplayModeChanged(SDL_Renderer * renderer);
     4.5  static int GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture);
     4.6  static int GLES_QueryTexturePixels(SDL_Renderer * renderer,
     4.7 -                                 SDL_Texture * texture, void **pixels,
     4.8 -                                 int *pitch);
     4.9 +                                   SDL_Texture * texture, void **pixels,
    4.10 +                                   int *pitch);
    4.11  static int GLES_SetTexturePalette(SDL_Renderer * renderer,
    4.12 -                                SDL_Texture * texture,
    4.13 -                                const SDL_Color * colors, int firstcolor,
    4.14 -                                int ncolors);
    4.15 +                                  SDL_Texture * texture,
    4.16 +                                  const SDL_Color * colors, int firstcolor,
    4.17 +                                  int ncolors);
    4.18  static int GLES_GetTexturePalette(SDL_Renderer * renderer,
    4.19 -                                SDL_Texture * texture, SDL_Color * colors,
    4.20 -                                int firstcolor, int ncolors);
    4.21 +                                  SDL_Texture * texture, SDL_Color * colors,
    4.22 +                                  int firstcolor, int ncolors);
    4.23  static int GLES_SetTextureColorMod(SDL_Renderer * renderer,
    4.24 -                                 SDL_Texture * texture);
    4.25 +                                   SDL_Texture * texture);
    4.26  static int GLES_SetTextureAlphaMod(SDL_Renderer * renderer,
    4.27 -                                 SDL_Texture * texture);
    4.28 +                                   SDL_Texture * texture);
    4.29  static int GLES_SetTextureBlendMode(SDL_Renderer * renderer,
    4.30 -                                  SDL_Texture * texture);
    4.31 +                                    SDL_Texture * texture);
    4.32  static int GLES_SetTextureScaleMode(SDL_Renderer * renderer,
    4.33 -                                  SDL_Texture * texture);
    4.34 +                                    SDL_Texture * texture);
    4.35  static int GLES_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
    4.36 -                            const SDL_Rect * rect, const void *pixels,
    4.37 -                            int pitch);
    4.38 +                              const SDL_Rect * rect, const void *pixels,
    4.39 +                              int pitch);
    4.40  static int GLES_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
    4.41 -                          const SDL_Rect * rect, int markDirty, void **pixels,
    4.42 -                          int *pitch);
    4.43 -static void GLES_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture);
    4.44 +                            const SDL_Rect * rect, int markDirty,
    4.45 +                            void **pixels, int *pitch);
    4.46 +static void GLES_UnlockTexture(SDL_Renderer * renderer,
    4.47 +                               SDL_Texture * texture);
    4.48  static void GLES_DirtyTexture(SDL_Renderer * renderer, SDL_Texture * texture,
    4.49 -                            int numrects, const SDL_Rect * rects);
    4.50 +                              int numrects, const SDL_Rect * rects);
    4.51  static int GLES_RenderFill(SDL_Renderer * renderer, Uint8 r, Uint8 g, Uint8 b,
    4.52 -                         Uint8 a, const SDL_Rect * rect);
    4.53 +                           Uint8 a, const SDL_Rect * rect);
    4.54  static int GLES_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
    4.55 -                         const SDL_Rect * srcrect, const SDL_Rect * dstrect);
    4.56 +                           const SDL_Rect * srcrect,
    4.57 +                           const SDL_Rect * dstrect);
    4.58  static void GLES_RenderPresent(SDL_Renderer * renderer);
    4.59 -static void GLES_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture);
    4.60 +static void GLES_DestroyTexture(SDL_Renderer * renderer,
    4.61 +                                SDL_Texture * texture);
    4.62  static void GLES_DestroyRenderer(SDL_Renderer * renderer);
    4.63  
    4.64  
    4.65 @@ -87,11 +90,11 @@
    4.66        SDL_TEXTUREBLENDMODE_MOD),
    4.67       (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST |
    4.68        SDL_TEXTURESCALEMODE_SLOW), 2,
    4.69 -		{
    4.70 -		SDL_PIXELFORMAT_RGB24,
    4.71 -		SDL_PIXELFORMAT_ABGR8888,
    4.72 -		},
    4.73 -	 0,
    4.74 +     {
    4.75 +      SDL_PIXELFORMAT_RGB24,
    4.76 +      SDL_PIXELFORMAT_ABGR8888,
    4.77 +      },
    4.78 +     0,
    4.79       0}
    4.80  };
    4.81  
    4.82 @@ -100,18 +103,18 @@
    4.83      SDL_GLContext context;
    4.84      SDL_bool updateSize;
    4.85      int blendMode;
    4.86 -	
    4.87 +
    4.88  #ifndef APIENTRY
    4.89  #define APIENTRY
    4.90  #endif
    4.91 -	
    4.92 -	SDL_bool useDrawTexture;
    4.93 -	SDL_bool GL_OES_draw_texture_supported;
    4.94 -	
    4.95 -	/* OpenGL ES functions */
    4.96 -	#define SDL_PROC(ret,func,params) ret (APIENTRY *func) params;
    4.97 -	#include "SDL_glesfuncs.h"
    4.98 -	#undef SDL_PROC
    4.99 +
   4.100 +    SDL_bool useDrawTexture;
   4.101 +    SDL_bool GL_OES_draw_texture_supported;
   4.102 +
   4.103 +    /* OpenGL ES functions */
   4.104 +#define SDL_PROC(ret,func,params) ret (APIENTRY *func) params;
   4.105 +#include "SDL_glesfuncs.h"
   4.106 +#undef SDL_PROC
   4.107  
   4.108  } GLES_RenderData;
   4.109  
   4.110 @@ -165,12 +168,12 @@
   4.111  static int
   4.112  GLES_LoadFunctions(GLES_RenderData * data)
   4.113  {
   4.114 -	
   4.115 -	#define SDL_PROC(ret,func,params) \
   4.116 +
   4.117 +#define SDL_PROC(ret,func,params) \
   4.118  	data->func = func;
   4.119 -	#include "SDL_glesfuncs.h"
   4.120 -	#undef SDL_PROC
   4.121 -	
   4.122 +#include "SDL_glesfuncs.h"
   4.123 +#undef SDL_PROC
   4.124 +
   4.125      return 0;
   4.126  }
   4.127  
   4.128 @@ -185,7 +188,7 @@
   4.129  SDL_Renderer *
   4.130  GLES_CreateRenderer(SDL_Window * window, Uint32 flags)
   4.131  {
   4.132 -		
   4.133 +
   4.134      SDL_Renderer *renderer;
   4.135      GLES_RenderData *data;
   4.136      GLint value;
   4.137 @@ -232,9 +235,10 @@
   4.138      renderer->info = GL_ES_RenderDriver.info;
   4.139      renderer->window = window->id;
   4.140      renderer->driverdata = data;
   4.141 -	
   4.142 -	
   4.143 -    renderer->info.flags = (SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED);
   4.144 +
   4.145 +
   4.146 +    renderer->info.flags =
   4.147 +        (SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED);
   4.148  
   4.149      if (GLES_LoadFunctions(data) < 0) {
   4.150          GLES_DestroyRenderer(renderer);
   4.151 @@ -265,15 +269,14 @@
   4.152              renderer->info.flags |= SDL_RENDERER_SINGLEBUFFER;
   4.153          }
   4.154      }
   4.155 -	
   4.156 -	if (SDL_GL_ExtensionSupported("GL_OES_draw_texture")) {
   4.157 -		data->GL_OES_draw_texture_supported = SDL_TRUE;
   4.158 -		data->useDrawTexture = SDL_TRUE;
   4.159 -	}
   4.160 -	else {
   4.161 -		data->GL_OES_draw_texture_supported = SDL_FALSE;
   4.162 -		data->useDrawTexture = SDL_FALSE;
   4.163 -	}	
   4.164 +
   4.165 +    if (SDL_GL_ExtensionSupported("GL_OES_draw_texture")) {
   4.166 +        data->GL_OES_draw_texture_supported = SDL_TRUE;
   4.167 +        data->useDrawTexture = SDL_TRUE;
   4.168 +    } else {
   4.169 +        data->GL_OES_draw_texture_supported = SDL_FALSE;
   4.170 +        data->useDrawTexture = SDL_FALSE;
   4.171 +    }
   4.172  
   4.173      data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
   4.174      renderer->info.max_texture_width = value;
   4.175 @@ -284,18 +287,19 @@
   4.176      data->blendMode = -1;
   4.177      data->glDisable(GL_DEPTH_TEST);
   4.178      data->glDisable(GL_CULL_FACE);
   4.179 -	data->glEnable(GL_TEXTURE_2D);
   4.180 +    data->glEnable(GL_TEXTURE_2D);
   4.181      data->updateSize = SDL_TRUE;
   4.182  
   4.183      return renderer;
   4.184  }
   4.185  
   4.186 -static int GLES_ActivateRenderer(SDL_Renderer * renderer)
   4.187 +static int
   4.188 +GLES_ActivateRenderer(SDL_Renderer * renderer)
   4.189  {
   4.190 -		
   4.191 -    GLES_RenderData *data = (GLES_RenderData *)renderer->driverdata;
   4.192 +
   4.193 +    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
   4.194      SDL_Window *window = SDL_GetWindowFromID(renderer->window);
   4.195 -				
   4.196 +
   4.197      if (SDL_GL_MakeCurrent(window->id, data->context) < 0) {
   4.198          return -1;
   4.199      }
   4.200 @@ -305,8 +309,8 @@
   4.201          data->glMatrixMode(GL_MODELVIEW);
   4.202          data->glLoadIdentity();
   4.203          data->glViewport(0, 0, window->w, window->h);
   4.204 -        data->glOrthof(0.0, (GLfloat)window->w, (GLfloat)window->h, 0.0,
   4.205 -                      0.0, 1.0);
   4.206 +        data->glOrthof(0.0, (GLfloat) window->w, (GLfloat) window->h, 0.0,
   4.207 +                       0.0, 1.0);
   4.208          data->updateSize = SDL_FALSE;
   4.209      }
   4.210      return 0;
   4.211 @@ -342,55 +346,55 @@
   4.212      GLenum format, type;
   4.213      int texture_w, texture_h;
   4.214      GLenum result;
   4.215 -	switch (texture->format) {
   4.216 -		case SDL_PIXELFORMAT_INDEX1LSB:
   4.217 -		case SDL_PIXELFORMAT_INDEX1MSB:
   4.218 -		case SDL_PIXELFORMAT_INDEX8:
   4.219 -		case SDL_PIXELFORMAT_RGB332:
   4.220 -		case SDL_PIXELFORMAT_RGB444:
   4.221 -		case SDL_PIXELFORMAT_RGB555:
   4.222 -		case SDL_PIXELFORMAT_ARGB4444:
   4.223 -		case SDL_PIXELFORMAT_ARGB1555:
   4.224 -		case SDL_PIXELFORMAT_BGR24:
   4.225 -		case SDL_PIXELFORMAT_BGR888:
   4.226 -		case SDL_PIXELFORMAT_RGB888:
   4.227 -		case SDL_PIXELFORMAT_RGBA8888:
   4.228 -		case SDL_PIXELFORMAT_ARGB2101010:
   4.229 -		case SDL_PIXELFORMAT_ARGB8888:
   4.230 -		case SDL_PIXELFORMAT_RGB24:
   4.231 -			internalFormat = GL_RGB;
   4.232 -			format = GL_RGB;
   4.233 -			type = GL_UNSIGNED_BYTE;
   4.234 -			break;
   4.235 -		case SDL_PIXELFORMAT_ABGR8888:
   4.236 -			internalFormat = GL_RGBA;
   4.237 -			format = GL_RGBA;
   4.238 -			type = GL_UNSIGNED_BYTE;			
   4.239 -			break;			
   4.240 -		/*
   4.241 -			These formats would be supported if SDL had the necessary pixel formats
   4.242 -		case SDL_PIXELFORMAT_BGR565:
   4.243 -			internalFormat = GL_RGB;
   4.244 -			format = GL_RGB;
   4.245 -			type = GL_UNSIGNED_SHORT_5_6_5;
   4.246 -			break;			
   4.247 -		case SDL_PIXELFORMAT_ABGR5551:
   4.248 -			internalFormat = GL_RGBA;
   4.249 -			format = GL_RGBA;
   4.250 -			type = GL_UNSIGNED_SHORT_5_5_5_1;
   4.251 -			break;
   4.252 -		case SDL_PIXELFORMAT_ABGR4444:
   4.253 -			internalFormat = GL_RGBA;
   4.254 -			format = GL_RGBA;
   4.255 -			type = GL_UNSIGNED_SHORT_4_4_4_4;
   4.256 -			break;
   4.257 -		*/
   4.258 -		default:
   4.259 -			SDL_SetError("Unsupported texture format");
   4.260 -			return -1;
   4.261 +    switch (texture->format) {
   4.262 +    case SDL_PIXELFORMAT_INDEX1LSB:
   4.263 +    case SDL_PIXELFORMAT_INDEX1MSB:
   4.264 +    case SDL_PIXELFORMAT_INDEX8:
   4.265 +    case SDL_PIXELFORMAT_RGB332:
   4.266 +    case SDL_PIXELFORMAT_RGB444:
   4.267 +    case SDL_PIXELFORMAT_RGB555:
   4.268 +    case SDL_PIXELFORMAT_ARGB4444:
   4.269 +    case SDL_PIXELFORMAT_ARGB1555:
   4.270 +    case SDL_PIXELFORMAT_BGR24:
   4.271 +    case SDL_PIXELFORMAT_BGR888:
   4.272 +    case SDL_PIXELFORMAT_RGB888:
   4.273 +    case SDL_PIXELFORMAT_RGBA8888:
   4.274 +    case SDL_PIXELFORMAT_ARGB2101010:
   4.275 +    case SDL_PIXELFORMAT_ARGB8888:
   4.276 +    case SDL_PIXELFORMAT_RGB24:
   4.277 +        internalFormat = GL_RGB;
   4.278 +        format = GL_RGB;
   4.279 +        type = GL_UNSIGNED_BYTE;
   4.280 +        break;
   4.281 +    case SDL_PIXELFORMAT_ABGR8888:
   4.282 +        internalFormat = GL_RGBA;
   4.283 +        format = GL_RGBA;
   4.284 +        type = GL_UNSIGNED_BYTE;
   4.285 +        break;
   4.286 +        /*
   4.287 +           These formats would be supported if SDL had the necessary pixel formats
   4.288 +           case SDL_PIXELFORMAT_BGR565:
   4.289 +           internalFormat = GL_RGB;
   4.290 +           format = GL_RGB;
   4.291 +           type = GL_UNSIGNED_SHORT_5_6_5;
   4.292 +           break;                       
   4.293 +           case SDL_PIXELFORMAT_ABGR5551:
   4.294 +           internalFormat = GL_RGBA;
   4.295 +           format = GL_RGBA;
   4.296 +           type = GL_UNSIGNED_SHORT_5_5_5_1;
   4.297 +           break;
   4.298 +           case SDL_PIXELFORMAT_ABGR4444:
   4.299 +           internalFormat = GL_RGBA;
   4.300 +           format = GL_RGBA;
   4.301 +           type = GL_UNSIGNED_SHORT_4_4_4_4;
   4.302 +           break;
   4.303 +         */
   4.304 +    default:
   4.305 +        SDL_SetError("Unsupported texture format");
   4.306 +        return -1;
   4.307      }
   4.308 -	
   4.309 -	data = (GLES_TextureData *) SDL_calloc(1, sizeof(*data));
   4.310 +
   4.311 +    data = (GLES_TextureData *) SDL_calloc(1, sizeof(*data));
   4.312      if (!data) {
   4.313          SDL_OutOfMemory();
   4.314          return -1;
   4.315 @@ -410,14 +414,14 @@
   4.316  
   4.317      renderdata->glGetError();
   4.318      renderdata->glGenTextures(1, &data->texture);
   4.319 -    
   4.320 -	data->type = GL_TEXTURE_2D;
   4.321 -	/* no NPOV textures allowed in OpenGL ES (yet) */
   4.322 -	texture_w = power_of_2(texture->w);
   4.323 -	texture_h = power_of_2(texture->h);
   4.324 -	data->texw = (GLfloat) texture->w / texture_w;
   4.325 -	data->texh = (GLfloat) texture->h / texture_h;
   4.326 -	
   4.327 +
   4.328 +    data->type = GL_TEXTURE_2D;
   4.329 +    /* no NPOV textures allowed in OpenGL ES (yet) */
   4.330 +    texture_w = power_of_2(texture->w);
   4.331 +    texture_h = power_of_2(texture->h);
   4.332 +    data->texw = (GLfloat) texture->w / texture_w;
   4.333 +    data->texh = (GLfloat) texture->h / texture_h;
   4.334 +
   4.335      data->format = format;
   4.336      data->formattype = type;
   4.337      renderdata->glBindTexture(data->type, data->texture);
   4.338 @@ -429,9 +433,9 @@
   4.339                                  GL_CLAMP_TO_EDGE);
   4.340      renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_T,
   4.341                                  GL_CLAMP_TO_EDGE);
   4.342 -    
   4.343 -	renderdata->glTexImage2D(data->type, 0, internalFormat, texture_w,
   4.344 -							 texture_h, 0, format, type, NULL);
   4.345 +
   4.346 +    renderdata->glTexImage2D(data->type, 0, internalFormat, texture_w,
   4.347 +                             texture_h, 0, format, type, NULL);
   4.348  
   4.349      result = renderdata->glGetError();
   4.350      if (result != GL_NO_ERROR) {
   4.351 @@ -443,7 +447,7 @@
   4.352  
   4.353  static int
   4.354  GLES_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture,
   4.355 -                      void **pixels, int *pitch)
   4.356 +                        void **pixels, int *pitch)
   4.357  {
   4.358      GLES_TextureData *data = (GLES_TextureData *) texture->driverdata;
   4.359  
   4.360 @@ -454,17 +458,17 @@
   4.361  
   4.362  static int
   4.363  GLES_SetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture,
   4.364 -                     const SDL_Color * colors, int firstcolor, int ncolors)
   4.365 +                       const SDL_Color * colors, int firstcolor, int ncolors)
   4.366  {
   4.367 -	SDL_SetError("OpenGL ES does not support paletted textures");
   4.368 +    SDL_SetError("OpenGL ES does not support paletted textures");
   4.369      return -1;
   4.370  }
   4.371  
   4.372  static int
   4.373  GLES_GetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture,
   4.374 -                     SDL_Color * colors, int firstcolor, int ncolors)
   4.375 +                       SDL_Color * colors, int firstcolor, int ncolors)
   4.376  {
   4.377 -	SDL_SetError("OpenGL ES does not support paletted textures");
   4.378 +    SDL_SetError("OpenGL ES does not support paletted textures");
   4.379      return -1;
   4.380  }
   4.381  
   4.382 @@ -472,10 +476,10 @@
   4.383  SetupTextureUpdate(GLES_RenderData * renderdata, SDL_Texture * texture,
   4.384                     int pitch)
   4.385  {
   4.386 -	
   4.387 -	
   4.388 -	GLES_TextureData *data = (GLES_TextureData *) texture->driverdata;
   4.389 -	renderdata->glBindTexture(data->type, data->texture);
   4.390 +
   4.391 +
   4.392 +    GLES_TextureData *data = (GLES_TextureData *) texture->driverdata;
   4.393 +    renderdata->glBindTexture(data->type, data->texture);
   4.394      renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
   4.395  }
   4.396  
   4.397 @@ -518,7 +522,7 @@
   4.398          return 0;
   4.399      case SDL_TEXTURESCALEMODE_BEST:
   4.400          SDL_Unsupported();
   4.401 -		texture->scaleMode = SDL_TEXTURESCALEMODE_SLOW;
   4.402 +        texture->scaleMode = SDL_TEXTURESCALEMODE_SLOW;
   4.403          return -1;
   4.404      default:
   4.405          SDL_Unsupported();
   4.406 @@ -529,15 +533,15 @@
   4.407  
   4.408  static int
   4.409  GLES_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
   4.410 -                 const SDL_Rect * rect, const void *pixels, int pitch)
   4.411 +                   const SDL_Rect * rect, const void *pixels, int pitch)
   4.412  {
   4.413      GLES_RenderData *renderdata = (GLES_RenderData *) renderer->driverdata;
   4.414      GLES_TextureData *data = (GLES_TextureData *) texture->driverdata;
   4.415      GLenum result;
   4.416  
   4.417      SetupTextureUpdate(renderdata, texture, pitch);
   4.418 -	renderdata->glGetError();
   4.419 -	renderdata->glTexSubImage2D(data->type, 0, rect->x, rect->y, rect->w,
   4.420 +    renderdata->glGetError();
   4.421 +    renderdata->glTexSubImage2D(data->type, 0, rect->x, rect->y, rect->w,
   4.422                                  rect->h, data->format, data->formattype,
   4.423                                  pixels);
   4.424      result = renderdata->glGetError();
   4.425 @@ -550,8 +554,8 @@
   4.426  
   4.427  static int
   4.428  GLES_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
   4.429 -               const SDL_Rect * rect, int markDirty, void **pixels,
   4.430 -               int *pitch)
   4.431 +                 const SDL_Rect * rect, int markDirty, void **pixels,
   4.432 +                 int *pitch)
   4.433  {
   4.434      GLES_TextureData *data = (GLES_TextureData *) texture->driverdata;
   4.435  
   4.436 @@ -572,8 +576,8 @@
   4.437  }
   4.438  
   4.439  static void
   4.440 -GLES_DirtyTexture(SDL_Renderer * renderer, SDL_Texture * texture, int numrects,
   4.441 -                const SDL_Rect * rects)
   4.442 +GLES_DirtyTexture(SDL_Renderer * renderer, SDL_Texture * texture,
   4.443 +                  int numrects, const SDL_Rect * rects)
   4.444  {
   4.445      GLES_TextureData *data = (GLES_TextureData *) texture->driverdata;
   4.446      int i;
   4.447 @@ -585,44 +589,45 @@
   4.448  
   4.449  static int
   4.450  GLES_RenderFill(SDL_Renderer * renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a,
   4.451 -              const SDL_Rect * rect)
   4.452 +                const SDL_Rect * rect)
   4.453  {
   4.454 - 	
   4.455 -	GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
   4.456 +
   4.457 +    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
   4.458      SDL_Window *window = SDL_GetWindowFromID(renderer->window);
   4.459 -	
   4.460 -	/* set proper drawing color */
   4.461 -	GLfloat oldClearColor[4];
   4.462 -	
   4.463 -	data->glGetFloatv(GL_COLOR_CLEAR_VALUE, oldClearColor);
   4.464 -	
   4.465 -	data->glClearColor((GLclampf) r * inv255f, (GLclampf) g * inv255f,
   4.466 -			  (GLclampf) b * inv255f, (GLclampf) a * inv255f);
   4.467 -	
   4.468 -	data->glScissor(rect->x, window->h - rect->y - rect->h, rect->w, rect->h);
   4.469 -	data->glEnable(GL_SCISSOR_TEST);
   4.470 -	data->glClear(GL_COLOR_BUFFER_BIT);
   4.471 -	data->glDisable(GL_SCISSOR_TEST);
   4.472 -	
   4.473 -	/* reset clear color */
   4.474 -	data->glClearColor(oldClearColor[0], oldClearColor[1], oldClearColor[2], oldClearColor[2]);
   4.475 -	
   4.476 -	return 0;
   4.477 +
   4.478 +    /* set proper drawing color */
   4.479 +    GLfloat oldClearColor[4];
   4.480 +
   4.481 +    data->glGetFloatv(GL_COLOR_CLEAR_VALUE, oldClearColor);
   4.482 +
   4.483 +    data->glClearColor((GLclampf) r * inv255f, (GLclampf) g * inv255f,
   4.484 +                       (GLclampf) b * inv255f, (GLclampf) a * inv255f);
   4.485 +
   4.486 +    data->glScissor(rect->x, window->h - rect->y - rect->h, rect->w, rect->h);
   4.487 +    data->glEnable(GL_SCISSOR_TEST);
   4.488 +    data->glClear(GL_COLOR_BUFFER_BIT);
   4.489 +    data->glDisable(GL_SCISSOR_TEST);
   4.490 +
   4.491 +    /* reset clear color */
   4.492 +    data->glClearColor(oldClearColor[0], oldClearColor[1], oldClearColor[2],
   4.493 +                       oldClearColor[2]);
   4.494 +
   4.495 +    return 0;
   4.496  }
   4.497  
   4.498  static int
   4.499  GLES_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
   4.500 -              const SDL_Rect * srcrect, const SDL_Rect * dstrect)
   4.501 +                const SDL_Rect * srcrect, const SDL_Rect * dstrect)
   4.502  {
   4.503 -		
   4.504 +
   4.505      GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
   4.506      GLES_TextureData *texturedata = (GLES_TextureData *) texture->driverdata;
   4.507      int minx, miny, maxx, maxy;
   4.508      GLfloat minu, maxu, minv, maxv;
   4.509 -	int i;
   4.510 -	void *temp_buffer; /* used for reformatting dirty rect pixels */
   4.511 -	void *temp_ptr;
   4.512 -	
   4.513 +    int i;
   4.514 +    void *temp_buffer;          /* used for reformatting dirty rect pixels */
   4.515 +    void *temp_ptr;
   4.516 +
   4.517      if (texturedata->dirty.list) {
   4.518          SDL_DirtyRect *dirty;
   4.519          void *pixels;
   4.520 @@ -630,38 +635,40 @@
   4.521          int pitch = texturedata->pitch;
   4.522  
   4.523          SetupTextureUpdate(data, texture, pitch);
   4.524 -		
   4.525 +
   4.526          data->glBindTexture(texturedata->type, texturedata->texture);
   4.527          for (dirty = texturedata->dirty.list; dirty; dirty = dirty->next) {
   4.528              SDL_Rect *rect = &dirty->rect;
   4.529 -            pixels = (void *) ((Uint8 *) texturedata->pixels + rect->y * pitch + rect->x * bpp);
   4.530 -			/*	There is no GL_UNPACK_ROW_LENGTH in OpenGLES 
   4.531 -				we must do this reformatting ourselves(!)
   4.532 -			 
   4.533 -				maybe it'd be a good idea to keep a temp buffer around
   4.534 -				for this purpose rather than allocating it each time
   4.535 -			*/
   4.536 -			temp_buffer = SDL_malloc(rect->w * rect->h * bpp);
   4.537 -			temp_ptr = temp_buffer;
   4.538 -			for (i=0; i<rect->h; i++) {
   4.539 -				SDL_memcpy(temp_ptr, pixels, rect->w * bpp);
   4.540 -				temp_ptr += rect->w * bpp;
   4.541 -				pixels	 += pitch;
   4.542 -			}
   4.543 -			
   4.544 +            pixels =
   4.545 +                (void *) ((Uint8 *) texturedata->pixels + rect->y * pitch +
   4.546 +                          rect->x * bpp);
   4.547 +            /*      There is no GL_UNPACK_ROW_LENGTH in OpenGLES 
   4.548 +               we must do this reformatting ourselves(!)
   4.549 +
   4.550 +               maybe it'd be a good idea to keep a temp buffer around
   4.551 +               for this purpose rather than allocating it each time
   4.552 +             */
   4.553 +            temp_buffer = SDL_malloc(rect->w * rect->h * bpp);
   4.554 +            temp_ptr = temp_buffer;
   4.555 +            for (i = 0; i < rect->h; i++) {
   4.556 +                SDL_memcpy(temp_ptr, pixels, rect->w * bpp);
   4.557 +                temp_ptr += rect->w * bpp;
   4.558 +                pixels += pitch;
   4.559 +            }
   4.560 +
   4.561              data->glTexSubImage2D(texturedata->type, 0, rect->x, rect->y,
   4.562                                    rect->w, rect->h, texturedata->format,
   4.563                                    texturedata->formattype, temp_buffer);
   4.564 -			
   4.565 -			SDL_free(temp_buffer);
   4.566 -			
   4.567 +
   4.568 +            SDL_free(temp_buffer);
   4.569 +
   4.570          }
   4.571          SDL_ClearDirtyRects(&texturedata->dirty);
   4.572      }
   4.573 -	
   4.574 +
   4.575      data->glBindTexture(texturedata->type, texturedata->texture);
   4.576 -	data->glEnable(GL_TEXTURE_2D);
   4.577 -	
   4.578 +    data->glEnable(GL_TEXTURE_2D);
   4.579 +
   4.580      if (texture->modMode) {
   4.581          data->glColor4f((GLfloat) texture->r * inv255f,
   4.582                          (GLfloat) texture->g * inv255f,
   4.583 @@ -697,71 +704,80 @@
   4.584          data->blendMode = texture->blendMode;
   4.585      }
   4.586  
   4.587 -	switch (texture->scaleMode) {
   4.588 -		case SDL_TEXTURESCALEMODE_NONE:
   4.589 -		case SDL_TEXTURESCALEMODE_FAST:
   4.590 -			data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
   4.591 -								  GL_NEAREST);
   4.592 -			data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
   4.593 -								  GL_NEAREST);
   4.594 -			break;
   4.595 -		case SDL_TEXTURESCALEMODE_SLOW:
   4.596 -		case SDL_TEXTURESCALEMODE_BEST:
   4.597 -			data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
   4.598 -								  GL_LINEAR);
   4.599 -			data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
   4.600 -								  GL_LINEAR);
   4.601 -			break;
   4.602 -	}
   4.603 +    switch (texture->scaleMode) {
   4.604 +    case SDL_TEXTURESCALEMODE_NONE:
   4.605 +    case SDL_TEXTURESCALEMODE_FAST:
   4.606 +        data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
   4.607 +                              GL_NEAREST);
   4.608 +        data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
   4.609 +                              GL_NEAREST);
   4.610 +        break;
   4.611 +    case SDL_TEXTURESCALEMODE_SLOW:
   4.612 +    case SDL_TEXTURESCALEMODE_BEST:
   4.613 +        data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
   4.614 +                              GL_LINEAR);
   4.615 +        data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
   4.616 +                              GL_LINEAR);
   4.617 +        break;
   4.618 +    }
   4.619  
   4.620 -	if (data->GL_OES_draw_texture_supported && data->useDrawTexture) {
   4.621 -		/* this code is a little funny because the viewport is upside down vs SDL's coordinate system */
   4.622 -		SDL_Window *window = SDL_GetWindowFromID(renderer->window);
   4.623 -		GLint cropRect[4];
   4.624 -		cropRect[0] = srcrect->x;
   4.625 -		cropRect[1] = srcrect->y + srcrect->h;
   4.626 -		cropRect[2] = srcrect->w;
   4.627 -		cropRect[3] = -srcrect->h;
   4.628 -		data->glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, cropRect);
   4.629 -		data->glDrawTexiOES(dstrect->x, window->h - dstrect->y - dstrect->h, 0, dstrect->w, dstrect->h);
   4.630 -	}
   4.631 -	else {
   4.632 -		
   4.633 -		minx = dstrect->x;
   4.634 -		miny = dstrect->y;
   4.635 -		maxx = dstrect->x + dstrect->w;
   4.636 -		maxy = dstrect->y + dstrect->h;
   4.637 -		
   4.638 -		minu = (GLfloat) srcrect->x / texture->w;
   4.639 -		minu *= texturedata->texw;
   4.640 -		maxu = (GLfloat) (srcrect->x + srcrect->w) / texture->w;
   4.641 -		maxu *= texturedata->texw;
   4.642 -		minv = (GLfloat) srcrect->y / texture->h;
   4.643 -		minv *= texturedata->texh;
   4.644 -		maxv = (GLfloat) (srcrect->y + srcrect->h) / texture->h;
   4.645 -		maxv *= texturedata->texh;			
   4.646 -		
   4.647 -		GLshort vertices[8];
   4.648 -		GLfloat texCoords[8];
   4.649 -		
   4.650 -		vertices[0] = minx; vertices[1] = miny;
   4.651 -		vertices[2] = maxx; vertices[3] = miny;
   4.652 -		vertices[4]	= minx; vertices[5] = maxy;
   4.653 -		vertices[6] = maxx; vertices[7] = maxy;	
   4.654 -		
   4.655 -		texCoords[0] = minu; texCoords[1] = minv;
   4.656 -		texCoords[2] = maxu; texCoords[3] = minv;
   4.657 -		texCoords[4] = minu; texCoords[5] = maxv;
   4.658 -		texCoords[6] = maxu; texCoords[7] = maxv;	
   4.659 -		
   4.660 -		data->glVertexPointer(2, GL_SHORT, 0, vertices);
   4.661 -		data->glEnableClientState(GL_VERTEX_ARRAY);
   4.662 -		data->glTexCoordPointer(2, GL_FLOAT, 0, texCoords);
   4.663 -		data->glEnableClientState(GL_TEXTURE_COORD_ARRAY);
   4.664 -		data->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
   4.665 -		
   4.666 -	}
   4.667 -		
   4.668 +    if (data->GL_OES_draw_texture_supported && data->useDrawTexture) {
   4.669 +        /* this code is a little funny because the viewport is upside down vs SDL's coordinate system */
   4.670 +        SDL_Window *window = SDL_GetWindowFromID(renderer->window);
   4.671 +        GLint cropRect[4];
   4.672 +        cropRect[0] = srcrect->x;
   4.673 +        cropRect[1] = srcrect->y + srcrect->h;
   4.674 +        cropRect[2] = srcrect->w;
   4.675 +        cropRect[3] = -srcrect->h;
   4.676 +        data->glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES,
   4.677 +                               cropRect);
   4.678 +        data->glDrawTexiOES(dstrect->x, window->h - dstrect->y - dstrect->h,
   4.679 +                            0, dstrect->w, dstrect->h);
   4.680 +    } else {
   4.681 +
   4.682 +        minx = dstrect->x;
   4.683 +        miny = dstrect->y;
   4.684 +        maxx = dstrect->x + dstrect->w;
   4.685 +        maxy = dstrect->y + dstrect->h;
   4.686 +
   4.687 +        minu = (GLfloat) srcrect->x / texture->w;
   4.688 +        minu *= texturedata->texw;
   4.689 +        maxu = (GLfloat) (srcrect->x + srcrect->w) / texture->w;
   4.690 +        maxu *= texturedata->texw;
   4.691 +        minv = (GLfloat) srcrect->y / texture->h;
   4.692 +        minv *= texturedata->texh;
   4.693 +        maxv = (GLfloat) (srcrect->y + srcrect->h) / texture->h;
   4.694 +        maxv *= texturedata->texh;
   4.695 +
   4.696 +        GLshort vertices[8];
   4.697 +        GLfloat texCoords[8];
   4.698 +
   4.699 +        vertices[0] = minx;
   4.700 +        vertices[1] = miny;
   4.701 +        vertices[2] = maxx;
   4.702 +        vertices[3] = miny;
   4.703 +        vertices[4] = minx;
   4.704 +        vertices[5] = maxy;
   4.705 +        vertices[6] = maxx;
   4.706 +        vertices[7] = maxy;
   4.707 +
   4.708 +        texCoords[0] = minu;
   4.709 +        texCoords[1] = minv;
   4.710 +        texCoords[2] = maxu;
   4.711 +        texCoords[3] = minv;
   4.712 +        texCoords[4] = minu;
   4.713 +        texCoords[5] = maxv;
   4.714 +        texCoords[6] = maxu;
   4.715 +        texCoords[7] = maxv;
   4.716 +
   4.717 +        data->glVertexPointer(2, GL_SHORT, 0, vertices);
   4.718 +        data->glEnableClientState(GL_VERTEX_ARRAY);
   4.719 +        data->glTexCoordPointer(2, GL_FLOAT, 0, texCoords);
   4.720 +        data->glEnableClientState(GL_TEXTURE_COORD_ARRAY);
   4.721 +        data->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
   4.722 +
   4.723 +    }
   4.724 +
   4.725      return 0;
   4.726  }
   4.727  
   4.728 @@ -781,7 +797,7 @@
   4.729          return;
   4.730      }
   4.731      if (data->texture) {
   4.732 -		glDeleteTextures(1, &data->texture);
   4.733 +        glDeleteTextures(1, &data->texture);
   4.734      }
   4.735      if (data->pixels) {
   4.736          SDL_free(data->pixels);
     5.1 --- a/src/video/SDL_sysvideo.h	Mon Sep 15 04:31:30 2008 +0000
     5.2 +++ b/src/video/SDL_sysvideo.h	Mon Sep 15 04:32:36 2008 +0000
     5.3 @@ -37,95 +37,99 @@
     5.4  typedef struct SDL_VideoDevice SDL_VideoDevice;
     5.5  
     5.6  /* Define the SDL texture structure */
     5.7 -struct SDL_Texture {
     5.8 -	Uint32          id;
     5.9 +struct SDL_Texture
    5.10 +{
    5.11 +    Uint32 id;
    5.12  
    5.13 -	Uint32          format;	/**< The pixel format of the texture */
    5.14 -	int             access;	/**< SDL_TextureAccess */
    5.15 -	int             w;	/**< The width of the texture */
    5.16 -	int             h;	/**< The height of the texture */
    5.17 -	int             modMode;/**< The texture modulation mode */
    5.18 -	int             blendMode;	/**< The texture blend mode */
    5.19 -	int             scaleMode;	/**< The texture scale mode */
    5.20 -	Uint8           r, g, b, a;	/**< Texture modulation values */
    5.21 +    Uint32 format;              /**< The pixel format of the texture */
    5.22 +    int access;                 /**< SDL_TextureAccess */
    5.23 +    int w;                      /**< The width of the texture */
    5.24 +    int h;                      /**< The height of the texture */
    5.25 +    int modMode;                /**< The texture modulation mode */
    5.26 +    int blendMode;                      /**< The texture blend mode */
    5.27 +    int scaleMode;                      /**< The texture scale mode */
    5.28 +    Uint8 r, g, b, a;                   /**< Texture modulation values */
    5.29  
    5.30 -	SDL_Renderer   *renderer;
    5.31 +    SDL_Renderer *renderer;
    5.32  
    5.33 -	void           *driverdata;	/**< Driver specific texture representation */
    5.34 +    void *driverdata;                   /**< Driver specific texture representation */
    5.35  
    5.36 -	SDL_Texture    *next;
    5.37 +    SDL_Texture *next;
    5.38  };
    5.39  
    5.40  /* Define the SDL renderer structure */
    5.41 -struct SDL_Renderer {
    5.42 -	int             (*ActivateRenderer) (SDL_Renderer * renderer);
    5.43 -	int             (*DisplayModeChanged) (SDL_Renderer * renderer);
    5.44 -	int             (*CreateTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
    5.45 -	int             (*QueryTexturePixels) (SDL_Renderer * renderer, SDL_Texture * texture,
    5.46 -				                 void **pixels, int *pitch);
    5.47 -	int             (*SetTexturePalette) (SDL_Renderer * renderer, SDL_Texture * texture,
    5.48 -		                   const SDL_Color * colors, int firstcolor,
    5.49 -					                      int ncolors);
    5.50 -	int             (*GetTexturePalette) (SDL_Renderer * renderer, SDL_Texture * texture,
    5.51 -			                 SDL_Color * colors, int firstcolor,
    5.52 -					                      int ncolors);
    5.53 -	int             (*SetTextureColorMod) (SDL_Renderer * renderer,
    5.54 -				                     SDL_Texture * texture);
    5.55 -	int             (*SetTextureAlphaMod) (SDL_Renderer * renderer,
    5.56 -				                     SDL_Texture * texture);
    5.57 -	int             (*SetTextureBlendMode) (SDL_Renderer * renderer,
    5.58 -				                     SDL_Texture * texture);
    5.59 -	int             (*SetTextureScaleMode) (SDL_Renderer * renderer,
    5.60 -				                     SDL_Texture * texture);
    5.61 -	int             (*UpdateTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
    5.62 -		                  const SDL_Rect * rect, const void *pixels,
    5.63 -					                  int pitch);
    5.64 -	int             (*LockTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
    5.65 -	                const SDL_Rect * rect, int markDirty, void **pixels,
    5.66 -					                int *pitch);
    5.67 -	void            (*UnlockTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
    5.68 -	void            (*DirtyTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
    5.69 -		                      int numrects, const SDL_Rect * rects);
    5.70 -	int             (*RenderFill) (SDL_Renderer * renderer, Uint8 r, Uint8 g, Uint8 b,
    5.71 -			                    Uint8 a, const SDL_Rect * rect);
    5.72 -	int             (*RenderCopy) (SDL_Renderer * renderer, SDL_Texture * texture,
    5.73 -	                const SDL_Rect * srcrect, const SDL_Rect * dstrect);
    5.74 -	void            (*RenderPresent) (SDL_Renderer * renderer);
    5.75 -	void            (*DestroyTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
    5.76 +struct SDL_Renderer
    5.77 +{
    5.78 +    int (*ActivateRenderer) (SDL_Renderer * renderer);
    5.79 +    int (*DisplayModeChanged) (SDL_Renderer * renderer);
    5.80 +    int (*CreateTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
    5.81 +    int (*QueryTexturePixels) (SDL_Renderer * renderer, SDL_Texture * texture,
    5.82 +                               void **pixels, int *pitch);
    5.83 +    int (*SetTexturePalette) (SDL_Renderer * renderer, SDL_Texture * texture,
    5.84 +                              const SDL_Color * colors, int firstcolor,
    5.85 +                              int ncolors);
    5.86 +    int (*GetTexturePalette) (SDL_Renderer * renderer, SDL_Texture * texture,
    5.87 +                              SDL_Color * colors, int firstcolor,
    5.88 +                              int ncolors);
    5.89 +    int (*SetTextureColorMod) (SDL_Renderer * renderer,
    5.90 +                               SDL_Texture * texture);
    5.91 +    int (*SetTextureAlphaMod) (SDL_Renderer * renderer,
    5.92 +                               SDL_Texture * texture);
    5.93 +    int (*SetTextureBlendMode) (SDL_Renderer * renderer,
    5.94 +                                SDL_Texture * texture);
    5.95 +    int (*SetTextureScaleMode) (SDL_Renderer * renderer,
    5.96 +                                SDL_Texture * texture);
    5.97 +    int (*UpdateTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
    5.98 +                          const SDL_Rect * rect, const void *pixels,
    5.99 +                          int pitch);
   5.100 +    int (*LockTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
   5.101 +                        const SDL_Rect * rect, int markDirty, void **pixels,
   5.102 +                        int *pitch);
   5.103 +    void (*UnlockTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
   5.104 +    void (*DirtyTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
   5.105 +                          int numrects, const SDL_Rect * rects);
   5.106 +    int (*RenderFill) (SDL_Renderer * renderer, Uint8 r, Uint8 g, Uint8 b,
   5.107 +                       Uint8 a, const SDL_Rect * rect);
   5.108 +    int (*RenderCopy) (SDL_Renderer * renderer, SDL_Texture * texture,
   5.109 +                       const SDL_Rect * srcrect, const SDL_Rect * dstrect);
   5.110 +    void (*RenderPresent) (SDL_Renderer * renderer);
   5.111 +    void (*DestroyTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
   5.112  
   5.113 -	void            (*DestroyRenderer) (SDL_Renderer * renderer);
   5.114 +    void (*DestroyRenderer) (SDL_Renderer * renderer);
   5.115  
   5.116 -	/* The current renderer info */
   5.117 -	SDL_RendererInfo info;
   5.118 +    /* The current renderer info */
   5.119 +    SDL_RendererInfo info;
   5.120  
   5.121 -	/* The window associated with the renderer */
   5.122 -	SDL_WindowID    window;
   5.123 +    /* The window associated with the renderer */
   5.124 +    SDL_WindowID window;
   5.125  
   5.126 -	void           *driverdata;
   5.127 +    void *driverdata;
   5.128  };
   5.129  
   5.130  /* Define the SDL render driver structure */
   5.131 -struct SDL_RenderDriver {
   5.132 -	SDL_Renderer   *(*CreateRenderer) (SDL_Window * window, Uint32 flags);
   5.133 +struct SDL_RenderDriver
   5.134 +{
   5.135 +    SDL_Renderer *(*CreateRenderer) (SDL_Window * window, Uint32 flags);
   5.136  
   5.137 -	/* Info about the renderer capabilities */
   5.138 -	SDL_RendererInfo info;
   5.139 +    /* Info about the renderer capabilities */
   5.140 +    SDL_RendererInfo info;
   5.141  };
   5.142  
   5.143  /* Define the SDL window structure, corresponding to toplevel windows */
   5.144 -struct SDL_Window {
   5.145 -	Uint32          id;
   5.146 +struct SDL_Window
   5.147 +{
   5.148 +    Uint32 id;
   5.149  
   5.150 -	char           *title;
   5.151 -	int             x, y;
   5.152 -	int             w, h;
   5.153 -	Uint32          flags;
   5.154 +    char *title;
   5.155 +    int x, y;
   5.156 +    int w, h;
   5.157 +    Uint32 flags;
   5.158  
   5.159 -	int             display;
   5.160 -	SDL_Renderer   *renderer;
   5.161 +    int display;
   5.162 +    SDL_Renderer *renderer;
   5.163  
   5.164 -	void           *userdata;
   5.165 -	void           *driverdata;
   5.166 +    void *userdata;
   5.167 +    void *driverdata;
   5.168  };
   5.169  #define FULLSCREEN_VISIBLE(W) \
   5.170      (((W)->flags & SDL_WINDOW_FULLSCREEN) && \
   5.171 @@ -136,177 +140,181 @@
   5.172   * Define the SDL display structure This corresponds to physical monitors
   5.173   * attached to the system.
   5.174   */
   5.175 -struct SDL_VideoDisplay {
   5.176 -	int             max_display_modes;
   5.177 -	int             num_display_modes;
   5.178 -	SDL_DisplayMode *display_modes;
   5.179 -	SDL_DisplayMode desktop_mode;
   5.180 -	SDL_DisplayMode current_mode;
   5.181 -	SDL_DisplayMode fullscreen_mode;
   5.182 -	SDL_Palette    *palette;
   5.183 +struct SDL_VideoDisplay
   5.184 +{
   5.185 +    int max_display_modes;
   5.186 +    int num_display_modes;
   5.187 +    SDL_DisplayMode *display_modes;
   5.188 +    SDL_DisplayMode desktop_mode;
   5.189 +    SDL_DisplayMode current_mode;
   5.190 +    SDL_DisplayMode fullscreen_mode;
   5.191 +    SDL_Palette *palette;
   5.192  
   5.193 -	Uint16         *gamma;
   5.194 -	Uint16         *saved_gamma;	/* (just offset into gamma) */
   5.195 +    Uint16 *gamma;
   5.196 +    Uint16 *saved_gamma;        /* (just offset into gamma) */
   5.197  
   5.198 -	int             num_render_drivers;
   5.199 -	SDL_RenderDriver *render_drivers;
   5.200 +    int num_render_drivers;
   5.201 +    SDL_RenderDriver *render_drivers;
   5.202  
   5.203 -	int             num_windows;
   5.204 -	SDL_Window     *windows;
   5.205 +    int num_windows;
   5.206 +    SDL_Window *windows;
   5.207  
   5.208 -	SDL_Renderer   *current_renderer;
   5.209 +    SDL_Renderer *current_renderer;
   5.210  
   5.211 -	/* The hash list of textures */
   5.212 -	SDL_Texture    *textures[64];
   5.213 +    /* The hash list of textures */
   5.214 +    SDL_Texture *textures[64];
   5.215  
   5.216 -	SDL_VideoDevice *device;
   5.217 +    SDL_VideoDevice *device;
   5.218  
   5.219 -	void           *driverdata;
   5.220 +    void *driverdata;
   5.221  };
   5.222  
   5.223  /* Define the SDL video driver structure */
   5.224  #define _THIS	SDL_VideoDevice *_this
   5.225  
   5.226 -struct SDL_VideoDevice {
   5.227 -	/* * * */
   5.228 -	/* The name of this video driver */
   5.229 -	const char     *name;
   5.230 +struct SDL_VideoDevice
   5.231 +{
   5.232 +    /* * * */
   5.233 +    /* The name of this video driver */
   5.234 +    const char *name;
   5.235  
   5.236 -	/* * * */
   5.237 -	/* Initialization/Query functions */
   5.238 +    /* * * */
   5.239 +    /* Initialization/Query functions */
   5.240  
   5.241 -	/*
   5.242 -	 * Initialize the native video subsystem, filling in the list of
   5.243 -	 * displays for this driver, returning 0 or -1 if there's an error.
   5.244 -	 */
   5.245 -	int             (*VideoInit) (_THIS);
   5.246 +    /*
   5.247 +     * Initialize the native video subsystem, filling in the list of
   5.248 +     * displays for this driver, returning 0 or -1 if there's an error.
   5.249 +     */
   5.250 +    int (*VideoInit) (_THIS);
   5.251  
   5.252 -	/*
   5.253 -	 * Reverse the effects VideoInit() -- called if VideoInit() fails or
   5.254 -	 * if the application is shutting down the video subsystem.
   5.255 -	 */
   5.256 -	void            (*VideoQuit) (_THIS);
   5.257 +    /*
   5.258 +     * Reverse the effects VideoInit() -- called if VideoInit() fails or
   5.259 +     * if the application is shutting down the video subsystem.
   5.260 +     */
   5.261 +    void (*VideoQuit) (_THIS);
   5.262  
   5.263 -	/* * * */
   5.264 -	/*
   5.265 -	 * Display functions
   5.266 -	 */
   5.267 +    /* * * */
   5.268 +    /*
   5.269 +     * Display functions
   5.270 +     */
   5.271  
   5.272 -	/*
   5.273 -	 * Get a list of the available display modes. e.g.
   5.274 -	 * SDL_AddDisplayMode(_this->current_display, mode)
   5.275 -	 */
   5.276 -	void            (*GetDisplayModes) (_THIS);
   5.277 +    /*
   5.278 +     * Get a list of the available display modes. e.g.
   5.279 +     * SDL_AddDisplayMode(_this->current_display, mode)
   5.280 +     */
   5.281 +    void (*GetDisplayModes) (_THIS);
   5.282  
   5.283 -	/*
   5.284 -	 * Setting the display mode is independent of creating windows, so
   5.285 -	 * when the display mode is changed, all existing windows should have
   5.286 -	 * their data updated accordingly, including the display surfaces
   5.287 -	 * associated with them.
   5.288 -	 */
   5.289 -	int             (*SetDisplayMode) (_THIS, SDL_DisplayMode * mode);
   5.290 +    /*
   5.291 +     * Setting the display mode is independent of creating windows, so
   5.292 +     * when the display mode is changed, all existing windows should have
   5.293 +     * their data updated accordingly, including the display surfaces
   5.294 +     * associated with them.
   5.295 +     */
   5.296 +    int (*SetDisplayMode) (_THIS, SDL_DisplayMode * mode);
   5.297  
   5.298 -	/* Set the color entries of the display palette */
   5.299 -	int             (*SetDisplayPalette) (_THIS, SDL_Palette * palette);
   5.300 +    /* Set the color entries of the display palette */
   5.301 +    int (*SetDisplayPalette) (_THIS, SDL_Palette * palette);
   5.302  
   5.303 -	/* Get the color entries of the display palette */
   5.304 -	int             (*GetDisplayPalette) (_THIS, SDL_Palette * palette);
   5.305 +    /* Get the color entries of the display palette */
   5.306 +    int (*GetDisplayPalette) (_THIS, SDL_Palette * palette);
   5.307  
   5.308 -	/* Set the gamma ramp */
   5.309 -	int             (*SetDisplayGammaRamp) (_THIS, Uint16 * ramp);
   5.310 +    /* Set the gamma ramp */
   5.311 +    int (*SetDisplayGammaRamp) (_THIS, Uint16 * ramp);
   5.312  
   5.313 -	/* Get the gamma ramp */
   5.314 -	int             (*GetDisplayGammaRamp) (_THIS, Uint16 * ramp);
   5.315 +    /* Get the gamma ramp */
   5.316 +    int (*GetDisplayGammaRamp) (_THIS, Uint16 * ramp);
   5.317  
   5.318 -	/* * * */
   5.319 -	/*
   5.320 -	 * Window functions
   5.321 -	 */
   5.322 -	int             (*CreateWindow) (_THIS, SDL_Window * window);
   5.323 -	int             (*CreateWindowFrom) (_THIS, SDL_Window * window, const void *data);
   5.324 -	void            (*SetWindowTitle) (_THIS, SDL_Window * window);
   5.325 -	void            (*SetWindowPosition) (_THIS, SDL_Window * window);
   5.326 -	void            (*SetWindowSize) (_THIS, SDL_Window * window);
   5.327 -	void            (*ShowWindow) (_THIS, SDL_Window * window);
   5.328 -	void            (*HideWindow) (_THIS, SDL_Window * window);
   5.329 -	void            (*RaiseWindow) (_THIS, SDL_Window * window);
   5.330 -	void            (*MaximizeWindow) (_THIS, SDL_Window * window);
   5.331 -	void            (*MinimizeWindow) (_THIS, SDL_Window * window);
   5.332 -	void            (*RestoreWindow) (_THIS, SDL_Window * window);
   5.333 -	void            (*SetWindowGrab) (_THIS, SDL_Window * window);
   5.334 -	void            (*DestroyWindow) (_THIS, SDL_Window * window);
   5.335 +    /* * * */
   5.336 +    /*
   5.337 +     * Window functions
   5.338 +     */
   5.339 +    int (*CreateWindow) (_THIS, SDL_Window * window);
   5.340 +    int (*CreateWindowFrom) (_THIS, SDL_Window * window, const void *data);
   5.341 +    void (*SetWindowTitle) (_THIS, SDL_Window * window);
   5.342 +    void (*SetWindowPosition) (_THIS, SDL_Window * window);
   5.343 +    void (*SetWindowSize) (_THIS, SDL_Window * window);
   5.344 +    void (*ShowWindow) (_THIS, SDL_Window * window);
   5.345 +    void (*HideWindow) (_THIS, SDL_Window * window);
   5.346 +    void (*RaiseWindow) (_THIS, SDL_Window * window);
   5.347 +    void (*MaximizeWindow) (_THIS, SDL_Window * window);
   5.348 +    void (*MinimizeWindow) (_THIS, SDL_Window * window);
   5.349 +    void (*RestoreWindow) (_THIS, SDL_Window * window);
   5.350 +    void (*SetWindowGrab) (_THIS, SDL_Window * window);
   5.351 +    void (*DestroyWindow) (_THIS, SDL_Window * window);
   5.352  
   5.353 -	/* Get some platform dependent window information */
   5.354 -	                SDL_bool(*GetWindowWMInfo) (_THIS, SDL_Window * window,
   5.355 -			                       struct SDL_SysWMinfo * info);
   5.356 +    /* Get some platform dependent window information */
   5.357 +      SDL_bool(*GetWindowWMInfo) (_THIS, SDL_Window * window,
   5.358 +                                  struct SDL_SysWMinfo * info);
   5.359  
   5.360 -	/* * * */
   5.361 -	/*
   5.362 -	 * OpenGL support
   5.363 -	 */
   5.364 -	int             (*GL_LoadLibrary) (_THIS, const char *path);
   5.365 -	void           *(*GL_GetProcAddress) (_THIS, const char *proc);
   5.366 -	                SDL_GLContext(*GL_CreateContext) (_THIS, SDL_Window * window);
   5.367 -	int             (*GL_MakeCurrent) (_THIS, SDL_Window * window, SDL_GLContext context);
   5.368 -	int             (*GL_SetSwapInterval) (_THIS, int interval);
   5.369 -	int             (*GL_GetSwapInterval) (_THIS);
   5.370 -	void            (*GL_SwapWindow) (_THIS, SDL_Window * window);
   5.371 -	void            (*GL_DeleteContext) (_THIS, SDL_GLContext context);
   5.372 +    /* * * */
   5.373 +    /*
   5.374 +     * OpenGL support
   5.375 +     */
   5.376 +    int (*GL_LoadLibrary) (_THIS, const char *path);
   5.377 +    void *(*GL_GetProcAddress) (_THIS, const char *proc);
   5.378 +      SDL_GLContext(*GL_CreateContext) (_THIS, SDL_Window * window);
   5.379 +    int (*GL_MakeCurrent) (_THIS, SDL_Window * window, SDL_GLContext context);
   5.380 +    int (*GL_SetSwapInterval) (_THIS, int interval);
   5.381 +    int (*GL_GetSwapInterval) (_THIS);
   5.382 +    void (*GL_SwapWindow) (_THIS, SDL_Window * window);
   5.383 +    void (*GL_DeleteContext) (_THIS, SDL_GLContext context);
   5.384  
   5.385 -	/* * * */
   5.386 -	/*
   5.387 -	 * Event manager functions
   5.388 -	 */
   5.389 -	void            (*PumpEvents) (_THIS);
   5.390 +    /* * * */
   5.391 +    /*
   5.392 +     * Event manager functions
   5.393 +     */
   5.394 +    void (*PumpEvents) (_THIS);
   5.395  
   5.396 -	/* * * */
   5.397 -	/* Data common to all drivers */
   5.398 -	int             num_displays;
   5.399 -	SDL_VideoDisplay *displays;
   5.400 -	int             current_display;
   5.401 -	Uint32          next_object_id;
   5.402 +    /* * * */
   5.403 +    /* Data common to all drivers */
   5.404 +    int num_displays;
   5.405 +    SDL_VideoDisplay *displays;
   5.406 +    int current_display;
   5.407 +    Uint32 next_object_id;
   5.408  
   5.409 -	/* * * */
   5.410 -	/* Data used by the GL drivers */
   5.411 -	struct {
   5.412 -		int             red_size;
   5.413 -		int             green_size;
   5.414 -		int             blue_size;
   5.415 -		int             alpha_size;
   5.416 -		int             depth_size;
   5.417 -		int             buffer_size;
   5.418 -		int             stencil_size;
   5.419 -		int             double_buffer;
   5.420 -		int             accum_red_size;
   5.421 -		int             accum_green_size;
   5.422 -		int             accum_blue_size;
   5.423 -		int             accum_alpha_size;
   5.424 -		int             stereo;
   5.425 -		int             multisamplebuffers;
   5.426 -		int             multisamplesamples;
   5.427 -		int             accelerated;
   5.428 -		int             retained_backing;
   5.429 -		int             driver_loaded;
   5.430 -		char            driver_path[256];
   5.431 -		void           *dll_handle;
   5.432 -	}               gl_config;
   5.433 +    /* * * */
   5.434 +    /* Data used by the GL drivers */
   5.435 +    struct
   5.436 +    {
   5.437 +        int red_size;
   5.438 +        int green_size;
   5.439 +        int blue_size;
   5.440 +        int alpha_size;
   5.441 +        int depth_size;
   5.442 +        int buffer_size;
   5.443 +        int stencil_size;
   5.444 +        int double_buffer;
   5.445 +        int accum_red_size;
   5.446 +        int accum_green_size;
   5.447 +        int accum_blue_size;
   5.448 +        int accum_alpha_size;
   5.449 +        int stereo;
   5.450 +        int multisamplebuffers;
   5.451 +        int multisamplesamples;
   5.452 +        int accelerated;
   5.453 +        int retained_backing;
   5.454 +        int driver_loaded;
   5.455 +        char driver_path[256];
   5.456 +        void *dll_handle;
   5.457 +    } gl_config;
   5.458  
   5.459 -	/* * * */
   5.460 -	/* Data private to this driver */
   5.461 -	void           *driverdata;
   5.462 -	struct SDL_GLDriverData *gl_data;
   5.463 +    /* * * */
   5.464 +    /* Data private to this driver */
   5.465 +    void *driverdata;
   5.466 +    struct SDL_GLDriverData *gl_data;
   5.467  
   5.468 -	/* * * */
   5.469 -	/* The function used to dispose of this structure */
   5.470 -	void            (*free) (_THIS);
   5.471 +    /* * * */
   5.472 +    /* The function used to dispose of this structure */
   5.473 +    void (*free) (_THIS);
   5.474  };
   5.475  
   5.476 -typedef struct VideoBootStrap {
   5.477 -	const char     *name;
   5.478 -	const char     *desc;
   5.479 -	int             (*available) (void);
   5.480 -	SDL_VideoDevice *(*create) (int devindex);
   5.481 -}               VideoBootStrap;
   5.482 +typedef struct VideoBootStrap
   5.483 +{
   5.484 +    const char *name;
   5.485 +    const char *desc;
   5.486 +    int (*available) (void);
   5.487 +    SDL_VideoDevice *(*create) (int devindex);
   5.488 +} VideoBootStrap;
   5.489  
   5.490  #if SDL_VIDEO_DRIVER_COCOA
   5.491  extern VideoBootStrap COCOA_bootstrap;
   5.492 @@ -381,26 +389,24 @@
   5.493  #define SDL_CurrentDisplay	(_this->displays[_this->current_display])
   5.494  
   5.495  extern SDL_VideoDevice *SDL_GetVideoDevice();
   5.496 -extern int      SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode);
   5.497 -extern int      SDL_AddVideoDisplay(const SDL_VideoDisplay * display);
   5.498 -extern SDL_bool 
   5.499 -SDL_AddDisplayMode(int displayIndex,
   5.500 -		   const SDL_DisplayMode * mode);
   5.501 -extern void 
   5.502 -SDL_AddRenderDriver(int displayIndex,
   5.503 -		    const SDL_RenderDriver * driver);
   5.504 +extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode);
   5.505 +extern int SDL_AddVideoDisplay(const SDL_VideoDisplay * display);
   5.506 +extern SDL_bool
   5.507 +SDL_AddDisplayMode(int displayIndex, const SDL_DisplayMode * mode);
   5.508 +extern void
   5.509 +SDL_AddRenderDriver(int displayIndex, const SDL_RenderDriver * driver);
   5.510  
   5.511 -extern int      SDL_RecreateWindow(SDL_Window * window, Uint32 flags);
   5.512 +extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags);
   5.513  extern SDL_Window *SDL_GetWindowFromID(SDL_WindowID windowID);
   5.514  extern SDL_VideoDisplay *SDL_GetDisplayFromWindow(SDL_Window * window);
   5.515  
   5.516 -extern void     SDL_OnWindowShown(SDL_Window * window);
   5.517 -extern void     SDL_OnWindowHidden(SDL_Window * window);
   5.518 -extern void     SDL_OnWindowResized(SDL_Window * window);
   5.519 -extern void     SDL_OnWindowFocusGained(SDL_Window * window);
   5.520 -extern void     SDL_OnWindowFocusLost(SDL_Window * window);
   5.521 +extern void SDL_OnWindowShown(SDL_Window * window);
   5.522 +extern void SDL_OnWindowHidden(SDL_Window * window);
   5.523 +extern void SDL_OnWindowResized(SDL_Window * window);
   5.524 +extern void SDL_OnWindowFocusGained(SDL_Window * window);
   5.525 +extern void SDL_OnWindowFocusLost(SDL_Window * window);
   5.526  extern SDL_WindowID SDL_GetFocusWindow(void);
   5.527  
   5.528 -#endif				/* _SDL_sysvideo_h */
   5.529 +#endif /* _SDL_sysvideo_h */
   5.530  
   5.531  /* vi: set ts=4 sw=4 expandtab: */
     6.1 --- a/src/video/SDL_video.c	Mon Sep 15 04:31:30 2008 +0000
     6.2 +++ b/src/video/SDL_video.c	Mon Sep 15 04:32:36 2008 +0000
     6.3 @@ -35,7 +35,7 @@
     6.4  
     6.5  #if SDL_VIDEO_OPENGL_ES
     6.6  #include "SDL_opengles.h"
     6.7 -#endif				/* SDL_VIDEO_OPENGL_ES */
     6.8 +#endif /* SDL_VIDEO_OPENGL_ES */
     6.9  
    6.10  #if SDL_VIDEO_OPENGL
    6.11  #include "SDL_opengl.h"
    6.12 @@ -44,128 +44,128 @@
    6.13  #ifdef CreateWindow
    6.14  #undef CreateWindow
    6.15  #endif
    6.16 -#endif				/* SDL_VIDEO_OPENGL */
    6.17 +#endif /* SDL_VIDEO_OPENGL */
    6.18  
    6.19  /* Available video drivers */
    6.20  static VideoBootStrap *bootstrap[] = {
    6.21  #if SDL_VIDEO_DRIVER_COCOA
    6.22 -	&COCOA_bootstrap,
    6.23 +    &COCOA_bootstrap,
    6.24  #endif
    6.25  #if SDL_VIDEO_DRIVER_X11
    6.26 -	&X11_bootstrap,
    6.27 +    &X11_bootstrap,
    6.28  #endif
    6.29  #if SDL_VIDEO_DRIVER_NANOX
    6.30 -	&NX_bootstrap,
    6.31 +    &NX_bootstrap,
    6.32  #endif
    6.33  #if SDL_VIDEO_DRIVER_IPOD
    6.34 -	&iPod_bootstrap,
    6.35 +    &iPod_bootstrap,
    6.36  #endif
    6.37  #if SDL_VIDEO_DRIVER_WSCONS
    6.38 -	&WSCONS_bootstrap,
    6.39 +    &WSCONS_bootstrap,
    6.40  #endif
    6.41  #if SDL_VIDEO_DRIVER_FBCON
    6.42 -	&FBCON_bootstrap,
    6.43 +    &FBCON_bootstrap,
    6.44  #endif
    6.45  #if SDL_VIDEO_DRIVER_DIRECTFB
    6.46 -	&DirectFB_bootstrap,
    6.47 +    &DirectFB_bootstrap,
    6.48  #endif
    6.49  #if SDL_VIDEO_DRIVER_PS2GS
    6.50 -	&PS2GS_bootstrap,
    6.51 +    &PS2GS_bootstrap,
    6.52  #endif
    6.53  #if SDL_VIDEO_DRIVER_VGL
    6.54 -	&VGL_bootstrap,
    6.55 +    &VGL_bootstrap,
    6.56  #endif
    6.57  #if SDL_VIDEO_DRIVER_SVGALIB
    6.58 -	&SVGALIB_bootstrap,
    6.59 +    &SVGALIB_bootstrap,
    6.60  #endif
    6.61  #if SDL_VIDEO_DRIVER_GAPI
    6.62 -	&GAPI_bootstrap,
    6.63 +    &GAPI_bootstrap,
    6.64  #endif
    6.65  #if SDL_VIDEO_DRIVER_WIN32
    6.66 -	&WIN32_bootstrap,
    6.67 +    &WIN32_bootstrap,
    6.68  #endif
    6.69  #if SDL_VIDEO_DRIVER_BWINDOW
    6.70 -	&BWINDOW_bootstrap,
    6.71 +    &BWINDOW_bootstrap,
    6.72  #endif
    6.73  #if SDL_VIDEO_DRIVER_PHOTON
    6.74 -	&ph_bootstrap,
    6.75 +    &ph_bootstrap,
    6.76  #endif
    6.77  #if SDL_VIDEO_DRIVER_EPOC
    6.78 -	&EPOC_bootstrap,
    6.79 +    &EPOC_bootstrap,
    6.80  #endif
    6.81  #if SDL_VIDEO_DRIVER_XBIOS
    6.82 -	&XBIOS_bootstrap,
    6.83 +    &XBIOS_bootstrap,
    6.84  #endif
    6.85  #if SDL_VIDEO_DRIVER_GEM
    6.86 -	&GEM_bootstrap,
    6.87 +    &GEM_bootstrap,
    6.88  #endif
    6.89  #if SDL_VIDEO_DRIVER_DC
    6.90 -	&DC_bootstrap,
    6.91 +    &DC_bootstrap,
    6.92  #endif
    6.93  #if SDL_VIDEO_DRIVER_RISCOS
    6.94 -	&RISCOS_bootstrap,
    6.95 +    &RISCOS_bootstrap,
    6.96  #endif
    6.97  #if SDL_VIDEO_DRIVER_OS2FS
    6.98 -	&OS2FSLib_bootstrap,
    6.99 +    &OS2FSLib_bootstrap,
   6.100  #endif
   6.101  #if SDL_VIDEO_DRIVER_NDS
   6.102 -	&NDS_bootstrap,
   6.103 +    &NDS_bootstrap,
   6.104  #endif
   6.105  #if SDL_VIDEO_DRIVER_UIKIT
   6.106 -	&UIKIT_bootstrap,
   6.107 +    &UIKIT_bootstrap,
   6.108  #endif
   6.109  #if SDL_VIDEO_DRIVER_DUMMY
   6.110 -	&DUMMY_bootstrap,
   6.111 +    &DUMMY_bootstrap,
   6.112  #endif
   6.113 -	NULL
   6.114 +    NULL
   6.115  };
   6.116  
   6.117  static SDL_VideoDevice *_this = NULL;
   6.118  
   6.119  /* Various local functions */
   6.120 -int             SDL_VideoInit(const char *driver_name, Uint32 flags);
   6.121 -void            SDL_VideoQuit(void);
   6.122 +int SDL_VideoInit(const char *driver_name, Uint32 flags);
   6.123 +void SDL_VideoQuit(void);
   6.124  
   6.125  static int
   6.126  cmpmodes(const void *A, const void *B)
   6.127  {
   6.128 -	SDL_DisplayMode a = *(const SDL_DisplayMode *) A;
   6.129 -	SDL_DisplayMode b = *(const SDL_DisplayMode *) B;
   6.130 +    SDL_DisplayMode a = *(const SDL_DisplayMode *) A;
   6.131 +    SDL_DisplayMode b = *(const SDL_DisplayMode *) B;
   6.132  
   6.133 -	if (a.w != b.w) {
   6.134 -		return b.w - a.w;
   6.135 -	}
   6.136 -	if (a.h != b.h) {
   6.137 -		return b.h - a.h;
   6.138 -	}
   6.139 -	if (SDL_BITSPERPIXEL(a.format) != SDL_BITSPERPIXEL(b.format)) {
   6.140 -		return SDL_BITSPERPIXEL(b.format) - SDL_BITSPERPIXEL(a.format);
   6.141 -	}
   6.142 -	if (a.refresh_rate != b.refresh_rate) {
   6.143 -		return b.refresh_rate - a.refresh_rate;
   6.144 -	}
   6.145 -	return 0;
   6.146 +    if (a.w != b.w) {
   6.147 +        return b.w - a.w;
   6.148 +    }
   6.149 +    if (a.h != b.h) {
   6.150 +        return b.h - a.h;
   6.151 +    }
   6.152 +    if (SDL_BITSPERPIXEL(a.format) != SDL_BITSPERPIXEL(b.format)) {
   6.153 +        return SDL_BITSPERPIXEL(b.format) - SDL_BITSPERPIXEL(a.format);
   6.154 +    }
   6.155 +    if (a.refresh_rate != b.refresh_rate) {
   6.156 +        return b.refresh_rate - a.refresh_rate;
   6.157 +    }
   6.158 +    return 0;
   6.159  }
   6.160  
   6.161  static void
   6.162  SDL_UninitializedVideo()
   6.163  {
   6.164 -	SDL_SetError("Video subsystem has not been initialized");
   6.165 +    SDL_SetError("Video subsystem has not been initialized");
   6.166  }
   6.167  
   6.168  int
   6.169  SDL_GetNumVideoDrivers(void)
   6.170  {
   6.171 -	return SDL_arraysize(bootstrap) - 1;
   6.172 +    return SDL_arraysize(bootstrap) - 1;
   6.173  }
   6.174  
   6.175 -const char     *
   6.176 +const char *
   6.177  SDL_GetVideoDriver(int index)
   6.178  {
   6.179 -	if (index >= 0 && index < SDL_GetNumVideoDrivers()) {
   6.180 -		return bootstrap[index]->name;
   6.181 -	}
   6.182 -	return NULL;
   6.183 +    if (index >= 0 && index < SDL_GetNumVideoDrivers()) {
   6.184 +        return bootstrap[index]->name;
   6.185 +    }
   6.186 +    return NULL;
   6.187  }
   6.188  
   6.189  /*
   6.190 @@ -174,1045 +174,1045 @@
   6.191  int
   6.192  SDL_VideoInit(const char *driver_name, Uint32 flags)
   6.193  {
   6.194 -	SDL_VideoDevice *video;
   6.195 -	int             index;
   6.196 -	int             i;
   6.197 +    SDL_VideoDevice *video;
   6.198 +    int index;
   6.199 +    int i;
   6.200  
   6.201 -	/* Toggle the event thread flags, based on OS requirements */
   6.202 +    /* Toggle the event thread flags, based on OS requirements */
   6.203  #if defined(MUST_THREAD_EVENTS)
   6.204 -	flags |= SDL_INIT_EVENTTHREAD;
   6.205 +    flags |= SDL_INIT_EVENTTHREAD;
   6.206  #elif defined(CANT_THREAD_EVENTS)
   6.207 -	if ((flags & SDL_INIT_EVENTTHREAD) == SDL_INIT_EVENTTHREAD) {
   6.208 -		SDL_SetError("OS doesn't support threaded events");
   6.209 -		return -1;
   6.210 -	}
   6.211 +    if ((flags & SDL_INIT_EVENTTHREAD) == SDL_INIT_EVENTTHREAD) {
   6.212 +        SDL_SetError("OS doesn't support threaded events");
   6.213 +        return -1;
   6.214 +    }
   6.215  #endif
   6.216  
   6.217 -	/* Start the event loop */
   6.218 -	if (SDL_StartEventLoop(flags) < 0) {
   6.219 -		return -1;
   6.220 -	}
   6.221 -	/* Check to make sure we don't overwrite '_this' */
   6.222 -	if (_this != NULL) {
   6.223 -		SDL_VideoQuit();
   6.224 -	}
   6.225 -	/* Select the proper video driver */
   6.226 -	index = 0;
   6.227 -	video = NULL;
   6.228 -	if (driver_name == NULL) {
   6.229 -		driver_name = SDL_getenv("SDL_VIDEODRIVER");
   6.230 -	}
   6.231 -	if (driver_name != NULL) {
   6.232 -		for (i = 0; bootstrap[i]; ++i) {
   6.233 -			if (SDL_strcasecmp(bootstrap[i]->name, driver_name) == 0) {
   6.234 -				if (bootstrap[i]->available()) {
   6.235 -					video = bootstrap[i]->create(index);
   6.236 -				}
   6.237 -				break;
   6.238 -			}
   6.239 -		}
   6.240 -	} else {
   6.241 -		for (i = 0; bootstrap[i]; ++i) {
   6.242 -			if (bootstrap[i]->available()) {
   6.243 -				video = bootstrap[i]->create(index);
   6.244 -				if (video != NULL) {
   6.245 -					break;
   6.246 -				}
   6.247 -			}
   6.248 -		}
   6.249 -	}
   6.250 -	if (video == NULL) {
   6.251 -		if (driver_name) {
   6.252 -			SDL_SetError("%s not available", driver_name);
   6.253 -		} else {
   6.254 -			SDL_SetError("No available video device");
   6.255 -		}
   6.256 -		return -1;
   6.257 -	}
   6.258 -	_this = video;
   6.259 -	_this->name = bootstrap[i]->name;
   6.260 -	_this->next_object_id = 1;
   6.261 +    /* Start the event loop */
   6.262 +    if (SDL_StartEventLoop(flags) < 0) {
   6.263 +        return -1;
   6.264 +    }
   6.265 +    /* Check to make sure we don't overwrite '_this' */
   6.266 +    if (_this != NULL) {
   6.267 +        SDL_VideoQuit();
   6.268 +    }
   6.269 +    /* Select the proper video driver */
   6.270 +    index = 0;
   6.271 +    video = NULL;
   6.272 +    if (driver_name == NULL) {
   6.273 +        driver_name = SDL_getenv("SDL_VIDEODRIVER");
   6.274 +    }
   6.275 +    if (driver_name != NULL) {
   6.276 +        for (i = 0; bootstrap[i]; ++i) {
   6.277 +            if (SDL_strcasecmp(bootstrap[i]->name, driver_name) == 0) {
   6.278 +                if (bootstrap[i]->available()) {
   6.279 +                    video = bootstrap[i]->create(index);
   6.280 +                }
   6.281 +                break;
   6.282 +            }
   6.283 +        }
   6.284 +    } else {
   6.285 +        for (i = 0; bootstrap[i]; ++i) {
   6.286 +            if (bootstrap[i]->available()) {
   6.287 +                video = bootstrap[i]->create(index);
   6.288 +                if (video != NULL) {
   6.289 +                    break;
   6.290 +                }
   6.291 +            }
   6.292 +        }
   6.293 +    }
   6.294 +    if (video == NULL) {
   6.295 +        if (driver_name) {
   6.296 +            SDL_SetError("%s not available", driver_name);
   6.297 +        } else {
   6.298 +            SDL_SetError("No available video device");
   6.299 +        }
   6.300 +        return -1;
   6.301 +    }
   6.302 +    _this = video;
   6.303 +    _this->name = bootstrap[i]->name;
   6.304 +    _this->next_object_id = 1;
   6.305  
   6.306  
   6.307 -	/* Set some very sane GL defaults */
   6.308 -	_this->gl_config.driver_loaded = 0;
   6.309 -	_this->gl_config.dll_handle = NULL;
   6.310 -	_this->gl_config.red_size = 3;
   6.311 -	_this->gl_config.green_size = 3;
   6.312 -	_this->gl_config.blue_size = 2;
   6.313 -	_this->gl_config.alpha_size = 0;
   6.314 -	_this->gl_config.buffer_size = 0;
   6.315 -	_this->gl_config.depth_size = 16;
   6.316 -	_this->gl_config.stencil_size = 0;
   6.317 -	_this->gl_config.double_buffer = 1;
   6.318 -	_this->gl_config.accum_red_size = 0;
   6.319 -	_this->gl_config.accum_green_size = 0;
   6.320 -	_this->gl_config.accum_blue_size = 0;
   6.321 -	_this->gl_config.accum_alpha_size = 0;
   6.322 -	_this->gl_config.stereo = 0;
   6.323 -	_this->gl_config.multisamplebuffers = 0;
   6.324 -	_this->gl_config.multisamplesamples = 0;
   6.325 -	_this->gl_config.retained_backing = 1;
   6.326 -	_this->gl_config.accelerated = -1;	/* not known, don't set */
   6.327 +    /* Set some very sane GL defaults */
   6.328 +    _this->gl_config.driver_loaded = 0;
   6.329 +    _this->gl_config.dll_handle = NULL;
   6.330 +    _this->gl_config.red_size = 3;
   6.331 +    _this->gl_config.green_size = 3;
   6.332 +    _this->gl_config.blue_size = 2;
   6.333 +    _this->gl_config.alpha_size = 0;
   6.334 +    _this->gl_config.buffer_size = 0;
   6.335 +    _this->gl_config.depth_size = 16;
   6.336 +    _this->gl_config.stencil_size = 0;
   6.337 +    _this->gl_config.double_buffer = 1;
   6.338 +    _this->gl_config.accum_red_size = 0;
   6.339 +    _this->gl_config.accum_green_size = 0;
   6.340 +    _this->gl_config.accum_blue_size = 0;
   6.341 +    _this->gl_config.accum_alpha_size = 0;
   6.342 +    _this->gl_config.stereo = 0;
   6.343 +    _this->gl_config.multisamplebuffers = 0;
   6.344 +    _this->gl_config.multisamplesamples = 0;
   6.345 +    _this->gl_config.retained_backing = 1;
   6.346 +    _this->gl_config.accelerated = -1;  /* not known, don't set */
   6.347  
   6.348 -	/* Initialize the video subsystem */
   6.349 -	if (_this->VideoInit(_this) < 0) {
   6.350 -		SDL_VideoQuit();
   6.351 -		return -1;
   6.352 -	}
   6.353 -	/* Make sure some displays were added */
   6.354 -	if (_this->num_displays == 0) {
   6.355 -		SDL_SetError("The video driver did not add any displays");
   6.356 -		SDL_VideoQuit();
   6.357 -		return (-1);
   6.358 -	}
   6.359 -	/* The software renderer is always available */
   6.360 -	for (i = 0; i < _this->num_displays; ++i) {
   6.361 +    /* Initialize the video subsystem */
   6.362 +    if (_this->VideoInit(_this) < 0) {
   6.363 +        SDL_VideoQuit();
   6.364 +        return -1;
   6.365 +    }
   6.366 +    /* Make sure some displays were added */
   6.367 +    if (_this->num_displays == 0) {
   6.368 +        SDL_SetError("The video driver did not add any displays");
   6.369 +        SDL_VideoQuit();
   6.370 +        return (-1);
   6.371 +    }
   6.372 +    /* The software renderer is always available */
   6.373 +    for (i = 0; i < _this->num_displays; ++i) {
   6.374  #if SDL_VIDEO_RENDER_OGL
   6.375 -		SDL_AddRenderDriver(i, &GL_RenderDriver);
   6.376 +        SDL_AddRenderDriver(i, &GL_RenderDriver);
   6.377  #endif
   6.378  
   6.379  #if SDL_VIDEO_RENDER_OGL_ES
   6.380 -		SDL_AddRenderDriver(i, &GL_ES_RenderDriver);
   6.381 +        SDL_AddRenderDriver(i, &GL_ES_RenderDriver);
   6.382  #endif
   6.383 -		if (_this->displays[i].num_render_drivers > 0) {
   6.384 -			SDL_AddRenderDriver(i, &SW_RenderDriver);
   6.385 -		}
   6.386 -	}
   6.387 +        if (_this->displays[i].num_render_drivers > 0) {
   6.388 +            SDL_AddRenderDriver(i, &SW_RenderDriver);
   6.389 +        }
   6.390 +    }
   6.391  
   6.392 -	/* We're ready to go! */
   6.393 -	return 0;
   6.394 +    /* We're ready to go! */
   6.395 +    return 0;
   6.396  }
   6.397  
   6.398 -const char     *
   6.399 +const char *
   6.400  SDL_GetCurrentVideoDriver()
   6.401  {
   6.402 -	if (!_this) {
   6.403 -		SDL_UninitializedVideo();
   6.404 -		return NULL;
   6.405 -	}
   6.406 -	return _this->name;
   6.407 +    if (!_this) {
   6.408 +        SDL_UninitializedVideo();
   6.409 +        return NULL;
   6.410 +    }
   6.411 +    return _this->name;
   6.412  }
   6.413  
   6.414  SDL_VideoDevice *
   6.415  SDL_GetVideoDevice()
   6.416  {
   6.417 -	return _this;
   6.418 +    return _this;
   6.419  }
   6.420  
   6.421  int
   6.422  SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode)
   6.423  {
   6.424 -	SDL_VideoDisplay display;
   6.425 +    SDL_VideoDisplay display;
   6.426  
   6.427 -	SDL_zero(display);
   6.428 -	if (desktop_mode) {
   6.429 -		display.desktop_mode = *desktop_mode;
   6.430 -	}
   6.431 -	display.current_mode = display.desktop_mode;
   6.432 +    SDL_zero(display);
   6.433 +    if (desktop_mode) {
   6.434 +        display.desktop_mode = *desktop_mode;
   6.435 +    }
   6.436 +    display.current_mode = display.desktop_mode;
   6.437  
   6.438 -	return SDL_AddVideoDisplay(&display);
   6.439 +    return SDL_AddVideoDisplay(&display);
   6.440  }
   6.441  
   6.442  int
   6.443  SDL_AddVideoDisplay(const SDL_VideoDisplay * display)
   6.444  {
   6.445 -	SDL_VideoDisplay *displays;
   6.446 -	int             index = -1;
   6.447 +    SDL_VideoDisplay *displays;
   6.448 +    int index = -1;
   6.449  
   6.450 -	displays =
   6.451 -		SDL_realloc(_this->displays,
   6.452 -			    (_this->num_displays + 1) * sizeof(*displays));
   6.453 -	if (displays) {
   6.454 -		index = _this->num_displays++;
   6.455 -		displays[index] = *display;
   6.456 -		displays[index].device = _this;
   6.457 -		_this->displays = displays;
   6.458 -	} else {
   6.459 -		SDL_OutOfMemory();
   6.460 -	}
   6.461 -	return index;
   6.462 +    displays =
   6.463 +        SDL_realloc(_this->displays,
   6.464 +                    (_this->num_displays + 1) * sizeof(*displays));
   6.465 +    if (displays) {
   6.466 +        index = _this->num_displays++;
   6.467 +        displays[index] = *display;
   6.468 +        displays[index].device = _this;
   6.469 +        _this->displays = displays;
   6.470 +    } else {
   6.471 +        SDL_OutOfMemory();
   6.472 +    }
   6.473 +    return index;
   6.474  }
   6.475  
   6.476  int
   6.477  SDL_GetNumVideoDisplays(void)
   6.478  {
   6.479 -	if (!_this) {
   6.480 -		SDL_UninitializedVideo();
   6.481 -		return 0;
   6.482 -	}
   6.483 -	return _this->num_displays;
   6.484 +    if (!_this) {
   6.485 +        SDL_UninitializedVideo();
   6.486 +        return 0;
   6.487 +    }
   6.488 +    return _this->num_displays;
   6.489  }
   6.490  
   6.491  int
   6.492  SDL_SelectVideoDisplay(int index)
   6.493  {
   6.494 -	if (!_this) {
   6.495 -		SDL_UninitializedVideo();
   6.496 -		return (-1);
   6.497 -	}
   6.498 -	if (index < 0 || index >= _this->num_displays) {
   6.499 -		SDL_SetError("index must be in the range 0 - %d",
   6.500 -			     _this->num_displays - 1);
   6.501 -		return -1;
   6.502 -	}
   6.503 -	_this->current_display = index;
   6.504 -	return 0;
   6.505 +    if (!_this) {
   6.506 +        SDL_UninitializedVideo();
   6.507 +        return (-1);
   6.508 +    }
   6.509 +    if (index < 0 || index >= _this->num_displays) {
   6.510 +        SDL_SetError("index must be in the range 0 - %d",
   6.511 +                     _this->num_displays - 1);
   6.512 +        return -1;
   6.513 +    }
   6.514 +    _this->current_display = index;
   6.515 +    return 0;
   6.516  }
   6.517  
   6.518  int
   6.519  SDL_GetCurrentVideoDisplay(void)
   6.520  {
   6.521 -	if (!_this) {
   6.522 -		SDL_UninitializedVideo();
   6.523 -		return (-1);
   6.524 -	}
   6.525 -	return _this->current_display;
   6.526 +    if (!_this) {
   6.527 +        SDL_UninitializedVideo();
   6.528 +        return (-1);
   6.529 +    }
   6.530 +    return _this->current_display;
   6.531  }
   6.532  
   6.533  SDL_bool
   6.534  SDL_AddDisplayMode(int displayIndex, const SDL_DisplayMode * mode)
   6.535  {
   6.536 -	SDL_VideoDisplay *display = &_this->displays[displayIndex];
   6.537 -	SDL_DisplayMode *modes;
   6.538 -	int             i, nmodes;
   6.539 +    SDL_VideoDisplay *display = &_this->displays[displayIndex];
   6.540 +    SDL_DisplayMode *modes;
   6.541 +    int i, nmodes;
   6.542  
   6.543 -	/* Make sure we don't already have the mode in the list */
   6.544 -	modes = display->display_modes;
   6.545 -	nmodes = display->num_display_modes;
   6.546 -	for (i = nmodes; i--;) {
   6.547 -		if (SDL_memcmp(mode, &modes[i], sizeof(*mode)) == 0) {
   6.548 -			return SDL_FALSE;
   6.549 -		}
   6.550 -	}
   6.551 +    /* Make sure we don't already have the mode in the list */
   6.552 +    modes = display->display_modes;
   6.553 +    nmodes = display->num_display_modes;
   6.554 +    for (i = nmodes; i--;) {
   6.555 +        if (SDL_memcmp(mode, &modes[i], sizeof(*mode)) == 0) {
   6.556 +            return SDL_FALSE;
   6.557 +        }
   6.558 +    }
   6.559  
   6.560 -	/* Go ahead and add the new mode */
   6.561 -	if (nmodes == display->max_display_modes) {
   6.562 -		modes =
   6.563 -			SDL_realloc(modes,
   6.564 -			(display->max_display_modes + 32) * sizeof(*modes));
   6.565 -		if (!modes) {
   6.566 -			return SDL_FALSE;
   6.567 -		}
   6.568 -		display->display_modes = modes;
   6.569 -		display->max_display_modes += 32;
   6.570 -	}
   6.571 -	modes[nmodes] = *mode;
   6.572 -	display->num_display_modes++;
   6.573 +    /* Go ahead and add the new mode */
   6.574 +    if (nmodes == display->max_display_modes) {
   6.575 +        modes =
   6.576 +            SDL_realloc(modes,
   6.577 +                        (display->max_display_modes + 32) * sizeof(*modes));
   6.578 +        if (!modes) {
   6.579 +            return SDL_FALSE;
   6.580 +        }
   6.581 +        display->display_modes = modes;
   6.582 +        display->max_display_modes += 32;
   6.583 +    }
   6.584 +    modes[nmodes] = *mode;
   6.585 +    display->num_display_modes++;
   6.586  
   6.587 -	return SDL_TRUE;
   6.588 +    return SDL_TRUE;
   6.589  }
   6.590  
   6.591  int
   6.592  SDL_GetNumDisplayModes()
   6.593  {
   6.594 -	if (_this) {
   6.595 -		SDL_VideoDisplay *display = &SDL_CurrentDisplay;
   6.596 -		if (!display->num_display_modes && _this->GetDisplayModes) {
   6.597 -			_this->GetDisplayModes(_this);
   6.598 -			SDL_qsort(display->display_modes, display->num_display_modes,
   6.599 -				  sizeof(SDL_DisplayMode), cmpmodes);
   6.600 -		}
   6.601 -		return display->num_display_modes;
   6.602 -	}
   6.603 -	return 0;
   6.604 +    if (_this) {
   6.605 +        SDL_VideoDisplay *display = &SDL_CurrentDisplay;
   6.606 +        if (!display->num_display_modes && _this->GetDisplayModes) {
   6.607 +            _this->GetDisplayModes(_this);
   6.608 +            SDL_qsort(display->display_modes, display->num_display_modes,
   6.609 +                      sizeof(SDL_DisplayMode), cmpmodes);
   6.610 +        }
   6.611 +        return display->num_display_modes;
   6.612 +    }
   6.613 +    return 0;
   6.614  }
   6.615  
   6.616  int
   6.617  SDL_GetDisplayMode(int index, SDL_DisplayMode * mode)
   6.618  {
   6.619 -	if (index < 0 || index >= SDL_GetNumDisplayModes()) {
   6.620 -		SDL_SetError("index must be in the range of 0 - %d",
   6.621 -			     SDL_GetNumDisplayModes() - 1);
   6.622 -		return -1;
   6.623 -	}
   6.624 -	if (mode) {
   6.625 -		*mode = SDL_CurrentDisplay.display_modes[index];
   6.626 -	}
   6.627 -	return 0;
   6.628 +    if (index < 0 || index >= SDL_GetNumDisplayModes()) {
   6.629 +        SDL_SetError("index must be in the range of 0 - %d",
   6.630 +                     SDL_GetNumDisplayModes() - 1);
   6.631 +        return -1;
   6.632 +    }
   6.633 +    if (mode) {
   6.634 +        *mode = SDL_CurrentDisplay.display_modes[index];
   6.635 +    }
   6.636 +    return 0;
   6.637  }
   6.638  
   6.639  int
   6.640  SDL_GetDesktopDisplayMode(SDL_DisplayMode * mode)
   6.641  {
   6.642 -	if (!_this) {
   6.643 -		SDL_UninitializedVideo();
   6.644 -		return -1;
   6.645 -	}
   6.646 -	if (mode) {
   6.647 -		*mode = SDL_CurrentDisplay.desktop_mode;
   6.648 -	}
   6.649 -	return 0;
   6.650 +    if (!_this) {
   6.651 +        SDL_UninitializedVideo();
   6.652 +        return -1;
   6.653 +    }
   6.654 +    if (mode) {
   6.655 +        *mode = SDL_CurrentDisplay.desktop_mode;
   6.656 +    }
   6.657 +    return 0;
   6.658  }
   6.659  
   6.660  int
   6.661  SDL_GetCurrentDisplayMode(SDL_DisplayMode * mode)
   6.662  {
   6.663 -	if (!_this) {
   6.664 -		SDL_UninitializedVideo();
   6.665 -		return -1;
   6.666 -	}
   6.667 -	if (mode) {
   6.668 -		*mode = SDL_CurrentDisplay.current_mode;
   6.669 -	}
   6.670 -	return 0;
   6.671 +    if (!_this) {
   6.672 +        SDL_UninitializedVideo();
   6.673 +        return -1;
   6.674 +    }
   6.675 +    if (mode) {
   6.676 +        *mode = SDL_CurrentDisplay.current_mode;
   6.677 +    }
   6.678 +    return 0;
   6.679  }
   6.680  
   6.681  SDL_DisplayMode *
   6.682  SDL_GetClosestDisplayMode(const SDL_DisplayMode * mode,
   6.683 -			  SDL_DisplayMode * closest)
   6.684 +                          SDL_DisplayMode * closest)
   6.685  {
   6.686 -	Uint32          target_format;
   6.687 -	int             target_refresh_rate;
   6.688 -	int             i;
   6.689 -	SDL_DisplayMode *current, *match;
   6.690 +    Uint32 target_format;
   6.691 +    int target_refresh_rate;
   6.692 +    int i;
   6.693 +    SDL_DisplayMode *current, *match;
   6.694  
   6.695 -	if (!_this || !mode || !closest) {
   6.696 -		return NULL;
   6.697 -	}
   6.698 -	/* Default to the desktop format */
   6.699 -	if (mode->format) {
   6.700 -		target_format = mode->format;
   6.701 -	} else {
   6.702 -		target_format = SDL_CurrentDisplay.desktop_mode.format;
   6.703 -	}
   6.704 +    if (!_this || !mode || !closest) {
   6.705 +        return NULL;
   6.706 +    }
   6.707 +    /* Default to the desktop format */
   6.708 +    if (mode->format) {
   6.709 +        target_format = mode->format;
   6.710 +    } else {
   6.711 +        target_format = SDL_CurrentDisplay.desktop_mode.format;
   6.712 +    }
   6.713  
   6.714 -	/* Default to the desktop refresh rate */
   6.715 -	if (mode->refresh_rate) {
   6.716 -		target_refresh_rate = mode->refresh_rate;
   6.717 -	} else {
   6.718 -		target_refresh_rate = SDL_CurrentDisplay.desktop_mode.refresh_rate;
   6.719 -	}
   6.720 +    /* Default to the desktop refresh rate */
   6.721 +    if (mode->refresh_rate) {
   6.722 +        target_refresh_rate = mode->refresh_rate;
   6.723 +    } else {
   6.724 +        target_refresh_rate = SDL_CurrentDisplay.desktop_mode.refresh_rate;
   6.725 +    }
   6.726  
   6.727 -	match = NULL;
   6.728 -	for (i = 0; i < SDL_GetNumDisplayModes(); ++i) {
   6.729 -		current = &SDL_CurrentDisplay.display_modes[i];
   6.730 +    match = NULL;
   6.731 +    for (i = 0; i < SDL_GetNumDisplayModes(); ++i) {
   6.732 +        current = &SDL_CurrentDisplay.display_modes[i];
   6.733  
   6.734 -		if ((current->w && current->h) &&
   6.735 -		    (current->w < mode->w || current->h < mode->h)) {
   6.736 -			/* Out of sorted modes large enough here */
   6.737 -			break;
   6.738 -		}
   6.739 -		if (!match || current->w < match->w || current->h < match->h) {
   6.740 -			match = current;
   6.741 -			continue;
   6.742 -		}
   6.743 -		if (current->format != match->format) {
   6.744 -			/* Sorted highest depth to lowest */
   6.745 -			if (current->format == target_format ||
   6.746 -			    (SDL_BITSPERPIXEL(current->format) >=
   6.747 -			     SDL_BITSPERPIXEL(target_format)
   6.748 -			     && SDL_PIXELTYPE(current->format) ==
   6.749 -			     SDL_PIXELTYPE(target_format))) {
   6.750 -				match = current;
   6.751 -			}
   6.752 -			continue;
   6.753 -		}
   6.754 -		if (current->refresh_rate != match->refresh_rate) {
   6.755 -			/* Sorted highest refresh to lowest */
   6.756 -			if (current->refresh_rate >= target_refresh_rate) {
   6.757 -				match = current;
   6.758 -			}
   6.759 -		}
   6.760 -	}
   6.761 -	if (match) {
   6.762 -		if (match->format) {
   6.763 -			closest->format = match->format;
   6.764 -		} else {
   6.765 -			closest->format = mode->format;
   6.766 -		}
   6.767 -		if (match->w && match->h) {
   6.768 -			closest->w = match->w;
   6.769 -			closest->h = match->h;
   6.770 -		} else {
   6.771 -			closest->w = mode->w;
   6.772 -			closest->h = mode->h;
   6.773 -		}
   6.774 -		if (match->refresh_rate) {
   6.775 -			closest->refresh_rate = match->refresh_rate;
   6.776 -		} else {
   6.777 -			closest->refresh_rate = mode->refresh_rate;
   6.778 -		}
   6.779 -		closest->driverdata = match->driverdata;
   6.780 +        if ((current->w && current->h) &&
   6.781 +            (current->w < mode->w || current->h < mode->h)) {
   6.782 +            /* Out of sorted modes large enough here */
   6.783 +            break;
   6.784 +        }
   6.785 +        if (!match || current->w < match->w || current->h < match->h) {
   6.786 +            match = current;
   6.787 +            continue;
   6.788 +        }
   6.789 +        if (current->format != match->format) {
   6.790 +            /* Sorted highest depth to lowest */
   6.791 +            if (current->format == target_format ||
   6.792 +                (SDL_BITSPERPIXEL(current->format) >=
   6.793 +                 SDL_BITSPERPIXEL(target_format)
   6.794 +                 && SDL_PIXELTYPE(current->format) ==
   6.795 +                 SDL_PIXELTYPE(target_format))) {
   6.796 +                match = current;
   6.797 +            }
   6.798 +            continue;
   6.799 +        }
   6.800 +        if (current->refresh_rate != match->refresh_rate) {
   6.801 +            /* Sorted highest refresh to lowest */
   6.802 +            if (current->refresh_rate >= target_refresh_rate) {
   6.803 +                match = current;
   6.804 +            }
   6.805 +        }
   6.806 +    }
   6.807 +    if (match) {
   6.808 +        if (match->format) {
   6.809 +            closest->format = match->format;
   6.810 +        } else {
   6.811 +            closest->format = mode->format;
   6.812 +        }
   6.813 +        if (match->w && match->h) {
   6.814 +            closest->w = match->w;
   6.815 +            closest->h = match->h;
   6.816 +        } else {
   6.817 +            closest->w = mode->w;
   6.818 +            closest->h = mode->h;
   6.819 +        }
   6.820 +        if (match->refresh_rate) {
   6.821 +            closest->refresh_rate = match->refresh_rate;
   6.822 +        } else {
   6.823 +            closest->refresh_rate = mode->refresh_rate;
   6.824 +        }
   6.825 +        closest->driverdata = match->driverdata;
   6.826  
   6.827 -		/*
   6.828 -		 * Pick some reasonable defaults if the app and driver don't
   6.829 -		 * care
   6.830 -		 */
   6.831 -		if (!closest->format) {
   6.832 -			closest->format = SDL_PIXELFORMAT_RGB888;
   6.833 -		}
   6.834 -		if (!closest->w) {
   6.835 -			closest->w = 640;
   6.836 -		}
   6.837 -		if (!closest->h) {
   6.838 -			closest->h = 480;
   6.839 -		}
   6.840 -		return closest;
   6.841 -	}
   6.842 -	return NULL;
   6.843 +        /*
   6.844 +         * Pick some reasonable defaults if the app and driver don't
   6.845 +         * care
   6.846 +         */
   6.847 +        if (!closest->format) {
   6.848 +            closest->format = SDL_PIXELFORMAT_RGB888;
   6.849 +        }
   6.850 +        if (!closest->w) {
   6.851 +            closest->w = 640;
   6.852 +        }
   6.853 +        if (!closest->h) {
   6.854 +            closest->h = 480;
   6.855 +        }
   6.856 +        return closest;
   6.857 +    }
   6.858 +    return NULL;
   6.859  }
   6.860  
   6.861  int
   6.862  SDL_SetDisplayMode(const SDL_DisplayMode * mode)
   6.863  {
   6.864 -	SDL_VideoDisplay *display;
   6.865 -	SDL_DisplayMode display_mode;
   6.866 -	SDL_DisplayMode current_mode;
   6.867 -	int             i, ncolors;
   6.868 +    SDL_VideoDisplay *display;
   6.869 +    SDL_DisplayMode display_mode;
   6.870 +    SDL_DisplayMode current_mode;
   6.871 +    int i, ncolors;
   6.872  
   6.873 -	if (!_this) {
   6.874 -		SDL_UninitializedVideo();
   6.875 -		return -1;
   6.876 -	}
   6.877 -	display = &SDL_CurrentDisplay;
   6.878 -	if (!mode) {
   6.879 -		mode = &display->desktop_mode;
   6.880 -	}
   6.881 -	display_mode = *mode;
   6.882 +    if (!_this) {
   6.883 +        SDL_UninitializedVideo();
   6.884 +        return -1;
   6.885 +    }
   6.886 +    display = &SDL_CurrentDisplay;
   6.887 +    if (!mode) {
   6.888 +        mode = &display->desktop_mode;
   6.889 +    }
   6.890 +    display_mode = *mode;
   6.891  
   6.892 -	/* Default to the current mode */
   6.893 -	if (!display_mode.format) {
   6.894 -		display_mode.format = display->current_mode.format;
   6.895 -	}
   6.896 -	if (!display_mode.w) {
   6.897 -		display_mode.w = display->current_mode.w;
   6.898 -	}
   6.899 -	if (!display_mode.h) {
   6.900 -		display_mode.h = display->current_mode.h;
   6.901 -	}
   6.902 -	if (!display_mode.refresh_rate) {
   6.903 -		display_mode.refresh_rate = display->current_mode.refresh_rate;
   6.904 -	}
   6.905 -	/* Get a good video mode, the closest one possible */
   6.906 -	if (!SDL_GetClosestDisplayMode(&display_mode, &display_mode)) {
   6.907 -		SDL_SetError("No video mode large enough for %dx%d",
   6.908 -			     display_mode.w, display_mode.h);
   6.909 -		return -1;
   6.910 -	}
   6.911 -	/* See if there's anything left to do */
   6.912 -	SDL_GetCurrentDisplayMode(&current_mode);
   6.913 -	if (SDL_memcmp(&display_mode, &current_mode, sizeof(display_mode)) == 0) {
   6.914 -		return 0;
   6.915 -	}
   6.916 -	/* Actually change the display mode */
   6.917 -	if (_this->SetDisplayMode(_this, &display_mode) < 0) {
   6.918 -		return -1;
   6.919 -	}
   6.920 -	display->current_mode = display_mode;
   6.921 +    /* Default to the current mode */
   6.922 +    if (!display_mode.format) {
   6.923 +        display_mode.format = display->current_mode.format;
   6.924 +    }
   6.925 +    if (!display_mode.w) {
   6.926 +        display_mode.w = display->current_mode.w;
   6.927 +    }
   6.928 +    if (!display_mode.h) {
   6.929 +        display_mode.h = display->current_mode.h;
   6.930 +    }
   6.931 +    if (!display_mode.refresh_rate) {
   6.932 +        display_mode.refresh_rate = display->current_mode.refresh_rate;
   6.933 +    }
   6.934 +    /* Get a good video mode, the closest one possible */
   6.935 +    if (!SDL_GetClosestDisplayMode(&display_mode, &display_mode)) {
   6.936 +        SDL_SetError("No video mode large enough for %dx%d",
   6.937 +                     display_mode.w, display_mode.h);
   6.938 +        return -1;
   6.939 +    }
   6.940 +    /* See if there's anything left to do */
   6.941 +    SDL_GetCurrentDisplayMode(&current_mode);
   6.942 +    if (SDL_memcmp(&display_mode, &current_mode, sizeof(display_mode)) == 0) {
   6.943 +        return 0;
   6.944 +    }
   6.945 +    /* Actually change the display mode */
   6.946 +    if (_this->SetDisplayMode(_this, &display_mode) < 0) {
   6.947 +        return -1;
   6.948 +    }
   6.949 +    display->current_mode = display_mode;
   6.950  
   6.951 -	/* Set up a palette, if necessary */
   6.952 -	if (SDL_ISPIXELFORMAT_INDEXED(display_mode.format)) {
   6.953 -		ncolors = (1 << SDL_BITSPERPIXEL(display_mode.format));
   6.954 -	} else {
   6.955 -		ncolors = 0;
   6.956 -	}
   6.957 -	if ((!ncolors && display->palette) || (ncolors && !display->palette)
   6.958 -	    || (ncolors && ncolors != display->palette->ncolors)) {
   6.959 -		if (display->palette) {
   6.960 -			SDL_FreePalette(display->palette);
   6.961 -			display->palette = NULL;
   6.962 -		}
   6.963 -		if (ncolors) {
   6.964 -			display->palette = SDL_AllocPalette(ncolors);
   6.965 -			if (!display->palette) {
   6.966 -				return -1;
   6.967 -			}
   6.968 -			SDL_DitherColors(display->palette->colors,
   6.969 -				     SDL_BITSPERPIXEL(display_mode.format));
   6.970 -		}
   6.971 -	}
   6.972 -	/* Move any fullscreen windows into position */
   6.973 -	for (i = 0; i < display->num_windows; ++i) {
   6.974 -		SDL_Window     *window = &display->windows[i];
   6.975 -		if (FULLSCREEN_VISIBLE(window)) {
   6.976 -			SDL_SetWindowPosition(window->id, SDL_WINDOWPOS_CENTERED,
   6.977 -					      SDL_WINDOWPOS_CENTERED);
   6.978 -		}
   6.979 -	}
   6.980 +    /* Set up a palette, if necessary */
   6.981 +    if (SDL_ISPIXELFORMAT_INDEXED(display_mode.format)) {
   6.982 +        ncolors = (1 << SDL_BITSPERPIXEL(display_mode.format));
   6.983 +    } else {
   6.984 +        ncolors = 0;
   6.985 +    }
   6.986 +    if ((!ncolors && display->palette) || (ncolors && !display->palette)
   6.987 +        || (ncolors && ncolors != display->palette->ncolors)) {
   6.988 +        if (display->palette) {
   6.989 +            SDL_FreePalette(display->palette);
   6.990 +            display->palette = NULL;
   6.991 +        }
   6.992 +        if (ncolors) {
   6.993 +            display->palette = SDL_AllocPalette(ncolors);
   6.994 +            if (!display->palette) {
   6.995 +                return -1;
   6.996 +            }
   6.997 +            SDL_DitherColors(display->palette->colors,
   6.998 +                             SDL_BITSPERPIXEL(display_mode.format));
   6.999 +        }
  6.1000 +    }
  6.1001 +    /* Move any fullscreen windows into position */
  6.1002 +    for (i = 0; i < display->num_windows; ++i) {
  6.1003 +        SDL_Window *window = &display->windows[i];
  6.1004 +        if (FULLSCREEN_VISIBLE(window)) {
  6.1005 +            SDL_SetWindowPosition(window->id, SDL_WINDOWPOS_CENTERED,
  6.1006 +                                  SDL_WINDOWPOS_CENTERED);
  6.1007 +        }
  6.1008 +    }
  6.1009  
  6.1010 -	return 0;
  6.1011 +    return 0;
  6.1012  }
  6.1013  
  6.1014  int
  6.1015  SDL_SetFullscreenDisplayMode(const SDL_DisplayMode * mode)
  6.1016  {
  6.1017 -	SDL_VideoDisplay *display;
  6.1018 -	SDL_DisplayMode fullscreen_mode;
  6.1019 -	int             i;
  6.1020 +    SDL_VideoDisplay *display;
  6.1021 +    SDL_DisplayMode fullscreen_mode;
  6.1022 +    int i;
  6.1023  
  6.1024 -	if (!_this) {
  6.1025 -		SDL_UninitializedVideo();
  6.1026 -		return -1;
  6.1027 -	}
  6.1028 -	display = &SDL_CurrentDisplay;
  6.1029 -	if (!mode) {
  6.1030 -		mode = &display->desktop_mode;
  6.1031 -	}
  6.1032 -	SDL_GetClosestDisplayMode(mode, &fullscreen_mode);
  6.1033 -	if (SDL_memcmp
  6.1034 -	    (&fullscreen_mode, &display->fullscreen_mode,
  6.1035 -	     sizeof(fullscreen_mode)) == 0) {
  6.1036 -		/* Nothing to do... */
  6.1037 -		return 0;
  6.1038 -	}
  6.1039 -	display->fullscreen_mode = fullscreen_mode;
  6.1040 +    if (!_this) {
  6.1041 +        SDL_UninitializedVideo();
  6.1042 +        return -1;
  6.1043 +    }
  6.1044 +    display = &SDL_CurrentDisplay;
  6.1045 +    if (!mode) {
  6.1046 +        mode = &display->desktop_mode;
  6.1047 +    }
  6.1048 +    SDL_GetClosestDisplayMode(mode, &fullscreen_mode);
  6.1049 +    if (SDL_memcmp
  6.1050 +        (&fullscreen_mode, &display->fullscreen_mode,
  6.1051 +         sizeof(fullscreen_mode)) == 0) {
  6.1052 +        /* Nothing to do... */
  6.1053 +        return 0;
  6.1054 +    }
  6.1055 +    display->fullscreen_mode = fullscreen_mode;
  6.1056  
  6.1057 -	/* Actually set the mode if we have a fullscreen window visible */
  6.1058 -	for (i = 0; i < display->num_windows; ++i) {
  6.1059 -		SDL_Window     *window = &display->windows[i];
  6.1060 -		if (FULLSCREEN_VISIBLE(window)) {
  6.1061 -			if (SDL_SetDisplayMode(&display->fullscreen_mode) < 0) {
  6.1062 -				return -1;
  6.1063 -			}
  6.1064 -		}
  6.1065 -		if (window->flags & SDL_WINDOW_FULLSCREEN) {
  6.1066 -			SDL_OnWindowResized(window);
  6.1067 -		}
  6.1068 -	}
  6.1069 -	return 0;
  6.1070 +    /* Actually set the mode if we have a fullscreen window visible */
  6.1071 +    for (i = 0; i < display->num_windows; ++i) {
  6.1072 +        SDL_Window *window = &display->windows[i];
  6.1073 +        if (FULLSCREEN_VISIBLE(window)) {
  6.1074 +            if (SDL_SetDisplayMode(&display->fullscreen_mode) < 0) {
  6.1075 +                return -1;
  6.1076 +            }
  6.1077 +        }
  6.1078 +        if (window->flags & SDL_WINDOW_FULLSCREEN) {
  6.1079 +            SDL_OnWindowResized(window);
  6.1080 +        }
  6.1081 +    }
  6.1082 +    return 0;
  6.1083  }
  6.1084  
  6.1085  int
  6.1086  SDL_GetFullscreenDisplayMode(SDL_DisplayMode * mode)
  6.1087  {
  6.1088 -	if (!_this) {
  6.1089 -		SDL_UninitializedVideo();
  6.1090 -		return -1;
  6.1091 -	}
  6.1092 -	if (mode) {
  6.1093 -		*mode = SDL_CurrentDisplay.fullscreen_mode;
  6.1094 -	}
  6.1095 -	return 0;
  6.1096 +    if (!_this) {
  6.1097 +        SDL_UninitializedVideo();
  6.1098 +        return -1;
  6.1099 +    }
  6.1100 +    if (mode) {
  6.1101 +        *mode = SDL_CurrentDisplay.fullscreen_mode;
  6.1102 +    }
  6.1103 +    return 0;
  6.1104  }
  6.1105  
  6.1106  int
  6.1107  SDL_SetDisplayPalette(const SDL_Color * colors, int firstcolor, int ncolors)
  6.1108  {
  6.1109 -	SDL_Palette    *palette;
  6.1110 -	int             status = 0;
  6.1111 +    SDL_Palette *palette;
  6.1112 +    int status = 0;
  6.1113  
  6.1114 -	if (!_this) {
  6.1115 -		SDL_UninitializedVideo();
  6.1116 -		return -1;
  6.1117 -	}
  6.1118 -	palette = SDL_CurrentDisplay.palette;
  6.1119 -	if (!palette) {
  6.1120 -		SDL_SetError("Display mode does not have a palette");
  6.1121 -		return -1;
  6.1122 -	}
  6.1123 -	status = SDL_SetPaletteColors(palette, colors, firstcolor, ncolors);
  6.1124 +    if (!_this) {
  6.1125 +        SDL_UninitializedVideo();
  6.1126 +        return -1;
  6.1127 +    }
  6.1128 +    palette = SDL_CurrentDisplay.palette;
  6.1129 +    if (!palette) {
  6.1130 +        SDL_SetError("Display mode does not have a palette");
  6.1131 +        return -1;
  6.1132 +    }
  6.1133 +    status = SDL_SetPaletteColors(palette, colors, firstcolor, ncolors);
  6.1134  
  6.1135 -	if (_this->SetDisplayPalette) {
  6.1136 -		if (_this->SetDisplayPalette(_this, palette) < 0) {
  6.1137 -			status = -1;
  6.1138 -		}
  6.1139 -	}
  6.1140 -	return status;
  6.1141 +    if (_this->SetDisplayPalette) {
  6.1142 +        if (_this->SetDisplayPalette(_this, palette) < 0) {
  6.1143 +            status = -1;
  6.1144 +        }
  6.1145 +    }
  6.1146 +    return status;
  6.1147  }
  6.1148  
  6.1149  int
  6.1150  SDL_GetDisplayPalette(SDL_Color * colors, int firstcolor, int ncolors)
  6.1151  {
  6.1152 -	SDL_Palette    *palette;
  6.1153 +    SDL_Palette *palette;
  6.1154  
  6.1155 -	if (!_this) {
  6.1156 -		SDL_UninitializedVideo();
  6.1157 -		return -1;
  6.1158 -	}
  6.1159 -	palette = SDL_CurrentDisplay.palette;
  6.1160 -	if (!palette->ncolors) {
  6.1161 -		SDL_SetError("Display mode does not have a palette");
  6.1162 -		return -1;
  6.1163 -	}
  6.1164 -	if (firstcolor < 0 || (firstcolor + ncolors) > palette->ncolors) {
  6.1165 -		SDL_SetError("Palette indices are out of range");
  6.1166 -		return -1;
  6.1167 -	}
  6.1168 -	SDL_memcpy(colors, &palette->colors[firstcolor],
  6.1169 -		   ncolors * sizeof(*colors));
  6.1170 -	return 0;
  6.1171 +    if (!_this) {
  6.1172 +        SDL_UninitializedVideo();
  6.1173 +        return -1;
  6.1174 +    }
  6.1175 +    palette = SDL_CurrentDisplay.palette;
  6.1176 +    if (!palette->ncolors) {
  6.1177 +        SDL_SetError("Display mode does not have a palette");
  6.1178 +        return -1;
  6.1179 +    }
  6.1180 +    if (firstcolor < 0 || (firstcolor + ncolors) > palette->ncolors) {
  6.1181 +        SDL_SetError("Palette indices are out of range");
  6.1182 +        return -1;
  6.1183 +    }
  6.1184 +    SDL_memcpy(colors, &palette->colors[firstcolor],
  6.1185 +               ncolors * sizeof(*colors));
  6.1186 +    return 0;
  6.1187  }
  6.1188  
  6.1189  SDL_WindowID
  6.1190  SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
  6.1191  {
  6.1192 -	const Uint32    allowed_flags = (SDL_WINDOW_FULLSCREEN |
  6.1193 -					 SDL_WINDOW_OPENGL |
  6.1194 -					 SDL_WINDOW_BORDERLESS |
  6.1195 -					 SDL_WINDOW_RESIZABLE);
  6.1196 -	SDL_VideoDisplay *display;
  6.1197 -	SDL_Window      window;
  6.1198 -	int             num_windows;
  6.1199 -	SDL_Window     *windows;
  6.1200 +    const Uint32 allowed_flags = (SDL_WINDOW_FULLSCREEN |
  6.1201 +                                  SDL_WINDOW_OPENGL |
  6.1202 +                                  SDL_WINDOW_BORDERLESS |
  6.1203 +                                  SDL_WINDOW_RESIZABLE);
  6.1204 +    SDL_VideoDisplay *display;
  6.1205 +    SDL_Window window;
  6.1206 +    int num_windows;
  6.1207 +    SDL_Window *windows;
  6.1208  
  6.1209 -	if (!_this) {
  6.1210 -		SDL_UninitializedVideo();
  6.1211 -		return 0;
  6.1212 -	}
  6.1213 -	if ((flags & SDL_WINDOW_OPENGL) && !_this->GL_CreateContext) {
  6.1214 -		SDL_SetError("No OpenGL support in video driver");
  6.1215 -		return 0;
  6.1216 -	}
  6.1217 -	/* Fullscreen windows don't have any window decorations */
  6.1218 -	if (flags & SDL_WINDOW_FULLSCREEN) {
  6.1219 -		flags |= SDL_WINDOW_BORDERLESS;
  6.1220 -		flags &= ~SDL_WINDOW_RESIZABLE;
  6.1221 -	}
  6.1222 -	SDL_zero(window);
  6.1223 -	window.id = _this->next_object_id++;
  6.1224 -	window.x = x;
  6.1225 -	window.y = y;
  6.1226 -	window.w = w;
  6.1227 -	window.h = h;
  6.1228 -	window.flags = (flags & allowed_flags);
  6.1229 -	window.display = _this->current_display;
  6.1230 +    if (!_this) {
  6.1231 +        SDL_UninitializedVideo();
  6.1232 +        return 0;
  6.1233 +    }
  6.1234 +    if ((flags & SDL_WINDOW_OPENGL) && !_this->GL_CreateContext) {
  6.1235 +        SDL_SetError("No OpenGL support in video driver");
  6.1236 +        return 0;
  6.1237 +    }
  6.1238 +    /* Fullscreen windows don't have any window decorations */
  6.1239 +    if (flags & SDL_WINDOW_FULLSCREEN) {
  6.1240 +        flags |= SDL_WINDOW_BORDERLESS;
  6.1241 +        flags &= ~SDL_WINDOW_RESIZABLE;
  6.1242 +    }
  6.1243 +    SDL_zero(window);
  6.1244 +    window.id = _this->next_object_id++;
  6.1245 +    window.x = x;
  6.1246 +    window.y = y;
  6.1247 +    window.w = w;
  6.1248 +    window.h = h;
  6.1249 +    window.flags = (flags & allowed_flags);
  6.1250 +    window.display = _this->current_display;
  6.1251  
  6.1252 -	if (_this->CreateWindow && _this->CreateWindow(_this, &window) < 0) {
  6.1253 -		return 0;
  6.1254 -	}
  6.1255 -	display = &SDL_CurrentDisplay;
  6.1256 -	num_windows = display->num_windows;
  6.1257 -	windows =
  6.1258 -		SDL_realloc(display->windows, (num_windows + 1) * sizeof(*windows));
  6.1259 -	if (!windows) {
  6.1260 -		if (_this->DestroyWindow) {
  6.1261 -			_this->DestroyWindow(_this, &window);
  6.1262 -		}
  6.1263 -		return 0;
  6.1264 -	}
  6.1265 -	windows[num_windows] = window;
  6.1266 -	display->windows = windows;
  6.1267 -	display->num_windows++;
  6.1268 +    if (_this->CreateWindow && _this->CreateWindow(_this, &window) < 0) {
  6.1269 +        return 0;
  6.1270 +    }
  6.1271 +    display = &SDL_CurrentDisplay;
  6.1272 +    num_windows = display->num_windows;
  6.1273 +    windows =
  6.1274 +        SDL_realloc(display->windows, (num_windows + 1) * sizeof(*windows));
  6.1275 +    if (!windows) {
  6.1276 +        if (_this->DestroyWindow) {
  6.1277 +            _this->DestroyWindow(_this, &window);
  6.1278 +        }
  6.1279 +        return 0;
  6.1280 +    }
  6.1281 +    windows[num_windows] = window;
  6.1282 +    display->windows = windows;
  6.1283 +    display->num_windows++;
  6.1284  
  6.1285 -	if (title) {
  6.1286 -		SDL_SetWindowTitle(window.id, title);
  6.1287 -	}
  6.1288 -	if (flags & SDL_WINDOW_MAXIMIZED) {
  6.1289 -		SDL_MaximizeWindow(window.id);
  6.1290 -	}
  6.1291 -	if (flags & SDL_WINDOW_MINIMIZED) {
  6.1292 -		SDL_MinimizeWindow(window.id);
  6.1293 -	}
  6.1294 -	if (flags & SDL_WINDOW_SHOWN) {
  6.1295 -		SDL_ShowWindow(window.id);
  6.1296 -	}
  6.1297 -	if (flags & SDL_WINDOW_INPUT_GRABBED) {
  6.1298 -		SDL_SetWindowGrab(window.id, 1);
  6.1299 -	}
  6.1300 -	return window.id;
  6.1301 +    if (title) {
  6.1302 +        SDL_SetWindowTitle(window.id, title);
  6.1303 +    }
  6.1304 +    if (flags & SDL_WINDOW_MAXIMIZED) {
  6.1305 +        SDL_MaximizeWindow(window.id);
  6.1306 +    }
  6.1307 +    if (flags & SDL_WINDOW_MINIMIZED) {
  6.1308 +        SDL_MinimizeWindow(window.id);
  6.1309 +    }
  6.1310 +    if (flags & SDL_WINDOW_SHOWN) {
  6.1311 +        SDL_ShowWindow(window.id);
  6.1312 +    }
  6.1313 +    if (flags & SDL_WINDOW_INPUT_GRABBED) {
  6.1314 +        SDL_SetWindowGrab(window.id, 1);
  6.1315 +    }
  6.1316 +    return window.id;
  6.1317  }
  6.1318  
  6.1319  SDL_WindowID
  6.1320  SDL_CreateWindowFrom(const void *data)
  6.1321  {
  6.1322 -	SDL_VideoDisplay *display;
  6.1323 -	SDL_Window      window;
  6.1324 -	int             num_windows;
  6.1325 -	SDL_Window     *windows;
  6.1326 +    SDL_VideoDisplay *display;
  6.1327 +    SDL_Window window;
  6.1328 +    int num_windows;
  6.1329 +    SDL_Window *windows;
  6.1330  
  6.1331 -	if (!_this) {
  6.1332 -		SDL_UninitializedVideo();
  6.1333 -		return (0);
  6.1334 -	}
  6.1335 -	SDL_zero(window);
  6.1336 -	window.id = _this->next_object_id++;
  6.1337 -	window.display = _this->current_display;
  6.1338 +    if (!_this) {
  6.1339 +        SDL_UninitializedVideo();
  6.1340 +        return (0);
  6.1341 +    }
  6.1342 +    SDL_zero(window);
  6.1343 +    window.id = _this->next_object_id++;
  6.1344 +    window.display = _this->current_display;
  6.1345  
  6.1346 -	if (!_this->CreateWindowFrom ||
  6.1347 -	    _this->CreateWindowFrom(_this, &window, data) < 0) {
  6.1348 -		return 0;
  6.1349 -	}
  6.1350 -	display = &SDL_CurrentDisplay;
  6.1351 -	num_windows = display->num_windows;
  6.1352 -	windows =
  6.1353 -		SDL_realloc(display->windows, (num_windows + 1) * sizeof(*windows));
  6.1354 -	if (!windows) {
  6.1355 -		if (_this->DestroyWindow) {
  6.1356 -			_this->DestroyWindow(_this, &window);
  6.1357 -		}
  6.1358 -		if (window.title) {
  6.1359 -			SDL_free(window.title);
  6.1360 -		}
  6.1361 -		return 0;
  6.1362 -	}
  6.1363 -	windows[num_windows] = window;
  6.1364 -	display->windows = windows;
  6.1365 -	display->num_windows++;
  6.1366 +    if (!_this->CreateWindowFrom ||
  6.1367 +        _this->CreateWindowFrom(_this, &window, data) < 0) {
  6.1368 +        return 0;
  6.1369 +    }
  6.1370 +    display = &SDL_CurrentDisplay;
  6.1371 +    num_windows = display->num_windows;
  6.1372 +    windows =
  6.1373 +        SDL_realloc(display->windows, (num_windows + 1) * sizeof(*windows));
  6.1374 +    if (!windows) {
  6.1375 +        if (_this->DestroyWindow) {
  6.1376 +            _this->DestroyWindow(_this, &window);
  6.1377 +        }
  6.1378 +        if (window.title) {
  6.1379 +            SDL_free(window.title);
  6.1380 +        }
  6.1381 +        return 0;
  6.1382 +    }
  6.1383 +    windows[num_windows] = window;
  6.1384 +    display->windows = windows;
  6.1385 +    display->num_windows++;
  6.1386  
  6.1387 -	return window.id;
  6.1388 +    return window.id;
  6.1389  }
  6.1390  
  6.1391  int
  6.1392  SDL_RecreateWindow(SDL_Window * window, Uint32 flags)
  6.1393  {
  6.1394 -	char           *title = window->title;
  6.1395 +    char *title = window->title;
  6.1396  
  6.1397 -	if ((flags & SDL_WINDOW_OPENGL) && !_this->GL_CreateContext) {
  6.1398 -		SDL_SetError("No OpenGL support in video driver");
  6.1399 -		return -1;
  6.1400 -	}
  6.1401 -	if (_this->DestroyWindow) {
  6.1402 -		_this->DestroyWindow(_this, window);
  6.1403 -	}
  6.1404 -	window->title = NULL;
  6.1405 -	window->flags =
  6.1406 -		(flags &
  6.1407 -	  ~(SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED | SDL_WINDOW_SHOWN |
  6.1408 -	    SDL_WINDOW_INPUT_GRABBED));
  6.1409 +    if ((flags & SDL_WINDOW_OPENGL) && !_this->GL_CreateContext) {
  6.1410 +        SDL_SetError("No OpenGL support in video driver");
  6.1411 +        return -1;
  6.1412 +    }
  6.1413 +    if (_this->DestroyWindow) {
  6.1414 +        _this->DestroyWindow(_this, window);
  6.1415 +    }
  6.1416 +    window->title = NULL;
  6.1417 +    window->flags =
  6.1418 +        (flags &
  6.1419 +         ~(SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED | SDL_WINDOW_SHOWN |
  6.1420 +           SDL_WINDOW_INPUT_GRABBED));
  6.1421  
  6.1422 -	if (_this->CreateWindow && _this->CreateWindow(_this, window) < 0) {
  6.1423 -		return -1;
  6.1424 -	}
  6.1425 -	if (title) {
  6.1426 -		SDL_SetWindowTitle(window->id, title);
  6.1427 -		SDL_free(title);
  6.1428 -	}
  6.1429 -	if (flags & SDL_WINDOW_MAXIMIZED) {
  6.1430 -		SDL_MaximizeWindow(window->id);
  6.1431 -	}
  6.1432 -	if (flags & SDL_WINDOW_MINIMIZED) {
  6.1433 -		SDL_MinimizeWindow(window->id);
  6.1434 -	}
  6.1435 -	if (flags & SDL_WINDOW_SHOWN) {
  6.1436 -		SDL_ShowWindow(window->id);
  6.1437 -	}
  6.1438 -	if (flags & SDL_WINDOW_INPUT_GRABBED) {
  6.1439 -		SDL_SetWindowGrab(window->id, 1);
  6.1440 -	}
  6.1441 -	return 0;
  6.1442 +    if (_this->CreateWindow && _this->CreateWindow(_this, window) < 0) {
  6.1443 +        return -1;
  6.1444 +    }
  6.1445 +    if (title) {
  6.1446 +        SDL_SetWindowTitle(window->id, title);
  6.1447 +        SDL_free(title);
  6.1448 +    }
  6.1449 +    if (flags & SDL_WINDOW_MAXIMIZED) {
  6.1450 +        SDL_MaximizeWindow(window->id);
  6.1451 +    }
  6.1452 +    if (flags & SDL_WINDOW_MINIMIZED) {
  6.1453 +        SDL_MinimizeWindow(window->id);
  6.1454 +    }
  6.1455 +    if (flags & SDL_WINDOW_SHOWN) {
  6.1456 +        SDL_ShowWindow(window->id);
  6.1457 +    }
  6.1458 +    if (flags & SDL_WINDOW_INPUT_GRABBED) {
  6.1459 +        SDL_SetWindowGrab(window->id, 1);
  6.1460 +    }
  6.1461 +    return 0;
  6.1462  }
  6.1463  
  6.1464 -SDL_Window     *
  6.1465 +SDL_Window *
  6.1466  SDL_GetWindowFromID(SDL_WindowID windowID)
  6.1467  {
  6.1468 -	int             i, j;
  6.1469 +    int i, j;
  6.1470  
  6.1471 -	if (!_this) {
  6.1472 -		SDL_UninitializedVideo();
  6.1473 -		return NULL;
  6.1474 -	}
  6.1475 -	for (i = 0; i < _this->num_displays; ++i) {
  6.1476 -		SDL_VideoDisplay *display = &_this->displays[i];
  6.1477 -		for (j = 0; j < display->num_windows; ++j) {
  6.1478 -			SDL_Window     *window = &display->windows[j];
  6.1479 -			if (window->id == windowID) {
  6.1480 -				return window;
  6.1481 -			}
  6.1482 -		}
  6.1483 -	}
  6.1484 -	return NULL;
  6.1485 +    if (!_this) {
  6.1486 +        SDL_UninitializedVideo();
  6.1487 +        return NULL;
  6.1488 +    }
  6.1489 +    for (i = 0; i < _this->num_displays; ++i) {
  6.1490 +        SDL_VideoDisplay *display = &_this->displays[i];
  6.1491 +        for (j = 0; j < display->num_windows; ++j) {
  6.1492 +            SDL_Window *window = &display->windows[j];
  6.1493 +            if (window->id == windowID) {
  6.1494 +                return window;
  6.1495 +            }
  6.1496 +        }
  6.1497 +    }
  6.1498 +    return NULL;
  6.1499  }
  6.1500  
  6.1501  SDL_VideoDisplay *
  6.1502  SDL_GetDisplayFromWindow(SDL_Window * window)
  6.1503  {
  6.1504 -	if (!_this) {
  6.1505 -		SDL_UninitializedVideo();
  6.1506 -		return NULL;
  6.1507 -	}
  6.1508 -	if (!window) {
  6.1509 -		return NULL;
  6.1510 -	}
  6.1511 -	return &_this->displays[window->display];
  6.1512 +    if (!_this) {
  6.1513 +        SDL_UninitializedVideo();
  6.1514 +        return NULL;
  6.1515 +    }
  6.1516 +    if (!window) {
  6.1517 +        return NULL;
  6.1518 +    }
  6.1519 +    return &_this->displays[window->display];
  6.1520  }
  6.1521  
  6.1522  Uint32
  6.1523  SDL_GetWindowFlags(SDL_WindowID windowID)
  6.1524  {
  6.1525 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.1526 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.1527  
  6.1528 -	if (!window) {
  6.1529 -		return 0;
  6.1530 -	}
  6.1531 -	return window->flags;
  6.1532 +    if (!window) {
  6.1533 +        return 0;
  6.1534 +    }
  6.1535 +    return window->flags;
  6.1536  }
  6.1537  
  6.1538  void
  6.1539  SDL_SetWindowTitle(SDL_WindowID windowID, const char *title)
  6.1540  {
  6.1541 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.1542 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.1543  
  6.1544 -	if (!window || title == window->title) {
  6.1545 -		return;
  6.1546 -	}
  6.1547 -	if (window->title) {
  6.1548 -		SDL_free(window->title);
  6.1549 -	}
  6.1550 -	if (title) {
  6.1551 -		window->title = SDL_strdup(title);
  6.1552 -	} else {
  6.1553 -		window->title = NULL;
  6.1554 -	}
  6.1555 +    if (!window || title == window->title) {
  6.1556 +        return;
  6.1557 +    }
  6.1558 +    if (window->title) {
  6.1559 +        SDL_free(window->title);
  6.1560 +    }
  6.1561 +    if (title) {
  6.1562 +        window->title = SDL_strdup(title);
  6.1563 +    } else {
  6.1564 +        window->title = NULL;
  6.1565 +    }
  6.1566  
  6.1567 -	if (_this->SetWindowTitle) {
  6.1568 -		_this->SetWindowTitle(_this, window);
  6.1569 -	}
  6.1570 +    if (_this->SetWindowTitle) {
  6.1571 +        _this->SetWindowTitle(_this, window);
  6.1572 +    }
  6.1573  }
  6.1574  
  6.1575 -const char     *
  6.1576 +const char *
  6.1577  SDL_GetWindowTitle(SDL_WindowID windowID)
  6.1578  {
  6.1579 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.1580 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.1581  
  6.1582 -	if (!window) {
  6.1583 -		return NULL;
  6.1584 -	}
  6.1585 -	return window->title;
  6.1586 +    if (!window) {
  6.1587 +        return NULL;
  6.1588 +    }
  6.1589 +    return window->title;
  6.1590  }
  6.1591  
  6.1592  void
  6.1593  SDL_SetWindowData(SDL_WindowID windowID, void *userdata)
  6.1594  {
  6.1595 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.1596 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.1597  
  6.1598 -	if (!window) {
  6.1599 -		return;
  6.1600 -	}
  6.1601 -	window->userdata = userdata;
  6.1602 +    if (!window) {
  6.1603 +        return;
  6.1604 +    }
  6.1605 +    window->userdata = userdata;
  6.1606  }
  6.1607  
  6.1608 -void           *
  6.1609 +void *
  6.1610  SDL_GetWindowData(SDL_WindowID windowID)
  6.1611  {
  6.1612 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.1613 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.1614  
  6.1615 -	if (!window) {
  6.1616 -		return NULL;
  6.1617 -	}
  6.1618 -	return window->userdata;
  6.1619 +    if (!window) {
  6.1620 +        return NULL;
  6.1621 +    }
  6.1622 +    return window->userdata;
  6.1623  }
  6.1624  
  6.1625  void
  6.1626  SDL_SetWindowPosition(SDL_WindowID windowID, int x, int y)
  6.1627  {
  6.1628 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.1629 -	SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
  6.1630 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.1631 +    SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
  6.1632  
  6.1633 -	if (!window) {
  6.1634 -		return;
  6.1635 -	}
  6.1636 -	if (x == SDL_WINDOWPOS_CENTERED) {
  6.1637 -		window->x = (display->current_mode.w - window->w) / 2;
  6.1638 -	} else if (x != SDL_WINDOWPOS_UNDEFINED) {
  6.1639 -		window->x = x;
  6.1640 -	}
  6.1641 -	if (y == SDL_WINDOWPOS_CENTERED) {
  6.1642 -		window->y = (display->current_mode.h - window->h) / 2;
  6.1643 -	} else if (y != SDL_WINDOWPOS_UNDEFINED) {
  6.1644 -		window->y = y;
  6.1645 -	}
  6.1646 -	if (_this->SetWindowPosition) {
  6.1647 -		_this->SetWindowPosition(_this, window);
  6.1648 -	}
  6.1649 +    if (!window) {
  6.1650 +        return;
  6.1651 +    }
  6.1652 +    if (x == SDL_WINDOWPOS_CENTERED) {
  6.1653 +        window->x = (display->current_mode.w - window->w) / 2;
  6.1654 +    } else if (x != SDL_WINDOWPOS_UNDEFINED) {
  6.1655 +        window->x = x;
  6.1656 +    }
  6.1657 +    if (y == SDL_WINDOWPOS_CENTERED) {
  6.1658 +        window->y = (display->current_mode.h - window->h) / 2;
  6.1659 +    } else if (y != SDL_WINDOWPOS_UNDEFINED) {
  6.1660 +        window->y = y;
  6.1661 +    }
  6.1662 +    if (_this->SetWindowPosition) {
  6.1663 +        _this->SetWindowPosition(_this, window);
  6.1664 +    }
  6.1665  }
  6.1666  
  6.1667  void
  6.1668  SDL_GetWindowPosition(SDL_WindowID windowID, int *x, int *y)
  6.1669  {
  6.1670 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.1671 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.1672  
  6.1673 -	if (!window) {
  6.1674 -		return;
  6.1675 -	}
  6.1676 -	if (x) {
  6.1677 -		*x = window->x;
  6.1678 -	}
  6.1679 -	if (y) {
  6.1680 -		*y = window->y;
  6.1681 -	}
  6.1682 +    if (!window) {
  6.1683 +        return;
  6.1684 +    }
  6.1685 +    if (x) {
  6.1686 +        *x = window->x;
  6.1687 +    }
  6.1688 +    if (y) {
  6.1689 +        *y = window->y;
  6.1690 +    }
  6.1691  }
  6.1692  
  6.1693  void
  6.1694  SDL_SetWindowSize(SDL_WindowID windowID, int w, int h)
  6.1695  {
  6.1696 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.1697 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.1698  
  6.1699 -	if (!window) {
  6.1700 -		return;
  6.1701 -	}
  6.1702 -	window->w = w;
  6.1703 -	window->h = h;
  6.1704 +    if (!window) {
  6.1705 +        return;
  6.1706 +    }
  6.1707 +    window->w = w;
  6.1708 +    window->h = h;
  6.1709  
  6.1710 -	if (_this->SetWindowSize) {
  6.1711 -		_this->SetWindowSize(_this, window);
  6.1712 -	}
  6.1713 +    if (_this->SetWindowSize) {
  6.1714 +        _this->SetWindowSize(_this, window);
  6.1715 +    }
  6.1716  }
  6.1717  
  6.1718  void
  6.1719  SDL_GetWindowSize(SDL_WindowID windowID, int *w, int *h)
  6.1720  {
  6.1721 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.1722 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.1723  
  6.1724 -	if (!window) {
  6.1725 -		return;
  6.1726 -	}
  6.1727 -	if (w) {
  6.1728 -		*w = window->w;
  6.1729 -	}
  6.1730 -	if (h) {
  6.1731 -		*h = window->h;
  6.1732 -	}
  6.1733 +    if (!window) {
  6.1734 +        return;
  6.1735 +    }
  6.1736 +    if (w) {
  6.1737 +        *w = window->w;
  6.1738 +    }
  6.1739 +    if (h) {
  6.1740 +        *h = window->h;
  6.1741 +    }
  6.1742  }
  6.1743  
  6.1744  void
  6.1745  SDL_ShowWindow(SDL_WindowID windowID)
  6.1746  {
  6.1747 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.1748 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.1749  
  6.1750 -	if (!window || (window->flags & SDL_WINDOW_SHOWN)) {
  6.1751 -		return;
  6.1752 -	}
  6.1753 -	SDL_SendWindowEvent(window->id, SDL_WINDOWEVENT_SHOWN, 0, 0);
  6.1754 +    if (!window || (window->flags & SDL_WINDOW_SHOWN)) {
  6.1755 +        return;
  6.1756 +    }
  6.1757 +    SDL_SendWindowEvent(window->id, SDL_WINDOWEVENT_SHOWN, 0, 0);
  6.1758  
  6.1759 -	if (_this->ShowWindow) {
  6.1760 -		_this->ShowWindow(_this, window);
  6.1761 -	}
  6.1762 +    if (_this->ShowWindow) {
  6.1763 +        _this->ShowWindow(_this, window);
  6.1764 +    }
  6.1765  }
  6.1766  
  6.1767  void
  6.1768  SDL_HideWindow(SDL_WindowID windowID)
  6.1769  {
  6.1770 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.1771 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.1772  
  6.1773 -	if (!window || !(window->flags & SDL_WINDOW_SHOWN)) {
  6.1774 -		return;
  6.1775 -	}
  6.1776 -	SDL_SendWindowEvent(window->id, SDL_WINDOWEVENT_HIDDEN, 0, 0);
  6.1777 +    if (!window || !(window->flags & SDL_WINDOW_SHOWN)) {
  6.1778 +        return;
  6.1779 +    }
  6.1780 +    SDL_SendWindowEvent(window->id, SDL_WINDOWEVENT_HIDDEN, 0, 0);
  6.1781  
  6.1782 -	if (_this->HideWindow) {
  6.1783 -		_this->HideWindow(_this, window);
  6.1784 -	}
  6.1785 +    if (_this->HideWindow) {
  6.1786 +        _this->HideWindow(_this, window);
  6.1787 +    }
  6.1788  }
  6.1789  
  6.1790  void
  6.1791  SDL_RaiseWindow(SDL_WindowID windowID)
  6.1792  {
  6.1793 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.1794 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.1795  
  6.1796 -	if (!window || !(window->flags & SDL_WINDOW_SHOWN)) {
  6.1797 -		return;
  6.1798 -	}
  6.1799 -	if (_this->RaiseWindow) {
  6.1800 -		_this->RaiseWindow(_this, window);
  6.1801 -	}
  6.1802 +    if (!window || !(window->flags & SDL_WINDOW_SHOWN)) {
  6.1803 +        return;
  6.1804 +    }
  6.1805 +    if (_this->RaiseWindow) {
  6.1806 +        _this->RaiseWindow(_this, window);
  6.1807 +    }
  6.1808  }
  6.1809  
  6.1810  void
  6.1811  SDL_MaximizeWindow(SDL_WindowID windowID)
  6.1812  {
  6.1813 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.1814 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.1815  
  6.1816 -	if (!window || (window->flags & SDL_WINDOW_MAXIMIZED)) {
  6.1817 -		return;
  6.1818 -	}
  6.1819 -	SDL_SendWindowEvent(window->id, SDL_WINDOWEVENT_MAXIMIZED, 0, 0);
  6.1820 +    if (!window || (window->flags & SDL_WINDOW_MAXIMIZED)) {
  6.1821 +        return;
  6.1822 +    }
  6.1823 +    SDL_SendWindowEvent(window->id, SDL_WINDOWEVENT_MAXIMIZED, 0, 0);
  6.1824  
  6.1825 -	if (_this->MaximizeWindow) {
  6.1826 -		_this->MaximizeWindow(_this, window);
  6.1827 -	}
  6.1828 +    if (_this->MaximizeWindow) {
  6.1829 +        _this->MaximizeWindow(_this, window);
  6.1830 +    }
  6.1831  }
  6.1832  
  6.1833  void
  6.1834  SDL_MinimizeWindow(SDL_WindowID windowID)
  6.1835  {
  6.1836 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.1837 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.1838  
  6.1839 -	if (!window || (window->flags & SDL_WINDOW_MINIMIZED)) {
  6.1840 -		return;
  6.1841 -	}
  6.1842 -	SDL_SendWindowEvent(window->id, SDL_WINDOWEVENT_MINIMIZED, 0, 0);
  6.1843 +    if (!window || (window->flags & SDL_WINDOW_MINIMIZED)) {
  6.1844 +        return;
  6.1845 +    }
  6.1846 +    SDL_SendWindowEvent(window->id, SDL_WINDOWEVENT_MINIMIZED, 0, 0);
  6.1847  
  6.1848 -	if (_this->MinimizeWindow) {
  6.1849 -		_this->MinimizeWindow(_this, window);
  6.1850 -	}
  6.1851 +    if (_this->MinimizeWindow) {
  6.1852 +        _this->MinimizeWindow(_this, window);
  6.1853 +    }
  6.1854  }
  6.1855  
  6.1856  void
  6.1857  SDL_RestoreWindow(SDL_WindowID windowID)
  6.1858  {
  6.1859 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.1860 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.1861  
  6.1862 -	if (!window
  6.1863 -	|| (window->flags & (SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED))) {
  6.1864 -		return;
  6.1865 -	}
  6.1866 -	SDL_SendWindowEvent(window->id, SDL_WINDOWEVENT_RESTORED, 0, 0);
  6.1867 +    if (!window
  6.1868 +        || (window->flags & (SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED))) {
  6.1869 +        return;
  6.1870 +    }
  6.1871 +    SDL_SendWindowEvent(window->id, SDL_WINDOWEVENT_RESTORED, 0, 0);
  6.1872  
  6.1873 -	if (_this->RestoreWindow) {
  6.1874 -		_this->RestoreWindow(_this, window);
  6.1875 -	}
  6.1876 +    if (_this->RestoreWindow) {
  6.1877 +        _this->RestoreWindow(_this, window);
  6.1878 +    }
  6.1879  }
  6.1880  
  6.1881  int
  6.1882  SDL_SetWindowFullscreen(SDL_WindowID windowID, int fullscreen)
  6.1883  {
  6.1884 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.1885 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.1886  
  6.1887 -	if (!window) {
  6.1888 -		return -1;
  6.1889 -	}
  6.1890 -	if (fullscreen) {
  6.1891 -		fullscreen = SDL_WINDOW_FULLSCREEN;
  6.1892 -	}
  6.1893 -	if ((window->flags & SDL_WINDOW_FULLSCREEN) == fullscreen) {
  6.1894 -		return 0;
  6.1895 -	}
  6.1896 -	if (fullscreen) {
  6.1897 -		window->flags |= SDL_WINDOW_FULLSCREEN;
  6.1898 +    if (!window) {
  6.1899 +        return -1;
  6.1900 +    }
  6.1901 +    if (fullscreen) {
  6.1902 +        fullscreen = SDL_WINDOW_FULLSCREEN;
  6.1903 +    }
  6.1904 +    if ((window->flags & SDL_WINDOW_FULLSCREEN) == fullscreen) {
  6.1905 +        return 0;
  6.1906 +    }
  6.1907 +    if (fullscreen) {
  6.1908 +        window->flags |= SDL_WINDOW_FULLSCREEN;
  6.1909  
  6.1910 -		if (FULLSCREEN_VISIBLE(window)) {
  6.1911 -			SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
  6.1912 +        if (FULLSCREEN_VISIBLE(window)) {
  6.1913 +            SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
  6.1914  
  6.1915 -			/* Hide any other fullscreen windows */
  6.1916 -			int             i;
  6.1917 -			for (i = 0; i < display->num_windows; ++i) {
  6.1918 -				SDL_Window     *other = &display->windows[i];
  6.1919 -				if (other->id != windowID && FULLSCREEN_VISIBLE(other)) {
  6.1920 -					SDL_MinimizeWindow(other->id);
  6.1921 -				}
  6.1922 -			}
  6.1923 +            /* Hide any other fullscreen windows */
  6.1924 +            int i;
  6.1925 +            for (i = 0; i < display->num_windows; ++i) {
  6.1926 +                SDL_Window *other = &display->windows[i];
  6.1927 +                if (other->id != windowID && FULLSCREEN_VISIBLE(other)) {
  6.1928 +                    SDL_MinimizeWindow(other->id);
  6.1929 +                }
  6.1930 +            }
  6.1931  
  6.1932 -			SDL_SetDisplayMode(&display->fullscreen_mode);
  6.1933 -		}
  6.1934 -	} else {
  6.1935 -		window->flags &= ~SDL_WINDOW_FULLSCREEN;
  6.1936 +            SDL_SetDisplayMode(&display->fullscreen_mode);
  6.1937 +        }
  6.1938 +    } else {
  6.1939 +        window->flags &= ~SDL_WINDOW_FULLSCREEN;
  6.1940  
  6.1941 -		if (FULLSCREEN_VISIBLE(window)) {
  6.1942 -			SDL_SetDisplayMode(NULL);
  6.1943 -		}
  6.1944 -	}
  6.1945 -	return 0;
  6.1946 +        if (FULLSCREEN_VISIBLE(window)) {
  6.1947 +            SDL_SetDisplayMode(NULL);
  6.1948 +        }
  6.1949 +    }
  6.1950 +    return 0;
  6.1951  }
  6.1952  
  6.1953  void
  6.1954  SDL_SetWindowGrab(SDL_WindowID windowID, int mode)
  6.1955  {
  6.1956 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.1957 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.1958  
  6.1959 -	if (!window || (!!mode == !!(window->flags & SDL_WINDOW_INPUT_GRABBED))) {
  6.1960 -		return;
  6.1961 -	}
  6.1962 -	if (mode) {
  6.1963 -		window->flags |= SDL_WINDOW_INPUT_GRABBED;
  6.1964 -	} else {
  6.1965 -		window->flags &= ~SDL_WINDOW_INPUT_GRABBED;
  6.1966 -	}
  6.1967 +    if (!window || (!!mode == !!(window->flags & SDL_WINDOW_INPUT_GRABBED))) {
  6.1968 +        return;
  6.1969 +    }
  6.1970 +    if (mode) {
  6.1971 +        window->flags |= SDL_WINDOW_INPUT_GRABBED;
  6.1972 +    } else {
  6.1973 +        window->flags &= ~SDL_WINDOW_INPUT_GRABBED;
  6.1974 +    }
  6.1975  
  6.1976 -	if ((window->flags & SDL_WINDOW_INPUT_FOCUS) && _this->SetWindowGrab) {
  6.1977 -		_this->SetWindowGrab(_this, window);
  6.1978 -	}
  6.1979 +    if ((window->flags & SDL_WINDOW_INPUT_FOCUS) && _this->SetWindowGrab) {
  6.1980 +        _this->SetWindowGrab(_this, window);
  6.1981 +    }
  6.1982  }
  6.1983  
  6.1984  int
  6.1985  SDL_GetWindowGrab(SDL_WindowID windowID)
  6.1986  {
  6.1987 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.1988 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.1989  
  6.1990 -	if (!window) {
  6.1991 -		return 0;
  6.1992 -	}
  6.1993 -	return ((window->flags & SDL_WINDOW_INPUT_GRABBED) != 0);
  6.1994 +    if (!window) {
  6.1995 +        return 0;
  6.1996 +    }
  6.1997 +    return ((window->flags & SDL_WINDOW_INPUT_GRABBED) != 0);
  6.1998  }
  6.1999  
  6.2000  void
  6.2001 @@ -1228,1041 +1228,1041 @@
  6.2002  void
  6.2003  SDL_OnWindowResized(SDL_Window * window)
  6.2004  {
  6.2005 -	SDL_Renderer   *renderer = window->renderer;
  6.2006 +    SDL_Renderer *renderer = window->renderer;
  6.2007  
  6.2008 -	if (renderer && renderer->DisplayModeChanged) {
  6.2009 -		renderer->DisplayModeChanged(renderer);
  6.2010 -	}
  6.2011 +    if (renderer && renderer->DisplayModeChanged) {
  6.2012 +        renderer->DisplayModeChanged(renderer);
  6.2013 +    }
  6.2014  }
  6.2015  
  6.2016  void
  6.2017  SDL_OnWindowFocusGained(SDL_Window * window)
  6.2018  {
  6.2019 -	SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
  6.2020 +    SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
  6.2021  
  6.2022 -	if (window->flags & SDL_WINDOW_FULLSCREEN) {
  6.2023 -		SDL_SetDisplayMode(&display->fullscreen_mode);
  6.2024 -	}
  6.2025 -	if (display->gamma && _this->SetDisplayGammaRamp) {
  6.2026 -		_this->SetDisplayGammaRamp(_this, display->gamma);
  6.2027 -	}
  6.2028 -	if ((window->flags & SDL_WINDOW_INPUT_GRABBED) && _this->SetWindowGrab) {
  6.2029 -		_this->SetWindowGrab(_this, window);
  6.2030 -	}
  6.2031 +    if (window->flags & SDL_WINDOW_FULLSCREEN) {
  6.2032 +        SDL_SetDisplayMode(&display->fullscreen_mode);
  6.2033 +    }
  6.2034 +    if (display->gamma && _this->SetDisplayGammaRamp) {
  6.2035 +        _this->SetDisplayGammaRamp(_this, display->gamma);
  6.2036 +    }
  6.2037 +    if ((window->flags & SDL_WINDOW_INPUT_GRABBED) && _this->SetWindowGrab) {
  6.2038 +        _this->SetWindowGrab(_this, window);
  6.2039 +    }
  6.2040  }
  6.2041  
  6.2042  void
  6.2043  SDL_OnWindowFocusLost(SDL_Window * window)
  6.2044  {
  6.2045 -	SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
  6.2046 +    SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
  6.2047  
  6.2048 -	if (window->flags & SDL_WINDOW_FULLSCREEN) {
  6.2049 -		SDL_MinimizeWindow(window->id);
  6.2050 -		SDL_SetDisplayMode(NULL);
  6.2051 -	}
  6.2052 -	if (display->gamma && _this->SetDisplayGammaRamp) {
  6.2053 -		_this->SetDisplayGammaRamp(_this, display->saved_gamma);
  6.2054 -	}
  6.2055 -	if ((window->flags & SDL_WINDOW_INPUT_GRABBED) && _this->SetWindowGrab) {
  6.2056 -		_this->SetWindowGrab(_this, window);
  6.2057 -	}
  6.2058 +    if (window->flags & SDL_WINDOW_FULLSCREEN) {
  6.2059 +        SDL_MinimizeWindow(window->id);
  6.2060 +        SDL_SetDisplayMode(NULL);
  6.2061 +    }
  6.2062 +    if (display->gamma && _this->SetDisplayGammaRamp) {
  6.2063 +        _this->SetDisplayGammaRamp(_this, display->saved_gamma);
  6.2064 +    }
  6.2065 +    if ((window->flags & SDL_WINDOW_INPUT_GRABBED) && _this->SetWindowGrab) {
  6.2066 +        _this->SetWindowGrab(_this, window);
  6.2067 +    }
  6.2068  }
  6.2069  
  6.2070  SDL_WindowID
  6.2071  SDL_GetFocusWindow(void)
  6.2072  {
  6.2073 -	SDL_VideoDisplay *display;
  6.2074 -	int             i;
  6.2075 +    SDL_VideoDisplay *display;
  6.2076 +    int i;
  6.2077  
  6.2078 -	if (!_this) {
  6.2079 -		return 0;
  6.2080 -	}
  6.2081 -	display = &SDL_CurrentDisplay;
  6.2082 -	for (i = 0; i < display->num_windows; ++i) {
  6.2083 -		SDL_Window     *window = &display->windows[i];
  6.2084 +    if (!_this) {
  6.2085 +        return 0;
  6.2086 +    }
  6.2087 +    display = &SDL_CurrentDisplay;
  6.2088 +    for (i = 0; i < display->num_windows; ++i) {
  6.2089 +        SDL_Window *window = &display->windows[i];
  6.2090  
  6.2091 -		if (window->flags & SDL_WINDOW_INPUT_FOCUS) {
  6.2092 -			return window->id;
  6.2093 -		}
  6.2094 -	}
  6.2095 -	return 0;
  6.2096 +        if (window->flags & SDL_WINDOW_INPUT_FOCUS) {
  6.2097 +            return window->id;
  6.2098 +        }
  6.2099 +    }
  6.2100 +    return 0;
  6.2101  }
  6.2102  
  6.2103  void
  6.2104  SDL_DestroyWindow(SDL_WindowID windowID)
  6.2105  {
  6.2106 -	int             i, j;
  6.2107 +    int i, j;
  6.2108  
  6.2109 -	if (!_this) {
  6.2110 -		return;
  6.2111 -	}
  6.2112 -	/* Restore video mode, etc. */
  6.2113 -	SDL_SendWindowEvent(windowID, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0);
  6.2114 +    if (!_this) {
  6.2115 +        return;
  6.2116 +    }
  6.2117 +    /* Restore video mode, etc. */
  6.2118 +    SDL_SendWindowEvent(windowID, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0);
  6.2119  
  6.2120 -	for (i = 0; i < _this->num_displays; ++i) {
  6.2121 -		SDL_VideoDisplay *display = &_this->displays[i];
  6.2122 -		for (j = 0; j < display->num_windows; ++j) {
  6.2123 -			SDL_Window     *window = &display->windows[j];
  6.2124 -			if (window->id != windowID) {
  6.2125 -				continue;
  6.2126 -			}
  6.2127 -			if (window->title) {
  6.2128 -				SDL_free(window->title);
  6.2129 -				window->title = NULL;
  6.2130 -			}
  6.2131 -			if (window->renderer) {
  6.2132 -				SDL_DestroyRenderer(window->id);
  6.2133 -				window->renderer = NULL;
  6.2134 -			}
  6.2135 -			if (_this->DestroyWindow) {
  6.2136 -				_this->DestroyWindow(_this, window);
  6.2137 -			}
  6.2138 -			if (j != display->num_windows - 1) {
  6.2139 -				SDL_memcpy(&display->windows[i],
  6.2140 -					   &display->windows[i + 1],
  6.2141 -					   (display->num_windows - i - 1) * sizeof(*window));
  6.2142 -			}
  6.2143 -			--display->num_windows;
  6.2144 -			return;
  6.2145 -		}
  6.2146 -	}
  6.2147 +    for (i = 0; i < _this->num_displays; ++i) {
  6.2148 +        SDL_VideoDisplay *display = &_this->displays[i];
  6.2149 +        for (j = 0; j < display->num_windows; ++j) {
  6.2150 +            SDL_Window *window = &display->windows[j];
  6.2151 +            if (window->id != windowID) {
  6.2152 +                continue;
  6.2153 +            }
  6.2154 +            if (window->title) {
  6.2155 +                SDL_free(window->title);
  6.2156 +                window->title = NULL;
  6.2157 +            }
  6.2158 +            if (window->renderer) {
  6.2159 +                SDL_DestroyRenderer(window->id);
  6.2160 +                window->renderer = NULL;
  6.2161 +            }
  6.2162 +            if (_this->DestroyWindow) {
  6.2163 +                _this->DestroyWindow(_this, window);
  6.2164 +            }
  6.2165 +            if (j != display->num_windows - 1) {
  6.2166 +                SDL_memcpy(&display->windows[i],
  6.2167 +                           &display->windows[i + 1],
  6.2168 +                           (display->num_windows - i - 1) * sizeof(*window));
  6.2169 +            }
  6.2170 +            --display->num_windows;
  6.2171 +            return;
  6.2172 +        }
  6.2173 +    }
  6.2174  }
  6.2175  
  6.2176  void
  6.2177  SDL_AddRenderDriver(int displayIndex, const SDL_RenderDriver * driver)
  6.2178  {
  6.2179 -	SDL_VideoDisplay *display;
  6.2180 -	SDL_RenderDriver *render_drivers;
  6.2181 +    SDL_VideoDisplay *display;
  6.2182 +    SDL_RenderDriver *render_drivers;
  6.2183  
  6.2184 -	if (displayIndex >= _this->num_displays) {
  6.2185 -		return;
  6.2186 -	}
  6.2187 -	display = &_this->displays[displayIndex];
  6.2188 +    if (displayIndex >= _this->num_displays) {
  6.2189 +        return;
  6.2190 +    }
  6.2191 +    display = &_this->displays[displayIndex];
  6.2192  
  6.2193 -	render_drivers =
  6.2194 -		SDL_realloc(display->render_drivers,
  6.2195 -			    (display->num_render_drivers +
  6.2196 -			     1) * sizeof(*render_drivers));
  6.2197 -	if (render_drivers) {
  6.2198 -		render_drivers[display->num_render_drivers] = *driver;
  6.2199 -		display->render_drivers = render_drivers;
  6.2200 -		display->num_render_drivers++;
  6.2201 -	}
  6.2202 +    render_drivers =
  6.2203 +        SDL_realloc(display->render_drivers,
  6.2204 +                    (display->num_render_drivers +
  6.2205 +                     1) * sizeof(*render_drivers));
  6.2206 +    if (render_drivers) {
  6.2207 +        render_drivers[display->num_render_drivers] = *driver;
  6.2208 +        display->render_drivers = render_drivers;
  6.2209 +        display->num_render_drivers++;
  6.2210 +    }
  6.2211  }
  6.2212  
  6.2213  int
  6.2214  SDL_GetNumRenderDrivers(void)
  6.2215  {
  6.2216 -	if (_this) {
  6.2217 -		return SDL_CurrentDisplay.num_render_drivers;
  6.2218 -	}
  6.2219 -	return 0;
  6.2220 +    if (_this) {
  6.2221 +        return SDL_CurrentDisplay.num_render_drivers;
  6.2222 +    }
  6.2223 +    return 0;
  6.2224  }
  6.2225  
  6.2226  int
  6.2227  SDL_GetRenderDriverInfo(int index, SDL_RendererInfo * info)
  6.2228  {
  6.2229 -	if (!_this) {
  6.2230 -		SDL_UninitializedVideo();
  6.2231 -		return -1;
  6.2232 -	}
  6.2233 -	if (index < 0 || index >= SDL_GetNumRenderDrivers()) {
  6.2234 -		SDL_SetError("index must be in the range of 0 - %d",
  6.2235 -			     SDL_GetNumRenderDrivers() - 1);
  6.2236 -		return -1;
  6.2237 -	}
  6.2238 -	*info = SDL_CurrentDisplay.render_drivers[index].info;
  6.2239 -	return 0;
  6.2240 +    if (!_this) {
  6.2241 +        SDL_UninitializedVideo();
  6.2242 +        return -1;
  6.2243 +    }
  6.2244 +    if (index < 0 || index >= SDL_GetNumRenderDrivers()) {
  6.2245 +        SDL_SetError("index must be in the range of 0 - %d",
  6.2246 +                     SDL_GetNumRenderDrivers() - 1);
  6.2247 +        return -1;
  6.2248 +    }
  6.2249 +    *info = SDL_CurrentDisplay.render_drivers[index].info;
  6.2250 +    return 0;
  6.2251  }
  6.2252  
  6.2253  int
  6.2254  SDL_CreateRenderer(SDL_WindowID windowID, int index, Uint32 flags)
  6.2255  {
  6.2256 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.2257 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.2258  
  6.2259 -	if (!window) {
  6.2260 -		return 0;
  6.2261 -	}
  6.2262 -	if (index < 0) {
  6.2263 -		const char     *override = SDL_getenv("SDL_VIDEO_RENDERER");
  6.2264 -		int             n = SDL_GetNumRenderDrivers();
  6.2265 -		for (index = 0; index < n; ++index) {
  6.2266 -			SDL_RenderDriver *driver =
  6.2267 -			&SDL_CurrentDisplay.render_drivers[index];
  6.2268 +    if (!window) {
  6.2269 +        return 0;
  6.2270 +    }
  6.2271 +    if (index < 0) {
  6.2272 +        const char *override = SDL_getenv("SDL_VIDEO_RENDERER");
  6.2273 +        int n = SDL_GetNumRenderDrivers();
  6.2274 +        for (index = 0; index < n; ++index) {
  6.2275 +            SDL_RenderDriver *driver =
  6.2276 +                &SDL_CurrentDisplay.render_drivers[index];
  6.2277  
  6.2278 -			if (override) {
  6.2279 -				if (SDL_strcasecmp(override, driver->info.name) == 0) {
  6.2280 -					break;
  6.2281 -				}
  6.2282 -			} else {
  6.2283 -				if ((driver->info.flags & flags) == flags) {
  6.2284 -					break;
  6.2285 -				}
  6.2286 -			}
  6.2287 -		}
  6.2288 -		if (index == n) {
  6.2289 -			SDL_SetError("Couldn't find matching render driver");
  6.2290 -			return -1;
  6.2291 -		}
  6.2292 -	}
  6.2293 -	if (index >= SDL_GetNumRenderDrivers()) {
  6.2294 -		SDL_SetError("index must be -1 or in the range of 0 - %d",
  6.2295 -			     SDL_GetNumRenderDrivers() - 1);
  6.2296 -		return -1;
  6.2297 -	}
  6.2298 -	/* Free any existing renderer */
  6.2299 -	SDL_DestroyRenderer(windowID);
  6.2300 +            if (override) {
  6.2301 +                if (SDL_strcasecmp(override, driver->info.name) == 0) {
  6.2302 +                    break;
  6.2303 +                }
  6.2304 +            } else {
  6.2305 +                if ((driver->info.flags & flags) == flags) {
  6.2306 +                    break;
  6.2307 +                }
  6.2308 +            }
  6.2309 +        }
  6.2310 +        if (index == n) {
  6.2311 +            SDL_SetError("Couldn't find matching render driver");
  6.2312 +            return -1;
  6.2313 +        }
  6.2314 +    }
  6.2315 +    if (index >= SDL_GetNumRenderDrivers()) {
  6.2316 +        SDL_SetError("index must be -1 or in the range of 0 - %d",
  6.2317 +                     SDL_GetNumRenderDrivers() - 1);
  6.2318 +        return -1;
  6.2319 +    }
  6.2320 +    /* Free any existing renderer */
  6.2321 +    SDL_DestroyRenderer(windowID);
  6.2322  
  6.2323 -	/* Create a new renderer instance */
  6.2324 -	window->renderer = SDL_CurrentDisplay.render_drivers[index]
  6.2325 -		.CreateRenderer(window, flags);
  6.2326 -	SDL_SelectRenderer(window->id);
  6.2327 +    /* Create a new renderer instance */
  6.2328 +    window->renderer = SDL_CurrentDisplay.render_drivers[index]
  6.2329 +        .CreateRenderer(window, flags);
  6.2330 +    SDL_SelectRenderer(window->id);
  6.2331  
  6.2332 -	return 0;
  6.2333 +    return 0;
  6.2334  }
  6.2335  
  6.2336  int
  6.2337  SDL_SelectRenderer(SDL_WindowID windowID)
  6.2338  {
  6.2339 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.2340 -	SDL_Renderer   *renderer;
  6.2341 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.2342 +    SDL_Renderer *renderer;
  6.2343  
  6.2344 -	if (!window || !window->renderer) {
  6.2345 -		return -1;
  6.2346 -	}
  6.2347 -	renderer = window->renderer;
  6.2348 -	if (renderer && renderer->ActivateRenderer) {
  6.2349 -		if (renderer->ActivateRenderer(renderer) < 0) {
  6.2350 -			return -1;
  6.2351 -		}
  6.2352 -	}
  6.2353 -	SDL_CurrentDisplay.current_renderer = renderer;
  6.2354 -	return 0;
  6.2355 +    if (!window || !window->renderer) {
  6.2356 +        return -1;
  6.2357 +    }
  6.2358 +    renderer = window->renderer;
  6.2359 +    if (renderer && renderer->ActivateRenderer) {
  6.2360 +        if (renderer->ActivateRenderer(renderer) < 0) {
  6.2361 +            return -1;
  6.2362 +        }
  6.2363 +    }
  6.2364 +    SDL_CurrentDisplay.current_renderer = renderer;
  6.2365 +    return 0;
  6.2366  }
  6.2367  
  6.2368  int
  6.2369  SDL_GetRendererInfo(SDL_RendererInfo * info)
  6.2370  {
  6.2371 -	if (!_this) {
  6.2372 -		SDL_UninitializedVideo();
  6.2373 -		return -1;
  6.2374 -	}
  6.2375 -	if (!SDL_CurrentDisplay.current_renderer) {
  6.2376 -		SDL_SetError("There is no current renderer");
  6.2377 -		return -1;
  6.2378 -	}
  6.2379 -	*info = SDL_CurrentDisplay.current_renderer->info;
  6.2380 -	return 0;
  6.2381 +    if (!_this) {
  6.2382 +        SDL_UninitializedVideo();
  6.2383 +        return -1;
  6.2384 +    }
  6.2385 +    if (!SDL_CurrentDisplay.current_renderer) {
  6.2386 +        SDL_SetError("There is no current renderer");
  6.2387 +        return -1;
  6.2388 +    }
  6.2389 +    *info = SDL_CurrentDisplay.current_renderer->info;
  6.2390 +    return 0;
  6.2391  }
  6.2392  
  6.2393  SDL_TextureID
  6.2394  SDL_CreateTexture(Uint32 format, int access, int w, int h)
  6.2395  {
  6.2396 -	int             hash;
  6.2397 -	SDL_Renderer   *renderer;
  6.2398 -	SDL_Texture    *texture;
  6.2399 +    int hash;
  6.2400 +    SDL_Renderer *renderer;
  6.2401 +    SDL_Texture *texture;
  6.2402  
  6.2403 -	if (!_this) {
  6.2404 -		SDL_UninitializedVideo();
  6.2405 -		return 0;
  6.2406 -	}
  6.2407 -	renderer = SDL_CurrentDisplay.current_renderer;
  6.2408 -	if (!renderer || !renderer->CreateTexture) {
  6.2409 -		return 0;
  6.2410 -	}
  6.2411 -	texture = (SDL_Texture *) SDL_calloc(1, sizeof(*texture));
  6.2412 -	if (!texture) {
  6.2413 -		SDL_OutOfMemory();
  6.2414 -		return 0;
  6.2415 -	}
  6.2416 -	texture->id = _this->next_object_id++;
  6.2417 -	texture->format = format;
  6.2418 -	texture->access = access;
  6.2419 -	texture->w = w;
  6.2420 -	texture->h = h;
  6.2421 -	texture->r = 255;
  6.2422 -	texture->g = 255;
  6.2423 -	texture->b = 255;
  6.2424 -	texture->a = 255;
  6.2425 -	texture->renderer = renderer;
  6.2426 +    if (!_this) {
  6.2427 +        SDL_UninitializedVideo();
  6.2428 +        return 0;
  6.2429 +    }
  6.2430 +    renderer = SDL_CurrentDisplay.current_renderer;
  6.2431 +    if (!renderer || !renderer->CreateTexture) {
  6.2432 +        return 0;
  6.2433 +    }
  6.2434 +    texture = (SDL_Texture *) SDL_calloc(1, sizeof(*texture));
  6.2435 +    if (!texture) {
  6.2436 +        SDL_OutOfMemory();
  6.2437 +        return 0;
  6.2438 +    }
  6.2439 +    texture->id = _this->next_object_id++;
  6.2440 +    texture->format = format;
  6.2441 +    texture->access = access;
  6.2442 +    texture->w = w;
  6.2443 +    texture->h = h;
  6.2444 +    texture->r = 255;
  6.2445 +    texture->g = 255;
  6.2446 +    texture->b = 255;
  6.2447 +    texture->a = 255;
  6.2448 +    texture->renderer = renderer;
  6.2449  
  6.2450 -	if (renderer->CreateTexture(renderer, texture) < 0) {
  6.2451 -		if (renderer->DestroyTexture) {
  6.2452 -			renderer->DestroyTexture(renderer, texture);
  6.2453 -		}
  6.2454 -		SDL_free(texture);
  6.2455 -		return 0;
  6.2456 -	}
  6.2457 -	hash = (texture->id % SDL_arraysize(SDL_CurrentDisplay.textures));
  6.2458 -	texture->next = SDL_CurrentDisplay.textures[hash];
  6.2459 -	SDL_CurrentDisplay.textures[hash] = texture;
  6.2460 +    if (renderer->CreateTexture(renderer, texture) < 0) {
  6.2461 +        if (renderer->DestroyTexture) {
  6.2462 +            renderer->DestroyTexture(renderer, texture);
  6.2463 +        }
  6.2464 +        SDL_free(texture);
  6.2465 +        return 0;
  6.2466 +    }
  6.2467 +    hash = (texture->id % SDL_arraysize(SDL_CurrentDisplay.textures));
  6.2468 +    texture->next = SDL_CurrentDisplay.textures[hash];
  6.2469 +    SDL_CurrentDisplay.textures[hash] = texture;
  6.2470  
  6.2471 -	return texture->id;
  6.2472 +    return texture->id;
  6.2473  }
  6.2474  
  6.2475  SDL_TextureID
  6.2476  SDL_CreateTextureFromSurface(Uint32 format, SDL_Surface * surface)
  6.2477  {
  6.2478 -	SDL_TextureID   textureID;
  6.2479 -	SDL_PixelFormat *fmt;
  6.2480 -	int             bpp;
  6.2481 -	Uint32          Rmask, Gmask, Bmask, Amask;
  6.2482 +    SDL_TextureID textureID;
  6.2483 +    SDL_PixelFormat *fmt;
  6.2484 +    int bpp;
  6.2485 +    Uint32 Rmask, Gmask, Bmask, Amask;
  6.2486  
  6.2487 -	if (!surface) {
  6.2488 -		SDL_SetError("SDL_CreateTextureFromSurface() passed NULL surface");
  6.2489 -		return 0;
  6.2490 -	}
  6.2491 -	fmt = surface->format;
  6.2492 +    if (!surface) {
  6.2493 +        SDL_SetError("SDL_CreateTextureFromSurface() passed NULL surface");
  6.2494 +        return 0;
  6.2495 +    }
  6.2496 +    fmt = surface->format;
  6.2497  
  6.2498 -	if (format) {
  6.2499 -		if (!SDL_PixelFormatEnumToMasks
  6.2500 -		    (format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) {
  6.2501 -			SDL_SetError("Unknown pixel format");
  6.2502 -			return 0;
  6.2503 -		}
  6.2504 -	} else {
  6.2505 -		if (surface->format->Amask
  6.2506 -		    || !(surface->map->info.flags &
  6.2507 -		    (SDL_COPY_COLORKEY | SDL_COPY_MASK | SDL_COPY_BLEND))) {
  6.2508 -			bpp = fmt->BitsPerPixel;
  6.2509 -			Rmask = fmt->Rmask;
  6.2510 -			Gmask = fmt->Gmask;
  6.2511 -			Bmask = fmt->Bmask;
  6.2512 -			Amask = fmt->Amask;
  6.2513 -		} else {
  6.2514 -			/* Need a format with alpha */
  6.2515 -			bpp = 32;
  6.2516 -			Rmask = 0x00FF0000;
  6.2517 -			Gmask = 0x0000FF00;
  6.2518 -			Bmask = 0x000000FF;
  6.2519 -			Amask = 0xFF000000;
  6.2520 -		}
  6.2521 -		format = SDL_MasksToPixelFormatEnum(bpp, Rmask, Gmask, Bmask, Amask);
  6.2522 -		if (!format) {
  6.2523 -			SDL_SetError("Unknown pixel format");
  6.2524 -			return 0;
  6.2525 -		}
  6.2526 -	}
  6.2527 +    if (format) {
  6.2528 +        if (!SDL_PixelFormatEnumToMasks
  6.2529 +            (format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) {
  6.2530 +            SDL_SetError("Unknown pixel format");
  6.2531 +            return 0;
  6.2532 +        }
  6.2533 +    } else {
  6.2534 +        if (surface->format->Amask
  6.2535 +            || !(surface->map->info.flags &
  6.2536 +                 (SDL_COPY_COLORKEY | SDL_COPY_MASK | SDL_COPY_BLEND))) {
  6.2537 +            bpp = fmt->BitsPerPixel;
  6.2538 +            Rmask = fmt->Rmask;
  6.2539 +            Gmask = fmt->Gmask;
  6.2540 +            Bmask = fmt->Bmask;
  6.2541 +            Amask = fmt->Amask;
  6.2542 +        } else {
  6.2543 +            /* Need a format with alpha */
  6.2544 +            bpp = 32;
  6.2545 +            Rmask = 0x00FF0000;
  6.2546 +            Gmask = 0x0000FF00;
  6.2547 +            Bmask = 0x000000FF;
  6.2548 +            Amask = 0xFF000000;
  6.2549 +        }
  6.2550 +        format = SDL_MasksToPixelFormatEnum(bpp, Rmask, Gmask, Bmask, Amask);
  6.2551 +        if (!format) {
  6.2552 +            SDL_SetError("Unknown pixel format");
  6.2553 +            return 0;
  6.2554 +        }
  6.2555 +    }
  6.2556  
  6.2557 -	textureID =
  6.2558 -		SDL_CreateTexture(format, SDL_TEXTUREACCESS_STATIC, surface->w,
  6.2559 -				  surface->h);
  6.2560 -	if (!textureID) {
  6.2561 -		return 0;
  6.2562 -	}
  6.2563 -	if (bpp == fmt->BitsPerPixel && Rmask == fmt->Rmask && Gmask == fmt->Gmask
  6.2564 -	    && Bmask == fmt->Bmask && Amask == fmt->Amask) {
  6.2565 -		if (SDL_MUSTLOCK(surface)) {
  6.2566 -			if (SDL_LockSurface(surface) < 0) {
  6.2567 -				SDL_DestroyTexture(textureID);
  6.2568 -				return 0;
  6.2569 -			}
  6.2570 -			SDL_UpdateTexture(textureID, NULL, surface->pixels,
  6.2571 -					  surface->pitch);
  6.2572 -			SDL_UnlockSurface(surface);
  6.2573 -		} else {
  6.2574 -			SDL_UpdateTexture(textureID, NULL, surface->pixels,
  6.2575 -					  surface->pitch);
  6.2576 -		}
  6.2577 -	} else {
  6.2578 -		SDL_PixelFormat *dst_fmt;
  6.2579 -		SDL_Surface    *dst = NULL;
  6.2580 +    textureID =
  6.2581 +        SDL_CreateTexture(format, SDL_TEXTUREACCESS_STATIC, surface->w,
  6.2582 +                          surface->h);
  6.2583 +    if (!textureID) {
  6.2584 +        return 0;
  6.2585 +    }
  6.2586 +    if (bpp == fmt->BitsPerPixel && Rmask == fmt->Rmask && Gmask == fmt->Gmask
  6.2587 +        && Bmask == fmt->Bmask && Amask == fmt->Amask) {
  6.2588 +        if (SDL_MUSTLOCK(surface)) {
  6.2589 +            if (SDL_LockSurface(surface) < 0) {
  6.2590 +                SDL_DestroyTexture(textureID);
  6.2591 +                return 0;
  6.2592 +            }
  6.2593 +            SDL_UpdateTexture(textureID, NULL, surface->pixels,
  6.2594 +                              surface->pitch);
  6.2595 +            SDL_UnlockSurface(surface);
  6.2596 +        } else {
  6.2597 +            SDL_UpdateTexture(textureID, NULL, surface->pixels,
  6.2598 +                              surface->pitch);
  6.2599 +        }
  6.2600 +    } else {
  6.2601 +        SDL_PixelFormat *dst_fmt;
  6.2602 +        SDL_Surface *dst = NULL;
  6.2603  
  6.2604 -		/* Set up a destination surface for the texture update */
  6.2605 -		dst_fmt = SDL_AllocFormat(bpp, Rmask, Gmask, Bmask, Amask);
  6.2606 -		if (dst_fmt) {
  6.2607 -			if (SDL_ISPIXELFORMAT_INDEXED(format)) {
  6.2608 -				dst_fmt->palette =
  6.2609 -					SDL_AllocPalette((1 << SDL_BITSPERPIXEL(format)));
  6.2610 -				if (dst_fmt->palette) {
  6.2611 -					/*
  6.2612 -					 * FIXME: Should we try to copy
  6.2613 -					 * fmt->palette?
  6.2614 -					 */
  6.2615 -					SDL_DitherColors(dst_fmt->palette->colors,
  6.2616 -						  SDL_BITSPERPIXEL(format));
  6.2617 -				}
  6.2618 -			}
  6.2619 -			dst = SDL_ConvertSurface(surface, dst_fmt, 0);
  6.2620 -			if (dst) {
  6.2621 -				SDL_UpdateTexture(textureID, NULL, dst->pixels, dst->pitch);
  6.2622 -				SDL_FreeSurface(dst);
  6.2623 -			}
  6.2624 -			if (dst_fmt->palette) {
  6.2625 -				SDL_FreePalette(dst_fmt->palette);
  6.2626 -			}
  6.2627 -			SDL_FreeFormat(dst_fmt);
  6.2628 -		}
  6.2629 -		if (!dst) {
  6.2630 -			SDL_DestroyTexture(textureID);
  6.2631 -			return 0;
  6.2632 -		}
  6.2633 -	}
  6.2634 +        /* Set up a destination surface for the texture update */
  6.2635 +        dst_fmt = SDL_AllocFormat(bpp, Rmask, Gmask, Bmask, Amask);
  6.2636 +        if (dst_fmt) {
  6.2637 +            if (SDL_ISPIXELFORMAT_INDEXED(format)) {
  6.2638 +                dst_fmt->palette =
  6.2639 +                    SDL_AllocPalette((1 << SDL_BITSPERPIXEL(format)));
  6.2640 +                if (dst_fmt->palette) {
  6.2641 +                    /*
  6.2642 +                     * FIXME: Should we try to copy
  6.2643 +                     * fmt->palette?
  6.2644 +                     */
  6.2645 +                    SDL_DitherColors(dst_fmt->palette->colors,
  6.2646 +                                     SDL_BITSPERPIXEL(format));
  6.2647 +                }
  6.2648 +            }
  6.2649 +            dst = SDL_ConvertSurface(surface, dst_fmt, 0);
  6.2650 +            if (dst) {
  6.2651 +                SDL_UpdateTexture(textureID, NULL, dst->pixels, dst->pitch);
  6.2652 +                SDL_FreeSurface(dst);
  6.2653 +            }
  6.2654 +            if (dst_fmt->palette) {
  6.2655 +                SDL_FreePalette(dst_fmt->palette);
  6.2656 +            }
  6.2657 +            SDL_FreeFormat(dst_fmt);
  6.2658 +        }
  6.2659 +        if (!dst) {
  6.2660 +            SDL_DestroyTexture(textureID);
  6.2661 +            return 0;
  6.2662 +        }
  6.2663 +    }
  6.2664  
  6.2665 -	if (SDL_ISPIXELFORMAT_INDEXED(format) && fmt->palette) {
  6.2666 -		SDL_SetTexturePalette(textureID, fmt->palette->colors, 0,
  6.2667 -				      fmt->palette->ncolors);
  6.2668 -	}
  6.2669 -	return textureID;
  6.2670 +    if (SDL_ISPIXELFORMAT_INDEXED(format) && fmt->palette) {
  6.2671 +        SDL_SetTexturePalette(textureID, fmt->palette->colors, 0,
  6.2672 +                              fmt->palette->ncolors);
  6.2673 +    }
  6.2674 +    return textureID;
  6.2675  }
  6.2676  
  6.2677  static __inline__ SDL_Texture *
  6.2678  SDL_GetTextureFromID(SDL_TextureID textureID)
  6.2679  {
  6.2680 -	int             hash;
  6.2681 -	SDL_Texture    *texture;
  6.2682 +    int hash;
  6.2683 +    SDL_Texture *texture;
  6.2684  
  6.2685 -	if (!_this) {
  6.2686 -		return NULL;
  6.2687 -	}
  6.2688 -	hash = (textureID % SDL_arraysize(SDL_CurrentDisplay.textures));
  6.2689 -	for (texture = SDL_CurrentDisplay.textures[hash]; texture;
  6.2690 -	     texture = texture->next) {
  6.2691 -		if (texture->id == textureID) {
  6.2692 -			return texture;
  6.2693 -		}
  6.2694 -	}
  6.2695 -	return NULL;
  6.2696 +    if (!_this) {
  6.2697 +        return NULL;
  6.2698 +    }
  6.2699 +    hash = (textureID % SDL_arraysize(SDL_CurrentDisplay.textures));
  6.2700 +    for (texture = SDL_CurrentDisplay.textures[hash]; texture;
  6.2701 +         texture = texture->next) {
  6.2702 +        if (texture->id == textureID) {
  6.2703 +            return texture;
  6.2704 +        }
  6.2705 +    }
  6.2706 +    return NULL;
  6.2707  }
  6.2708  
  6.2709  int
  6.2710  SDL_QueryTexture(SDL_TextureID textureID, Uint32 * format, int *access,
  6.2711 -		 int *w, int *h)
  6.2712 +                 int *w, int *h)
  6.2713  {
  6.2714 -	SDL_Texture    *texture = SDL_GetTextureFromID(textureID);
  6.2715 +    SDL_Texture *texture = SDL_GetTextureFromID(textureID);
  6.2716  
  6.2717 -	if (!texture) {
  6.2718 -		return -1;
  6.2719 -	}
  6.2720 -	if (format) {
  6.2721 -		*format = texture->format;
  6.2722 -	}
  6.2723 -	if (access) {
  6.2724 -		*access = texture->access;
  6.2725 -	}
  6.2726 -	if (w) {
  6.2727 -		*w = texture->w;
  6.2728 -	}
  6.2729 -	if (h) {
  6.2730 -		*h = texture->h;
  6.2731 -	}
  6.2732 -	return 0;
  6.2733 +    if (!texture) {
  6.2734 +        return -1;
  6.2735 +    }
  6.2736 +    if (format) {
  6.2737 +        *format = texture->format;
  6.2738 +    }
  6.2739 +    if (access) {
  6.2740 +        *access = texture->access;
  6.2741 +    }
  6.2742 +    if (w) {
  6.2743 +        *w = texture->w;
  6.2744 +    }
  6.2745 +    if (h) {
  6.2746 +        *h = texture->h;
  6.2747 +    }
  6.2748 +    return 0;
  6.2749  }
  6.2750  
  6.2751  int
  6.2752  SDL_QueryTexturePixels(SDL_TextureID textureID, void **pixels, int *pitch)
  6.2753  {
  6.2754 -	SDL_Texture    *texture = SDL_GetTextureFromID(textureID);
  6.2755 -	SDL_Renderer   *renderer;
  6.2756 +    SDL_Texture *texture = SDL_GetTextureFromID(textureID);
  6.2757 +    SDL_Renderer *renderer;
  6.2758  
  6.2759 -	if (!texture) {
  6.2760 -		return -1;
  6.2761 -	}
  6.2762 -	renderer = texture->renderer;
  6.2763 -	if (!renderer->QueryTexturePixels) {
  6.2764 -		return -1;
  6.2765 -	}
  6.2766 -	return renderer->QueryTexturePixels(renderer, texture, pixels, pitch);
  6.2767 +    if (!texture) {
  6.2768 +        return -1;
  6.2769 +    }
  6.2770 +    renderer = texture->renderer;
  6.2771 +    if (!renderer->QueryTexturePixels) {
  6.2772 +        return -1;
  6.2773 +    }
  6.2774 +    return renderer->QueryTexturePixels(renderer, texture, pixels, pitch);
  6.2775  }
  6.2776  
  6.2777  int
  6.2778  SDL_SetTexturePalette(SDL_TextureID textureID, const SDL_Color * colors,
  6.2779 -		      int firstcolor, int ncolors)
  6.2780 +                      int firstcolor, int ncolors)
  6.2781  {
  6.2782 -	SDL_Texture    *texture = SDL_GetTextureFromID(textureID);
  6.2783 -	SDL_Renderer   *renderer;
  6.2784 +    SDL_Texture *texture = SDL_GetTextureFromID(textureID);
  6.2785 +    SDL_Renderer *renderer;
  6.2786  
  6.2787 -	if (!texture) {
  6.2788 -		return -1;
  6.2789 -	}
  6.2790 -	renderer = texture->renderer;
  6.2791 -	if (!renderer->SetTexturePalette) {
  6.2792 -		return -1;
  6.2793 -	}
  6.2794 -	return renderer->SetTexturePalette(renderer, texture, colors, firstcolor,
  6.2795 -					   ncolors);
  6.2796 +    if (!texture) {
  6.2797 +        return -1;
  6.2798 +    }
  6.2799 +    renderer = texture->renderer;
  6.2800 +    if (!renderer->SetTexturePalette) {
  6.2801 +        return -1;
  6.2802 +    }
  6.2803 +    return renderer->SetTexturePalette(renderer, texture, colors, firstcolor,
  6.2804 +                                       ncolors);
  6.2805  }
  6.2806  
  6.2807  int
  6.2808  SDL_GetTexturePalette(SDL_TextureID textureID, SDL_Color * colors,
  6.2809 -		      int firstcolor, int ncolors)
  6.2810 +                      int firstcolor, int ncolors)
  6.2811  {
  6.2812 -	SDL_Texture    *texture = SDL_GetTextureFromID(textureID);
  6.2813 -	SDL_Renderer   *renderer;
  6.2814 +    SDL_Texture *texture = SDL_GetTextureFromID(textureID);
  6.2815 +    SDL_Renderer *renderer;
  6.2816  
  6.2817 -	if (!texture) {
  6.2818 -		return -1;
  6.2819 -	}
  6.2820 -	renderer = texture->renderer;
  6.2821 -	if (!renderer->GetTexturePalette) {
  6.2822 -		return -1;
  6.2823 -	}
  6.2824 -	return renderer->GetTexturePalette(renderer, texture, colors, firstcolor,
  6.2825 -					   ncolors);
  6.2826 +    if (!texture) {
  6.2827 +        return -1;
  6.2828 +    }
  6.2829 +    renderer = texture->renderer;
  6.2830 +    if (!renderer->GetTexturePalette) {
  6.2831 +        return -1;
  6.2832 +    }
  6.2833 +    return renderer->GetTexturePalette(renderer, texture, colors, firstcolor,
  6.2834 +                                       ncolors);
  6.2835  }
  6.2836  
  6.2837  int
  6.2838  SDL_SetTextureColorMod(SDL_TextureID textureID, Uint8 r, Uint8 g, Uint8 b)
  6.2839  {
  6.2840 -	SDL_Texture    *texture = SDL_GetTextureFromID(textureID);
  6.2841 -	SDL_Renderer   *renderer;
  6.2842 +    SDL_Texture *texture = SDL_GetTextureFromID(textureID);
  6.2843 +    SDL_Renderer *renderer;
  6.2844  
  6.2845 -	if (!texture) {
  6.2846 -		return -1;
  6.2847 -	}
  6.2848 -	renderer = texture->renderer;
  6.2849 -	if (!renderer->SetTextureColorMod) {
  6.2850 -		return -1;
  6.2851 -	}
  6.2852 -	if (r < 255 || g < 255 || b < 255) {
  6.2853 -		texture->modMode |= SDL_TEXTUREMODULATE_COLOR;
  6.2854 -	} else {
  6.2855 -		texture->modMode &= ~SDL_TEXTUREMODULATE_COLOR;
  6.2856 -	}
  6.2857 -	texture->r = r;
  6.2858 -	texture->g = g;
  6.2859 -	texture->b = b;
  6.2860 -	return renderer->SetTextureColorMod(renderer, texture);
  6.2861 +    if (!texture) {
  6.2862 +        return -1;
  6.2863 +    }
  6.2864 +    renderer = texture->renderer;
  6.2865 +    if (!renderer->SetTextureColorMod) {
  6.2866 +        return -1;
  6.2867 +    }
  6.2868 +    if (r < 255 || g < 255 || b < 255) {
  6.2869 +        texture->modMode |= SDL_TEXTUREMODULATE_COLOR;
  6.2870 +    } else {
  6.2871 +        texture->modMode &= ~SDL_TEXTUREMODULATE_COLOR;
  6.2872 +    }
  6.2873 +    texture->r = r;
  6.2874 +    texture->g = g;
  6.2875 +    texture->b = b;
  6.2876 +    return renderer->SetTextureColorMod(renderer, texture);
  6.2877  }
  6.2878  
  6.2879  int
  6.2880  SDL_GetTextureColorMod(SDL_TextureID textureID, Uint8 * r, Uint8 * g,
  6.2881 -		       Uint8 * b)
  6.2882 +                       Uint8 * b)
  6.2883  {
  6.2884 -	SDL_Texture    *texture = SDL_GetTextureFromID(textureID);
  6.2885 -	SDL_Renderer   *renderer;
  6.2886 +    SDL_Texture *texture = SDL_GetTextureFromID(textureID);
  6.2887 +    SDL_Renderer *renderer;
  6.2888  
  6.2889 -	if (!texture) {
  6.2890 -		return -1;
  6.2891 -	}
  6.2892 -	renderer = texture->renderer;
  6.2893 -	if (r) {
  6.2894 -		*r = texture->r;
  6.2895 -	}
  6.2896 -	if (g) {
  6.2897 -		*g = texture->g;
  6.2898 -	}
  6.2899 -	if (b) {
  6.2900 -		*b = texture->b;
  6.2901 -	}
  6.2902 -	return 0;
  6.2903 +    if (!texture) {
  6.2904 +        return -1;
  6.2905 +    }
  6.2906 +    renderer = texture->renderer;
  6.2907 +    if (r) {
  6.2908 +        *r = texture->r;
  6.2909 +    }
  6.2910 +    if (g) {
  6.2911 +        *g = texture->g;
  6.2912 +    }
  6.2913 +    if (b) {
  6.2914 +        *b = texture->b;
  6.2915 +    }
  6.2916 +    return 0;
  6.2917  }
  6.2918  
  6.2919  int
  6.2920  SDL_SetTextureAlphaMod(SDL_TextureID textureID, Uint8 alpha)
  6.2921  {
  6.2922 -	SDL_Texture    *texture = SDL_GetTextureFromID(textureID);
  6.2923 -	SDL_Renderer   *renderer;
  6.2924 +    SDL_Texture *texture = SDL_GetTextureFromID(textureID);
  6.2925 +    SDL_Renderer *renderer;
  6.2926  
  6.2927 -	if (!texture) {
  6.2928 -		return -1;
  6.2929 -	}
  6.2930 -	renderer = texture->renderer;
  6.2931 -	if (!renderer->SetTextureAlphaMod) {
  6.2932 -		return -1;
  6.2933 -	}
  6.2934 -	if (alpha < 255) {
  6.2935 -		texture->modMode |= SDL_TEXTUREMODULATE_ALPHA;
  6.2936 -	} else {
  6.2937 -		texture->modMode &= ~SDL_TEXTUREMODULATE_ALPHA;
  6.2938 -	}
  6.2939 -	texture->a = alpha;
  6.2940 -	return renderer->SetTextureAlphaMod(renderer, texture);
  6.2941 +    if (!texture) {
  6.2942 +        return -1;
  6.2943 +    }
  6.2944 +    renderer = texture->renderer;
  6.2945 +    if (!renderer->SetTextureAlphaMod) {
  6.2946 +        return -1;
  6.2947 +    }
  6.2948 +    if (alpha < 255) {
  6.2949 +        texture->modMode |= SDL_TEXTUREMODULATE_ALPHA;
  6.2950 +    } else {
  6.2951 +        texture->modMode &= ~SDL_TEXTUREMODULATE_ALPHA;
  6.2952 +    }
  6.2953 +    texture->a = alpha;
  6.2954 +    return renderer->SetTextureAlphaMod(renderer, texture);
  6.2955  }
  6.2956  
  6.2957  int
  6.2958  SDL_GetTextureAlphaMod(SDL_TextureID textureID, Uint8 * alpha)
  6.2959  {
  6.2960 -	SDL_Texture    *texture = SDL_GetTextureFromID(textureID);
  6.2961 +    SDL_Texture *texture = SDL_GetTextureFromID(textureID);
  6.2962  
  6.2963 -	if (!texture) {
  6.2964 -		return -1;
  6.2965 -	}
  6.2966 -	if (alpha) {
  6.2967 -		*alpha = texture->a;
  6.2968 -	}
  6.2969 -	return 0;
  6.2970 +    if (!texture) {
  6.2971 +        return -1;
  6.2972 +    }
  6.2973 +    if (alpha) {
  6.2974 +        *alpha = texture->a;
  6.2975 +    }
  6.2976 +    return 0;
  6.2977  }
  6.2978  
  6.2979  int
  6.2980  SDL_SetTextureBlendMode(SDL_TextureID textureID, int blendMode)
  6.2981  {
  6.2982 -	SDL_Texture    *texture = SDL_GetTextureFromID(textureID);
  6.2983 -	SDL_Renderer   *renderer;
  6.2984 +    SDL_Texture *texture = SDL_GetTextureFromID(textureID);
  6.2985 +    SDL_Renderer *renderer;
  6.2986  
  6.2987 -	if (!texture) {
  6.2988 -		return -1;
  6.2989 -	}
  6.2990 -	renderer = texture->renderer;
  6.2991 -	if (!renderer->SetTextureBlendMode) {
  6.2992 -		return -1;
  6.2993 -	}
  6.2994 -	texture->blendMode = blendMode;
  6.2995 -	return renderer->SetTextureBlendMode(renderer, texture);
  6.2996 +    if (!texture) {
  6.2997 +        return -1;
  6.2998 +    }
  6.2999 +    renderer = texture->renderer;
  6.3000 +    if (!renderer->SetTextureBlendMode) {
  6.3001 +        return -1;
  6.3002 +    }
  6.3003 +    texture->blendMode = blendMode;
  6.3004 +    return renderer->SetTextureBlendMode(renderer, texture);
  6.3005  }
  6.3006  
  6.3007  int
  6.3008  SDL_GetTextureBlendMode(SDL_TextureID textureID, int *blendMode)
  6.3009  {
  6.3010 -	SDL_Texture    *texture = SDL_GetTextureFromID(textureID);
  6.3011 +    SDL_Texture *texture = SDL_GetTextureFromID(textureID);
  6.3012  
  6.3013 -	if (!texture) {
  6.3014 -		return -1;
  6.3015 -	}
  6.3016 -	if (blendMode) {
  6.3017 -		*blendMode = texture->blendMode;
  6.3018 -	}
  6.3019 -	return 0;
  6.3020 +    if (!texture) {
  6.3021 +        return -1;
  6.3022 +    }
  6.3023 +    if (blendMode) {
  6.3024 +        *blendMode = texture->blendMode;
  6.3025 +    }
  6.3026 +    return 0;
  6.3027  }
  6.3028  
  6.3029  int
  6.3030  SDL_SetTextureScaleMode(SDL_TextureID textureID, int scaleMode)
  6.3031  {
  6.3032 -	SDL_Texture    *texture = SDL_GetTextureFromID(textureID);
  6.3033 -	SDL_Renderer   *renderer;
  6.3034 +    SDL_Texture *texture = SDL_GetTextureFromID(textureID);
  6.3035 +    SDL_Renderer *renderer;
  6.3036  
  6.3037 -	if (!texture) {
  6.3038 -		return -1;
  6.3039 -	}
  6.3040 -	renderer = texture->renderer;
  6.3041 -	if (!renderer->SetTextureScaleMode) {
  6.3042 -		return -1;
  6.3043 -	}
  6.3044 -	texture->scaleMode = scaleMode;
  6.3045 -	return renderer->SetTextureScaleMode(renderer, texture);
  6.3046 +    if (!texture) {
  6.3047 +        return -1;
  6.3048 +    }
  6.3049 +    renderer = texture->renderer;
  6.3050 +    if (!renderer->SetTextureScaleMode) {
  6.3051 +        return -1;
  6.3052 +    }
  6.3053 +    texture->scaleMode = scaleMode;
  6.3054 +    return renderer->SetTextureScaleMode(renderer, texture);
  6.3055  }
  6.3056  
  6.3057  int
  6.3058  SDL_GetTextureScaleMode(SDL_TextureID textureID, int *scaleMode)
  6.3059  {
  6.3060 -	SDL_Texture    *texture = SDL_GetTextureFromID(textureID);
  6.3061 +    SDL_Texture *texture = SDL_GetTextureFromID(textureID);
  6.3062  
  6.3063 -	if (!texture) {
  6.3064 -		return -1;
  6.3065 -	}
  6.3066 -	if (scaleMode) {
  6.3067 -		*scaleMode = texture->scaleMode;
  6.3068 -	}
  6.3069 -	return 0;
  6.3070 +    if (!texture) {
  6.3071 +        return -1;
  6.3072 +    }
  6.3073 +    if (scaleMode) {
  6.3074 +        *scaleMode = texture->scaleMode;
  6.3075 +    }
  6.3076 +    return 0;
  6.3077  }
  6.3078  
  6.3079  int
  6.3080  SDL_UpdateTexture(SDL_TextureID textureID, const SDL_Rect * rect,
  6.3081 -		  const void *pixels, int pitch)
  6.3082 +                  const void *pixels, int pitch)
  6.3083  {
  6.3084 -	SDL_Texture    *texture = SDL_GetTextureFromID(textureID);
  6.3085 -	SDL_Renderer   *renderer;
  6.3086 -	SDL_Rect        full_rect;
  6.3087 +    SDL_Texture *texture = SDL_GetTextureFromID(textureID);
  6.3088 +    SDL_Renderer *renderer;
  6.3089 +    SDL_Rect full_rect;
  6.3090  
  6.3091 -	if (!texture) {
  6.3092 -		return -1;
  6.3093 -	}
  6.3094 -	renderer = texture->renderer;
  6.3095 -	if (!renderer->UpdateTexture) {
  6.3096 -		return -1;
  6.3097 -	}
  6.3098 -	if (!rect) {
  6.3099 -		full_rect.x = 0;
  6.3100 -		full_rect.y = 0;
  6.3101 -		full_rect.w = texture->w;
  6.3102 -		full_rect.h = texture->h;
  6.3103 -		rect = &full_rect;
  6.3104 -	}
  6.3105 -	return renderer->UpdateTexture(renderer, texture, rect, pixels, pitch);
  6.3106 +    if (!texture) {
  6.3107 +        return -1;
  6.3108 +    }
  6.3109 +    renderer = texture->renderer;
  6.3110 +    if (!renderer->UpdateTexture) {
  6.3111 +        return -1;
  6.3112 +    }
  6.3113 +    if (!rect) {
  6.3114 +        full_rect.x = 0;
  6.3115 +        full_rect.y = 0;
  6.3116 +        full_rect.w = texture->w;
  6.3117 +        full_rect.h = texture->h;
  6.3118 +        rect = &full_rect;
  6.3119 +    }
  6.3120 +    return renderer->UpdateTexture(renderer, texture, rect, pixels, pitch);
  6.3121  }
  6.3122  
  6.3123  int
  6.3124  SDL_LockTexture(SDL_TextureID textureID, const SDL_Rect * rect, int markDirty,
  6.3125 -		void **pixels, int *pitch)
  6.3126 +                void **pixels, int *pitch)
  6.3127  {
  6.3128 -	SDL_Texture    *texture = SDL_GetTextureFromID(textureID);
  6.3129 -	SDL_Renderer   *renderer;
  6.3130 -	SDL_Rect        full_rect;
  6.3131 +    SDL_Texture *texture = SDL_GetTextureFromID(textureID);
  6.3132 +    SDL_Renderer *renderer;
  6.3133 +    SDL_Rect full_rect;
  6.3134  
  6.3135 -	if (!texture) {
  6.3136 -		return -1;
  6.3137 -	}
  6.3138 -	if (texture->access != SDL_TEXTUREACCESS_STREAMING) {
  6.3139 -		SDL_SetError("SDL_LockTexture(): texture must be streaming");
  6.3140 -		return -1;
  6.3141 -	}
  6.3142 -	renderer = texture->renderer;
  6.3143 -	if (!renderer->LockTexture) {
  6.3144 -		return -1;
  6.3145 -	}
  6.3146 -	if (!rect) {
  6.3147 -		full_rect.x = 0;
  6.3148 -		full_rect.y = 0;
  6.3149 -		full_rect.w = texture->w;
  6.3150 -		full_rect.h = texture->h;
  6.3151 -		rect = &full_rect;
  6.3152 -	}
  6.3153 -	return renderer->LockTexture(renderer, texture, rect, markDirty, pixels,
  6.3154 -				     pitch);
  6.3155 +    if (!texture) {
  6.3156 +        return -1;
  6.3157 +    }
  6.3158 +    if (texture->access != SDL_TEXTUREACCESS_STREAMING) {
  6.3159 +        SDL_SetError("SDL_LockTexture(): texture must be streaming");
  6.3160 +        return -1;
  6.3161 +    }
  6.3162 +    renderer = texture->renderer;
  6.3163 +    if (!renderer->LockTexture) {
  6.3164 +        return -1;
  6.3165 +    }
  6.3166 +    if (!rect) {
  6.3167 +        full_rect.x = 0;
  6.3168 +        full_rect.y = 0;
  6.3169 +        full_rect.w = texture->w;
  6.3170 +        full_rect.h = texture->h;
  6.3171 +        rect = &full_rect;
  6.3172 +    }
  6.3173 +    return renderer->LockTexture(renderer, texture, rect, markDirty, pixels,
  6.3174 +                                 pitch);
  6.3175  }
  6.3176  
  6.3177  void
  6.3178  SDL_UnlockTexture(SDL_TextureID textureID)
  6.3179  {
  6.3180 -	SDL_Texture    *texture = SDL_GetTextureFromID(textureID);
  6.3181 -	SDL_Renderer   *renderer;
  6.3182 +    SDL_Texture *texture = SDL_GetTextureFromID(textureID);
  6.3183 +    SDL_Renderer *renderer;
  6.3184  
  6.3185 -	if (!texture) {
  6.3186 -		return;
  6.3187 -	}
  6.3188 -	if (texture->access != SDL_TEXTUREACCESS_STREAMING) {
  6.3189 -		return;
  6.3190 -	}
  6.3191 -	renderer = texture->renderer;
  6.3192 -	if (!renderer->UnlockTexture) {
  6.3193 -		return;
  6.3194 -	}
  6.3195 -	renderer->UnlockTexture(renderer, texture);
  6.3196 +    if (!texture) {
  6.3197 +        return;
  6.3198 +    }
  6.3199 +    if (texture->access != SDL_TEXTUREACCESS_STREAMING) {
  6.3200 +        return;
  6.3201 +    }
  6.3202 +    renderer = texture->renderer;
  6.3203 +    if (!renderer->UnlockTexture) {
  6.3204 +        return;
  6.3205 +    }
  6.3206 +    renderer->UnlockTexture(renderer, texture);
  6.3207  }
  6.3208  
  6.3209  void
  6.3210  SDL_DirtyTexture(SDL_TextureID textureID, int numrects,
  6.3211 -		 const SDL_Rect * rects)
  6.3212 +                 const SDL_Rect * rects)
  6.3213  {
  6.3214 -	SDL_Texture    *texture = SDL_GetTextureFromID(textureID);
  6.3215 -	SDL_Renderer   *renderer;
  6.3216 +    SDL_Texture *texture = SDL_GetTextureFromID(textureID);
  6.3217 +    SDL_Renderer *renderer;
  6.3218  
  6.3219 -	if (!texture) {
  6.3220 -		return;
  6.3221 -	}
  6.3222 -	if (texture->access != SDL_TEXTUREACCESS_STREAMING) {
  6.3223 -		return;
  6.3224 -	}
  6.3225 -	renderer = texture->renderer;
  6.3226 -	if (!renderer->DirtyTexture) {
  6.3227 -		return;
  6.3228 -	}
  6.3229 -	renderer->DirtyTexture(renderer, texture, numrects, rects);
  6.3230 +    if (!texture) {
  6.3231 +        return;
  6.3232 +    }
  6.3233 +    if (texture->access != SDL_TEXTUREACCESS_STREAMING) {
  6.3234 +        return;
  6.3235 +    }
  6.3236 +    renderer = texture->renderer;
  6.3237 +    if (!renderer->DirtyTexture) {
  6.3238 +        return;
  6.3239 +    }
  6.3240 +    renderer->DirtyTexture(renderer, texture, numrects, rects);
  6.3241  }
  6.3242  
  6.3243  int
  6.3244  SDL_RenderFill(Uint8 r, Uint8 g, Uint8 b, Uint8 a, const SDL_Rect * rect)
  6.3245  {
  6.3246 -	SDL_Renderer   *renderer;
  6.3247 -	SDL_Window     *window;
  6.3248 -	SDL_Rect        real_rect;
  6.3249 +    SDL_Renderer *renderer;
  6.3250 +    SDL_Window *window;
  6.3251 +    SDL_Rect real_rect;
  6.3252  
  6.3253 -	if (!_this) {
  6.3254 -		SDL_UninitializedVideo();
  6.3255 -		return -1;
  6.3256 -	}
  6.3257 -	renderer = SDL_CurrentDisplay.current_renderer;
  6.3258 -	if (!renderer || !renderer->RenderFill) {
  6.3259 -		return -1;
  6.3260 -	}
  6.3261 -	window = SDL_GetWindowFromID(renderer->window);
  6.3262 -	real_rect.x = 0;
  6.3263 -	real_rect.y = 0;
  6.3264 -	real_rect.w = window->w;
  6.3265 -	real_rect.h = window->h;
  6.3266 -	if (rect) {
  6.3267 -		if (!SDL_IntersectRect(rect, &real_rect, &real_rect)) {
  6.3268 -			return 0;
  6.3269 -		}
  6.3270 -	}
  6.3271 -	return renderer->RenderFill(renderer, r, g, b, a, &real_rect);
  6.3272 +    if (!_this) {
  6.3273 +        SDL_UninitializedVideo();
  6.3274 +        return -1;
  6.3275 +    }
  6.3276 +    renderer = SDL_CurrentDisplay.current_renderer;
  6.3277 +    if (!renderer || !renderer->RenderFill) {
  6.3278 +        return -1;
  6.3279 +    }
  6.3280 +    window = SDL_GetWindowFromID(renderer->window);
  6.3281 +    real_rect.x = 0;
  6.3282 +    real_rect.y = 0;
  6.3283 +    real_rect.w = window->w;
  6.3284 +    real_rect.h = window->h;
  6.3285 +    if (rect) {
  6.3286 +        if (!SDL_IntersectRect(rect, &real_rect, &real_rect)) {
  6.3287 +            return 0;
  6.3288 +        }
  6.3289 +    }
  6.3290 +    return renderer->RenderFill(renderer, r, g, b, a, &real_rect);
  6.3291  }
  6.3292  
  6.3293  int
  6.3294  SDL_RenderCopy(SDL_TextureID textureID, const SDL_Rect * srcrect,
  6.3295 -	       const SDL_Rect * dstrect)
  6.3296 +               const SDL_Rect * dstrect)
  6.3297  {
  6.3298 -	SDL_Texture    *texture = SDL_GetTextureFromID(textureID);
  6.3299 -	SDL_Renderer   *renderer;
  6.3300 -	SDL_Window     *window;
  6.3301 -	SDL_Rect        real_srcrect;
  6.3302 -	SDL_Rect        real_dstrect;
  6.3303 +    SDL_Texture *texture = SDL_GetTextureFromID(textureID);
  6.3304 +    SDL_Renderer *renderer;
  6.3305 +    SDL_Window *window;
  6.3306 +    SDL_Rect real_srcrect;
  6.3307 +    SDL_Rect real_dstrect;
  6.3308  
  6.3309 -	if (!texture || texture->renderer != SDL_CurrentDisplay.current_renderer) {
  6.3310 -		return -1;
  6.3311 -	}
  6.3312 -	renderer = SDL_CurrentDisplay.current_renderer;
  6.3313 -	if (!renderer || !renderer->RenderCopy) {
  6.3314 -		return -1;
  6.3315 -	}
  6.3316 -	window = SDL_GetWindowFromID(renderer->window);
  6.3317 -	if (srcrect) {
  6.3318 -		real_srcrect = *srcrect;
  6.3319 -	} else {
  6.3320 -		real_srcrect.x = 0;
  6.3321 -		real_srcrect.y = 0;
  6.3322 -		real_srcrect.w = texture->w;
  6.3323 -		real_srcrect.h = texture->h;
  6.3324 -	}
  6.3325 -	if (dstrect) {
  6.3326 -		real_dstrect = *dstrect;
  6.3327 -	} else {
  6.3328 -		real_dstrect.x = 0;
  6.3329 -		real_dstrect.y = 0;
  6.3330 -		real_dstrect.w = window->w;
  6.3331 -		real_dstrect.h = window->h;
  6.3332 -	}
  6.3333 +    if (!texture || texture->renderer != SDL_CurrentDisplay.current_renderer) {
  6.3334 +        return -1;
  6.3335 +    }
  6.3336 +    renderer = SDL_CurrentDisplay.current_renderer;
  6.3337 +    if (!renderer || !renderer->RenderCopy) {
  6.3338 +        return -1;
  6.3339 +    }
  6.3340 +    window = SDL_GetWindowFromID(renderer->window);
  6.3341 +    if (srcrect) {
  6.3342 +        real_srcrect = *srcrect;
  6.3343 +    } else {
  6.3344 +        real_srcrect.x = 0;
  6.3345 +        real_srcrect.y = 0;
  6.3346 +        real_srcrect.w = texture->w;
  6.3347 +        real_srcrect.h = texture->h;
  6.3348 +    }
  6.3349 +    if (dstrect) {
  6.3350 +        real_dstrect = *dstrect;
  6.3351 +    } else {
  6.3352 +        real_dstrect.x = 0;
  6.3353 +        real_dstrect.y = 0;
  6.3354 +        real_dstrect.w = window->w;
  6.3355 +        real_dstrect.h = window->h;
  6.3356 +    }
  6.3357  
  6.3358 -	return renderer->RenderCopy(renderer, texture, &real_srcrect,
  6.3359 -				    &real_dstrect);
  6.3360 +    return renderer->RenderCopy(renderer, texture, &real_srcrect,
  6.3361 +                                &real_dstrect);
  6.3362  }
  6.3363  
  6.3364  void
  6.3365  SDL_RenderPresent(void)
  6.3366  {
  6.3367 -	SDL_Renderer   *renderer;
  6.3368 +    SDL_Renderer *renderer;
  6.3369  
  6.3370 -	if (!_this) {
  6.3371 -		SDL_UninitializedVideo();
  6.3372 -		return;
  6.3373 -	}
  6.3374 -	renderer = SDL_CurrentDisplay.current_renderer;
  6.3375 -	if (!renderer || !renderer->RenderPresent) {
  6.3376 -		return;
  6.3377 -	}
  6.3378 -	renderer->RenderPresent(renderer);
  6.3379 +    if (!_this) {
  6.3380 +        SDL_UninitializedVideo();
  6.3381 +        return;
  6.3382 +    }
  6.3383 +    renderer = SDL_CurrentDisplay.current_renderer;
  6.3384 +    if (!renderer || !renderer->RenderPresent) {
  6.3385 +        return;
  6.3386 +    }
  6.3387 +    renderer->RenderPresent(renderer);
  6.3388  }
  6.3389  
  6.3390  void
  6.3391  SDL_DestroyTexture(SDL_TextureID textureID)
  6.3392  {
  6.3393 -	int             hash;
  6.3394 -	SDL_Texture    *prev, *texture;
  6.3395 -	SDL_Renderer   *renderer;
  6.3396 +    int hash;
  6.3397 +    SDL_Texture *prev, *texture;
  6.3398 +    SDL_Renderer *renderer;
  6.3399  
  6.3400 -	if (!_this) {
  6.3401 -		SDL_UninitializedVideo();
  6.3402 -		return;
  6.3403 -	}
  6.3404 -	/* Look up the texture in the hash table */
  6.3405 -	hash = (textureID % SDL_arraysize(SDL_CurrentDisplay.textures));
  6.3406 -	prev = NULL;
  6.3407 -	for (texture = SDL_CurrentDisplay.textures[hash]; texture;
  6.3408 -	     prev = texture, texture = texture->next) {
  6.3409 -		if (texture->id == textureID) {
  6.3410 -			break;
  6.3411 -		}
  6.3412 -	}
  6.3413 -	if (!texture) {
  6.3414 -		return;
  6.3415 -	}
  6.3416 -	/* Unlink the texture from the list */
  6.3417 -	if (prev) {
  6.3418 -		prev->next = texture->next;
  6.3419 -	} else {
  6.3420 -		SDL_CurrentDisplay.textures[hash] = texture->next;
  6.3421 -	}
  6.3422 +    if (!_this) {
  6.3423 +        SDL_UninitializedVideo();
  6.3424 +        return;
  6.3425 +    }
  6.3426 +    /* Look up the texture in the hash table */
  6.3427 +    hash = (textureID % SDL_arraysize(SDL_CurrentDisplay.textures));
  6.3428 +    prev = NULL;
  6.3429 +    for (texture = SDL_CurrentDisplay.textures[hash]; texture;
  6.3430 +         prev = texture, texture = texture->next) {
  6.3431 +        if (texture->id == textureID) {
  6.3432 +            break;
  6.3433 +        }
  6.3434 +    }
  6.3435 +    if (!texture) {
  6.3436 +        return;
  6.3437 +    }
  6.3438 +    /* Unlink the texture from the list */
  6.3439 +    if (prev) {
  6.3440 +        prev->next = texture->next;
  6.3441 +    } else {
  6.3442 +        SDL_CurrentDisplay.textures[hash] = texture->next;
  6.3443 +    }
  6.3444  
  6.3445 -	/* Free the texture */
  6.3446 -	renderer = texture->renderer;
  6.3447 -	renderer->DestroyTexture(renderer, texture);
  6.3448 -	SDL_free(texture);
  6.3449 +    /* Free the texture */
  6.3450 +    renderer = texture->renderer;
  6.3451 +    renderer->DestroyTexture(renderer, texture);
  6.3452 +    SDL_free(texture);
  6.3453  }
  6.3454  
  6.3455  void
  6.3456  SDL_DestroyRenderer(SDL_WindowID windowID)
  6.3457  {
  6.3458 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.3459 -	SDL_Renderer   *renderer;
  6.3460 -	int             i;
  6.3461 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.3462 +    SDL_Renderer *renderer;
  6.3463 +    int i;
  6.3464  
  6.3465 -	if (!window) {
  6.3466 -		return;
  6.3467 -	}
  6.3468 -	renderer = window->renderer;
  6.3469 -	if (!renderer) {
  6.3470 -		return;
  6.3471 -	}
  6.3472 -	/* Free existing textures for this renderer */
  6.3473 -	for (i = 0; i < SDL_arraysize(SDL_CurrentDisplay.textures); ++i) {
  6.3474 -		SDL_Texture    *texture;
  6.3475 -		SDL_Texture    *prev = NULL;
  6.3476 -		SDL_Texture    *next;
  6.3477 -		for (texture = SDL_CurrentDisplay.textures[i]; texture;
  6.3478 -		     texture = next) {
  6.3479 -			next = texture->next;
  6.3480 -			if (texture->renderer == renderer) {
  6.3481 -				if (prev) {
  6.3482 -					prev->next = next;
  6.3483 -				} else {
  6.3484 -					SDL_CurrentDisplay.textures[i] = next;
  6.3485 -				}
  6.3486 -				renderer->DestroyTexture(renderer, texture);
  6.3487 -				SDL_free(texture);
  6.3488 -			} else {
  6.3489 -				prev = texture;
  6.3490 -			}
  6.3491 -		}
  6.3492 -	}
  6.3493 +    if (!window) {
  6.3494 +        return;
  6.3495 +    }
  6.3496 +    renderer = window->renderer;
  6.3497 +    if (!renderer) {
  6.3498 +        return;
  6.3499 +    }
  6.3500 +    /* Free existing textures for this renderer */
  6.3501 +    for (i = 0; i < SDL_arraysize(SDL_CurrentDisplay.textures); ++i) {
  6.3502 +        SDL_Texture *texture;
  6.3503 +        SDL_Texture *prev = NULL;
  6.3504 +        SDL_Texture *next;
  6.3505 +        for (texture = SDL_CurrentDisplay.textures[i]; texture;
  6.3506 +             texture = next) {
  6.3507 +            next = texture->next;
  6.3508 +            if (texture->renderer == renderer) {
  6.3509 +                if (prev) {
  6.3510 +                    prev->next = next;
  6.3511 +                } else {
  6.3512 +                    SDL_CurrentDisplay.textures[i] = next;
  6.3513 +                }
  6.3514 +                renderer->DestroyTexture(renderer, texture);
  6.3515 +                SDL_free(texture);
  6.3516 +            } else {
  6.3517 +                prev = texture;
  6.3518 +            }
  6.3519 +        }
  6.3520 +    }
  6.3521  
  6.3522 -	/* Free the renderer instance */
  6.3523 -	renderer->DestroyRenderer(renderer);
  6.3524 +    /* Free the renderer instance */
  6.3525 +    renderer->DestroyRenderer(renderer);
  6.3526  
  6.3527 -	/* Clear references */
  6.3528 -	window->renderer = NULL;
  6.3529 -	if (SDL_CurrentDisplay.current_renderer == renderer) {
  6.3530 -		SDL_CurrentDisplay.current_renderer = NULL;
  6.3531 -	}
  6.3532 +    /* Clear references */
  6.3533 +    window->renderer = NULL;
  6.3534 +    if (SDL_CurrentDisplay.current_renderer == renderer) {
  6.3535 +        SDL_CurrentDisplay.current_renderer = NULL;
  6.3536 +    }
  6.3537  }
  6.3538  
  6.3539  void
  6.3540  SDL_VideoQuit(void)
  6.3541  {
  6.3542 -	int             i, j;
  6.3543 +    int i, j;
  6.3544  
  6.3545 -	if (!_this) {
  6.3546 -		return;
  6.3547 -	}
  6.3548 -	/* Halt event processing before doing anything else */
  6.3549 -	SDL_StopEventLoop();
  6.3550 +    if (!_this) {
  6.3551 +        return;
  6.3552 +    }
  6.3553 +    /* Halt event processing before doing anything else */
  6.3554 +    SDL_StopEventLoop();
  6.3555  
  6.3556 -	/* Clean up the system video */
  6.3557 -	for (i = _this->num_displays; i--;) {
  6.3558 -		SDL_VideoDisplay *display = &_this->displays[i];
  6.3559 -		for (j = display->num_windows; j--;) {
  6.3560 -			SDL_DestroyWindow(display->windows[i].id);
  6.3561 -		}
  6.3562 -		if (display->windows) {
  6.3563 -			SDL_free(display->windows);
  6.3564 -			display->windows = NULL;
  6.3565 -		}
  6.3566 -		display->num_windows = 0;
  6.3567 -		if (display->render_drivers) {
  6.3568 -			SDL_free(display->render_drivers);
  6.3569 -			display->render_drivers = NULL;
  6.3570 -		}
  6.3571 -		display->num_render_drivers = 0;
  6.3572 -	}
  6.3573 -	_this->VideoQuit(_this);
  6.3574 +    /* Clean up the system video */
  6.3575 +    for (i = _this->num_displays; i--;) {
  6.3576 +        SDL_VideoDisplay *display = &_this->displays[i];
  6.3577 +        for (j = display->num_windows; j--;) {
  6.3578 +            SDL_DestroyWindow(display->windows[i].id);
  6.3579 +        }
  6.3580 +        if (display->windows) {
  6.3581 +            SDL_free(display->windows);
  6.3582 +            display->windows = NULL;
  6.3583 +        }
  6.3584 +        display->num_windows = 0;
  6.3585 +        if (display->render_drivers) {
  6.3586 +            SDL_free(display->render_drivers);
  6.3587 +            display->render_drivers = NULL;
  6.3588 +        }
  6.3589 +        display->num_render_drivers = 0;
  6.3590 +    }
  6.3591 +    _this->VideoQuit(_this);
  6.3592  
  6.3593 -	for (i = _this->num_displays; i--;) {
  6.3594 -		SDL_VideoDisplay *display = &_this->displays[i];
  6.3595 -		for (j = display->num_display_modes; j--;) {
  6.3596 -			if (display->display_modes[j].driverdata) {
  6.3597 -				SDL_free(display->display_modes[j].driverdata);
  6.3598 -				display->display_modes[j].driverdata = NULL;
  6.3599 -			}
  6.3600 -		}
  6.3601 -		if (display->display_modes) {
  6.3602 -			SDL_free(display->display_modes);
  6.3603 -			display->display_modes = NULL;
  6.3604 -		}
  6.3605 -		if (display->desktop_mode.driverdata) {
  6.3606 -			SDL_free(display->desktop_mode.driverdata);
  6.3607 -			display->desktop_mode.driverdata = NULL;
  6.3608 -		}
  6.3609 -		if (display->palette) {
  6.3610 -			SDL_FreePalette(display->palette);
  6.3611 -			display->palette = NULL;
  6.3612 -		}
  6.3613 -		if (display->gamma) {
  6.3614 -			SDL_free(display->gamma);
  6.3615 -			display->gamma = NULL;
  6.3616 -		}
  6.3617 -		if (display->driverdata) {
  6.3618 -			SDL_free(display->driverdata);
  6.3619 -			display->driverdata = NULL;
  6.3620 -		}
  6.3621 -	}
  6.3622 -	if (_this->displays) {
  6.3623 -		SDL_free(_this->displays);
  6.3624 -		_this->displays = NULL;
  6.3625 -	}
  6.3626 -	_this->free(_this);
  6.3627 -	_this = NULL;
  6.3628 +    for (i = _this->num_displays; i--;) {
  6.3629 +        SDL_VideoDisplay *display = &_this->displays[i];
  6.3630 +        for (j = display->num_display_modes; j--;) {
  6.3631 +            if (display->display_modes[j].driverdata) {
  6.3632 +                SDL_free(display->display_modes[j].driverdata);
  6.3633 +                display->display_modes[j].driverdata = NULL;
  6.3634 +            }
  6.3635 +        }
  6.3636 +        if (display->display_modes) {
  6.3637 +            SDL_free(display->display_modes);
  6.3638 +            display->display_modes = NULL;
  6.3639 +        }
  6.3640 +        if (display->desktop_mode.driverdata) {
  6.3641 +            SDL_free(display->desktop_mode.driverdata);
  6.3642 +            display->desktop_mode.driverdata = NULL;
  6.3643 +        }
  6.3644 +        if (display->palette) {
  6.3645 +            SDL_FreePalette(display->palette);
  6.3646 +            display->palette = NULL;
  6.3647 +        }
  6.3648 +        if (display->gamma) {
  6.3649 +            SDL_free(display->gamma);
  6.3650 +            display->gamma = NULL;
  6.3651 +        }
  6.3652 +        if (display->driverdata) {
  6.3653 +            SDL_free(display->driverdata);
  6.3654 +            display->driverdata = NULL;
  6.3655 +        }
  6.3656 +    }
  6.3657 +    if (_this->displays) {
  6.3658 +        SDL_free(_this->displays);
  6.3659 +        _this->displays = NULL;
  6.3660 +    }
  6.3661 +    _this->free(_this);
  6.3662 +    _this = NULL;
  6.3663  }
  6.3664  
  6.3665  int
  6.3666  SDL_GL_LoadLibrary(const char *path)
  6.3667  {
  6.3668 -	int             retval;
  6.3669 +    int retval;
  6.3670  
  6.3671 -	if (!_this) {
  6.3672 -		SDL_UninitializedVideo();
  6.3673 -		return -1;
  6.3674 -	}
  6.3675 -	if (_this->GL_LoadLibrary) {
  6.3676 -		retval = _this->GL_LoadLibrary(_this, path);
  6.3677 -	} else {
  6.3678 -		SDL_SetError("No dynamic GL support in video driver");
  6.3679 -		retval = -1;
  6.3680 -	}
  6.3681 -	return (retval);
  6.3682 +    if (!_this) {
  6.3683 +        SDL_UninitializedVideo();
  6.3684 +        return -1;
  6.3685 +    }
  6.3686 +    if (_this->GL_LoadLibrary) {
  6.3687 +        retval = _this->GL_LoadLibrary(_this, path);
  6.3688 +    } else {
  6.3689 +        SDL_SetError("No dynamic GL support in video driver");
  6.3690 +        retval = -1;
  6.3691 +    }
  6.3692 +    return (retval);
  6.3693  }
  6.3694  
  6.3695 -void           *
  6.3696 +void *
  6.3697  SDL_GL_GetProcAddress(const char *proc)
  6.3698  {
  6.3699 -	void           *func;
  6.3700 +    void *func;
  6.3701  
  6.3702 -	if (!_this) {
  6.3703 -		SDL_UninitializedVideo();
  6.3704 -		return NULL;
  6.3705 -	}
  6.3706 -	func = NULL;
  6.3707 -	if (_this->GL_GetProcAddress) {
  6.3708 -		if (_this->gl_config.driver_loaded) {
  6.3709 -			func = _this->GL_GetProcAddress(_this, proc);
  6.3710 -		} else {
  6.3711 -			SDL_SetError("No GL driver has been loaded");
  6.3712 -		}
  6.3713 -	} else {
  6.3714 -		SDL_SetError("No dynamic GL support in video driver");
  6.3715 -	}
  6.3716 -	return func;
  6.3717 +    if (!_this) {
  6.3718 +        SDL_UninitializedVideo();
  6.3719 +        return NULL;
  6.3720 +    }
  6.3721 +    func = NULL;
  6.3722 +    if (_this->GL_GetProcAddress) {
  6.3723 +        if (_this->gl_config.driver_loaded) {
  6.3724 +            func = _this->GL_GetProcAddress(_this, proc);
  6.3725 +        } else {
  6.3726 +            SDL_SetError("No GL driver has been loaded");
  6.3727 +        }
  6.3728 +    } else {
  6.3729 +        SDL_SetError("No dynamic GL support in video driver");
  6.3730 +    }
  6.3731 +    return func;
  6.3732  }
  6.3733  
  6.3734  SDL_bool
  6.3735  SDL_GL_ExtensionSupported(const char *extension)
  6.3736  {
  6.3737  #if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES
  6.3738 -	const GLubyte  *(APIENTRY * glGetStringFunc) (GLenum);
  6.3739 -	const char     *extensions;
  6.3740 -	const char     *start;
  6.3741 -	const char     *where, *terminator;
  6.3742 +    const GLubyte *(APIENTRY * glGetStringFunc) (GLenum);
  6.3743 +    const char *extensions;
  6.3744 +    const char *start;
  6.3745 +    const char *where, *terminator;
  6.3746  
  6.3747 -	/* Extension names should not have spaces. */
  6.3748 -	where = SDL_strchr(extension, ' ');
  6.3749 -	if (where || *extension == '\0') {
  6.3750 -		return SDL_FALSE;
  6.3751 -	}
  6.3752 -	/* See if there's an environment variable override */
  6.3753 -	start = SDL_getenv(extension);
  6.3754 -	if (start && *start == '0') {
  6.3755 -		return SDL_FALSE;
  6.3756 -	}
  6.3757 -	/* Lookup the available extensions */
  6.3758 -	glGetStringFunc = SDL_GL_GetProcAddress("glGetString");
  6.3759 -	if (glGetStringFunc) {
  6.3760 -		extensions = (const char *) glGetStringFunc(GL_EXTENSIONS);
  6.3761 -	} else {
  6.3762 -		extensions = NULL;
  6.3763 -	}
  6.3764 -	if (!extensions) {
  6.3765 -		return SDL_FALSE;
  6.3766 -	}
  6.3767 -	/*
  6.3768 -	 * It takes a bit of care to be fool-proof about parsing the OpenGL
  6.3769 -	 * extensions string. Don't be fooled by sub-strings, etc.
  6.3770 -	 */
  6.3771 +    /* Extension names should not have spaces. */
  6.3772 +    where = SDL_strchr(extension, ' ');
  6.3773 +    if (where || *extension == '\0') {
  6.3774 +        return SDL_FALSE;
  6.3775 +    }
  6.3776 +    /* See if there's an environment variable override */
  6.3777 +    start = SDL_getenv(extension);
  6.3778 +    if (start && *start == '0') {
  6.3779 +        return SDL_FALSE;
  6.3780 +    }
  6.3781 +    /* Lookup the available extensions */
  6.3782 +    glGetStringFunc = SDL_GL_GetProcAddress("glGetString");
  6.3783 +    if (glGetStringFunc) {
  6.3784 +        extensions = (const char *) glGetStringFunc(GL_EXTENSIONS);
  6.3785 +    } else {
  6.3786 +        extensions = NULL;
  6.3787 +    }
  6.3788 +    if (!extensions) {
  6.3789 +        return SDL_FALSE;
  6.3790 +    }
  6.3791 +    /*
  6.3792 +     * It takes a bit of care to be fool-proof about parsing the OpenGL
  6.3793 +     * extensions string. Don't be fooled by sub-strings, etc.
  6.3794 +     */
  6.3795  
  6.3796 -	start = extensions;
  6.3797 +    start = extensions;
  6.3798  
  6.3799 -	for (;;) {
  6.3800 -		where = SDL_strstr(start, extension);
  6.3801 -		if (!where)
  6.3802 -			break;
  6.3803 +    for (;;) {
  6.3804 +        where = SDL_strstr(start, extension);
  6.3805 +        if (!where)
  6.3806 +            break;
  6.3807  
  6.3808 -		terminator = where + SDL_strlen(extension);
  6.3809 -		if (where == start || *(where - 1) == ' ')
  6.3810 -			if (*terminator == ' ' || *terminator == '\0')
  6.3811 -				return SDL_TRUE;
  6.3812 +        terminator = where + SDL_strlen(extension);
  6.3813 +        if (where == start || *(where - 1) == ' ')
  6.3814 +            if (*terminator == ' ' || *terminator == '\0')
  6.3815 +                return SDL_TRUE;
  6.3816  
  6.3817 -		start = terminator;
  6.3818 -	}
  6.3819 -	return SDL_FALSE;
  6.3820 +        start = terminator;
  6.3821 +    }
  6.3822 +    return SDL_FALSE;
  6.3823  #else
  6.3824 -	return SDL_FALSE;
  6.3825 +    return SDL_FALSE;
  6.3826  #endif
  6.3827  }
  6.3828  
  6.3829 @@ -2270,285 +2270,285 @@
  6.3830  SDL_GL_SetAttribute(SDL_GLattr attr, int value)
  6.3831  {
  6.3832  #if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES
  6.3833 -	int             retval;
  6.3834 +    int retval;
  6.3835  
  6.3836 -	if (!_this) {
  6.3837 -		SDL_UninitializedVideo();
  6.3838 -		return -1;
  6.3839 -	}
  6.3840 -	retval = 0;
  6.3841 -	switch (attr) {
  6.3842 -	case SDL_GL_RED_SIZE:
  6.3843 -		_this->gl_config.red_size = value;
  6.3844 -		break;
  6.3845 -	case SDL_GL_GREEN_SIZE:
  6.3846 -		_this->gl_config.green_size = value;
  6.3847 -		break;
  6.3848 -	case SDL_GL_BLUE_SIZE:
  6.3849 -		_this->gl_config.blue_size = value;
  6.3850 -		break;
  6.3851 -	case SDL_GL_ALPHA_SIZE:
  6.3852 -		_this->gl_config.alpha_size = value;
  6.3853 -		break;
  6.3854 -	case SDL_GL_DOUBLEBUFFER:
  6.3855 -		_this->gl_config.double_buffer = value;
  6.3856 -		break;
  6.3857 -	case SDL_GL_BUFFER_SIZE:
  6.3858 -		_this->gl_config.buffer_size = value;
  6.3859 -		break;
  6.3860 -	case SDL_GL_DEPTH_SIZE:
  6.3861 -		_this->gl_config.depth_size = value;
  6.3862 -		break;
  6.3863 -	case SDL_GL_STENCIL_SIZE:
  6.3864 -		_this->gl_config.stencil_size = value;
  6.3865 -		break;
  6.3866 -	case SDL_GL_ACCUM_RED_SIZE:
  6.3867 -		_this->gl_config.accum_red_size = value;
  6.3868 -		break;
  6.3869 -	case SDL_GL_ACCUM_GREEN_SIZE:
  6.3870 -		_this->gl_config.accum_green_size = value;
  6.3871 -		break;
  6.3872 -	case SDL_GL_ACCUM_BLUE_SIZE:
  6.3873 -		_this->gl_config.accum_blue_size = value;
  6.3874 -		break;
  6.3875 -	case SDL_GL_ACCUM_ALPHA_SIZE:
  6.3876 -		_this->gl_config.accum_alpha_size = value;
  6.3877 -		break;
  6.3878 -	case SDL_GL_STEREO:
  6.3879 -		_this->gl_config.stereo = value;
  6.3880 -		break;
  6.3881 -	case SDL_GL_MULTISAMPLEBUFFERS:
  6.3882 -		_this->gl_config.multisamplebuffers = value;
  6.3883 -		break;
  6.3884 -	case SDL_GL_MULTISAMPLESAMPLES:
  6.3885 -		_this->gl_config.multisamplesamples = value;
  6.3886 -		break;
  6.3887 -	case SDL_GL_ACCELERATED_VISUAL:
  6.3888 -		_this->gl_config.accelerated = value;
  6.3889 -		break;
  6.3890 -	case SDL_GL_RETAINED_BACKING:
  6.3891 -		_this->gl_config.retained_backing = value;
  6.3892 -		break;
  6.3893 -	default:
  6.3894 -		SDL_SetError("Unknown OpenGL attribute");
  6.3895 -		retval = -1;
  6.3896 -		break;
  6.3897 -	}
  6.3898 -	return retval;
  6.3899 +    if (!_this) {
  6.3900 +        SDL_UninitializedVideo();
  6.3901 +        return -1;
  6.3902 +    }
  6.3903 +    retval = 0;
  6.3904 +    switch (attr) {
  6.3905 +    case SDL_GL_RED_SIZE:
  6.3906 +        _this->gl_config.red_size = value;
  6.3907 +        break;
  6.3908 +    case SDL_GL_GREEN_SIZE:
  6.3909 +        _this->gl_config.green_size = value;
  6.3910 +        break;
  6.3911 +    case SDL_GL_BLUE_SIZE:
  6.3912 +        _this->gl_config.blue_size = value;
  6.3913 +        break;
  6.3914 +    case SDL_GL_ALPHA_SIZE:
  6.3915 +        _this->gl_config.alpha_size = value;
  6.3916 +        break;
  6.3917 +    case SDL_GL_DOUBLEBUFFER:
  6.3918 +        _this->gl_config.double_buffer = value;
  6.3919 +        break;
  6.3920 +    case SDL_GL_BUFFER_SIZE:
  6.3921 +        _this->gl_config.buffer_size = value;
  6.3922 +        break;
  6.3923 +    case SDL_GL_DEPTH_SIZE:
  6.3924 +        _this->gl_config.depth_size = value;
  6.3925 +        break;
  6.3926 +    case SDL_GL_STENCIL_SIZE:
  6.3927 +        _this->gl_config.stencil_size = value;
  6.3928 +        break;
  6.3929 +    case SDL_GL_ACCUM_RED_SIZE:
  6.3930 +        _this->gl_config.accum_red_size = value;
  6.3931 +        break;
  6.3932 +    case SDL_GL_ACCUM_GREEN_SIZE:
  6.3933 +        _this->gl_config.accum_green_size = value;
  6.3934 +        break;
  6.3935 +    case SDL_GL_ACCUM_BLUE_SIZE:
  6.3936 +        _this->gl_config.accum_blue_size = value;
  6.3937 +        break;
  6.3938 +    case SDL_GL_ACCUM_ALPHA_SIZE:
  6.3939 +        _this->gl_config.accum_alpha_size = value;
  6.3940 +        break;
  6.3941 +    case SDL_GL_STEREO:
  6.3942 +        _this->gl_config.stereo = value;
  6.3943 +        break;
  6.3944 +    case SDL_GL_MULTISAMPLEBUFFERS:
  6.3945 +        _this->gl_config.multisamplebuffers = value;
  6.3946 +        break;
  6.3947 +    case SDL_GL_MULTISAMPLESAMPLES:
  6.3948 +        _this->gl_config.multisamplesamples = value;
  6.3949 +        break;
  6.3950 +    case SDL_GL_ACCELERATED_VISUAL:
  6.3951 +        _this->gl_config.accelerated = value;
  6.3952 +        break;
  6.3953 +    case SDL_GL_RETAINED_BACKING:
  6.3954 +        _this->gl_config.retained_backing = value;
  6.3955 +        break;
  6.3956 +    default:
  6.3957 +        SDL_SetError("Unknown OpenGL attribute");
  6.3958 +        retval = -1;
  6.3959 +        break;
  6.3960 +    }
  6.3961 +    return retval;
  6.3962  #else
  6.3963 -	SDL_Unsupported();
  6.3964 -	return -1;
  6.3965 -#endif				/* SDL_VIDEO_OPENGL */
  6.3966 +    SDL_Unsupported();
  6.3967 +    return -1;
  6.3968 +#endif /* SDL_VIDEO_OPENGL */
  6.3969  }
  6.3970  
  6.3971  int
  6.3972  SDL_GL_GetAttribute(SDL_GLattr attr, int *value)
  6.3973  {
  6.3974  #if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES
  6.3975 -	void            (APIENTRY * glGetIntegervFunc) (GLenum pname, GLint * params);
  6.3976 -	GLenum          attrib = 0;
  6.3977 +    void (APIENTRY * glGetIntegervFunc) (GLenum pname, GLint * params);
  6.3978 +    GLenum attrib = 0;
  6.3979  
  6.3980 -	glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv");
  6.3981 -	if (!glGetIntegervFunc) {
  6.3982 -		return -1;
  6.3983 -	}
  6.3984 -	switch (attr) {
  6.3985 -	case SDL_GL_RETAINED_BACKING:
  6.3986 -		*value = _this->gl_config.retained_backing;
  6.3987 -		return 0;
  6.3988 -	case SDL_GL_RED_SIZE:
  6.3989 -		attrib = GL_RED_BITS;
  6.3990 -		break;
  6.3991 -	case SDL_GL_BLUE_SIZE:
  6.3992 -		attrib = GL_BLUE_BITS;
  6.3993 -		break;
  6.3994 -	case SDL_GL_GREEN_SIZE:
  6.3995 -		attrib = GL_GREEN_BITS;
  6.3996 -		break;
  6.3997 -	case SDL_GL_ALPHA_SIZE:
  6.3998 -		attrib = GL_ALPHA_BITS;
  6.3999 -		break;
  6.4000 -	case SDL_GL_DOUBLEBUFFER:
  6.4001 +    glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv");
  6.4002 +    if (!glGetIntegervFunc) {
  6.4003 +        return -1;
  6.4004 +    }
  6.4005 +    switch (attr) {
  6.4006 +    case SDL_GL_RETAINED_BACKING:
  6.4007 +        *value = _this->gl_config.retained_backing;
  6.4008 +        return 0;
  6.4009 +    case SDL_GL_RED_SIZE:
  6.4010 +        attrib = GL_RED_BITS;
  6.4011 +        break;
  6.4012 +    case SDL_GL_BLUE_SIZE:
  6.4013 +        attrib = GL_BLUE_BITS;
  6.4014 +        break;
  6.4015 +    case SDL_GL_GREEN_SIZE:
  6.4016 +        attrib = GL_GREEN_BITS;
  6.4017 +        break;
  6.4018 +    case SDL_GL_ALPHA_SIZE:
  6.4019 +        attrib = GL_ALPHA_BITS;
  6.4020 +        break;
  6.4021 +    case SDL_GL_DOUBLEBUFFER:
  6.4022  #ifndef SDL_VIDEO_OPENGL_ES
  6.4023 -		attrib = GL_DOUBLEBUFFER;
  6.4024 -		break;
  6.4025 +        attrib = GL_DOUBLEBUFFER;
  6.4026 +        break;
  6.4027  #else
  6.4028 -		/*
  6.4029 -		 * I believe double buffering is the only option in OpenGL ES
  6.4030 -		 * -- in any case, GL_DOUBLEBUFFER doesn't exist
  6.4031 -		 */
  6.4032 -		*value = 1;
  6.4033 -		return 0;
  6.4034 +        /*
  6.4035 +         * I believe double buffering is the only option in OpenGL ES
  6.4036 +         * -- in any case, GL_DOUBLEBUFFER doesn't exist
  6.4037 +         */
  6.4038 +        *value = 1;
  6.4039 +        return 0;
  6.4040  #endif
  6.4041 -	case SDL_GL_DEPTH_SIZE:
  6.4042 -		attrib = GL_DEPTH_BITS;
  6.4043 -		break;
  6.4044 -	case SDL_GL_STENCIL_SIZE:
  6.4045 -		attrib = GL_STENCIL_BITS;
  6.4046 -		break;
  6.4047 +    case SDL_GL_DEPTH_SIZE:
  6.4048 +        attrib = GL_DEPTH_BITS;
  6.4049 +        break;
  6.4050 +    case SDL_GL_STENCIL_SIZE:
  6.4051 +        attrib = GL_STENCIL_BITS;
  6.4052 +        break;
  6.4053  #ifndef SDL_VIDEO_OPENGL_ES
  6.4054 -	case SDL_GL_ACCUM_RED_SIZE:
  6.4055 -		attrib = GL_ACCUM_RED_BITS;
  6.4056 -		break;
  6.4057 -	case SDL_GL_ACCUM_GREEN_SIZE:
  6.4058 -		attrib = GL_ACCUM_GREEN_BITS;
  6.4059 -		break;
  6.4060 -	case SDL_GL_ACCUM_BLUE_SIZE:
  6.4061 -		attrib = GL_ACCUM_BLUE_BITS;
  6.4062 -		break;
  6.4063 -	case SDL_GL_ACCUM_ALPHA_SIZE:
  6.4064 -		attrib = GL_ACCUM_ALPHA_BITS;
  6.4065 -		break;
  6.4066 -	case SDL_GL_STEREO:
  6.4067 -		attrib = GL_STEREO;
  6.4068 -		break;
  6.4069 +    case SDL_GL_ACCUM_RED_SIZE:
  6.4070 +        attrib = GL_ACCUM_RED_BITS;
  6.4071 +        break;
  6.4072 +    case SDL_GL_ACCUM_GREEN_SIZE:
  6.4073 +        attrib = GL_ACCUM_GREEN_BITS;
  6.4074 +        break;
  6.4075 +    case SDL_GL_ACCUM_BLUE_SIZE:
  6.4076 +        attrib = GL_ACCUM_BLUE_BITS;
  6.4077 +        break;
  6.4078 +    case SDL_GL_ACCUM_ALPHA_SIZE:
  6.4079 +        attrib = GL_ACCUM_ALPHA_BITS;
  6.4080 +        break;
  6.4081 +    case SDL_GL_STEREO:
  6.4082 +        attrib = GL_STEREO;
  6.4083 +        break;
  6.4084  #else
  6.4085 -	case SDL_GL_ACCUM_RED_SIZE:
  6.4086 -	case SDL_GL_ACCUM_GREEN_SIZE:
  6.4087 -	case SDL_GL_ACCUM_BLUE_SIZE:
  6.4088 -	case SDL_GL_ACCUM_ALPHA_SIZE:
  6.4089 -	case SDL_GL_STEREO:
  6.4090 -		/* none of these are supported in OpenGL ES */
  6.4091 -		*value = 0;
  6.4092 -		return 0;
  6.4093 +    case SDL_GL_ACCUM_RED_SIZE:
  6.4094 +    case SDL_GL_ACCUM_GREEN_SIZE:
  6.4095 +    case SDL_GL_ACCUM_BLUE_SIZE:
  6.4096 +    case SDL_GL_ACCUM_ALPHA_SIZE:
  6.4097 +    case SDL_GL_STEREO:
  6.4098 +        /* none of these are supported in OpenGL ES */
  6.4099 +        *value = 0;
  6.4100 +        return 0;
  6.4101  #endif
  6.4102 -	case SDL_GL_MULTISAMPLEBUFFERS:
  6.4103 +    case SDL_GL_MULTISAMPLEBUFFERS:
  6.4104  #ifndef SDL_VIDEO_OPENGL_ES
  6.4105 -		attrib = GL_SAMPLE_BUFFERS_ARB;
  6.4106 +        attrib = GL_SAMPLE_BUFFERS_ARB;
  6.4107  #else
  6.4108 -		attrib = GL_SAMPLE_BUFFERS;
  6.4109 +        attrib = GL_SAMPLE_BUFFERS;
  6.4110  #endif
  6.4111 -		break;
  6.4112 -	case SDL_GL_MULTISAMPLESAMPLES:
  6.4113 +        break;
  6.4114 +    case SDL_GL_MULTISAMPLESAMPLES:
  6.4115  #ifndef SDL_VIDEO_OPENGL_ES
  6.4116 -		attrib = GL_SAMPLES_ARB;
  6.4117 +        attrib = GL_SAMPLES_ARB;
  6.4118  #else
  6.4119 -		attrib = GL_SAMPLES;
  6.4120 +        attrib = GL_SAMPLES;
  6.4121  #endif
  6.4122 -		break;
  6.4123 -	case SDL_GL_BUFFER_SIZE:
  6.4124 -		{
  6.4125 -			GLint           bits = 0;
  6.4126 -			GLint           component;
  6.4127 +        break;
  6.4128 +    case SDL_GL_BUFFER_SIZE:
  6.4129 +        {
  6.4130 +            GLint bits = 0;
  6.4131 +            GLint component;
  6.4132  
  6.4133 -			/*
  6.4134 -			 * there doesn't seem to be a single flag in OpenGL
  6.4135 -			 * for this!
  6.4136 -			 */
  6.4137 -			glGetIntegervFunc(GL_RED_BITS, &component);
  6.4138 -			bits += component;
  6.4139 -			glGetIntegervFunc(GL_GREEN_BITS, &component);
  6.4140 -			bits += component;
  6.4141 -			glGetIntegervFunc(GL_BLUE_BITS, &component);
  6.4142 -			bits += component;
  6.4143 -			glGetIntegervFunc(GL_ALPHA_BITS, &component);
  6.4144 -			bits += component;
  6.4145 +            /*
  6.4146 +             * there doesn't seem to be a single flag in OpenGL
  6.4147 +             * for this!
  6.4148 +             */
  6.4149 +            glGetIntegervFunc(GL_RED_BITS, &component);
  6.4150 +            bits += component;
  6.4151 +            glGetIntegervFunc(GL_GREEN_BITS, &component);
  6.4152 +            bits += component;
  6.4153 +            glGetIntegervFunc(GL_BLUE_BITS, &component);
  6.4154 +            bits += component;
  6.4155 +            glGetIntegervFunc(GL_ALPHA_BITS, &component);
  6.4156 +            bits += component;
  6.4157  
  6.4158 -			*value = bits;
  6.4159 -			return 0;
  6.4160 -		}
  6.4161 -	case SDL_GL_ACCELERATED_VISUAL:
  6.4162 -		{
  6.4163 -			/* FIXME: How do we get this information? */
  6.4164 -			*value = (_this->gl_config.accelerated != 0);
  6.4165 -			return 0;
  6.4166 -		}
  6.4167 -	default:
  6.4168 -		SDL_SetError("Unknown OpenGL attribute");
  6.4169 -		return -1;
  6.4170 -	}
  6.4171 +            *value = bits;
  6.4172 +            return 0;
  6.4173 +        }
  6.4174 +    case SDL_GL_ACCELERATED_VISUAL:
  6.4175 +        {
  6.4176 +            /* FIXME: How do we get this information? */
  6.4177 +            *value = (_this->gl_config.accelerated != 0);
  6.4178 +            return 0;
  6.4179 +        }
  6.4180 +    default:
  6.4181 +        SDL_SetError("Unknown OpenGL attribute");
  6.4182 +        return -1;
  6.4183 +    }
  6.4184  
  6.4185 -	glGetIntegervFunc(attrib, (GLint *) value);
  6.4186 -	return 0;
  6.4187 +    glGetIntegervFunc(attrib, (GLint *) value);
  6.4188 +    return 0;
  6.4189  #else
  6.4190 -	SDL_Unsupported();
  6.4191 -	return -1;
  6.4192 -#endif				/* SDL_VIDEO_OPENGL */
  6.4193 +    SDL_Unsupported();
  6.4194 +    return -1;
  6.4195 +#endif /* SDL_VIDEO_OPENGL */
  6.4196  }
  6.4197  
  6.4198  SDL_GLContext
  6.4199  SDL_GL_CreateContext(SDL_WindowID windowID)
  6.4200  {
  6.4201 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.4202 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.4203  
  6.4204 -	if (!window) {
  6.4205 -		return NULL;
  6.4206 -	}
  6.4207 -	if (!(window->flags & SDL_WINDOW_OPENGL)) {
  6.4208 -		SDL_SetError("The specified window isn't an OpenGL window");
  6.4209 -		return NULL;
  6.4210 -	}
  6.4211 -	return _this->GL_CreateContext(_this, window);
  6.4212 +    if (!window) {
  6.4213 +        return NULL;
  6.4214 +    }
  6.4215 +    if (!(window->flags & SDL_WINDOW_OPENGL)) {
  6.4216 +        SDL_SetError("The specified window isn't an OpenGL window");
  6.4217 +        return NULL;
  6.4218 +    }
  6.4219 +    return _this->GL_CreateContext(_this, window);
  6.4220  }
  6.4221  
  6.4222  int
  6.4223  SDL_GL_MakeCurrent(SDL_WindowID windowID, SDL_GLContext context)
  6.4224  {
  6.4225 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.4226 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.4227  
  6.4228 -	if (window && !(window->flags & SDL_WINDOW_OPENGL)) {
  6.4229 -		SDL_SetError("The specified window isn't an OpenGL window");
  6.4230 -		return -1;
  6.4231 -	}
  6.4232 -	if (!context) {
  6.4233 -		window = NULL;
  6.4234 -	}
  6.4235 -	return _this->GL_MakeCurrent(_this, window, context);
  6.4236 +    if (window && !(window->flags & SDL_WINDOW_OPENGL)) {
  6.4237 +        SDL_SetError("The specified window isn't an OpenGL window");
  6.4238 +        return -1;
  6.4239 +    }
  6.4240 +    if (!context) {
  6.4241 +        window = NULL;
  6.4242 +    }
  6.4243 +    return _this->GL_MakeCurrent(_this, window, context);
  6.4244  }
  6.4245  
  6.4246  int
  6.4247  SDL_GL_SetSwapInterval(int interval)
  6.4248  {
  6.4249 -	if (!_this) {
  6.4250 -		SDL_UninitializedVideo();
  6.4251 -		return -1;
  6.4252 -	}
  6.4253 -	if (_this->GL_SetSwapInterval) {
  6.4254 -		return _this->GL_SetSwapInterval(_this, interval);
  6.4255 -	} else {
  6.4256 -		SDL_SetError("Setting the swap interval is not supported");
  6.4257 -		return -1;
  6.4258 -	}
  6.4259 +    if (!_this) {
  6.4260 +        SDL_UninitializedVideo();
  6.4261 +        return -1;
  6.4262 +    }
  6.4263 +    if (_this->GL_SetSwapInterval) {
  6.4264 +        return _this->GL_SetSwapInterval(_this, interval);
  6.4265 +    } else {
  6.4266 +        SDL_SetError("Setting the swap interval is not supported");
  6.4267 +        return -1;
  6.4268 +    }
  6.4269  }
  6.4270  
  6.4271  int
  6.4272  SDL_GL_GetSwapInterval(void)
  6.4273  {
  6.4274 -	if (!_this) {
  6.4275 -		SDL_UninitializedVideo();
  6.4276 -		return -1;
  6.4277 -	}
  6.4278 -	if (_this->GL_GetSwapInterval) {
  6.4279 -		return _this->GL_GetSwapInterval(_this);
  6.4280 -	} else {
  6.4281 -		SDL_SetError("Getting the swap interval is not supported");
  6.4282 -		return -1;
  6.4283 -	}
  6.4284 +    if (!_this) {
  6.4285 +        SDL_UninitializedVideo();
  6.4286 +        return -1;
  6.4287 +    }
  6.4288 +    if (_this->GL_GetSwapInterval) {
  6.4289 +        return _this->GL_GetSwapInterval(_this);
  6.4290 +    } else {
  6.4291 +        SDL_SetError("Getting the swap interval is not supported");
  6.4292 +        return -1;
  6.4293 +    }
  6.4294  }
  6.4295  
  6.4296  void
  6.4297  SDL_GL_SwapWindow(SDL_WindowID windowID)
  6.4298  {
  6.4299 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.4300 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.4301  
  6.4302 -	if (!window) {
  6.4303 -		return;
  6.4304 -	}
  6.4305 -	if (!(window->flags & SDL_WINDOW_OPENGL)) {
  6.4306 -		SDL_SetError("The specified window isn't an OpenGL window");
  6.4307 -		return;
  6.4308 -	}
  6.4309 -	_this->GL_SwapWindow(_this, window);
  6.4310 +    if (!window) {
  6.4311 +        return;
  6.4312 +    }
  6.4313 +    if (!(window->flags & SDL_WINDOW_OPENGL)) {
  6.4314 +        SDL_SetError("The specified window isn't an OpenGL window");
  6.4315 +        return;
  6.4316 +    }
  6.4317 +    _this->GL_SwapWindow(_this, window);
  6.4318  }
  6.4319  
  6.4320  void
  6.4321  SDL_GL_DeleteContext(SDL_GLContext context)
  6.4322  {
  6.4323 -	if (!_this || !context) {
  6.4324 -		return;
  6.4325 -	}
  6.4326 -	_this->GL_MakeCurrent(_this, NULL, NULL);
  6.4327 -	_this->GL_DeleteContext(_this, context);
  6.4328 +    if (!_this || !context) {
  6.4329 +        return;
  6.4330 +    }
  6.4331 +    _this->GL_MakeCurrent(_this, NULL, NULL);
  6.4332 +    _this->GL_DeleteContext(_this, context);
  6.4333  }
  6.4334  
  6.4335  #if 0                           // FIXME
  6.4336 @@ -2559,63 +2559,63 @@
  6.4337  static void
  6.4338  CreateMaskFromColorKeyOrAlpha(SDL_Surface * icon, Uint8 * mask, int flags)
  6.4339  {
  6.4340 -	int             x, y;
  6.4341 -	Uint32          colorkey;
  6.4342 +    int x, y;
  6.4343 +    Uint32 colorkey;
  6.4344  #define SET_MASKBIT(icon, x, y, mask) \
  6.4345  	mask[(y*((icon->w+7)/8))+(x/8)] &= ~(0x01<<(7-(x%8)))
  6.4346  
  6.4347 -	colorkey = icon->format->colorkey;
  6.4348 -	switch (icon->format->BytesPerPixel) {
  6.4349 -	case 1:
  6.4350 -		{
  6.4351 -			Uint8          *pixels;
  6.4352 -			for (y = 0; y < icon->h; ++y) {
  6.4353 -				pixels = (Uint8 *) icon->pixels + y * icon->pitch;
  6.4354 -				for (x = 0; x < icon->w; ++x) {
  6.4355 -					if (*pixels++ == colorkey) {
  6.4356 -						SET_MASKBIT(icon, x, y, mask);
  6.4357 -					}
  6.4358 -				}
  6.4359 -			}
  6.4360 -		}
  6.4361 -		break;
  6.4362 +    colorkey = icon->format->colorkey;
  6.4363 +    switch (icon->format->BytesPerPixel) {
  6.4364 +    case 1:
  6.4365 +        {
  6.4366 +            Uint8 *pixels;
  6.4367 +            for (y = 0; y < icon->h; ++y) {
  6.4368 +                pixels = (Uint8 *) icon->pixels + y * icon->pitch;
  6.4369 +                for (x = 0; x < icon->w; ++x) {
  6.4370 +                    if (*pixels++ == colorkey) {
  6.4371 +                        SET_MASKBIT(icon, x, y, mask);
  6.4372 +                    }
  6.4373 +                }
  6.4374 +            }
  6.4375 +        }
  6.4376 +        break;
  6.4377  
  6.4378 -	case 2:
  6.4379 -		{
  6.4380 -			Uint16         *pixels;
  6.4381 -			for (y = 0; y < icon->h; ++y) {
  6.4382 -				pixels = (Uint16 *) icon->pixels + y * icon->pitch / 2;
  6.4383 -				for (x = 0; x < icon->w; ++x) {
  6.4384 -					if ((flags & 1) && *pixels == colorkey) {
  6.4385 -						SET_MASKBIT(icon, x, y, mask);
  6.4386 -					} else if ((flags & 2)
  6.4387 -						   && (*pixels & icon->format->Amask) == 0) {
  6.4388 -						SET_MASKBIT(icon, x, y, mask);
  6.4389 -					}
  6.4390 -					pixels++;
  6.4391 -				}
  6.4392 -			}
  6.4393 -		}
  6.4394 -		break;
  6.4395 +    case 2:
  6.4396 +        {
  6.4397 +            Uint16 *pixels;
  6.4398 +            for (y = 0; y < icon->h; ++y) {
  6.4399 +                pixels = (Uint16 *) icon->pixels + y * icon->pitch / 2;
  6.4400 +                for (x = 0; x < icon->w; ++x) {
  6.4401 +                    if ((flags & 1) && *pixels == colorkey) {
  6.4402 +                        SET_MASKBIT(icon, x, y, mask);
  6.4403 +                    } else if ((flags & 2)
  6.4404 +                               && (*pixels & icon->format->Amask) == 0) {
  6.4405 +                        SET_MASKBIT(icon, x, y, mask);
  6.4406 +                    }
  6.4407 +                    pixels++;
  6.4408 +                }
  6.4409 +            }
  6.4410 +        }
  6.4411 +        break;
  6.4412  
  6.4413 -	case 4:
  6.4414 -		{
  6.4415 -			Uint32         *pixels;
  6.4416 -			for (y = 0; y < icon->h; ++y) {
  6.4417 -				pixels = (Uint32 *) icon->pixels + y * icon->pitch / 4;
  6.4418 -				for (x = 0; x < icon->w; ++x) {
  6.4419 -					if ((flags & 1) && *pixels == colorkey) {
  6.4420 -						SET_MASKBIT(icon, x, y, mask);
  6.4421 -					} else if ((flags & 2)
  6.4422 -						   && (*pixels & icon->format->Amask) == 0) {
  6.4423 -						SET_MASKBIT(icon, x, y, mask);
  6.4424 -					}
  6.4425 -					pixels++;
  6.4426 -				}
  6.4427 -			}
  6.4428 -		}
  6.4429 -		break;
  6.4430 -	}
  6.4431 +    case 4:
  6.4432 +        {
  6.4433 +            Uint32 *pixels;
  6.4434 +            for (y = 0; y < icon->h; ++y) {
  6.4435 +                pixels = (Uint32 *) icon->pixels + y * icon->pitch / 4;
  6.4436 +                for (x = 0; x < icon->w; ++x) {
  6.4437 +                    if ((flags & 1) && *pixels == colorkey) {
  6.4438 +                        SET_MASKBIT(icon, x, y, mask);
  6.4439 +                    } else if ((flags & 2)
  6.4440 +                               && (*pixels & icon->format->Amask) == 0) {
  6.4441 +                        SET_MASKBIT(icon, x, y, mask);
  6.4442 +                    }
  6.4443 +                    pixels++;
  6.4444 +                }
  6.4445 +            }
  6.4446 +        }
  6.4447 +        break;
  6.4448 +    }
  6.4449  }
  6.4450  
  6.4451  /*
  6.4452 @@ -2624,41 +2624,41 @@
  6.4453  void
  6.4454  SDL_WM_SetIcon(SDL_Surface * icon, Uint8 * mask)
  6.4455  {
  6.4456 -	if (icon && _this->SetIcon) {
  6.4457 -		/* Generate a mask if necessary, and create the icon! */
  6.4458 -		if (mask == NULL) {
  6.4459 -			int             mask_len = icon->h * (icon->w + 7) / 8;
  6.4460 -			int             flags = 0;
  6.4461 -			mask = (Uint8 *) SDL_malloc(mask_len);
  6.4462 -			if (mask == NULL) {
  6.4463 -				return;
  6.4464 -			}
  6.4465 -			SDL_memset(mask, ~0, mask_len);
  6.4466 -			if (icon->flags & SDL_SRCCOLORKEY)
  6.4467 -				flags |= 1;
  6.4468 -			if (icon->flags & SDL_SRCALPHA)
  6.4469 -				flags |= 2;
  6.4470 -			if (flags) {
  6.4471 -				CreateMaskFromColorKeyOrAlpha(icon, mask, flags);
  6.4472 -			}
  6.4473 -			_this->SetIcon(_this, icon, mask);
  6.4474 -			SDL_free(mask);
  6.4475 -		} else {
  6.4476 -			_this->SetIcon(_this, icon, mask);
  6.4477 -		}
  6.4478 -	}
  6.4479 +    if (icon && _this->SetIcon) {
  6.4480 +        /* Generate a mask if necessary, and create the icon! */
  6.4481 +        if (mask == NULL) {
  6.4482 +            int mask_len = icon->h * (icon->w + 7) / 8;
  6.4483 +            int flags = 0;
  6.4484 +            mask = (Uint8 *) SDL_malloc(mask_len);
  6.4485 +            if (mask == NULL) {
  6.4486 +                return;
  6.4487 +            }
  6.4488 +            SDL_memset(mask, ~0, mask_len);
  6.4489 +            if (icon->flags & SDL_SRCCOLORKEY)
  6.4490 +                flags |= 1;
  6.4491 +            if (icon->flags & SDL_SRCALPHA)
  6.4492 +                flags |= 2;
  6.4493 +            if (flags) {
  6.4494 +                CreateMaskFromColorKeyOrAlpha(icon, mask, flags);
  6.4495 +            }
  6.4496 +            _this->SetIcon(_this, icon, mask);
  6.4497 +            SDL_free(mask);
  6.4498 +        } else {
  6.4499 +            _this->SetIcon(_this, icon, mask);
  6.4500 +        }
  6.4501 +    }
  6.4502  }
  6.4503  #endif
  6.4504  
  6.4505  SDL_bool
  6.4506 -SDL_GetWindowWMInfo(SDL_WindowID windowID, struct SDL_SysWMinfo * info)
  6.4507 +SDL_GetWindowWMInfo(SDL_WindowID windowID, struct SDL_SysWMinfo *info)
  6.4508  {
  6.4509 -	SDL_Window     *window = SDL_GetWindowFromID(windowID);
  6.4510 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  6.4511  
  6.4512 -	if (!window || !_this->GetWindowWMInfo) {
  6.4513 -		return SDL_FALSE;
  6.4514 -	}
  6.4515 -	return (_this->GetWindowWMInfo(_this, window, info));
  6.4516 +    if (!window || !_this->GetWindowWMInfo) {
  6.4517 +        return SDL_FALSE;
  6.4518 +    }
  6.4519 +    return (_this->GetWindowWMInfo(_this, window, info));
  6.4520  }
  6.4521  
  6.4522  /* vi: set ts=4 sw=4 expandtab: */
     7.1 --- a/src/video/Xext/Xxf86vm/XF86VMode.c	Mon Sep 15 04:31:30 2008 +0000
     7.2 +++ b/src/video/Xext/Xxf86vm/XF86VMode.c	Mon Sep 15 04:32:36 2008 +0000
     7.3 @@ -292,7 +292,7 @@
     7.4          _XRead(dpy, (char *) modeline->private,
     7.5                 modeline->privsize * sizeof(INT32));
     7.6      } else {
     7.7 -        zap_ptr((char *)&modeline->private, sizeof(modeline->private))
     7.8 +        zap_ptr((char *) &modeline->private, sizeof(modeline->private))
     7.9      }
    7.10      UnlockDisplay(dpy);
    7.11      SyncHandle();