array of Materials.

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Epsilon
Posts: 38
Joined: Fri Jan 09, 2004 1:46 pm
Location: Argentina

array of Materials.

Post by Epsilon »

hi, i have an error when i compile that i dont understand, maybe you can help me.

the error is in the line:
buffer->Material = MaterialList[Index];

MaterialList is an array of pointers to SMaterials, that is passed in a function.
core::array<video::SMaterial>* MaterialList

the error is:
error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class irr::core::array<struct irr::video::SMaterial>' (or there is no acceptable conversion)

i think this says which the class array cant return the class SMaterial, or something like this.

thanks.
Guest
Posts: 35
Joined: Mon Feb 02, 2004 7:17 pm
Location: Russia, Saint-Petersburg

Post by Guest »

:)

really easy - you should write

Code: Select all

if (MaterialList)
  buffer->Material  = (*MaterialList)[Index];
Look carefully and you will get what the problem is in two seconds I think :)
It's not an advance help, so, please post such questions into the beginners section :P
there is another guest...
Epsilon
Posts: 38
Joined: Fri Jan 09, 2004 1:46 pm
Location: Argentina

Post by Epsilon »

thanks but the problem is already solved :D
i changed the class in the array from SMaterial to MaterialGroup and found.
Post Reply