Source

pygame / doc / capi / base.rst

pygame2.base

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`.

Import

Include headers:

pygame2/pgbase.h

Basic Types

For platform and system environment compatibility, :mod:`pygame2.base` defines a small set of own types to be used for most of its functions.

Macros

In addition to the types, a set of helpful macros was established, which are used heavily and should be relied on wherever possible.

Errors

Functions

PyColor

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).

Members

Functions

PyRect

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.

Members

Functions

PyFRect

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.

Members

Functions

PyBufferProxy

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.

Members

Functions

PyFont

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.

Members

PyFont only defines a set of function pointer bindings to access and set by inheriting classes and interfaces. Those are

Functions

PySurface

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.

Members

PySurface only defines a set of function pointer bindings to access and set by inheriting classes and interfaces. Those are

Functions

CPyStreamWrapper

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.

Note

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.

Members

Functions