I saw this code line in the Direct3D SDK and I want to know what id does exactly. Does it convert from object type to another object type, or set data, or what?
ID3DX11Effect effect ;
ID3DX11EffectShaderResourceVariable var ;
var = effect->GetVariableByName ( "texture_obj" )->AsShaderResource() ;
GetVariableByName() has ID3DX11EffectVariable type .
My question is about the second part AsShaderResource(): does it convert the ID3DX11EffectVariable to ID3DX11EffectShaderResourceVariable?
Yes, it converts the effect’s variable into a shader resource variable.
See the MS specs (section ‘Remarks’).