• Advertisement
Sign in to follow this  

ID3DXEffect::SetValue with textures

This topic is 3911 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

The effect interface i'm implimenting does not know what type of value it is setting to each effect parameter (i.e. matrix, vector, texture, etc). The value is verified when the handle is retrieved and then all parameters are set with SetValue() calls. This seems to work fine for matrices and other things, but not with textures. Ther is no invalid call, but an access violation error. For example
void EffectParameter::SetValue(void* value)
    _myEffect->SetValue(_myHandle, value, D3DX_DEFAULT); //This works for matrices
    //_myEffect->SetTexture(_myHandle, (IDirect3DBaseTexture9*)value); //This actually works for textures, but of course you get an invalid call for everything else

I have never seen any examples of setting textures with SetValue, even though it says its legal. Do you pass in a (IDirect3DBaseTexture9*) or a (IDirect3DBaseTexture9**) and what do you pass for the size, I tried sizeof(IDirect3DBaseTexture9*) and 4 and D3DX_DEFAULT, all failed (acces violation). Thanks

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement