Jump to content
  • Advertisement
Sign in to follow this  
Njguy

dumb question

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

I'm having problems accesing this structure.
struct MeshContainer : public D3DXMESHCONTAINER
{
	char **materialNames; // Temporary array of material (texture) names.
	Material **materials; // Array of materials used by the mesh container.
	ID3DXMesh *originalMesh; // Original mesh.
	D3DXATTRIBUTERANGE *attributeTable; // Mesh's attribute table.
	unsigned long totalAttributeGroups; // Total number of attribute groups.
	D3DXMATRIX **boneMatrixPointers; // Array of pointers to the bone transformation matrices.
};

I am trying to get the originalMesh out of the strucuture and put it in this Clonemesh function which is in another file.
// Clone the mesh to the NMapVertex format.
	ID3DXMesh* clonedTempMesh = 0;
	MeshContainer.originalMesh->CloneMesh(D3DXMESH_MANAGED, elems, g_engine->GetDevice(), &clonedTempMesh);

What I currently have, produces syntax errors. Anyone have any solutions? Errors: >c:\documents and settings\hp_administrator\desktop\source\chapter 10\engine\sceneobject.cpp(55) : error C2143: syntax error : missing ';' before '.' 1>c:\documents and settings\hp_administrator\desktop\source\chapter 10\engine\sceneobject.cpp(55) : error C2143: syntax error : missing ';' before '.'

Share this post


Link to post
Share on other sites
Advertisement
MeshContainer is a type. The . operator operates on instances, not types.

I'd recommend you review basic C/C++ tutorials, and get a good grasp of the differences between a type and an instance. You will not be able to even get started with DX until you are fully aware of the differences.

Share this post


Link to post
Share on other sites
Well not true, I have come a long way with directx, I have just never fully grasped pointers. Can you give me an example of what your referring to? Or a web link.

Share this post


Link to post
Share on other sites
What you're asking about has nothing to do with pointers. As sirob said, review basic C/C++ tutorials, and get a good grasp of the differences between a type and an instance.

Share this post


Link to post
Share on other sites
ok i see the dumb mistake I was doing, so I tried to fix it with this

ID3DXMesh* clonedTempMesh = 0;
m_mesh->CloneMesh(D3DXMESH_MANAGED, elems, g_engine->GetDevice(), &clonedTempMesh);


m_mesh is a pointer to the objects mesh. But I still get errors.

c:\documents and settings\hp_administrator\desktop\source\chapter 10\engine\sceneobject.cpp(55) : error C2039: 'CloneMesh' : is not a member of 'Mesh'
1> c:\documents and settings\hp_administrator\desktop\source\chapter 10\engine\mesh.h(53) : see declaration of 'Mesh'

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!