On 24 June 2010 05:18, Misha Koshelev <misha680 at gmail.com> wrote:
+#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define ID3DXMesh_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define ID3DXMesh_AddRef(p) (p)->lpVtbl->AddRef(p) +#define ID3DXMesh_Release(p) (p)->lpVtbl->Release(p) +#else +/*** IUnknown methods ***/ +#define ID3DXMesh_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define ID3DXMesh_AddRef(p) (p)->AddRef() +#define ID3DXMesh_Release(p) (p)->Release() +#endif
Which version of the DX SDK do these match?
Ok, now here I just have to plead ignorance my apologies...
If I do not declare these functions, how do I call the Release method of the appropriate interfaces?
Specifically, I started looking at the test for line.c - I believe that if I create a mesh, I have to release it.
I have largely been learning from this page: http://www.mvps.org/directx/articles/d3dxmesh.htm (which is DirectX 8) but it seems I have to somehow release the functions no?
Also, I'm probably going to start with the D3DXCreateBox function, as I need to figure out exactly what's going on with the vertices before I delve into something as complicated as spheres ;)
Thanks y'all :)
Misha
On 25 June 2010 18:14, Misha Koshelev misha680@gmail.com wrote:
If I do not declare these functions, how do I call the Release method of the appropriate interfaces?
Specifically, I started looking at the test for line.c - I believe that if I create a mesh, I have to release it.
If it's just about releasing the interface, using the generic IUnknown_Release macro should always work. The larger issue though is that most (all?) of the d3dx9 interfaces don't have corresponding C macros. That means you'll have to call those functions explicitly through lpVtbl in C, but you'd have to do that when using the MS headers as well.