Jump to content
  • Advertisement
Sign in to follow this  
cannyshammy

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.

If you intended to correct an error in the post then please contact us.

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 this post


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

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!