<div dir="ltr">Thanks!</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Apr 27, 2014 at 8:15 AM, Niklas Hambüchen <span dir="ltr"><<a href="mailto:mail@nh2.me" target="_blank">mail@nh2.me</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yes, what Anthony says. I create the BufferObject from the Vector when<br>
what I want to render changes (which happens less frequently than every<br>
frame), and each frame then renders from the BufferObject.<br>
<br>
If you want to change single elements, like he says, the mutable vector<br>
should make you happy.<br>
<div class="HOEnZb"><div class="h5"><br>
On 27/04/14 04:54, Anthony Cowley wrote:<br>
>> So do you all just create a new vector every frame? Could you go into<br>
>> a little more detail?<br>
><br>
> You can create a new vector every frame, or you can use a mutable vector<br>
> that you freeze before passing to 'fromVector' or 'replaceVector'. You<br>
> can also investigate using, say, 10 vectors of 1k elements each if your<br>
> updates are spatially correlated somehow.  I do the latter when I am<br>
> generating new data over time, for example. The nice thing about using<br>
> Vector is that you can use it like an array that you peek from and poke<br>
> to, or you can take advantage of the fusion machinery to generate or<br>
> update it on the Haskell side before shipping the underlying data off to<br>
> OpenGL.<br>
><br>
> The specifics of your update patterns will govern what is the best strategy.<br>
><br>
> Anthony<br>
</div></div></blockquote></div><br></div>