summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineOpenGL
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-01-29 06:05:19 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-01-29 06:05:19 +0000
commit3d92951b74f0e788432a0f3a35f452e74d936fce (patch)
treefe401a2770aac16a5ab39ecf70fdd4a9ff22f38a /Graphics/GraphicsEngineOpenGL
parentReworked interface definitions to use DILIGENT_BEGIN_INTERFACE/DILIGENT_END_I... (diff)
downloadDiligentCore-3d92951b74f0e788432a0f3a35f452e74d936fce.tar.gz
DiligentCore-3d92951b74f0e788432a0f3a35f452e74d936fce.zip
Reworked C interface to optimize inheritance handling
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
-rw-r--r--Graphics/GraphicsEngineOpenGL/interface/BufferGL.h18
-rw-r--r--Graphics/GraphicsEngineOpenGL/interface/BufferViewGL.h13
-rw-r--r--Graphics/GraphicsEngineOpenGL/interface/DeviceContextGL.h13
-rw-r--r--Graphics/GraphicsEngineOpenGL/interface/EngineFactoryOpenGL.h13
-rw-r--r--Graphics/GraphicsEngineOpenGL/interface/FenceGL.h9
-rw-r--r--Graphics/GraphicsEngineOpenGL/interface/PipelineStateGL.h9
-rw-r--r--Graphics/GraphicsEngineOpenGL/interface/QueryGL.h13
-rw-r--r--Graphics/GraphicsEngineOpenGL/interface/RenderDeviceGL.h13
-rw-r--r--Graphics/GraphicsEngineOpenGL/interface/SamplerGL.h13
-rw-r--r--Graphics/GraphicsEngineOpenGL/interface/ShaderGL.h13
-rw-r--r--Graphics/GraphicsEngineOpenGL/interface/ShaderResourceBindingGL.h13
-rw-r--r--Graphics/GraphicsEngineOpenGL/interface/SwapChainGL.h12
-rw-r--r--Graphics/GraphicsEngineOpenGL/interface/TextureGL.h12
-rw-r--r--Graphics/GraphicsEngineOpenGL/interface/TextureViewGL.h13
14 files changed, 76 insertions, 101 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/interface/BufferGL.h b/Graphics/GraphicsEngineOpenGL/interface/BufferGL.h
index 3ce855ec..f0b690f8 100644
--- a/Graphics/GraphicsEngineOpenGL/interface/BufferGL.h
+++ b/Graphics/GraphicsEngineOpenGL/interface/BufferGL.h
@@ -34,13 +34,17 @@
DILIGENT_BEGIN_NAMESPACE(Diligent)
-#define DILIGENT_INTERFACE_NAME IBufferGL
-#include "../../../Primitives/interface/DefineInterfaceHelperMacros.h"
-
// {08DF7319-F425-4EC7-8D2B-1B3FC0BDDBB4}
static const INTERFACE_ID IID_BufferGL =
{0x8df7319, 0xf425, 0x4ec7, {0x8d, 0x2b, 0x1b, 0x3f, 0xc0, 0xbd, 0xdb, 0xb4}};
+#define DILIGENT_INTERFACE_NAME IBufferGL
+#include "../../../Primitives/interface/DefineInterfaceHelperMacros.h"
+
+#define IBufferGLInclusiveMethods \
+ IBufferInclusiveMethods; \
+ IBufferGLMethods BufferGL
+
/// Exposes OpenGL-specific functionality of a buffer object.
DILIGENT_BEGIN_INTERFACE(IBufferGL, IBuffer)
{
@@ -53,14 +57,6 @@ DILIGENT_END_INTERFACE
#if DILIGENT_C_INTERFACE
-struct IBufferGLVtbl
-{
- struct IObjectMethods Object;
- struct IDeviceObjectMethods DeviceObject;
- struct IBufferMethods Buffer;
- struct IBufferGLMethods BufferGL;
-};
-
# 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 085f23b6..66fe5e47 100644
--- a/Graphics/GraphicsEngineOpenGL/interface/BufferViewGL.h
+++ b/Graphics/GraphicsEngineOpenGL/interface/BufferViewGL.h
@@ -41,6 +41,10 @@ static const INTERFACE_ID IID_BufferViewGL =
#define DILIGENT_INTERFACE_NAME IBufferViewGL
#include "../../../Primitives/interface/DefineInterfaceHelperMacros.h"
+#define IBufferViewGLInclusiveMethods \
+ IBufferViewInclusiveMethods
+//IBufferViewGLMethods BufferViewGL
+
#if DILIGENT_CPP_INTERFACE
/// Exposes OpenGL-specific functionality of a buffer view object.
@@ -53,13 +57,10 @@ DILIGENT_END_INTERFACE
#if DILIGENT_C_INTERFACE
-struct IBufferViewGLVtbl
+typedef struct IBufferViewGLVtbl
{
- struct IObjectMethods Object;
- struct IDeviceObjectMethods DeviceObject;
- struct IBufferViewMethods BufferView;
- //struct IBufferViewGLMethods BufferViewGL;
-};
+ IBufferViewGLInclusiveMethods;
+} IBufferViewGLVtbl;
typedef struct IBufferViewGL
{
diff --git a/Graphics/GraphicsEngineOpenGL/interface/DeviceContextGL.h b/Graphics/GraphicsEngineOpenGL/interface/DeviceContextGL.h
index d11b4a74..cbc87616 100644
--- a/Graphics/GraphicsEngineOpenGL/interface/DeviceContextGL.h
+++ b/Graphics/GraphicsEngineOpenGL/interface/DeviceContextGL.h
@@ -43,6 +43,10 @@ static const INTERFACE_ID IID_DeviceContextGL =
#define DILIGENT_INTERFACE_NAME IDeviceContextGL
#include "../../../Primitives/interface/DefineInterfaceHelperMacros.h"
+#define IDeviceContextGLInclusiveMethods \
+ IDeviceContextInclusiveMethods; \
+ IDeviceContextGLMethods DeviceContextGL
+
// clang-format off
/// Exposes OpenGL-specific functionality of a device context.
@@ -68,15 +72,6 @@ DILIGENT_END_INTERFACE
#if DILIGENT_C_INTERFACE
-// clang-format on
-
-struct IDeviceContextGLVtbl
-{
- struct IObjectMethods Object;
- struct IDeviceContextMethods DeviceContext;
- struct IDeviceContextGLMethods DeviceContextGL;
-};
-
// 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 ad92cb68..0d42a16e 100644
--- a/Graphics/GraphicsEngineOpenGL/interface/EngineFactoryOpenGL.h
+++ b/Graphics/GraphicsEngineOpenGL/interface/EngineFactoryOpenGL.h
@@ -61,6 +61,10 @@ static const INTERFACE_ID IID_EngineFactoryOpenGL =
#define DILIGENT_INTERFACE_NAME IEngineFactoryOpenGL
#include "../../../Primitives/interface/DefineInterfaceHelperMacros.h"
+#define IEngineFactoryOpenGLInclusiveMethods \
+ IEngineFactoryInclusiveMethods; \
+ IEngineFactoryOpenGLMethods EngineFactoryOpenGL
+
// clang-format off
DILIGENT_BEGIN_INTERFACE(IEngineFactoryOpenGL, IEngineFactory)
@@ -86,15 +90,6 @@ DILIGENT_END_INTERFACE
#if DILIGENT_C_INTERFACE
-// clang-format on
-
-struct IEngineFactoryOpenGLVtbl
-{
- struct IObjectMethods Object;
- struct IEngineFactoryMethods EngineFactory;
- struct IEngineFactoryOpenGLMethods EngineFactoryOpenGL;
-};
-
// 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 86f4c390..3f535fe1 100644
--- a/Graphics/GraphicsEngineOpenGL/interface/FenceGL.h
+++ b/Graphics/GraphicsEngineOpenGL/interface/FenceGL.h
@@ -41,6 +41,10 @@ static const INTERFACE_ID IID_FenceGL =
#define DILIGENT_INTERFACE_NAME IFenceGL
#include "../../../Primitives/interface/DefineInterfaceHelperMacros.h"
+#define IFenceGLInclusiveMethods \
+ IFenceInclusiveMethods
+//IFenceGLMethods FenceGL
+
#if DILIGENT_CPP_INTERFACE
/// Exposes OpenGL-specific functionality of a fence object.
@@ -55,10 +59,7 @@ DILIGENT_END_INTERFACE
struct IFenceGLVtbl
{
- struct IObjectMethods Object;
- struct IDeviceObjectMethods DeviceObject;
- struct IFenceMethods Fence;
- //struct IFenceGLMethods FenceGL;
+ IFenceGLInclusiveMethods;
};
typedef struct IFenceGL
diff --git a/Graphics/GraphicsEngineOpenGL/interface/PipelineStateGL.h b/Graphics/GraphicsEngineOpenGL/interface/PipelineStateGL.h
index 64a5dc84..69617ea3 100644
--- a/Graphics/GraphicsEngineOpenGL/interface/PipelineStateGL.h
+++ b/Graphics/GraphicsEngineOpenGL/interface/PipelineStateGL.h
@@ -41,6 +41,10 @@ static const INTERFACE_ID IID_PipelineStateGL =
#define DILIGENT_INTERFACE_NAME IPipelineStateGL
#include "../../../Primitives/interface/DefineInterfaceHelperMacros.h"
+#define IPipelineStateGLInclusiveMethods \
+ IPipelineStateInclusiveMethods
+//IPipelineStateGLMethods PipelineStateGL
+
#if DILIGENT_CPP_INTERFACE
/// Exposes OpenGL-specific functionality of a pipeline state object.
@@ -55,10 +59,7 @@ DILIGENT_END_INTERFACE
struct IPipelineStateGLVtbl
{
- struct IObjectMethods Object;
- struct IDeviceObjectMethods DeviceObject;
- struct IPipelineStateMethods PipelineState;
- //struct IPipelineStateGLMethods PipelineStateGL;
+ IPipelineStateGLInclusiveMethods;
};
typedef struct IPipelineStateGL
diff --git a/Graphics/GraphicsEngineOpenGL/interface/QueryGL.h b/Graphics/GraphicsEngineOpenGL/interface/QueryGL.h
index 2e1a0853..455ad7fb 100644
--- a/Graphics/GraphicsEngineOpenGL/interface/QueryGL.h
+++ b/Graphics/GraphicsEngineOpenGL/interface/QueryGL.h
@@ -38,10 +38,13 @@ DILIGENT_BEGIN_NAMESPACE(Diligent)
static const INTERFACE_ID IID_QueryGL =
{0xd8a02ab7, 0x720, 0x417d, {0xaa, 0x9b, 0x20, 0xa2, 0xc0, 0x5a, 0x3e, 0xe0}};
-
#define DILIGENT_INTERFACE_NAME IQueryGL
#include "../../../Primitives/interface/DefineInterfaceHelperMacros.h"
+#define IQueryGLInclusiveMethods \
+ IQueryInclusiveMethods; \
+ IQueryGLMethods QueryGL
+
/// Exposes OpenGL-specific functionality of a Query object.
DILIGENT_BEGIN_INTERFACE(IQueryGL, IQuery)
{
@@ -54,14 +57,6 @@ DILIGENT_END_INTERFACE
#if DILIGENT_C_INTERFACE
-struct IQueryGLVtbl
-{
- struct IObjectMethods Object;
- struct IDeviceObjectMethods DeviceObject;
- struct IQueryMethods Query;
- struct IQueryGLMethods QueryGL;
-};
-
# 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 3329b420..287b1cc6 100644
--- a/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceGL.h
+++ b/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceGL.h
@@ -42,6 +42,10 @@ static const INTERFACE_ID IID_RenderDeviceGL =
#define DILIGENT_INTERFACE_NAME IRenderDeviceGL
#include "../../../Primitives/interface/DefineInterfaceHelperMacros.h"
+#define IRenderDeviceGLInclusiveMethods \
+ IRenderDeviceInclusiveMethods; \
+ IRenderDeviceGLMethods RenderDeviceGL
+
// clang-format off
/// Exposes OpenGL-specific functionality of a render device.
@@ -110,15 +114,6 @@ DILIGENT_END_INTERFACE
#if DILIGENT_C_INTERFACE
-// clang-format on
-
-struct IRenderDeviceGLVtbl
-{
- struct IObjectMethods Object;
- struct IRenderDeviceMethods RenderDevice;
- struct IRenderDeviceGLMethods RenderDeviceGL;
-};
-
// 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 49cdc5c7..240bec41 100644
--- a/Graphics/GraphicsEngineOpenGL/interface/SamplerGL.h
+++ b/Graphics/GraphicsEngineOpenGL/interface/SamplerGL.h
@@ -41,6 +41,10 @@ static const INTERFACE_ID IID_SamplerGL =
#define DILIGENT_INTERFACE_NAME ISamplerGL
#include "../../../Primitives/interface/DefineInterfaceHelperMacros.h"
+#define ISamplerGLInclusiveMethods \
+ ISamplerInclusiveMethods
+//ISamplerGLMethods SamplerGL
+
#if DILIGENT_CPP_INTERFACE
/// Exposes OpenGL-specific functionality of a sampler object.
@@ -53,13 +57,10 @@ DILIGENT_END_INTERFACE
#if DILIGENT_C_INTERFACE
-struct ISamplerGLVtbl
+typedef struct ISamplerGLVtbl
{
- struct IObjectMethods Object;
- struct IDeviceObjectMethods DeviceObject;
- //struct ISamplerMethods Sampler;
- //struct ISamplerGLMethods SamplerGL;
-};
+ ISamplerGLInclusiveMethods;
+} ISamplerGLVtbl;
typedef struct ISamplerGL
{
diff --git a/Graphics/GraphicsEngineOpenGL/interface/ShaderGL.h b/Graphics/GraphicsEngineOpenGL/interface/ShaderGL.h
index efca18ce..ac2af1bf 100644
--- a/Graphics/GraphicsEngineOpenGL/interface/ShaderGL.h
+++ b/Graphics/GraphicsEngineOpenGL/interface/ShaderGL.h
@@ -41,6 +41,10 @@ static const INTERFACE_ID IID_ShaderGL =
#define DILIGENT_INTERFACE_NAME IShaderGL
#include "../../../Primitives/interface/DefineInterfaceHelperMacros.h"
+#define IShaderGLInclusiveMethods \
+ IShaderInclusiveMethods
+//IShaderGLMethods ShaderGL
+
#if DILIGENT_CPP_INTERFACE
/// Exposes OpenGL-specific functionality of a shader object.
@@ -53,13 +57,10 @@ DILIGENT_END_INTERFACE
#if DILIGENT_C_INTERFACE
-struct IShaderGLVtbl
+typedef struct IShaderGLVtbl
{
- struct IObjectMethods Object;
- struct IDeviceObjectMethods DeviceObject;
- struct IShaderMethods Shader;
- //struct IShaderGLMethods ShaderGL;
-};
+ IShaderGLInclusiveMethods;
+} IShaderGLVtbl;
#endif
diff --git a/Graphics/GraphicsEngineOpenGL/interface/ShaderResourceBindingGL.h b/Graphics/GraphicsEngineOpenGL/interface/ShaderResourceBindingGL.h
index 52042495..d403ac70 100644
--- a/Graphics/GraphicsEngineOpenGL/interface/ShaderResourceBindingGL.h
+++ b/Graphics/GraphicsEngineOpenGL/interface/ShaderResourceBindingGL.h
@@ -41,6 +41,10 @@ static const INTERFACE_ID IID_ShaderResourceBindingGL =
#define DILIGENT_INTERFACE_NAME IShaderResourceBindingGL
#include "../../../Primitives/interface/DefineInterfaceHelperMacros.h"
+#define IShaderResourceBindingGLInclusiveMethods \
+ IShaderResourceBindingInclusiveMethods
+//IShaderResourceBindingGLMethods ShaderResourceBindingGL
+
#if DILIGENT_CPP_INTERFACE
/// Exposes OpenGL-specific functionality of a shader resource binding object.
@@ -53,13 +57,10 @@ DILIGENT_END_INTERFACE
#if DILIGENT_C_INTERFACE
-struct IShaderResourceBindingGLVtbl
+typedef struct IShaderResourceBindingGLVtbl
{
- struct IObjectMethods Object;
- struct IDeviceObjectMethods DeviceObject;
- struct IShaderResourceBindingMethods ShaderResourceBinding;
- //struct IShaderResourceBindingGLMethods ShaderResourceBindingGL;
-};
+ IShaderResourceBindingGLInclusiveMethods;
+} IShaderResourceBindingGLVtbl;
#endif
diff --git a/Graphics/GraphicsEngineOpenGL/interface/SwapChainGL.h b/Graphics/GraphicsEngineOpenGL/interface/SwapChainGL.h
index 186d861a..b3546deb 100644
--- a/Graphics/GraphicsEngineOpenGL/interface/SwapChainGL.h
+++ b/Graphics/GraphicsEngineOpenGL/interface/SwapChainGL.h
@@ -38,6 +38,10 @@ DILIGENT_BEGIN_NAMESPACE(Diligent)
static const INTERFACE_ID IID_SwapChainGL =
{0xf457bd7c, 0xe725, 0x4d3e, {0x86, 0x7, 0xa1, 0xf9, 0xba, 0xe3, 0x29, 0xeb}};
+#define ISwapChainGLInclusiveMethods \
+ ISwapChainInclusiveMethods; \
+ ISwapChainGLMethods SwapChainGL
+
#define DILIGENT_INTERFACE_NAME ISwapChainGL
#include "../../../Primitives/interface/DefineInterfaceHelperMacros.h"
@@ -53,14 +57,6 @@ DILIGENT_END_INTERFACE
#if DILIGENT_C_INTERFACE
-struct ISwapChainGLVtbl
-{
- struct IObjectMethods Object;
- struct IDeviceObjectMethods DeviceObject;
- struct ISwapChainMethods SwapChain;
- struct ISwapChainGLMethods SwapChainGL;
-};
-
// 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 bc779970..b37a2906 100644
--- a/Graphics/GraphicsEngineOpenGL/interface/TextureGL.h
+++ b/Graphics/GraphicsEngineOpenGL/interface/TextureGL.h
@@ -41,6 +41,10 @@ static const INTERFACE_ID IID_TextureGL =
#define DILIGENT_INTERFACE_NAME ITextureGL
#include "../../../Primitives/interface/DefineInterfaceHelperMacros.h"
+#define ITextureGLInclusiveMethods \
+ ITextureInclusiveMethods; \
+ ITextureGLMethods TextureGL
+
/// Exposes OpenGL-specific functionality of a texture object.
DILIGENT_BEGIN_INTERFACE(ITextureGL, ITexture)
{
@@ -56,14 +60,6 @@ DILIGENT_END_INTERFACE
#if DILIGENT_C_INTERFACE
-struct ITextureGLVtbl
-{
- struct IObjectMethods Object;
- struct IDeviceObjectMethods DeviceObject;
- struct ITextureMethods Texture;
- struct ITextureGLMethods TextureGL;
-};
-
// 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 7831571f..7051a709 100644
--- a/Graphics/GraphicsEngineOpenGL/interface/TextureViewGL.h
+++ b/Graphics/GraphicsEngineOpenGL/interface/TextureViewGL.h
@@ -41,6 +41,10 @@ static const INTERFACE_ID IID_TextureViewGL =
#define DILIGENT_INTERFACE_NAME ITextureViewGL
#include "../../../Primitives/interface/DefineInterfaceHelperMacros.h"
+#define ITextureViewGLInclusiveMethods \
+ ITextureViewInclusiveMethods
+//ITextureViewGLMethods TextureViewGL
+
#if DILIGENT_CPP_INTERFACE
/// Exposes OpenGL-specific functionality of a texture view object.
@@ -57,13 +61,10 @@ DILIGENT_END_INTERFACE
#if DILIGENT_C_INTERFACE
-struct ITextureViewGLVtbl
+typedef struct ITextureViewGLVtbl
{
- struct IObjectMethods Object;
- struct IDeviceObjectMethods DeviceObject;
- struct ITextureViewMethods TextureView;
- //struct ITextureViewGLMethods TextureViewGL;
-};
+ ITextureViewGLInclusiveMethods;
+} ITextureViewGLVtbl;
typedef struct ITextureViewGL
{