From fa7fb792ec7ce494b434cc68fed5a3d2c9328a38 Mon Sep 17 00:00:00 2001 From: assiduous Date: Sun, 26 Jan 2020 17:55:51 -0800 Subject: A bunch of final .h -> .hpp renamings --- .../include/GLContextAndroid.h | 87 ---------------------- .../include/GLContextAndroid.hpp | 87 ++++++++++++++++++++++ .../GraphicsEngineOpenGL/include/GLContextIOS.h | 39 ---------- .../GraphicsEngineOpenGL/include/GLContextIOS.hpp | 39 ++++++++++ .../GraphicsEngineOpenGL/include/GLContextLinux.h | 46 ------------ .../include/GLContextLinux.hpp | 46 ++++++++++++ .../GraphicsEngineOpenGL/include/GLContextMacOS.h | 39 ---------- .../include/GLContextMacOS.hpp | 39 ++++++++++ .../GraphicsEngineOpenGL/src/GLContextAndroid.cpp | 2 +- Graphics/GraphicsEngineOpenGL/src/GLContextIOS.mm | 4 +- .../GraphicsEngineOpenGL/src/GLContextLinux.cpp | 4 +- .../GraphicsEngineOpenGL/src/GLContextMacOS.mm | 4 +- 12 files changed, 218 insertions(+), 218 deletions(-) delete mode 100644 Graphics/GraphicsEngineOpenGL/include/GLContextAndroid.h create mode 100644 Graphics/GraphicsEngineOpenGL/include/GLContextAndroid.hpp delete mode 100644 Graphics/GraphicsEngineOpenGL/include/GLContextIOS.h create mode 100644 Graphics/GraphicsEngineOpenGL/include/GLContextIOS.hpp delete mode 100644 Graphics/GraphicsEngineOpenGL/include/GLContextLinux.h create mode 100644 Graphics/GraphicsEngineOpenGL/include/GLContextLinux.hpp delete mode 100644 Graphics/GraphicsEngineOpenGL/include/GLContextMacOS.h create mode 100644 Graphics/GraphicsEngineOpenGL/include/GLContextMacOS.hpp (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/include/GLContextAndroid.h b/Graphics/GraphicsEngineOpenGL/include/GLContextAndroid.h deleted file mode 100644 index e7d98d85..00000000 --- a/Graphics/GraphicsEngineOpenGL/include/GLContextAndroid.h +++ /dev/null @@ -1,87 +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 -#include - -namespace Diligent -{ - -class GLContext -{ -public: - using NativeGLContextType = EGLContext; - - GLContext(const struct EngineGLCreateInfo& InitAttribs, struct DeviceCaps& DeviceCaps, const struct SwapChainDesc* pSCDesc); - ~GLContext(); - - bool Init(ANativeWindow* window); - - void SwapBuffers(); - - void UpdateScreenSize(); - - bool Invalidate(); - - void Suspend(); - EGLint Resume(ANativeWindow* window); - - NativeGLContextType GetCurrentNativeGLContext(); - - int32_t GetScreenWidth() const { return screen_width_; } - int32_t GetScreenHeight() const { return screen_height_; } - -private: - //EGL configurations - ANativeWindow* window_ = nullptr; - EGLDisplay display_ = EGL_NO_DISPLAY; - EGLSurface surface_ = EGL_NO_SURFACE; - EGLContext context_ = EGL_NO_CONTEXT; - EGLConfig config_; - - //Screen parameters - int32_t color_size_ = 0; - int32_t depth_size_ = 0; - int32_t major_version_ = 0; - int32_t minor_version_ = 0; - int32_t screen_width_ = 0; - int32_t screen_height_ = 0; - - //Flags - bool gles_initialized_ = false; - bool egl_context_initialized_ = false; - bool context_valid_ = false; - - SwapChainDesc SwapChainAttribs_; - - void InitGLES(); - void Terminate(); - bool InitEGLSurface(); - bool InitEGLContext(); - void AttachToCurrentEGLContext(); - void FillDeviceCaps(DeviceCaps& DeviceCaps); -}; - -} // namespace Diligent diff --git a/Graphics/GraphicsEngineOpenGL/include/GLContextAndroid.hpp b/Graphics/GraphicsEngineOpenGL/include/GLContextAndroid.hpp new file mode 100644 index 00000000..e7d98d85 --- /dev/null +++ b/Graphics/GraphicsEngineOpenGL/include/GLContextAndroid.hpp @@ -0,0 +1,87 @@ +/* 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 +#include + +namespace Diligent +{ + +class GLContext +{ +public: + using NativeGLContextType = EGLContext; + + GLContext(const struct EngineGLCreateInfo& InitAttribs, struct DeviceCaps& DeviceCaps, const struct SwapChainDesc* pSCDesc); + ~GLContext(); + + bool Init(ANativeWindow* window); + + void SwapBuffers(); + + void UpdateScreenSize(); + + bool Invalidate(); + + void Suspend(); + EGLint Resume(ANativeWindow* window); + + NativeGLContextType GetCurrentNativeGLContext(); + + int32_t GetScreenWidth() const { return screen_width_; } + int32_t GetScreenHeight() const { return screen_height_; } + +private: + //EGL configurations + ANativeWindow* window_ = nullptr; + EGLDisplay display_ = EGL_NO_DISPLAY; + EGLSurface surface_ = EGL_NO_SURFACE; + EGLContext context_ = EGL_NO_CONTEXT; + EGLConfig config_; + + //Screen parameters + int32_t color_size_ = 0; + int32_t depth_size_ = 0; + int32_t major_version_ = 0; + int32_t minor_version_ = 0; + int32_t screen_width_ = 0; + int32_t screen_height_ = 0; + + //Flags + bool gles_initialized_ = false; + bool egl_context_initialized_ = false; + bool context_valid_ = false; + + SwapChainDesc SwapChainAttribs_; + + void InitGLES(); + void Terminate(); + bool InitEGLSurface(); + bool InitEGLContext(); + void AttachToCurrentEGLContext(); + void FillDeviceCaps(DeviceCaps& DeviceCaps); +}; + +} // namespace Diligent diff --git a/Graphics/GraphicsEngineOpenGL/include/GLContextIOS.h b/Graphics/GraphicsEngineOpenGL/include/GLContextIOS.h deleted file mode 100644 index 53d80a87..00000000 --- a/Graphics/GraphicsEngineOpenGL/include/GLContextIOS.h +++ /dev/null @@ -1,39 +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 - -namespace Diligent -{ - -class GLContext -{ -public: - using NativeGLContextType = void*; // EAGLContext* - - GLContext(const struct EngineGLCreateInfo& InitAttribs, struct DeviceCaps& DeviceCaps, const struct SwapChainDesc* pSCDesc); - - NativeGLContextType GetCurrentNativeGLContext(); -}; - -} // namespace Diligent diff --git a/Graphics/GraphicsEngineOpenGL/include/GLContextIOS.hpp b/Graphics/GraphicsEngineOpenGL/include/GLContextIOS.hpp new file mode 100644 index 00000000..53d80a87 --- /dev/null +++ b/Graphics/GraphicsEngineOpenGL/include/GLContextIOS.hpp @@ -0,0 +1,39 @@ +/* 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 + +namespace Diligent +{ + +class GLContext +{ +public: + using NativeGLContextType = void*; // EAGLContext* + + GLContext(const struct EngineGLCreateInfo& InitAttribs, struct DeviceCaps& DeviceCaps, const struct SwapChainDesc* pSCDesc); + + NativeGLContextType GetCurrentNativeGLContext(); +}; + +} // namespace Diligent diff --git a/Graphics/GraphicsEngineOpenGL/include/GLContextLinux.h b/Graphics/GraphicsEngineOpenGL/include/GLContextLinux.h deleted file mode 100644 index 2e30183f..00000000 --- a/Graphics/GraphicsEngineOpenGL/include/GLContextLinux.h +++ /dev/null @@ -1,46 +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 - -namespace Diligent -{ - -class GLContext -{ -public: - using NativeGLContextType = GLXContext; - - GLContext(const struct EngineGLCreateInfo& InitAttribs, struct DeviceCaps& DeviceCaps, const struct SwapChainDesc* pSCDesc); - ~GLContext(); - void SwapBuffers(); - - NativeGLContextType GetCurrentNativeGLContext(); - -private: - void* m_pNativeWindow = nullptr; - void* m_pDisplay = nullptr; - NativeGLContextType m_Context; -}; - -} // namespace Diligent diff --git a/Graphics/GraphicsEngineOpenGL/include/GLContextLinux.hpp b/Graphics/GraphicsEngineOpenGL/include/GLContextLinux.hpp new file mode 100644 index 00000000..2e30183f --- /dev/null +++ b/Graphics/GraphicsEngineOpenGL/include/GLContextLinux.hpp @@ -0,0 +1,46 @@ +/* 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 + +namespace Diligent +{ + +class GLContext +{ +public: + using NativeGLContextType = GLXContext; + + GLContext(const struct EngineGLCreateInfo& InitAttribs, struct DeviceCaps& DeviceCaps, const struct SwapChainDesc* pSCDesc); + ~GLContext(); + void SwapBuffers(); + + NativeGLContextType GetCurrentNativeGLContext(); + +private: + void* m_pNativeWindow = nullptr; + void* m_pDisplay = nullptr; + NativeGLContextType m_Context; +}; + +} // namespace Diligent diff --git a/Graphics/GraphicsEngineOpenGL/include/GLContextMacOS.h b/Graphics/GraphicsEngineOpenGL/include/GLContextMacOS.h deleted file mode 100644 index 86dd685a..00000000 --- a/Graphics/GraphicsEngineOpenGL/include/GLContextMacOS.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2015-2019 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 - -namespace Diligent -{ - -class GLContext -{ -public: - using NativeGLContextType = void*; // NSOpenGLContext* - - GLContext(const struct EngineGLCreateInfo& InitAttribs, struct DeviceCaps& DeviceCaps, const struct SwapChainDesc* pSCDesc); - - NativeGLContextType GetCurrentNativeGLContext(); -}; - -} // namespace Diligent diff --git a/Graphics/GraphicsEngineOpenGL/include/GLContextMacOS.hpp b/Graphics/GraphicsEngineOpenGL/include/GLContextMacOS.hpp new file mode 100644 index 00000000..86dd685a --- /dev/null +++ b/Graphics/GraphicsEngineOpenGL/include/GLContextMacOS.hpp @@ -0,0 +1,39 @@ +/* Copyright 2015-2019 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 + +namespace Diligent +{ + +class GLContext +{ +public: + using NativeGLContextType = void*; // NSOpenGLContext* + + GLContext(const struct EngineGLCreateInfo& InitAttribs, struct DeviceCaps& DeviceCaps, const struct SwapChainDesc* pSCDesc); + + NativeGLContextType GetCurrentNativeGLContext(); +}; + +} // namespace Diligent diff --git a/Graphics/GraphicsEngineOpenGL/src/GLContextAndroid.cpp b/Graphics/GraphicsEngineOpenGL/src/GLContextAndroid.cpp index b5a2721c..54787d46 100644 --- a/Graphics/GraphicsEngineOpenGL/src/GLContextAndroid.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/GLContextAndroid.cpp @@ -24,7 +24,7 @@ #include "pch.h" #include -#include "GLContextAndroid.h" +#include "GLContextAndroid.hpp" #ifndef EGL_CONTEXT_MINOR_VERSION_KHR # define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB diff --git a/Graphics/GraphicsEngineOpenGL/src/GLContextIOS.mm b/Graphics/GraphicsEngineOpenGL/src/GLContextIOS.mm index 9a1bb07f..3381698c 100644 --- a/Graphics/GraphicsEngineOpenGL/src/GLContextIOS.mm +++ b/Graphics/GraphicsEngineOpenGL/src/GLContextIOS.mm @@ -25,9 +25,9 @@ #import -#include "GLContextIOS.h" +#include "GLContextIOS.hpp" #include "DeviceCaps.h" -#include "GLTypeConversions.h" +#include "GLTypeConversions.hpp" namespace Diligent { diff --git a/Graphics/GraphicsEngineOpenGL/src/GLContextLinux.cpp b/Graphics/GraphicsEngineOpenGL/src/GLContextLinux.cpp index dbbba5e8..ce27deb7 100644 --- a/Graphics/GraphicsEngineOpenGL/src/GLContextLinux.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/GLContextLinux.cpp @@ -23,9 +23,9 @@ #include "pch.h" -#include "GLContextLinux.h" +#include "GLContextLinux.hpp" #include "DeviceCaps.h" -#include "GLTypeConversions.h" +#include "GLTypeConversions.hpp" namespace Diligent { diff --git a/Graphics/GraphicsEngineOpenGL/src/GLContextMacOS.mm b/Graphics/GraphicsEngineOpenGL/src/GLContextMacOS.mm index 24747c5d..56bb5d22 100644 --- a/Graphics/GraphicsEngineOpenGL/src/GLContextMacOS.mm +++ b/Graphics/GraphicsEngineOpenGL/src/GLContextMacOS.mm @@ -25,9 +25,9 @@ #import -#include "GLContextMacOS.h" +#include "GLContextMacOS.hpp" #include "DeviceCaps.h" -#include "GLTypeConversions.h" +#include "GLTypeConversions.hpp" static void glDrawArraysInstancedBaseInstance_stub(GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance) { -- cgit v1.2.3