Okay,<br>so I think that the better idea is to carry on with my low-level, imperative binding, and then build a more functional on top of this.<br><br>Concerning the mutability of images, I notice that the problem with SFML is that it handles Sprites in a way that is even more imperative than OpenGL texture handling.<br>
<br><br><div class="gmail_quote">2010/7/7 Sebastian Sylvan <span dir="ltr">&lt;<a href="mailto:sebastian.sylvan@gmail.com">sebastian.sylvan@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br><br><div class="gmail_quote"><div class="im">On Wed, Jul 7, 2010 at 2:24 PM, Yves Parès <span dir="ltr">&lt;<a href="mailto:limestrael@gmail.com" target="_blank">limestrael@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

&gt; 2010/7/7 Liam O&#39;Connor <span dir="ltr">&lt;<a href="mailto:liamoc@cse.unsw.edu.au" target="_blank">liamoc@cse.unsw.edu.au</a>&gt;</span><div><br>&gt; Making an immutable API from a mutable one generally damages performance (on von neumann architectures) somewhat, the goal is to minimize that impact.<br>


</div><div class="gmail_quote"><div><br>In fact, I would like to determine if an EFFICIENT way to make images and such immutable exists, or if it is impossible.<br></div></div></blockquote><div><br></div></div><div>Both OpenGL and DirectX, while supporting updates to images, make it slow enough that any image data is effectively immutable. Each animation step a completely fresh frame buffer is created, without overwriting any of the inputs, by combining these immutable images in interesting ways.</div>

<div><br></div><div>You&#39;re expected to combine multiple immutable data sources in the shader to produce the final output (which will be a different image from the inputs). Examples of data sources would be images, transformation matrices, colours etc.</div>

<div><br></div><div>It&#39;s extremely rare to see people poke values individually into a mutable buffer (in fact, the capability of doing this on the GPU is very recent, and even then it&#39;s highly limited). You do a big purely functional transform from inputs to outputs instead. HLSL and GLSL may not look like functional languages, but they essentially are, in that each kernel runs independently with no shared mutable state, producing outputs from immutable inputs.</div>

<div><br></div><div>So, if you want to do it on the CPU, I would mimic the way GPUs have been doing it for ages. Define what operations you want to perform in terms of the inputs, and then do them all &quot;in bulk&quot; to produce the output image. You don&#39;t want people to go in and arbitrarily set pixels to anything they want at any time they want.</div>

<div><br></div></div><br>-- <br><font color="#888888">Sebastian Sylvan<br>
</font></blockquote></div><br>