Skip to content

Commit

Permalink
Fixed build on MSVC. (#897)
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Pecka <[email protected]>
Co-authored-by: Ian Chen <[email protected]>
Co-authored-by: Michael Carroll <[email protected]>
  • Loading branch information
3 people authored Sep 14, 2023
1 parent 98c5978 commit 0795e09
Show file tree
Hide file tree
Showing 14 changed files with 177 additions and 8 deletions.
5 changes: 4 additions & 1 deletion include/gz/rendering/GlobalIlluminationBase.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 8 additions & 2 deletions include/gz/rendering/GlobalIlluminationCiVct.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion include/gz/rendering/GlobalIlluminationVct.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion include/gz/rendering/NativeWindow.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions include/gz/rendering/base/BaseNativeWindow.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions ogre2/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 5 additions & 0 deletions ogre2/src/Ogre2GlobalIlluminationCiVct.cc
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ Ogre2GlobalIlluminationCiVct::~Ogre2GlobalIlluminationCiVct()
this->Destroy();
}

//////////////////////////////////////////////////
Ogre2CiVctCascade::~Ogre2CiVctCascade()
{
}

//////////////////////////////////////////////////
void Ogre2GlobalIlluminationCiVct::Init()
{
Expand Down
2 changes: 1 addition & 1 deletion ogre2/src/Ogre2RenderEngine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 28 additions & 0 deletions src/GlobalIlluminationBase.cc
Original file line number Diff line number Diff line change
@@ -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;

34 changes: 34 additions & 0 deletions src/GlobalIlluminationCiVct.cc
Original file line number Diff line number Diff line change
@@ -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;

28 changes: 28 additions & 0 deletions src/GlobalIlluminationVct.cc
Original file line number Diff line number Diff line change
@@ -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;

28 changes: 28 additions & 0 deletions src/NativeWindow.cc
Original file line number Diff line number Diff line change
@@ -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;

28 changes: 28 additions & 0 deletions src/base/BaseNativeWindow.cc
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 0795e09

Please sign in to comment.