Handle error return value for SDL_GetSwapInterval

This commit is contained in:
Sylvain Becker
2023-01-01 17:20:41 +01:00
committed by GitHub
parent a515f51ac0
commit 8a13533949
7 changed files with 68 additions and 17 deletions

View File

@@ -1989,18 +1989,20 @@ extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval);
* Get the swap interval for the current OpenGL context.
*
* If the system can't determine the swap interval, or there isn't a valid
* current context, this function will return 0 as a safe default.
* current context, this function will set *interval to 0 as a safe default.
*
* \returns 0 if there is no vertical retrace synchronization, 1 if the buffer
* \param interval Output interval value. 0 if there is no vertical retrace synchronization, 1 if the buffer
* swap is synchronized with the vertical retrace, and -1 if late
* swaps happen immediately instead of waiting for the next retrace;
* swaps happen immediately instead of waiting for the next retrace
*
* \returns 0 on success or -1 error.
* call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GL_SetSwapInterval
*/
extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void);
extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(int *interval);
/**
* Update a window with OpenGL rendering.