diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-01-25 23:24:20 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-01-25 23:24:20 +0000 |
| commit | f5cc92f41904dceaa6ef7f05f1860d381443e42f (patch) | |
| tree | 1231136b6a109c9934abdfb2944734d21da6a669 /Primitives/interface | |
| parent | c inteface: implemented core object VTBLs (diff) | |
| download | DiligentCore-f5cc92f41904dceaa6ef7f05f1860d381443e42f.tar.gz DiligentCore-f5cc92f41904dceaa6ef7f05f1860d381443e42f.zip | |
Updated Buffer and Texture C interfaces
Diffstat (limited to 'Primitives/interface')
| -rw-r--r-- | Primitives/interface/Object.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/Primitives/interface/Object.h b/Primitives/interface/Object.h index 1b3dbaf9..3635c154 100644 --- a/Primitives/interface/Object.h +++ b/Primitives/interface/Object.h @@ -84,23 +84,30 @@ public: struct IObject; +// clang-format off + struct IObjectVtbl { - void (*QueryInterface)(const struct INTERFACE_ID* IID, struct IObject** ppInterface); - ReferenceCounterValueType (*AddRef)(); - ReferenceCounterValueType (*Release)(); - class IReferenceCounters* (*GetReferenceCounters)(); + void (*QueryInterface) (struct IObject*, const struct INTERFACE_ID* IID, struct IObject** ppInterface); + ReferenceCounterValueType (*AddRef) (struct IObject*); + ReferenceCounterValueType (*Release) (struct IObject*); + class IReferenceCounters* (*GetReferenceCounters)(struct IObject*); }; +// clang-format on + struct IObject { struct IObjectVtbl* pObjectVtbl; - struct IObjectVtbl* pDeviceObjectVtbl; }; -# define IObject_QueryInterface(This, ...) (This)->pDeviceObjectVtbl->QueryInterface(This, __VA_ARGS__) -# define IObject_AddRef(This, ...) (This)->pDeviceObjectVtbl->AddRef(This, __VA_ARGS__) -# define IObject_Release(This) (This)->pDeviceObjectVtbl->Release() +// 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)) + +// clang-format on #endif |
