Bladeren bron

video: Change SDL_GLattr to SDL_GLAttr.

Ryan C. Gordon 5 maanden geleden
bovenliggende
commit
7108291d0b

+ 4 - 0
build-scripts/SDL_migration.cocci

@@ -3727,3 +3727,7 @@ typedef SDL_bool, bool;
 @@
 - SDL_GLcontextReleaseFlag
 + SDL_GLContextReleaseFlag
+@@
+@@
+- SDL_GLattr
++ SDL_GLAttr

+ 1 - 0
docs/README-migration.md

@@ -2229,6 +2229,7 @@ The following symbols have been renamed:
 * SDL_DISPLAYEVENT_DISCONNECTED => SDL_EVENT_DISPLAY_REMOVED
 * SDL_DISPLAYEVENT_MOVED => SDL_EVENT_DISPLAY_MOVED
 * SDL_DISPLAYEVENT_ORIENTATION => SDL_EVENT_DISPLAY_ORIENTATION
+* SDL_GLattr => SDL_GLAttr
 * SDL_GLcontextFlag => SDL_GLContextFlag
 * SDL_GLcontextReleaseFlag => SDL_GLContextReleaseFlag
 * SDL_GLprofile => SDL_GLProfile

+ 2 - 0
include/SDL3/SDL_oldnames.h

@@ -659,6 +659,7 @@
 
 /* ##SDL_video.h */
 #define SDL_GL_DeleteContext SDL_GL_DestroyContext
+#define SDL_GLattr SDL_GLAttr
 #define SDL_GLcontextFlag SDL_GLContextFlag
 #define SDL_GLcontextReleaseFlag SDL_GLContextReleaseFlag
 #define SDL_GLprofile SDL_GLProfile
@@ -1300,6 +1301,7 @@
 
 /* ##SDL_video.h */
 #define SDL_GL_DeleteContext SDL_GL_DeleteContext_renamed_SDL_GL_DestroyContext
+#define SDL_GLattr SDL_GLattr_renamed_SDL_GLAttr
 #define SDL_GLcontextFlag SDL_GLcontextFlag_renamed_SDL_GLContextFlag
 #define SDL_GLcontextReleaseFlag SDL_GLcontextReleaseFlag_renamed_SDL_GLContextReleaseFlag
 #define SDL_GLprofile SDL_GLprofile_renamed_SDL_GLProfile

+ 6 - 6
include/SDL3/SDL_video.h

@@ -332,7 +332,7 @@ typedef SDL_EGLint *(SDLCALL *SDL_EGLIntArrayCallback)(void *userdata, SDL_EGLDi
  *
  * \since This enum is available since SDL 3.1.3.
  */
-typedef enum SDL_GLattr
+typedef enum SDL_GLAttr
 {
     SDL_GL_RED_SIZE,                    /**< the minimum number of bits for the red channel of the color buffer; defaults to 3. */
     SDL_GL_GREEN_SIZE,                  /**< the minimum number of bits for the green channel of the color buffer; defaults to 3. */
@@ -362,7 +362,7 @@ typedef enum SDL_GLattr
     SDL_GL_CONTEXT_NO_ERROR,
     SDL_GL_FLOATBUFFERS,
     SDL_GL_EGL_PLATFORM
-} SDL_GLattr;
+} SDL_GLAttr;
 
 /**
  * Possible values to be set for the SDL_GL_CONTEXT_PROFILE_MASK attribute.
@@ -2709,7 +2709,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void);
  * SDL_GL_GetAttribute() to check the values after creating the OpenGL
  * context, since the values obtained can differ from the requested ones.
  *
- * \param attr an SDL_GLattr enum value specifying the OpenGL attribute to
+ * \param attr an SDL_GLAttr enum value specifying the OpenGL attribute to
  *             set.
  * \param value the desired value for the attribute.
  * \returns true on success or false on failure; call SDL_GetError() for more
@@ -2720,12 +2720,12 @@ extern SDL_DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void);
  * \sa SDL_GL_GetAttribute
  * \sa SDL_GL_ResetAttributes
  */
-extern SDL_DECLSPEC bool SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
+extern SDL_DECLSPEC bool SDLCALL SDL_GL_SetAttribute(SDL_GLAttr attr, int value);
 
 /**
  * Get the actual value for an attribute from the current context.
  *
- * \param attr an SDL_GLattr enum value specifying the OpenGL attribute to
+ * \param attr an SDL_GLAttr enum value specifying the OpenGL attribute to
  *             get.
  * \param value a pointer filled in with the current value of `attr`.
  * \returns true on success or false on failure; call SDL_GetError() for more
@@ -2736,7 +2736,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value)
  * \sa SDL_GL_ResetAttributes
  * \sa SDL_GL_SetAttribute
  */
-extern SDL_DECLSPEC bool SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value);
+extern SDL_DECLSPEC bool SDLCALL SDL_GL_GetAttribute(SDL_GLAttr attr, int *value);
 
 /**
  * Create an OpenGL context for an OpenGL window, and make it current.

+ 2 - 2
src/dynapi/SDL_dynapi_procs.h

@@ -225,7 +225,7 @@ SDL_DYNAPI_PROC(void,SDL_GDKSuspendGPU,(SDL_GPUDevice *a),(a),)
 SDL_DYNAPI_PROC(SDL_GLContext,SDL_GL_CreateContext,(SDL_Window *a),(a),return)
 SDL_DYNAPI_PROC(bool,SDL_GL_DestroyContext,(SDL_GLContext a),(a),return)
 SDL_DYNAPI_PROC(bool,SDL_GL_ExtensionSupported,(const char *a),(a),return)
-SDL_DYNAPI_PROC(bool,SDL_GL_GetAttribute,(SDL_GLattr a, int *b),(a,b),return)
+SDL_DYNAPI_PROC(bool,SDL_GL_GetAttribute,(SDL_GLAttr a, int *b),(a,b),return)
 SDL_DYNAPI_PROC(SDL_GLContext,SDL_GL_GetCurrentContext,(void),(),return)
 SDL_DYNAPI_PROC(SDL_Window*,SDL_GL_GetCurrentWindow,(void),(),return)
 SDL_DYNAPI_PROC(SDL_FunctionPointer,SDL_GL_GetProcAddress,(const char *a),(a),return)
@@ -233,7 +233,7 @@ SDL_DYNAPI_PROC(bool,SDL_GL_GetSwapInterval,(int *a),(a),return)
 SDL_DYNAPI_PROC(bool,SDL_GL_LoadLibrary,(const char *a),(a),return)
 SDL_DYNAPI_PROC(bool,SDL_GL_MakeCurrent,(SDL_Window *a, SDL_GLContext b),(a,b),return)
 SDL_DYNAPI_PROC(void,SDL_GL_ResetAttributes,(void),(),)
-SDL_DYNAPI_PROC(bool,SDL_GL_SetAttribute,(SDL_GLattr a, int b),(a,b),return)
+SDL_DYNAPI_PROC(bool,SDL_GL_SetAttribute,(SDL_GLAttr a, int b),(a,b),return)
 SDL_DYNAPI_PROC(bool,SDL_GL_SetSwapInterval,(int a),(a),return)
 SDL_DYNAPI_PROC(bool,SDL_GL_SwapWindow,(SDL_Window *a),(a),return)
 SDL_DYNAPI_PROC(void,SDL_GL_UnloadLibrary,(void),(),)

+ 1 - 1
src/video/SDL_egl_c.h

@@ -117,7 +117,7 @@ typedef enum SDL_EGL_ExtensionType
 
 extern bool SDL_EGL_HasExtension(SDL_VideoDevice *_this, SDL_EGL_ExtensionType type, const char *ext);
 
-extern bool SDL_EGL_GetAttribute(SDL_VideoDevice *_this, SDL_GLattr attrib, int *value);
+extern bool SDL_EGL_GetAttribute(SDL_VideoDevice *_this, SDL_GLAttr attrib, int *value);
 /* SDL_EGL_LoadLibrary can get a display for a specific platform (EGL_PLATFORM_*)
  * or, if 0 is passed, let the implementation decide.
  */

+ 2 - 2
src/video/SDL_video.c

@@ -4543,7 +4543,7 @@ void SDL_GL_ResetAttributes(void)
     _this->gl_config.egl_platform = 0;
 }
 
-bool SDL_GL_SetAttribute(SDL_GLattr attr, int value)
+bool SDL_GL_SetAttribute(SDL_GLAttr attr, int value)
 {
 #if defined(SDL_VIDEO_OPENGL) || defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2)
     bool result;
@@ -4661,7 +4661,7 @@ bool SDL_GL_SetAttribute(SDL_GLattr attr, int value)
 #endif // SDL_VIDEO_OPENGL
 }
 
-bool SDL_GL_GetAttribute(SDL_GLattr attr, int *value)
+bool SDL_GL_GetAttribute(SDL_GLAttr attr, int *value)
 {
 #if defined(SDL_VIDEO_OPENGL) || defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2)
     PFNGLGETERRORPROC glGetErrorFunc;