Below is some code to use SDL with Haskell to draw a diagonal line. I get a CYAN line when the RGB clearly should be white. This is on Ubuntu. Am I doing something wrong?
import qualified Graphics.UI.SDL as SDL
import qualified Graphics.UI.SDL.Primitives as SDLP
main = do
SDL.init [SDL.InitEverything]
SDL.setVideoMode 640 480 32 []
SDL.setCaption "My Window" "My Test"
surf0 <- SDL.getVideoSurface
white <- SDL.mapRGB (SDL.surfaceGetPixelFormat surf0) 255 255 255
SDLP.line surf0 0 0 640 480 white
SDL.flip surf0
eventLoop
SDL.quit
print "done"
where
eventLoop = SDL.waitEventBlocking >>= checkEvent
checkEvent (SDL.KeyUp _) = return ()
checkEvent _ = eventLoop