class SDL_DLL(library_name, version_function_name, version=None)

Bases: object

assert_version_compatible(name, since)

Raises an exception if since is later than the loaded library.

function(name, doc, args=[], arg_types=[], return_type=None, dereference_return=False, require_return=False, success_return=None, error_return=None, since=None)

Construct a wrapper function for ctypes.


The name of the function as it appears in the shared library.


Docstring to associate with the wrapper function.


List of strings giving the argument names.


List of ctypes classes giving the argument types.


The ctypes class giving the wrapped function’s native return type.


If True, the return value is assumed to be a pointer and will be dereferenced via .contents before being returned to the user application.


Used in conjunction with dereference_return; if True, an exception will be raised if the result is NULL; if False None will be returned when the result is NULL.


If not None, the expected result of the wrapped function. If the return value does not equal success_return, an exception will be raised.


If not None, the error result of the wrapped function. If the return value equals error_return, an exception will be raised. Cannot be used in conjunction with success_return.


Tuple (major, minor, patch) or string ‘x.y.z’ of the first version of SDL in which this function appears. If the loaded version predates it, a placeholder function that raises SDL_NotImplementedError will be returned instead. Set to None if the function is in all versions of SDL.

private_function(name, **kwargs)

Construct a wrapper function for ctypes with internal documentation and no argument names.


Returns True iff v is equal to or later than the loaded library version.