SDL module
This module is under development and the interface may change.
SDL provides a low-level interface to video output, and keyboard and mouse input. This module currently supports making windowed or full-screen graphical applications, reading keyboard and mouse input, and displaying the contents of BMP graphics.
See the examples/sdl directory in the Kaya distribution for a simple example program.
Data types
- SDL::BPP - A colour depth.
- SDL::KeyModifier - A key modifier
- SDL::Rect - A rectangle
- SDL::SDLColour - A colour
- SDL::SDLEvent - An input event
- SDL::SDLKey - A key press
- SDL::SDLSurface - An SDL surface
Exceptions
- IllegalMode - An illegal display mode was selected
- LoadingError - A BMP file could not be loaded
- SDLQuit - The SDL application quit
Functions
- Void blitSurface(SDLSurface src,Rect srcrect,SDLSurface dest,Rect destrect) - Copy from one surface to another
- Void drawRectangle(SDLSurface surface,Rect rect,SDLColour colour) - Draw a filled rectangle
- SDLSurface loadSurface(String file) - Load an image file
- SDLSurface newSurface(Int x,Int y,BPP bpp,Bool fullscreen) - Create a new display window or screen
- SDLEvent nextEvent() - Get the next input event
- String sdlError() - Describe SDL error
- Void sdlInit() - Initialise SDL libraries
- Void sdlQuit() - Shutdown SDL libraries
- Void setTransparency(SDLSurface surface,SDLColour rgba) - Set surface transparency
- Void setWMIcon(SDLSurface icon) - Set window icon
- Void setWMTitle(String wmtitle,String icontitle) - Set window title
- Void updateScreen(SDLSurface screen) - Update the screen