diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-01-28 20:30:39 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-01-28 20:30:39 +0000 |
| commit | de9b8692d538f4249e30dd979c3ebac45120be41 (patch) | |
| tree | 2a0c65090d858680c3767d4dc974fd483f923294 /Graphics/GraphicsEngineOpenGL | |
| parent | Fixed few issues in C interface (diff) | |
| download | DiligentCore-de9b8692d538f4249e30dd979c3ebac45120be41.tar.gz DiligentCore-de9b8692d538f4249e30dd979c3ebac45120be41.zip | |
Reworked interface definitions to use DILIGENT_BEGIN_INTERFACE/DILIGENT_END_INTERFACE pair
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
14 files changed, 28 insertions, 60 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/interface/BufferGL.h b/Graphics/GraphicsEngineOpenGL/interface/BufferGL.h index 26c3b377..3ce855ec 100644 --- a/Graphics/GraphicsEngineOpenGL/interface/BufferGL.h +++ b/Graphics/GraphicsEngineOpenGL/interface/BufferGL.h @@ -42,11 +42,12 @@ static const INTERFACE_ID IID_BufferGL = {0x8df7319, 0xf425, 0x4ec7, {0x8d, 0x2b, 0x1b, 0x3f, 0xc0, 0xbd, 0xdb, 0xb4}}; /// Exposes OpenGL-specific functionality of a buffer object. -DILIGENT_INTERFACE(IBufferGL, IBuffer) +DILIGENT_BEGIN_INTERFACE(IBufferGL, IBuffer) { /// Returns OpenGL buffer handle VIRTUAL GLuint METHOD(GetGLBufferHandle)(THIS) PURE; }; +DILIGENT_END_INTERFACE #include "../../../Primitives/interface/UndefInterfaceHelperMacros.h" @@ -60,11 +61,6 @@ struct IBufferGLVtbl struct IBufferGLMethods BufferGL; }; -typedef struct IBufferGL -{ - struct IBufferGLVtbl* pVtbl; -} IBufferGL; - # define IBufferGL_GetGLBufferHandle(This) CALL_IFACE_METHOD(BufferGL, GetGLBufferHandle, This) #endif diff --git a/Graphics/GraphicsEngineOpenGL/interface/BufferViewGL.h b/Graphics/GraphicsEngineOpenGL/interface/BufferViewGL.h index 60e0e4c6..085f23b6 100644 --- a/Graphics/GraphicsEngineOpenGL/interface/BufferViewGL.h +++ b/Graphics/GraphicsEngineOpenGL/interface/BufferViewGL.h @@ -44,7 +44,8 @@ static const INTERFACE_ID IID_BufferViewGL = #if DILIGENT_CPP_INTERFACE /// Exposes OpenGL-specific functionality of a buffer view object. -DILIGENT_INTERFACE(IBufferViewGL, IBufferView){}; +DILIGENT_BEGIN_INTERFACE(IBufferViewGL, IBufferView){}; +DILIGENT_END_INTERFACE #endif diff --git a/Graphics/GraphicsEngineOpenGL/interface/DeviceContextGL.h b/Graphics/GraphicsEngineOpenGL/interface/DeviceContextGL.h index e47cb0ab..d11b4a74 100644 --- a/Graphics/GraphicsEngineOpenGL/interface/DeviceContextGL.h +++ b/Graphics/GraphicsEngineOpenGL/interface/DeviceContextGL.h @@ -46,7 +46,7 @@ static const INTERFACE_ID IID_DeviceContextGL = // clang-format off /// Exposes OpenGL-specific functionality of a device context. -DILIGENT_INTERFACE(IDeviceContextGL, IDeviceContext) +DILIGENT_BEGIN_INTERFACE(IDeviceContextGL, IDeviceContext) { /// Attaches to the active GL context in the thread. @@ -62,6 +62,7 @@ DILIGENT_INTERFACE(IDeviceContextGL, IDeviceContext) VIRTUAL void METHOD(SetSwapChain)(THIS_ struct ISwapChainGL* pSwapChain) PURE; }; +DILIGENT_END_INTERFACE #include "../../../Primitives/interface/UndefInterfaceHelperMacros.h" @@ -76,11 +77,6 @@ struct IDeviceContextGLVtbl struct IDeviceContextGLMethods DeviceContextGL; }; -typedef struct IDeviceContextGL -{ - struct IDeviceContextGLVtbl* pVtbl; -} IDeviceContextGL; - // clang-format off # define IDeviceContextGL_UpdateCurrentGLContext(This) CALL_IFACE_METHOD(DeviceContextGL, UpdateCurrentGLContext, This) diff --git a/Graphics/GraphicsEngineOpenGL/interface/EngineFactoryOpenGL.h b/Graphics/GraphicsEngineOpenGL/interface/EngineFactoryOpenGL.h index 60b9f4c8..ad92cb68 100644 --- a/Graphics/GraphicsEngineOpenGL/interface/EngineFactoryOpenGL.h +++ b/Graphics/GraphicsEngineOpenGL/interface/EngineFactoryOpenGL.h @@ -63,7 +63,7 @@ static const INTERFACE_ID IID_EngineFactoryOpenGL = // clang-format off -DILIGENT_INTERFACE(IEngineFactoryOpenGL, IEngineFactory) +DILIGENT_BEGIN_INTERFACE(IEngineFactoryOpenGL, IEngineFactory) { VIRTUAL void METHOD(CreateDeviceAndSwapChainGL)(THIS_ const EngineGLCreateInfo REF EngineCI, @@ -80,6 +80,7 @@ DILIGENT_INTERFACE(IEngineFactoryOpenGL, IEngineFactory) IRenderDevice** ppDevice, IDeviceContext** ppImmediateContext) PURE; }; +DILIGENT_END_INTERFACE #include "../../../Primitives/interface/UndefInterfaceHelperMacros.h" @@ -94,11 +95,6 @@ struct IEngineFactoryOpenGLVtbl struct IEngineFactoryOpenGLMethods EngineFactoryOpenGL; }; -typedef struct IEngineFactoryOpenGL -{ - struct IEngineFactoryOpenGLVtbl* pVtbl; -} IEngineFactoryOpenGL; - // clang-format off # define IEngineFactoryOpenGL_CreateDeviceAndSwapChainGL(This, ...) CALL_IFACE_METHOD(EngineFactoryOpenGL, CreateDeviceAndSwapChainGL, This, __VA_ARGS__) diff --git a/Graphics/GraphicsEngineOpenGL/interface/FenceGL.h b/Graphics/GraphicsEngineOpenGL/interface/FenceGL.h index c5a3faca..86f4c390 100644 --- a/Graphics/GraphicsEngineOpenGL/interface/FenceGL.h +++ b/Graphics/GraphicsEngineOpenGL/interface/FenceGL.h @@ -44,7 +44,8 @@ static const INTERFACE_ID IID_FenceGL = #if DILIGENT_CPP_INTERFACE /// Exposes OpenGL-specific functionality of a fence object. -DILIGENT_INTERFACE(IFenceGL, IFence){}; +DILIGENT_BEGIN_INTERFACE(IFenceGL, IFence){}; +DILIGENT_END_INTERFACE #endif diff --git a/Graphics/GraphicsEngineOpenGL/interface/PipelineStateGL.h b/Graphics/GraphicsEngineOpenGL/interface/PipelineStateGL.h index de47144f..64a5dc84 100644 --- a/Graphics/GraphicsEngineOpenGL/interface/PipelineStateGL.h +++ b/Graphics/GraphicsEngineOpenGL/interface/PipelineStateGL.h @@ -44,7 +44,8 @@ static const INTERFACE_ID IID_PipelineStateGL = #if DILIGENT_CPP_INTERFACE /// Exposes OpenGL-specific functionality of a pipeline state object. -DILIGENT_INTERFACE(IPipelineStateGL, IPipelineState){}; +DILIGENT_BEGIN_INTERFACE(IPipelineStateGL, IPipelineState){}; +DILIGENT_END_INTERFACE #endif diff --git a/Graphics/GraphicsEngineOpenGL/interface/QueryGL.h b/Graphics/GraphicsEngineOpenGL/interface/QueryGL.h index 27749494..2e1a0853 100644 --- a/Graphics/GraphicsEngineOpenGL/interface/QueryGL.h +++ b/Graphics/GraphicsEngineOpenGL/interface/QueryGL.h @@ -43,11 +43,12 @@ static const INTERFACE_ID IID_QueryGL = #include "../../../Primitives/interface/DefineInterfaceHelperMacros.h" /// Exposes OpenGL-specific functionality of a Query object. -DILIGENT_INTERFACE(IQueryGL, IQuery) +DILIGENT_BEGIN_INTERFACE(IQueryGL, IQuery) { /// Returns OpenGL handle of an internal query object. VIRTUAL GLuint METHOD(GetGlQueryHandle)(THIS) CONST PURE; }; +DILIGENT_END_INTERFACE #include "../../../Primitives/interface/UndefInterfaceHelperMacros.h" @@ -61,11 +62,6 @@ struct IQueryGLVtbl struct IQueryGLMethods QueryGL; }; -typedef struct IQueryGL -{ - struct IQueryGLVtbl* pVtbl; -} IQueryGL; - # define IQueryGL_GetGlQueryHandle(This) CALL_IFACE_METHOD(QueryGL, GetGlQueryHandle, This) #endif diff --git a/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceGL.h b/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceGL.h index db508a1b..3329b420 100644 --- a/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceGL.h +++ b/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceGL.h @@ -45,7 +45,7 @@ static const INTERFACE_ID IID_RenderDeviceGL = // clang-format off /// Exposes OpenGL-specific functionality of a render device. -DILIGENT_INTERFACE(IRenderDeviceGL, IRenderDevice) +DILIGENT_BEGIN_INTERFACE(IRenderDeviceGL, IRenderDevice) { /// Creates a texture from OpenGL handle @@ -104,7 +104,7 @@ DILIGENT_INTERFACE(IRenderDeviceGL, IRenderDevice) RESOURCE_STATE InitialState, ITexture** ppTexture) PURE; }; - +DILIGENT_END_INTERFACE #include "../../../Primitives/interface/UndefInterfaceHelperMacros.h" @@ -119,11 +119,6 @@ struct IRenderDeviceGLVtbl struct IRenderDeviceGLMethods RenderDeviceGL; }; -typedef struct IRenderDeviceGL -{ - struct IRenderDeviceGLVtbl* pVtbl; -} IRenderDeviceGL; - // clang-format off # define IRenderDeviceGL_CreateTextureFromGLHandle(This, ...)CALL_IFACE_METHOD(RenderDeviceGL, CreateTextureFromGLHandle, This, __VA_ARGS__) diff --git a/Graphics/GraphicsEngineOpenGL/interface/SamplerGL.h b/Graphics/GraphicsEngineOpenGL/interface/SamplerGL.h index ac7625d7..49cdc5c7 100644 --- a/Graphics/GraphicsEngineOpenGL/interface/SamplerGL.h +++ b/Graphics/GraphicsEngineOpenGL/interface/SamplerGL.h @@ -44,7 +44,8 @@ static const INTERFACE_ID IID_SamplerGL = #if DILIGENT_CPP_INTERFACE /// Exposes OpenGL-specific functionality of a sampler object. -DILIGENT_INTERFACE(ISamplerGL, ISampler){}; +DILIGENT_BEGIN_INTERFACE(ISamplerGL, ISampler){}; +DILIGENT_END_INTERFACE #endif diff --git a/Graphics/GraphicsEngineOpenGL/interface/ShaderGL.h b/Graphics/GraphicsEngineOpenGL/interface/ShaderGL.h index 2a92c31b..efca18ce 100644 --- a/Graphics/GraphicsEngineOpenGL/interface/ShaderGL.h +++ b/Graphics/GraphicsEngineOpenGL/interface/ShaderGL.h @@ -44,7 +44,8 @@ static const INTERFACE_ID IID_ShaderGL = #if DILIGENT_CPP_INTERFACE /// Exposes OpenGL-specific functionality of a shader object. -DILIGENT_INTERFACE(IShaderGL, IShader){}; +DILIGENT_BEGIN_INTERFACE(IShaderGL, IShader){}; +DILIGENT_END_INTERFACE #endif @@ -60,11 +61,6 @@ struct IShaderGLVtbl //struct IShaderGLMethods ShaderGL; }; -typedef struct IShaderGL -{ - struct IShaderGLVtbl* pVtbl; -} IShaderGL; - #endif DILIGENT_END_NAMESPACE // namespace Diligent diff --git a/Graphics/GraphicsEngineOpenGL/interface/ShaderResourceBindingGL.h b/Graphics/GraphicsEngineOpenGL/interface/ShaderResourceBindingGL.h index 821bef77..52042495 100644 --- a/Graphics/GraphicsEngineOpenGL/interface/ShaderResourceBindingGL.h +++ b/Graphics/GraphicsEngineOpenGL/interface/ShaderResourceBindingGL.h @@ -44,7 +44,8 @@ static const INTERFACE_ID IID_ShaderResourceBindingGL = #if DILIGENT_CPP_INTERFACE /// Exposes OpenGL-specific functionality of a shader resource binding object. -DILIGENT_INTERFACE(IShaderResourceBindingGL, IShaderResourceBinding){}; +DILIGENT_BEGIN_INTERFACE(IShaderResourceBindingGL, IShaderResourceBinding){}; +DILIGENT_END_INTERFACE #endif @@ -60,11 +61,6 @@ struct IShaderResourceBindingGLVtbl //struct IShaderResourceBindingGLMethods ShaderResourceBindingGL; }; -typedef struct IShaderResourceBindingGL -{ - struct IShaderResourceBindingGLVtbl* pVtbl; -} IShaderResourceBindingGL; - #endif diff --git a/Graphics/GraphicsEngineOpenGL/interface/SwapChainGL.h b/Graphics/GraphicsEngineOpenGL/interface/SwapChainGL.h index 88d8d29e..186d861a 100644 --- a/Graphics/GraphicsEngineOpenGL/interface/SwapChainGL.h +++ b/Graphics/GraphicsEngineOpenGL/interface/SwapChainGL.h @@ -42,11 +42,12 @@ static const INTERFACE_ID IID_SwapChainGL = #include "../../../Primitives/interface/DefineInterfaceHelperMacros.h" /// Exposes OpenGL-specific functionality of a swap chain. -DILIGENT_INTERFACE(ISwapChainGL, ISwapChain) +DILIGENT_BEGIN_INTERFACE(ISwapChainGL, ISwapChain) { /// Returns the default framebuffer handle VIRTUAL GLuint METHOD(GetDefaultFBO)(THIS) CONST PURE; }; +DILIGENT_END_INTERFACE #include "../../../Primitives/interface/UndefInterfaceHelperMacros.h" @@ -60,11 +61,6 @@ struct ISwapChainGLVtbl struct ISwapChainGLMethods SwapChainGL; }; -typedef struct ISwapChainGL -{ - struct ISwapChainGLVtbl* pVtbl; -} ISwapChainGL; - // clang-format off # define ISwapChainGL_GetDefaultFBO(This) CALL_IFACE_METHOD(SwapChainGL, GetDefaultFBO, This) diff --git a/Graphics/GraphicsEngineOpenGL/interface/TextureGL.h b/Graphics/GraphicsEngineOpenGL/interface/TextureGL.h index 7d8e9306..bc779970 100644 --- a/Graphics/GraphicsEngineOpenGL/interface/TextureGL.h +++ b/Graphics/GraphicsEngineOpenGL/interface/TextureGL.h @@ -42,7 +42,7 @@ static const INTERFACE_ID IID_TextureGL = #include "../../../Primitives/interface/DefineInterfaceHelperMacros.h" /// Exposes OpenGL-specific functionality of a texture object. -DILIGENT_INTERFACE(ITextureGL, ITexture) +DILIGENT_BEGIN_INTERFACE(ITextureGL, ITexture) { /// Returns OpenGL texture handle VIRTUAL GLuint METHOD(GetGLTextureHandle)(THIS) PURE; @@ -50,6 +50,7 @@ DILIGENT_INTERFACE(ITextureGL, ITexture) /// Returns bind target of the native OpenGL texture VIRTUAL GLenum METHOD(GetBindTarget)(THIS) CONST PURE; }; +DILIGENT_END_INTERFACE #include "../../../Primitives/interface/UndefInterfaceHelperMacros.h" @@ -63,11 +64,6 @@ struct ITextureGLVtbl struct ITextureGLMethods TextureGL; }; -typedef struct ITextureGL -{ - struct ITextureGLVtbl* pVtbl; -} ITextureGL; - // clang-format off # define ITextureGL_GetGLTextureHandle(This) CALL_IFACE_METHOD(TextureGL, GetGLTextureHandle, This) diff --git a/Graphics/GraphicsEngineOpenGL/interface/TextureViewGL.h b/Graphics/GraphicsEngineOpenGL/interface/TextureViewGL.h index b69c1d3e..7831571f 100644 --- a/Graphics/GraphicsEngineOpenGL/interface/TextureViewGL.h +++ b/Graphics/GraphicsEngineOpenGL/interface/TextureViewGL.h @@ -44,11 +44,12 @@ static const INTERFACE_ID IID_TextureViewGL = #if DILIGENT_CPP_INTERFACE /// Exposes OpenGL-specific functionality of a texture view object. -DILIGENT_INTERFACE(ITextureViewGL, ITextureView) // +DILIGENT_BEGIN_INTERFACE(ITextureViewGL, ITextureView) // { //const GLObjectWrappers::GLTextureObj& GetHandle(); //GLenum GetBindTarget(); }; +DILIGENT_END_INTERFACE #endif |
