
I'm using SDL (http://hackage.haskell.org/packages/archive/SDL/0.5.9/doc/html/Graphics-UI-S...) As far as I know, in the original SDL for C, reading and writing pixels on a surface is done by accessing pointer + y * width + x. In Pygame, since Python has no such thing as pointer, they have get_at and set_at function for this task. I thought there would be something equivalent in Haskell SDL, but couldn't find any. For writing pixels on the Surface, I've found a couple of functions: Graphics.UI.SDL.Video.fillRect (http://hackage.haskell.org/packages/archive/SDL/0.5.9/doc/html/Graphics-UI-S...) Graphics.UI.SDL.Primitives.pixel (http://hackage.haskell.org/packages/archive/SDL-gfx/0.5.3/doc/html/Graphics-...) ... However, I can't find one that reads. Graphics.UI.SDL.Types.surfaceGetPixels (http://hackage.haskell.org/packages/archive/SDL/0.5.9/doc/html/Graphics-UI-S...) looks like the one, but I have no idea how I can use it, since it returns Pixels which is defined as: data PixelsData type Pixels = Ptr PixelsData I want to read a pixel at (x, y) of a Surface. Does anyone know how?