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;
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”
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.