The :mod:`pygame2.base` C API contains fundamental core objects and functions used throughout nearly all :mod:`pygame2` modules. As such, it should be considered to be imported in the first place in all C extensions for :mod:`pygame2`.
For platform and system environment compatibility, :mod:`pygame2.base` defines a small set of own types to be used for most of its functions.
In addition to the types, a set of helpful macros was established, which are used heavily and should be relied on wherever possible.
The PyColor object is suitable for storing RGBA color values that feature a 8-bit resolution range for each channel (allowing it to represent a 24/32-bit color depth).
The PyRect object defines a rectangular area for arbitrary usage. It features the most typical operations, but is - due to its integer resolution - limited in some usage scenarios.
The PyFRect object defines a rectangular area for arbitrary usage and a high floating point resolution. It features the most typical operations required by most applications.
The PyBufferProxy object is a transparent proxy class for buffer-like access. It supports the Python 2.x and 3.x buffer APIs, automatic unlock hooks for the buffer object and read/write access to the buffer contents.
The PyFont object an abstract base class, to be used by inheriting classes and other interfaces, so it is guaranteed that font-like objects contain a set of same attributes and methods.
PyFont only defines a set of function pointer bindings to access and set by inheriting classes and interfaces. Those are
The PySurface object is an abstract base class, to be used by inheriting classes and other interfaces, so it is guaranteed that surface-like objects contain a set of same attributes and methods.
PySurface only defines a set of function pointer bindings to access and set by inheriting classes and interfaces. Those are
CPyStreamWrapper is a C API only class type for reading and writing Python stream objects in a threaded or non-threaded manner. It encapsules the important underlying stream methods.
The C functions provided below do not perform any argument checks. It is up to the caller to ensure that the passed CPyStreamWrapper argument is correct.