diff --git a/src/libretro/api/__init__.py b/src/libretro/api/__init__.py index e2f1d30..e47b5b7 100644 --- a/src/libretro/api/__init__.py +++ b/src/libretro/api/__init__.py @@ -1,3 +1,29 @@ +""" +This module contains types that directly correspond to the libretro API, + +All ``retro_`` classes in this package are ctypes wrappers around their equivalents in +`libretro-common `_. + +Unless otherwise noted, all structs can be copied with ``copy.deepcopy``; +the struct itself and its fields (including strings and buffers) are all deep-copied. +For example: + +.. code-block:: python + + import copy + from libretro.api import retro_controller_description + + desc = retro_controller_description(b'Game Pad', 5) + desc_copy = copy.deepcopy(desc) + + assert desc == desc_copy + + desc.desc = b'Another Game Pad' + assert desc != desc_copy + +Additionally, all `c_char_p` fields are converted to Python `bytes` objects when accessed. +""" + from .audio import * from .av import * from .camera import * diff --git a/src/libretro/core.py b/src/libretro/core.py index 1810f22..3ef9c2f 100644 --- a/src/libretro/core.py +++ b/src/libretro/core.py @@ -38,6 +38,10 @@ class CoreInterface(Protocol): + """ + An interface for a libretro core. + """ + @abstractmethod def set_environment(self, env: retro_environment_t) -> None: ... diff --git a/src/libretro/driver/__init__.py b/src/libretro/driver/__init__.py index e13932c..ae1ac95 100644 --- a/src/libretro/driver/__init__.py +++ b/src/libretro/driver/__init__.py @@ -1,3 +1,7 @@ +""" +stuff for drivers +""" + from .audio import * from .camera import * from .content import * diff --git a/src/libretro/driver/audio/__init__.py b/src/libretro/driver/audio/__init__.py index 702be4c..03c8f4d 100644 --- a/src/libretro/driver/audio/__init__.py +++ b/src/libretro/driver/audio/__init__.py @@ -1,3 +1,7 @@ +""" +Drivers for handling audio output. +""" + from .driver import * from .array import * from .wave import *