Skip to content

Create a RenderWindow class to manage Pygame initializationΒ #6

@dmccoystephenson

Description

@dmccoystephenson

Patchwork should provide a RenderWindow class that encapsulates Pygame setup logic and manages the window, surface, event loop, and frame rate.

The class should be designed for composition, not inheritance, so that clients like Apex can use it as a container for rendering rather than subclassing it.

Key Features

  • Initialize Pygame with title and window size
  • Expose get_surface(), tick(fps), and should_continue() methods
  • Allow registration of custom event handlers with register_event_handler(handler)
  • Call each handler on events, while handling QUIT internally

This enables modular, flexible use in multiple projects.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions