From e7c040cefafce9465e7a18423fb93927b1722555 Mon Sep 17 00:00:00 2001 From: Martin Pecka Date: Sun, 3 Sep 2023 19:29:01 +0200 Subject: [PATCH] Fixed build on MSVC. Signed-off-by: Martin Pecka --- .../gz/rendering/GlobalIlluminationBase.hh | 5 ++- .../gz/rendering/GlobalIlluminationCiVct.hh | 10 ++++-- include/gz/rendering/GlobalIlluminationVct.hh | 5 ++- include/gz/rendering/NativeWindow.hh | 5 ++- include/gz/rendering/base/BaseNativeWindow.hh | 4 +-- .../ogre2/Ogre2GlobalIlluminationCiVct.hh | 2 ++ ogre2/src/CMakeLists.txt | 1 + ogre2/src/Ogre2GlobalIlluminationCiVct.cc | 5 +++ ogre2/src/Ogre2RenderEngine.cc | 2 +- src/GlobalIlluminationBase.cc | 28 +++++++++++++++ src/GlobalIlluminationCiVct.cc | 34 +++++++++++++++++++ src/GlobalIlluminationVct.cc | 28 +++++++++++++++ src/NativeWindow.cc | 28 +++++++++++++++ src/base/BaseNativeWindow.cc | 28 +++++++++++++++ 14 files changed, 177 insertions(+), 8 deletions(-) create mode 100644 src/GlobalIlluminationBase.cc create mode 100644 src/GlobalIlluminationCiVct.cc create mode 100644 src/GlobalIlluminationVct.cc create mode 100644 src/NativeWindow.cc create mode 100644 src/base/BaseNativeWindow.cc diff --git a/include/gz/rendering/GlobalIlluminationBase.hh b/include/gz/rendering/GlobalIlluminationBase.hh index 881512558..87caf5c3c 100644 --- a/include/gz/rendering/GlobalIlluminationBase.hh +++ b/include/gz/rendering/GlobalIlluminationBase.hh @@ -52,8 +52,11 @@ namespace gz STATIC_VISUALS = 1u << 1u }; + /// \brief Constructor + public: GlobalIlluminationBase(); + /// \brief Destructor - public: virtual ~GlobalIlluminationBase() { } + public: virtual ~GlobalIlluminationBase(); /// \brief Initialize the class protected: virtual void Init() = 0; diff --git a/include/gz/rendering/GlobalIlluminationCiVct.hh b/include/gz/rendering/GlobalIlluminationCiVct.hh index a3a2ea401..dbffdf01a 100644 --- a/include/gz/rendering/GlobalIlluminationCiVct.hh +++ b/include/gz/rendering/GlobalIlluminationCiVct.hh @@ -31,8 +31,11 @@ namespace gz class GZ_RENDERING_VISIBLE CiVctCascade { + /// \brief Constructor + public: CiVctCascade(); + /// \brief Destructor - public: virtual ~CiVctCascade() {} + public: virtual ~CiVctCascade(); /// \brief Sets whether to correctly calculate GI occlusion caused /// by occluders against area lights. Consumes more VRAM. @@ -149,8 +152,11 @@ namespace gz DVM_None }; + /// \brief Constructor + public: GlobalIlluminationCiVct(); + /// \brief Destructor - public: virtual ~GlobalIlluminationCiVct() { } + public: virtual ~GlobalIlluminationCiVct(); /// \brief Tells how many times AddCascade will be called. /// You can call it fewer times (i.e. some kb of RAM will be wasted) diff --git a/include/gz/rendering/GlobalIlluminationVct.hh b/include/gz/rendering/GlobalIlluminationVct.hh index be86924a0..a755e5216 100644 --- a/include/gz/rendering/GlobalIlluminationVct.hh +++ b/include/gz/rendering/GlobalIlluminationVct.hh @@ -48,8 +48,11 @@ namespace gz DVM_None }; + /// \brief Constructor + public: GlobalIlluminationVct(); + /// \brief Destructor - public: virtual ~GlobalIlluminationVct() { } + public: virtual ~GlobalIlluminationVct(); /// \brief Resolution of the 3D Voxel. Must be multiple of 2 /// \remarks To avoid wasting RAM, make this function your first call diff --git a/include/gz/rendering/NativeWindow.hh b/include/gz/rendering/NativeWindow.hh index c1b8f6fb1..1e8982fcb 100644 --- a/include/gz/rendering/NativeWindow.hh +++ b/include/gz/rendering/NativeWindow.hh @@ -38,8 +38,11 @@ namespace gz /// on OS and RenderSystem class GZ_RENDERING_VISIBLE NativeWindow { + /// \brief Constructor + public: NativeWindow(); + /// \brief Destructor - public: virtual ~NativeWindow() { } + public: virtual ~NativeWindow(); /// \brief Tells the native window whether it's under focus /// \param[in] _focused True if we acquired focus. False if we lost it diff --git a/include/gz/rendering/base/BaseNativeWindow.hh b/include/gz/rendering/base/BaseNativeWindow.hh index adb664087..55919140c 100644 --- a/include/gz/rendering/base/BaseNativeWindow.hh +++ b/include/gz/rendering/base/BaseNativeWindow.hh @@ -32,9 +32,9 @@ namespace gz class GZ_RENDERING_VISIBLE BaseNativeWindow : public virtual NativeWindow { - protected: BaseNativeWindow() {} + protected: BaseNativeWindow(); - public: virtual ~BaseNativeWindow() {} + public: virtual ~BaseNativeWindow(); // Documentation Inherited. public: virtual void NotifyFocused(bool /*_focused*/) override {} diff --git a/ogre2/include/gz/rendering/ogre2/Ogre2GlobalIlluminationCiVct.hh b/ogre2/include/gz/rendering/ogre2/Ogre2GlobalIlluminationCiVct.hh index dd1b3b3a2..06d05f48c 100644 --- a/ogre2/include/gz/rendering/ogre2/Ogre2GlobalIlluminationCiVct.hh +++ b/ogre2/include/gz/rendering/ogre2/Ogre2GlobalIlluminationCiVct.hh @@ -47,6 +47,8 @@ namespace gz /// \brief Constructor public: explicit Ogre2CiVctCascade(); + public: ~Ogre2CiVctCascade() override; + /// \brief Initializes the cascade /// \param[in] _cascade Cascade we control /// \param[in] _ref Reference to clone settings from (can be nullptr) diff --git a/ogre2/src/CMakeLists.txt b/ogre2/src/CMakeLists.txt index c2cd9f479..466db6983 100644 --- a/ogre2/src/CMakeLists.txt +++ b/ogre2/src/CMakeLists.txt @@ -9,6 +9,7 @@ if (MSVC) # warning is not important since those members do not need to be interfaced # with. set_source_files_properties(${sources} ${gtest_sources} COMPILE_FLAGS "/wd4251") + set_source_files_properties(${sources} ${gtest_sources} COMPILE_FLAGS "/D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS") endif() set(engine_name "ogre2") diff --git a/ogre2/src/Ogre2GlobalIlluminationCiVct.cc b/ogre2/src/Ogre2GlobalIlluminationCiVct.cc index eb6555033..2a90fac9c 100644 --- a/ogre2/src/Ogre2GlobalIlluminationCiVct.cc +++ b/ogre2/src/Ogre2GlobalIlluminationCiVct.cc @@ -212,6 +212,11 @@ Ogre2GlobalIlluminationCiVct::~Ogre2GlobalIlluminationCiVct() this->Destroy(); } +////////////////////////////////////////////////// +Ogre2CiVctCascade::~Ogre2CiVctCascade() +{ +} + ////////////////////////////////////////////////// void Ogre2GlobalIlluminationCiVct::Init() { diff --git a/ogre2/src/Ogre2RenderEngine.cc b/ogre2/src/Ogre2RenderEngine.cc index ca68b5af4..8ae00523e 100644 --- a/ogre2/src/Ogre2RenderEngine.cc +++ b/ogre2/src/Ogre2RenderEngine.cc @@ -1343,7 +1343,7 @@ NativeWindowPtr Ogre2RenderEngine::CreateNativeWindow( #ifdef _WIN32 params["externalGLContext"] = std::to_string((size_t)wglGetCurrentContext()); -# elidef __APPLE__ +#elif defined(__APPLE__) params["externalGLContext"] = std::to_string((size_t)CGLGetCurrentContext()); #else diff --git a/src/GlobalIlluminationBase.cc b/src/GlobalIlluminationBase.cc new file mode 100644 index 000000000..f6fb974e6 --- /dev/null +++ b/src/GlobalIlluminationBase.cc @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2023 Open Source Robotics Foundation + * + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "gz/rendering/GlobalIlluminationBase.hh" + +using namespace gz; +using namespace rendering; + +////////////////////////////////////////////////// +GlobalIlluminationBase::GlobalIlluminationBase() = default; + +////////////////////////////////////////////////// +GlobalIlluminationBase::~GlobalIlluminationBase() = default; + diff --git a/src/GlobalIlluminationCiVct.cc b/src/GlobalIlluminationCiVct.cc new file mode 100644 index 000000000..293f72c4d --- /dev/null +++ b/src/GlobalIlluminationCiVct.cc @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2023 Open Source Robotics Foundation + * + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "gz/rendering/GlobalIlluminationCiVct.hh" + +using namespace gz; +using namespace rendering; + +////////////////////////////////////////////////// +CiVctCascade::CiVctCascade() = default; + +////////////////////////////////////////////////// +CiVctCascade::~CiVctCascade() = default; + +////////////////////////////////////////////////// +GlobalIlluminationCiVct::GlobalIlluminationCiVct() = default; + +////////////////////////////////////////////////// +GlobalIlluminationCiVct::~GlobalIlluminationCiVct() = default; + diff --git a/src/GlobalIlluminationVct.cc b/src/GlobalIlluminationVct.cc new file mode 100644 index 000000000..cf87d4e9d --- /dev/null +++ b/src/GlobalIlluminationVct.cc @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2023 Open Source Robotics Foundation + * + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "gz/rendering/GlobalIlluminationVct.hh" + +using namespace gz; +using namespace rendering; + +////////////////////////////////////////////////// +GlobalIlluminationVct::GlobalIlluminationVct() = default; + +////////////////////////////////////////////////// +GlobalIlluminationVct::~GlobalIlluminationVct() = default; + diff --git a/src/NativeWindow.cc b/src/NativeWindow.cc new file mode 100644 index 000000000..0a7f97d66 --- /dev/null +++ b/src/NativeWindow.cc @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2023 Open Source Robotics Foundation + * + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "gz/rendering/NativeWindow.hh" + +using namespace gz; +using namespace rendering; + +////////////////////////////////////////////////// +NativeWindow::NativeWindow() = default; + +////////////////////////////////////////////////// +NativeWindow::~NativeWindow() = default; + diff --git a/src/base/BaseNativeWindow.cc b/src/base/BaseNativeWindow.cc new file mode 100644 index 000000000..76bb7d26d --- /dev/null +++ b/src/base/BaseNativeWindow.cc @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2023 Open Source Robotics Foundation + * + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "gz/rendering/base/BaseNativeWindow.hh" + +using namespace gz; +using namespace rendering; + +////////////////////////////////////////////////// +BaseNativeWindow::BaseNativeWindow() = default; + +////////////////////////////////////////////////// +BaseNativeWindow::~BaseNativeWindow() = default; +