From b54e515f4c6eef6a6484a99bf12453f5cdb52c47 Mon Sep 17 00:00:00 2001 From: wanghoi Date: Mon, 14 Oct 2024 10:12:00 +0800 Subject: [PATCH] IDeviceContextGL: fix include test --- .../GraphicsEngineOpenGL/interface/DeviceContextGL.h | 9 +++++---- .../GraphicsEngineOpenGL/DeviceContextGLH_test.c | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Graphics/GraphicsEngineOpenGL/interface/DeviceContextGL.h b/Graphics/GraphicsEngineOpenGL/interface/DeviceContextGL.h index f533df525..892d2ffce 100644 --- a/Graphics/GraphicsEngineOpenGL/interface/DeviceContextGL.h +++ b/Graphics/GraphicsEngineOpenGL/interface/DeviceContextGL.h @@ -59,14 +59,14 @@ DILIGENT_BEGIN_INTERFACE(IDeviceContextGL, IDeviceContext) /// is passed over from the main application. /// /// \return false if there is no active GL context, and true otherwise. - VIRTUAL bool METHOD(UpdateCurrentGLContext)(THIS_) PURE; + VIRTUAL Bool METHOD(UpdateCurrentGLContext)(THIS) PURE; /// Purge current context caches (e.g. VAO, FBO). /// If an application uses multiple GL contexts, this method must be called /// before the current context is about to be released, /// to let the engine cleanup internal OpenGL object caches. - VIRTUAL void METHOD(PurgeCurrentContextCaches)(THIS_) PURE; + VIRTUAL void METHOD(PurgeCurrentContextCaches)(THIS) PURE; /// Sets the swap in the device context. The swap chain is used by the device context /// to obtain the default FBO handle. @@ -81,8 +81,9 @@ DILIGENT_END_INTERFACE // clang-format off -# define IDeviceContextGL_UpdateCurrentGLContext(This, ...) CALL_IFACE_METHOD(DeviceContextGL, UpdateCurrentGLContext, This, __VA_ARGS__) -# define IDeviceContextGL_SetSwapChain(This, ...) CALL_IFACE_METHOD(DeviceContextGL, SetSwapChain, This, __VA_ARGS__) +# define IDeviceContextGL_UpdateCurrentGLContext(This) CALL_IFACE_METHOD(DeviceContextGL, UpdateCurrentGLContext, This) +# define IDeviceContextGL_PurgeCurrentContextCaches(This) CALL_IFACE_METHOD(DeviceContextGL, PurgeCurrentContextCaches, This) +# define IDeviceContextGL_SetSwapChain(This, ...) CALL_IFACE_METHOD(DeviceContextGL, SetSwapChain, This, __VA_ARGS__) // clang-format on diff --git a/Tests/IncludeTest/GraphicsEngineOpenGL/DeviceContextGLH_test.c b/Tests/IncludeTest/GraphicsEngineOpenGL/DeviceContextGLH_test.c index 4e9e00091..2f2c7e548 100644 --- a/Tests/IncludeTest/GraphicsEngineOpenGL/DeviceContextGLH_test.c +++ b/Tests/IncludeTest/GraphicsEngineOpenGL/DeviceContextGLH_test.c @@ -29,7 +29,8 @@ void TestDeviceContextGL_CInterface(IDeviceContextGL* pCtxGL) { - bool res = IDeviceContextGL_UpdateCurrentGLContext(pCtxGL, true); + bool res = IDeviceContextGL_UpdateCurrentGLContext(pCtxGL); (void)res; + IDeviceContextGL_PurgeCurrentContextCaches(pCtxGL); IDeviceContextGL_SetSwapChain(pCtxGL, (struct ISwapChainGL*)NULL); }