Skip to main content
gamedev.net
🔒 Locked

Smart pointers

Started by aker_jus May 8, 2003 at 12:30 PM 1 replies 550+ views
Original Post
aker_jus
aker_jus
I was recently looking at CComPtr of atlbase.h and I was wondering if it would be a good choice to use Smart pointers instead of the ordinary way LPDIRECT3DDEVICE9 for instance. I will not have to call Release, is that right? Any other benefits I get from smart pointers? Thanks
GraphicsWare|RenderTechhttp://www.graphicsware.com3D Graphics & Solutions
kimryo
kimryo
Yes,do not need call release any more,because CComPtr call it on destruct.

More benefits on QIs.

We create world.
God create the world,we create another one.-Reference
aker_jus
aker_jus
QIs? Can you tell me some more on that?

Also, if I create the device first and then the texture for example, how do I make sure that the texture is released before the device? Or does it handle it automatically?
GraphicsWare|RenderTechhttp://www.graphicsware.com3D Graphics & Solutions

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.