Elmi
Elmi

Reputation: 6203

What function releases a ID3D11Texture2D?

I create a currTexture of type ID3D11Texture2D via a call to

ID3D11Device->CreateTexture2D(&m_desc, NULL, &currTexture);

What is the proper way to release the resources assigned to this Texture2D? There does not exist a ReleaseTexture2D()-function or something like that…

Thanks! :-)

Upvotes: 0

Views: 880

Answers (1)

gonutz
gonutz

Reputation: 5582

There does exists a Release method as you can see in the docs:

"The ID3D11Texture2D interface inherits from ID3D11Resource".

"The ID3D11Resource interface inherits from ID3D11DeviceChild".

"The ID3D11DeviceChild interface inherits from the IUnknown interface".

And the IUnknown has method Release.

So call currTexture->Release() when you are done with it.

Upvotes: 2

Related Questions