🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Method to store resources

Started by
2 comments, last by Calin 2 years, 7 months ago

How does one stores a DirectX resource in a C++ program. Let`s say I want to place several buffers in an array so that I can iterate through them. Do I need to create an array of pointers?

ID3D10Buffer* g_pVertexBuffer = NULL;

My project`s facebook page is “DreamLand Page”

Advertisement

Yes, D3D uses COM so you'll always be dealing with pointers to interfaces. It's pretty standard to store in an array/std::vector/etc of pointers. You can also use a COM smart pointer too if you prefer to have something handle calling AddRef/Release for you automatically. Those can also be stored in arrays just like a pointer.

Thanks MJP

My project`s facebook page is “DreamLand Page”

This topic is closed to new replies.

Advertisement