@@ -188,10 +188,16 @@ def SDL_GET_CURRENT_BINARY() -> typing.Any:
188
188
189
189
def SDL_FUNC (name : str , retType : typing .Any , * args : typing .List [typing .Any ]) -> None :
190
190
"""Define an SDL3 function."""
191
- func = getattr (binary := SDL_GET_CURRENT_BINARY (), name )
192
- func .__binary__ , func .restype , func .argtypes = binary , retType , args
193
- if not __doc_generator__ : setattr (__module__ , name , func )
194
- __module__ .modules [SDL_GET_BINARY_NAME (binary )][name ] = func
191
+
192
+ if not hasattr (binary := SDL_GET_CURRENT_BINARY (), name ):
193
+ if int (os .environ .get ("SDL_IGNORE_MISSING_FUNCTIONS" , "0" )) > 0 : return
194
+ print ("\33 [35m" , f"function '{ name } ' not found in binary: '{ SDL_GET_BINARY_NAME (binary )} '." , "\33 [0m" , sep = "" , flush = True )
195
+
196
+ else :
197
+ func = getattr (binary , name )
198
+ func .__binary__ , func .restype , func .argtypes = binary , retType , args
199
+ if not __doc_generator__ : setattr (__module__ , name , func )
200
+ __module__ .modules [SDL_GET_BINARY_NAME (binary )][name ] = func
195
201
196
202
async def SDL_GET_LATEST_RELEASES () -> typing .Dict [str , str ]:
197
203
"""Get latest releases of SDL3 modules from their official github repositories."""
0 commit comments