Hello,<br><br>I don&#39;t know if some of you are familiar with the SFML library (stands for Simple and Fast Multimedia Library) --&gt; <a href="http://sfml-dev.org" target="_blank">http://sfml-dev.org</a><br>As SDL, SFML is a 2D graphics library, but conversely to SDL it provides a hardware-accelerated drawing, through OpenGL.<br>
Well, I&#39;m currently writing its Haskell binding, and I&#39;m stuck with design issues.<br>
What I&#39;m heading to is a full IO binding, and that&#39;s what I&#39;d like to avoid.<br>I particularly like the way HGL works, with the Draw monad which (IMO) enables powerful composability of the drawings.<br>But HGL is simpler in the way that, for instance, it doesn&#39;t deal with images/sprites.<br>

So that&#39;s why I would like to pick up advice concerning the design of such a binding.<br><br>First, this is how SFML (in C/C++) works:<br>The main types are RenderWindow, Drawable, Image, Sprite, Shape, Font and Text.<br>

An Image basically represents an array of pixels. It is just a resource, and is not directly drawable. An image is loaded from a file, and provides methods for accessing/altering its pixels. Its main purpose is to be bound as an OpenGL texture.<br>
A RenderWindow is the window on which the Drawables are... well... drawn.<br>A Sprite, now, is a Drawable. One Sprite is linked to one Image. A Sprite NEVER alters its Image, it just provides positionning/rotation/resizing/colorizing methods that will be translated, when drawing on the RenderWindow, to glTranslate/glRotate/glScale/glColor, etc.<br>
So we can see a Sprite as an instance of an Image, since if a same Image is to be drawn 3 times on the same frame, we are advised to create three Sprites of it, which will differ by their position.<br><br>A Font is loaded from a file, it is a simple resource, just like Image.<br>
Text and Shape are Drawables.<br><br>So, now, questions:<br>1) For those who know HGL, can the monad Draw principle be adapted to my case? Or am I heading for disaster?<br><br>2) How would I handle images? SFML API enables the user to alter the pixels of the image, and I obviously don&#39;t wanna copy the entire Image each time a pixel is changed.<br>
3) Is there another library on hackage that handles images in a functional way? (I mean not <i>all in IO</i>)<br>