File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed
Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change 1515
1616__sdl_version__ = ""
1717
18+ REQUIRED_SDL_VERSION = (3 , 2 , 0 )
19+
1820ffi_check = cffi .FFI ()
1921ffi_check .cdef (
2022 """
21- typedef struct SDL_version
22- {
23- uint8_t major;
24- uint8_t minor;
25- uint8_t patch;
26- } SDL_version;
27-
28- void SDL_GetVersion(SDL_version * ver);
23+ int SDL_GetVersion(void);
2924"""
3025)
3126
@@ -34,10 +29,12 @@ def verify_dependencies() -> None:
3429 """Try to make sure dependencies exist on this system."""
3530 if sys .platform == "win32" :
3631 lib_test : Any = ffi_check .dlopen ("SDL3.dll" ) # Make sure SDL3.dll is here.
37- version : Any = ffi_check .new ("struct SDL_version*" )
38- lib_test .SDL_GetVersion (version ) # Need to check this version.
39- version_tuple = version .major , version .minor , version .patch
40- if version_tuple < (2 , 0 , 5 ):
32+ int_version = lib_test .SDL_GetVersion () # Need to check this version.
33+ major = int_version // 1000000
34+ minor = (int_version // 1000 ) % 1000
35+ patch = int_version % 1000
36+ version_tuple = major , minor , patch
37+ if version_tuple < REQUIRED_SDL_VERSION :
4138 msg = f"Tried to load an old version of SDL { version_tuple !r} "
4239 raise RuntimeError (msg )
4340
You can’t perform that action at this time.
0 commit comments