Sign in to follow this  

SetVertexQuantity wild magic Geometric tools

This topic is 2848 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hy. I'use wild magic engine from geometric tools. My problem is that i must fill a vertexbuffer with data but i don't know how many vertex the mesh have at the start, then i'm trying to use the SetVertexQuantity for dinamically allocate new space , the problem is that this don't work:
if(m_pkCurrVBuffer->GetVertexQuantity()<= (nQuantityCurrent)
m_pkCurrVBuffer->SetVertexQuantity(nQuantityCurrent+1);

when nQuantityCurrent+1 is the new size of the vertexbuffer. This cause some memory problem : a map or some vars that are in the scope of the function are leaked. But if i set a large size at the start:
    Attributes kAttr;
    kAttr.SetPositionChannels(3);
    kAttr.SetTCoordChannels(0,3);
    kAttr.SetNormalChannels(3);
    kAttr.SetTangentChannels(3);
    m_pkCurrVBuffer = WM4_NEW VertexBuffer(kAttr, 1000);

all works fine. Someone uses this engine? How i can dinamcally resize the vertexbuffer

Share this post


Link to post
Share on other sites

This topic is 2848 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this