On Wed, Feb 27, 2008 at 10:06 PM, Night Hawk
[EMAIL PROTECTED] wrote:
Surprising indeed. I was about to override the Array classes to use native
c-style arrays. But now it seems OSG can convert vectors to C-style arrays
fast enough :)
The OSG wouldn't do it if it wasn't efficient, its
On Thu, 2008-02-28 at 09:11 +, Robert Osfield wrote:
On Wed, Feb 27, 2008 at 10:06 PM, Night Hawk
[EMAIL PROTECTED] wrote:
Surprising indeed. I was about to override the Array classes to use native
c-style arrays. But now it seems OSG can convert vectors to C-style arrays
fast enough
Hello all,
I was going through the source-code of Array class in the OSG and was
wondering the data-conversion efficiency between STL::Vector (used by OSG
Arrays) and the underlying OpenGL C-Style Arrays.
However, I came across this usage where vector.front() is used to treat the
vector members
std::vector is guaranteed to have contiguous memory. So vector.front() or
(vector[0]) are legal references to the first element of a c-style array.
That is why it is important to preallocate vectors to the expected length
when possible, to avoid the reallocation hit necessary to preserve
Mike Weiblen wrote:
std::vector is guaranteed to have contiguous memory. So vector.front() or
(vector[0]) are legal references to the first element of a c-style array.
That is why it is important to preallocate vectors to the expected length
when possible, to avoid the reallocation hit
5 matches
Mail list logo