pygame2.sdlgfx – basic SDL_gfx wrapper module

Basic SDL_gfx library wrapper module

Module Functions

pygame2.sdlgfx.get_compiled_version() -> (int, int, int)

Gets the SDL_gfx version pygame2 was compiled against as three-value tuple.

This version is built at compile time. It can be used to detect which features may not be available through Pygame, if it is used as precompiled package using a different version of the SDL_gfx library.

FPSmanager

class pygame2.sdlgfx.FPSManager(framerate) → FPSManager

Creates a new FPSManager using the specified frame rate.

The FPSManager takes care of measuring and keeping constant frame rates for the application it is used with. On demand it automatically delays the execution to keep the required frame rate.

The desired frame rate must be within the range of FPS_LOWER_LIMIT and const:FPS_UPPER_LIMIT.

Attributes

FPSmanager.framerate
Gets or sets the frame rate to keep.

Methods

FPSmanager.delay() → None
Delays the execution of the application to keep up the desired frame rate.