News for hackers. Stuff that matters.
Re:EA open sources their internal version of STL by archangel_one on Monday October 25, 2010 @06:55PM (#1831993)
I wouldn't call myself an expert on vertex buffers, but IIRC the OpenGL API to load data into a buffer just takes a pointer to the data and a size, so requires that your data is contiguous in memory beforehand - so deque may not have been an option.
Re:EA open sources their internal version of STL by georgecmu on Monday October 25, 2010 @07:18PM (#1832070)
Agreed. But I can't think of any data structure that would offer you contiguous, order-preserving storage and O(1) insertions/deletions of arbitrary elements.
Re:EA open sources their internal version of STL by jemfinch on Tuesday October 26, 2010 @10:47AM (#1834381)
There are actually implementations of deque which can store elements contiguously: imagine a vector where the "first element" is placed in the middle of the vector, and push_{front,back} reallocate whenever either end is reached. It wastes more memory than the typical deque implementation, but the elements are contiguous.
Re:EA open sources their internal version of STL by georgecmu on Monday November 08, 2010 @02:04PM (#1883521)
You still don't get O(1) insertions/deletions of arbitrary elements with this implementation.

Insertions and deletions at either end are O(1), but inserting/deleting in the middle is costly.