c++ - Expression must be an lvalue -
there lot of such questions, going through them didn't solve problem in case.
the pssetshaderresources 3rd parameter wants id3dshaderresourceview* const*.
so cannot make way (because getting lvalue error):
// std::unique_ptr<texture> mtexture; // id3d11shaderresourceview* texture::gettexture() const { // return mtexture; // } devicecontext->pssetshaderresources( 0u, 1u, &mtexture->gettexture() ); that's why found way around make way:
auto tex = mtexture->gettexture(); devicecontext->pssetshaderresources( 0u, 1u, &tex ); however, i'd rid of auto tex = ... line. is there possibility change gettexture() method (or without changing it) write in first case?
okay, have solved changing gettexture() method to:
id3d11shaderresourceview* const* texture::gettexture() const { return &mtexture.p; // ccomptr<id3dshaderresourceview> mtexture; }
Comments
Post a Comment