I want to use the Haskell SDL binding to draw simple objects (triangle, circles, etc.). There is a function for drawing rectangles in Graphics.UI.SDL.Video, which works fine. But I can not get the functions that I found for drawing other primitives (in Graphics.UI.SDL.Primitives) to work. The following code draws only a rectangle. Any ideas what I missed?
module Main where import Graphics.UI.SDL as SDL import Graphics.UI.SDL.Color import Graphics.UI.SDL.Primitives main = do SDL.init [SDL.InitVideo] screen <- SDL.setVideoMode 500 500 32 [SDL.HWSurface] SDL.fillRect screen Nothing (SDL.Pixel 0x0000FF) fillRect screen (Just (SDL.Rect 10 10 30 30)) (SDL.Pixel 0x00FF0000) filledCircle screen 40 40 50 (SDL.Pixel 0x00FF0000) SDL.flip screen delay 2000 SDL.quit
source share