From c55556104937ef5f16c3b8a8df9d940a8d257781 Mon Sep 17 00:00:00 2001 From: assiduous Date: Wed, 8 Jan 2020 00:11:05 -0800 Subject: Updated factory functions to not throw exceptions, but return; fixed API version mismatch error message --- Graphics/GraphicsEngineOpenGL/src/EngineFactoryOpenGL.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/src/EngineFactoryOpenGL.cpp b/Graphics/GraphicsEngineOpenGL/src/EngineFactoryOpenGL.cpp index eebcb682..04a19d7e 100644 --- a/Graphics/GraphicsEngineOpenGL/src/EngineFactoryOpenGL.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/EngineFactoryOpenGL.cpp @@ -117,7 +117,10 @@ void EngineFactoryOpenGLImpl::CreateDeviceAndSwapChainGL(const EngineGLCreateInf SetDebugMessageCallback(EngineCI.DebugMessageCallback); if (EngineCI.APIVersion != DILIGENT_API_VERSION) - LOG_ERROR_AND_THROW("Diligent Engine runtime (", EngineCI.APIVersion, ") is not compatible with the client API version (", DILIGENT_API_VERSION, ")"); + { + LOG_ERROR_MESSAGE("Diligent Engine runtime (", DILIGENT_API_VERSION, ") is not compatible with the client API version (", EngineCI.APIVersion, ")"); + return; + } VERIFY(ppDevice && ppImmediateContext && ppSwapChain, "Null pointer provided"); if (!ppDevice || !ppImmediateContext || !ppSwapChain) @@ -194,7 +197,10 @@ void EngineFactoryOpenGLImpl::AttachToActiveGLContext(const EngineGLCreateInfo& SetDebugMessageCallback(EngineCI.DebugMessageCallback); if (EngineCI.APIVersion != DILIGENT_API_VERSION) - LOG_ERROR_AND_THROW("Diligent Engine runtime (", EngineCI.APIVersion, ") is not compatible with the client API version (", DILIGENT_API_VERSION, ")"); + { + LOG_ERROR_MESSAGE("Diligent Engine runtime (", DILIGENT_API_VERSION, ") is not compatible with the client API version (", EngineCI.APIVersion, ")"); + return; + } VERIFY(ppDevice && ppImmediateContext, "Null pointer provided"); if (!ppDevice || !ppImmediateContext) -- cgit v1.2.3