</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>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>Sebastian Sylvan<br>