From 6d5749ee39652c68e8a923fcbb2611b1ed71533c Mon Sep 17 00:00:00 2001 From: assiduous Date: Sun, 26 Jan 2020 18:14:06 -0800 Subject: Fixed few GL build issues on Mac --- Graphics/GraphicsEngineOpenGL/CMakeLists.txt | 6 +- .../GraphicsEngineOpenGL/include/SwapChainGLIOS.h | 68 ---------------------- .../include/SwapChainGLIOS.hpp | 68 ++++++++++++++++++++++ .../GraphicsEngineOpenGL/src/SwapChainGLIOS.mm | 6 +- 4 files changed, 74 insertions(+), 74 deletions(-) delete mode 100644 Graphics/GraphicsEngineOpenGL/include/SwapChainGLIOS.h create mode 100644 Graphics/GraphicsEngineOpenGL/include/SwapChainGLIOS.hpp (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/CMakeLists.txt b/Graphics/GraphicsEngineOpenGL/CMakeLists.txt index 2ee218be..bb43533f 100644 --- a/Graphics/GraphicsEngineOpenGL/CMakeLists.txt +++ b/Graphics/GraphicsEngineOpenGL/CMakeLists.txt @@ -111,15 +111,15 @@ elseif(PLATFORM_LINUX) list(APPEND INCLUDE include/SwapChainGLImpl.hpp) elseif(PLATFORM_MACOS) list(APPEND SOURCE src/GLContextMacOS.mm) - list(APPEND INCLUDE include/GLContextMacOS.h) + list(APPEND INCLUDE include/GLContextMacOS.hpp) list(APPEND SOURCE src/SwapChainGLImpl.cpp) list(APPEND INCLUDE include/SwapChainGLImpl.hpp) elseif(PLATFORM_IOS) list(APPEND SOURCE src/GLContextIOS.mm) - list(APPEND INCLUDE include/GLContextIOS.h) + list(APPEND INCLUDE include/GLContextIOS.hpp) list(APPEND INCLUDE include/GLStubsIOS.h) list(APPEND SOURCE src/SwapChainGLIOS.mm) - list(APPEND INCLUDE include/SwapChainGLIOS.h) + list(APPEND INCLUDE include/SwapChainGLIOS.hpp) else() message(FATAL_ERROR "Unknown platform") endif() diff --git a/Graphics/GraphicsEngineOpenGL/include/SwapChainGLIOS.h b/Graphics/GraphicsEngineOpenGL/include/SwapChainGLIOS.h deleted file mode 100644 index ef423930..00000000 --- a/Graphics/GraphicsEngineOpenGL/include/SwapChainGLIOS.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright 2015-2018 Egor Yusov - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. - * - * In no event and under no legal theory, whether in tort (including negligence), - * contract, or otherwise, unless required by applicable law (such as deliberate - * and grossly negligent acts) or agreed to in writing, shall any Contributor be - * liable for any damages, including any direct, indirect, special, incidental, - * or consequential damages of any character arising as a result of this License or - * out of the use or inability to use the software (including but not limited to damages - * for loss of goodwill, work stoppage, computer failure or malfunction, or any and - * all other commercial damages or losses), even if such Contributor has been advised - * of the possibility of such damages. - */ - -#pragma once - -#include "SwapChainGL.h" -#include "SwapChainGLBase.h" -#include "GLObjectWrapper.h" - -namespace Diligent -{ - -class IMemoryAllocator; -/// Implementation of the Diligent::ISwapChainGL interface on IOS -class SwapChainGLIOS final : public SwapChainGLBase -{ -public: - using TSwapChainGLBase = SwapChainGLBase; - - SwapChainGLIOS(IReferenceCounters* pRefCounters, - const EngineGLCreateInfo& InitAttribs, - const SwapChainDesc& SwapChainDesc, - class RenderDeviceGLImpl* pRenderDeviceGL, - class DeviceContextGLImpl* pImmediateContextGL); - SwapChainGLIOS(); - - virtual void QueryInterface(const Diligent::INTERFACE_ID& IID, IObject** ppInterface) override final; - - virtual void Present(Uint32 SyncInterval) override final; - - virtual void Resize(Uint32 NewWidth, Uint32 NewHeight) override final; - - virtual void SetFullscreenMode(const DisplayModeAttribs& DisplayMode) override final; - - virtual void SetWindowedMode() override final; - - virtual GLuint GetDefaultFBO() const override final; - -private: - void InitRenderBuffers(bool InitFromDrawable, Uint32& Width, Uint32& Height); - - GLObjectWrappers::GLRenderBufferObj m_ColorRenderBuffer; - GLObjectWrappers::GLRenderBufferObj m_DepthRenderBuffer; - GLObjectWrappers::GLFrameBufferObj m_DefaultFBO; - void* m_CALayer; -}; - -} // namespace Diligent diff --git a/Graphics/GraphicsEngineOpenGL/include/SwapChainGLIOS.hpp b/Graphics/GraphicsEngineOpenGL/include/SwapChainGLIOS.hpp new file mode 100644 index 00000000..ef423930 --- /dev/null +++ b/Graphics/GraphicsEngineOpenGL/include/SwapChainGLIOS.hpp @@ -0,0 +1,68 @@ +/* Copyright 2015-2018 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "SwapChainGL.h" +#include "SwapChainGLBase.h" +#include "GLObjectWrapper.h" + +namespace Diligent +{ + +class IMemoryAllocator; +/// Implementation of the Diligent::ISwapChainGL interface on IOS +class SwapChainGLIOS final : public SwapChainGLBase +{ +public: + using TSwapChainGLBase = SwapChainGLBase; + + SwapChainGLIOS(IReferenceCounters* pRefCounters, + const EngineGLCreateInfo& InitAttribs, + const SwapChainDesc& SwapChainDesc, + class RenderDeviceGLImpl* pRenderDeviceGL, + class DeviceContextGLImpl* pImmediateContextGL); + SwapChainGLIOS(); + + virtual void QueryInterface(const Diligent::INTERFACE_ID& IID, IObject** ppInterface) override final; + + virtual void Present(Uint32 SyncInterval) override final; + + virtual void Resize(Uint32 NewWidth, Uint32 NewHeight) override final; + + virtual void SetFullscreenMode(const DisplayModeAttribs& DisplayMode) override final; + + virtual void SetWindowedMode() override final; + + virtual GLuint GetDefaultFBO() const override final; + +private: + void InitRenderBuffers(bool InitFromDrawable, Uint32& Width, Uint32& Height); + + GLObjectWrappers::GLRenderBufferObj m_ColorRenderBuffer; + GLObjectWrappers::GLRenderBufferObj m_DepthRenderBuffer; + GLObjectWrappers::GLFrameBufferObj m_DefaultFBO; + void* m_CALayer; +}; + +} // namespace Diligent diff --git a/Graphics/GraphicsEngineOpenGL/src/SwapChainGLIOS.mm b/Graphics/GraphicsEngineOpenGL/src/SwapChainGLIOS.mm index e9fbb418..c2a95ed0 100644 --- a/Graphics/GraphicsEngineOpenGL/src/SwapChainGLIOS.mm +++ b/Graphics/GraphicsEngineOpenGL/src/SwapChainGLIOS.mm @@ -27,9 +27,9 @@ #import #import -#include "DeviceContextGLImpl.h" -#include "RenderDeviceGLImpl.h" -#include "SwapChainGLIOS.h" +#include "DeviceContextGLImpl.hpp" +#include "RenderDeviceGLImpl.hpp" +#include "SwapChainGLIOS.hpp" namespace Diligent { -- cgit v1.2.3