9 import Graphics
.UI
.SDL
(Surface
)
16 data Backend
= UseSDL | UseOpenGL
19 startVideo
:: Int -> Int -> Backend
-> IO Video
20 startVideo w h UseSDL
= do
21 screen
<- setupSDL w h
22 return (mkClassicBackend screen
)
23 startVideo w h UseOpenGL
= do
28 mkClassicBackend
:: Surface
-> Video
29 mkClassicBackend screen
= Video
{
30 clear
= sdlClear screen
,
31 loadImage
= sdlLoadImage screen
,
32 setClip
= sdlSetClip screen
,
33 finalize
= sdlFinalize screen
39 loadImage
= glLoadImage
,
47 drawImage
:: Coord
-> Image
-> IO ()
48 drawImage xy img
= (imgApply img
) xy