Hey guys,
In my application I want to set a texture as shader resource, so the pixel shader can sample it using the passed in uv coordinates. Generally, I know how to do it and I have it working in another place of my application. However, for one special case it just doesn't seem to work and I can't get rid of a compilation error.
I have a class Font with this function:
ID3D11ShaderResourceView* GetTexture();
And another class trying to access that function in order to get the texture and set it as a resource for the pixel shader:
pDeviceContext -> PSSetShaderResources(0, 1, m_font.GetTexture() );
(m_font is an object of the class Font, that has that GetTexture() function)
The compiler gives me this error:
argument of type "ID3D11ShaderResourceView *" is incompatible with parameter of type "ID3D11ShaderResourceView *const *"
I think I tried all combinations of constness for the return type of the GetTexture() function and nothing changed. Also, I'm building this pretty much based on a tutorial that has pretty much the same code, so I think it should be working. Especially as it is working somewhere else in my application (although I'm not getting the texture over a get-function there but pass in the address of a member texture).
So, please help me to solve this. Thank you very much in advance.