I am loading a traffic lights model with the.x functions the problem is i want 3 texture states for the lights etc, red, amba , green , how would i load 3 different textures if the model loading function loads 1 texture?
for(DWORD i = 0; i < numMaterials; i++) // for each material...
{
material = tempMaterials.MatD3D; // get the material info
material.Ambient = material.Diffuse; // make ambient the same as diffuse
// if there is a texture to load, load it
if(FAILED(D3DXCreateTextureFromFileA(d3ddev,
tempMaterials.pTextureFilename,
&texture)))
texture = NULL; // if there is no texture, set the texture to NULL
}
could i not use D3DXCreateTextureFromFileA 3 times on the different texture states and apply the texture this way?
because in code i need to set device->SetTexture(&red); , device->SetTexture(&amba); device->SetTexture(&green);
http://i.imgur.com/hGL4nHH.png?1
thanks if you can help