It seems to me that you are not really drawing anything. Are you sure setColors does what you think it does? If I need memory, to adjust the color palette for an 8-bit surface, then you explicitly set the 32-bit video mode.
, , , , , : 8- 8- 256 , ; , RGB-, 8 (32- 8- -, 8 padding , ).
, , , :
import Ix
getPix x y = SDL.Rect (fromIntegral x) (fromIntegral y) 1 1
drawPixel surf (x, y) = do
let pixRect = Just (getPix x y)
pixColor <- createColor surf x y 255
SDL.fillRect surf pixRect pixColor
drawGrad screen = mapM_ (drawPixel screen) $ range ((0,0),(255,255))
: , Win32. Haskell, . . Happy Fun IO Monad.
, , SDL, Haskell. Graphics.UI.SDL , , API C Haskell. SDL (, PyGame), SDL C .