Sign in to follow this  

ID3DXEffect::SetValue with textures

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this