Hi,
you need to include windows.h, the definition is into d3d9.h
ENABLE_RENDER material flag lets you modify the render of each visible entity which has the material assigned.
(untested code)
#define skFloatArray skill20
...
function evnMtl00 () {
if (mtl->d3deffect == NULL) // no effect loaded?
return 1; // do not render
if (me == NULL) // not an actual entity?
return 0; // render as it is
LPD3DXEFFECT _fx = mtl->d3deffect;
// fill a float array, or retrieve a pointer to an array from the entity skill or whatever
float *_fArray = (float*)my->skFloatArray;
_fx->SetVector("myFloats", _fArray);
return 0;
}
MATERIAL *mtl00 = {
event = evnMtl00;
flags = ENABLE_RENDER;
}
This is only needed when each entity has its own values for the same variables.