helm-1.0.0: A functionally reactive game engine.

Safe HaskellNone
LanguageHaskell2010

Helm.Engine.SDL

Contents

Description

Contains the SDL engine implementation of Helm.

Synopsis

Types

data SDLEngine Source

Represents the SDL engine's internal state.

Instances

data Image SDLEngine = SDLImage {} Source

Represents an Image for the SDL engine.

data SDLEngineConfig Source

Represents the configuration to run the SDL engine with. Use defaultConfig and then only change the necessary fields.

Startup

defaultConfig :: SDLEngineConfig Source

The default configuration for the engine. You should change the values where necessary.

startup :: IO SDLEngine Source

Initialize a new engine with default configuration. The engine can then be run later using run.

startupWith :: SDLEngineConfig -> IO SDLEngine Source

Initialize a new engine with some configration, ready to be run.

Asset Loading

withImage :: SDLEngine -> FilePath -> (Image SDLEngine -> IO a) -> IO a Source

Load an image asset using the SDL engine and do something with it. The image will be cleaned up once the provided monad completes.

Currently, the only supported image file format is PNG.

The expected usage would be to use withImage for each image you need to load before running the engine, and then use the images with graphics. Once the engine stops running, the image will then be automatically cleaned up.