Sign in to follow this  

allocating d3dxmeshcontainer

This topic is 4736 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

Hi there, recently I started to learn about skinning, its quite a lot to learn, so while I'm learning it I wanted to try to do some of the things myself. Basicly I want to do the recursion bit for a D3DXMESHCONTAINER_DERIVED (as derived from D3DXMESHCONTAINER). Can any one help with how to do the memory allocation?
D3DXMESHCONTAINER_DERIVED  mesh_derived; //make an original one
D3DXMESHCONTAINER_DERIVED  *meshhierachy; //define a pointer

meshhierachy = &mesh_derived; //make pointer point to original

int t = 0;
while(t <5)
{
//what here?
meshhierachy = new D3DXMESHCONTAINER_DERIVED; //make a new one.
meshhierachy =  //do whatever is neede with it.

//or 
meshhierachy += sizeof(D3DXMESHCONTAINER_DERIVED); //move the pointer up, then
//make a new one?
meshhierachy = new D3DXMESHCONTAINER_DERIVED;

outfile <<meshhierachy <<endl; //print out memory location for checking.
t++;

}
I think the second method works, but when I try to access them again using n* =+ sizeosizeof(), or n* -= sizeosizeof(), the pointer doesn't point to the same memory locations? At the moment I'm not trying to allocate everything in the containers, just the containers themselves. Alternatavely has anyone got amy other help/suggestions. Thanks alot

Share this post


Link to post
Share on other sites

This topic is 4736 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