summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-01-26 04:12:57 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-01-26 04:12:57 +0000
commite5a8e78e2214ef16a3416d8c1d677336dee6dcd8 (patch)
tree1c47908ecb2484fcd00a51da2fad5defe6f85634 /Graphics/GraphicsEngine
parentFixed IObject::AddRef c interface (diff)
downloadDiligentCore-e5a8e78e2214ef16a3416d8c1d677336dee6dcd8.tar.gz
DiligentCore-e5a8e78e2214ef16a3416d8c1d677336dee6dcd8.zip
Fixed swap cahin C interface; added test.
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/include/QueryBase.h2
-rw-r--r--Graphics/GraphicsEngine/interface/SwapChain.h39
2 files changed, 31 insertions, 10 deletions
diff --git a/Graphics/GraphicsEngine/include/QueryBase.h b/Graphics/GraphicsEngine/include/QueryBase.h
index 31480f2c..daa0d30e 100644
--- a/Graphics/GraphicsEngine/include/QueryBase.h
+++ b/Graphics/GraphicsEngine/include/QueryBase.h
@@ -38,6 +38,8 @@
namespace Diligent
{
+class IDeviceContext;
+
/// Template class implementing base functionality for a Query object
/// \tparam BaseInterface - base interface that this class will inheret
diff --git a/Graphics/GraphicsEngine/interface/SwapChain.h b/Graphics/GraphicsEngine/interface/SwapChain.h
index 2cfcc5de..60bdb22f 100644
--- a/Graphics/GraphicsEngine/interface/SwapChain.h
+++ b/Graphics/GraphicsEngine/interface/SwapChain.h
@@ -94,25 +94,44 @@ public:
struct ISwapChain;
-struct ISwapChainVtbl
+// clang-format off
+
+struct ISwapChainMethods
{
- void (*Present)(Uint32 SyncInterval);
- const struct SwapChainDesc* (*GetDesc)();
- void (*Resize)(Uint32 NewWidth, Uint32 NewHeight);
- void (*SetFullscreenMode)(const struct DisplayModeAttribs* DisplayMode);
- void (*SetWindowedMode)();
- struct ITextureView* (*GetCurrentBackBufferRTV)();
- struct ITextureView* (*GetDepthBufferDSV)();
+ void (*Present) (struct ISwapChain*, Uint32 SyncInterval);
+ const struct SwapChainDesc* (*GetDesc) (struct ISwapChain*);
+ void (*Resize) (struct ISwapChain*, Uint32 NewWidth, Uint32 NewHeight);
+ void (*SetFullscreenMode) (struct ISwapChain*, const struct DisplayModeAttribs* DisplayMode);
+ void (*SetWindowedMode) (struct ISwapChain*);
+ struct ITextureView* (*GetCurrentBackBufferRTV)(struct ISwapChain*);
+ struct ITextureView* (*GetDepthBufferDSV) (struct ISwapChain*);
};
// clang-format on
+struct ISwapChainVtbl
+{
+ struct IObjectMethods Object;
+ struct ISwapChainMethods SwapChain;
+};
+
struct ISwapChain
{
- struct IObjectVtbl* pObjectVtbl;
- struct ISwapChain* pSwapChainVtbl;
+ struct ISwapChainVtbl* pVtbl;
};
+// clang-format off
+
+# define ISwapChain_Present(This, ...) (This)->pVtbl->SwapChain.Present ((struct ISwapChain*)(This), __VA_ARGS__)
+# define ISwapChain_GetDesc(This) (This)->pVtbl->SwapChain.GetDesc ((struct ISwapChain*)(This))
+# define ISwapChain_Resize(This, ...) (This)->pVtbl->SwapChain.Resize ((struct ISwapChain*)(This), __VA_ARGS__)
+# define ISwapChain_SetFullscreenMode(This, ...) (This)->pVtbl->SwapChain.SetFullscreenMode ((struct ISwapChain*)(This), __VA_ARGS__)
+# define ISwapChain_SetWindowedMode(This) (This)->pVtbl->SwapChain.SetWindowedMode ((struct ISwapChain*)(This))
+# define ISwapChain_GetCurrentBackBufferRTV(This) (This)->pVtbl->SwapChain.GetCurrentBackBufferRTV((struct ISwapChain*)(This))
+# define ISwapChain_GetDepthBufferDSV(This) (This)->pVtbl->SwapChain.GetDepthBufferDSV ((struct ISwapChain*)(This))
+
+// clang-format on
+
#endif
DILIGENT_END_NAMESPACE // namespace Diligent