Safe Haskell | None |
---|---|
Language | Haskell2010 |
Contains the SDL engine implementation of Helm.
- data SDLEngine
- data SDLEngineConfig = SDLEngineConfig {}
- defaultConfig :: SDLEngineConfig
- startup :: IO SDLEngine
- startupWith :: SDLEngineConfig -> IO SDLEngine
- withImage :: SDLEngine -> FilePath -> (Image SDLEngine -> IO a) -> IO a
Types
Represents the SDL engine's internal state.
data SDLEngineConfig Source
Represents the configuration to run the SDL engine with.
Use defaultConfig
and then only change the necessary fields.
SDLEngineConfig | |
|
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.