Changing Materials Values ( error C2100: illegal indirection )

Started by
0 comments, last by VolkerG 19 years, 4 months ago
Hi All! Making a game where you can change the colour of a mesh dynamically. Each mesh has a single material so i thought it would be no problem changing the colours all i would have to do was something like this:


for( DWORD i=0; i<m_dwNumMaterials; i++ )
{
        *m_pMeshMaterials.Diffuse.r = r;
	*m_pMeshMaterials.Diffuse.g = g;
	*m_pMeshMaterials.Diffuse.b = b;
}


However as the title of this post suggests its not that simple, i have been getting "error C2100: illegal indirection" errors. Any ideas why im getting this? Im sorry if this is abit of a nooby question as i have only been C++ programming a few weeks ;) Cheers Mike
Advertisement
I guess m_pMeshMaterials is a pointer. So why do you derefence the element indexed with ? Just remove the '*'s.

This topic is closed to new replies.

Advertisement