# Changing Materials Values ( error C2100: illegal indirection )

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

## Recommended Posts

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

##### Share on other sites
I guess m_pMeshMaterials is a pointer. So why do you derefence the element indexed with ? Just remove the '*'s.

1. 1
2. 2
3. 3
Rutin
14
4. 4
5. 5

• 9
• 9
• 11
• 11
• 23
• ### Forum Statistics

• Total Topics
633670
• Total Posts
3013262
×