Home

Module lib2d

Classes

Functions

def init(render_backend=RenderBackend.GL, render_context=0)

Initializes lib2d.

Depending on the RenderBackend used you may need to pass in relevant context information. This is platform specific. For OpenGL make sure the context is currently bound when you call this function and pass NULL to render_context.

Examples

>>> import pygame
>>> from pygame.locals import *
>>> screen = pygame.display.set_mode((800, 600), HWSURFACE|OPENGL|DOUBLEBUF)
>>> lib2d.init(RenderBackend.GL)
>>> lib2d.viewport(800, 600)

def shutdown()

Releases all resources created by lib2d.

Examples

>>> lib2d.init()
>>> # game code ...
>>> lib2d.shutdown()

def viewport(width, height)

Informs lib2d of the current viewport size.

This should be kept up to date with the size of the window or surface you are rendering to.

def render()

Executes all draw commands issued since the last call to this function.