dumb question

Started by
5 comments, last by Njguy 15 years, 4 months ago
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 '.'
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.
Sirob Yes.» - status: Work-O-Rama.
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.
anyone...i cant seem to find anything that's similar to what im trying to do.
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.
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'
nvm i see my problem. thx guys

This topic is closed to new replies.

Advertisement