From 7cc1c475e5822da8bad790b66d3ddbd5f8afddd5 Mon Sep 17 00:00:00 2001 From: assiduous Date: Sat, 25 Jan 2020 19:06:12 -0800 Subject: Fixed Buffer, BufferView, Texture, TextureView interfaces; added C interface tests --- Primitives/interface/Object.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'Primitives/interface') diff --git a/Primitives/interface/Object.h b/Primitives/interface/Object.h index 3635c154..a3ede3ff 100644 --- a/Primitives/interface/Object.h +++ b/Primitives/interface/Object.h @@ -86,7 +86,7 @@ struct IObject; // clang-format off -struct IObjectVtbl +struct IObjectMethods { void (*QueryInterface) (struct IObject*, const struct INTERFACE_ID* IID, struct IObject** ppInterface); ReferenceCounterValueType (*AddRef) (struct IObject*); @@ -94,18 +94,23 @@ struct IObjectVtbl class IReferenceCounters* (*GetReferenceCounters)(struct IObject*); }; +struct IObjectVtbl +{ + struct IObjectMethods Object; +}; + // clang-format on struct IObject { - struct IObjectVtbl* pObjectVtbl; + struct IObjectVtbl* pVtbl; }; // clang-format off -# define IObject_QueryInterface(This, ...) (This)->pObjectVtbl->QueryInterface((struct IObject*)(This), __VA_ARGS__) -# define IObject_AddRef(This, ...) (This)->pObjectVtbl->AddRef ((struct IObject*)(This), __VA_ARGS__) -# define IObject_Release(This) (This)->pObjectVtbl->Release ((struct IObject*)(This)) +# define IObject_QueryInterface(This, ...) (This)->pVtbl->Object.QueryInterface((struct IObject*)(This), __VA_ARGS__) +# define IObject_AddRef(This, ...) (This)->pVtbl->Object.AddRef ((struct IObject*)(This), __VA_ARGS__) +# define IObject_Release(This) (This)->pVtbl->Object.Release ((struct IObject*)(This)) // clang-format on -- cgit v1.2.3