File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -2370,12 +2370,25 @@ pg_is_vsync(PyObject *self, PyObject *_null)
23702370 }
23712371
23722372 if (state -> using_gl ) {
2373+ #if SDL_VERSION_ATLEAST (3 , 0 , 0 )
2374+ int interval ;
2375+ if (!SDL_GL_GetSwapInterval (& interval )) {
2376+ return RAISE (pgExc_SDLError , SDL_GetError ());
2377+ }
2378+ if (interval != 0 ) {
2379+ Py_RETURN_TRUE ;
2380+ }
2381+ else {
2382+ Py_RETURN_FALSE ;
2383+ }
2384+ #else
23732385 if (SDL_GL_GetSwapInterval () != 0 ) {
23742386 Py_RETURN_TRUE ;
23752387 }
23762388 else {
23772389 Py_RETURN_FALSE ;
23782390 }
2391+ #endif
23792392 }
23802393
23812394 Py_RETURN_FALSE ;
@@ -2534,7 +2547,11 @@ pg_toggle_fullscreen(PyObject *self, PyObject *_null)
25342547 */
25352548 if (state -> using_gl ) {
25362549 p_glViewport = (GL_glViewport_Func )SDL_GL_GetProcAddress ("glViewport" );
2550+ #if SDL_VERSION_ATLEAST (3 , 0 , 0 )
2551+ SDL_GetWindowSizeInPixels (win , & w , & h );
2552+ #else
25372553 SDL_GL_GetDrawableSize (win , & w , & h );
2554+ #endif
25382555 }
25392556 else {
25402557 w = display_surface -> surf -> w ;
You can’t perform that action at this time.
0 commit comments