Skip to content

Commit

Permalink
Ogre2RenderEngine: on Windows if useCurrentGLContext is specified, se…
Browse files Browse the repository at this point in the history
…t the externalWindowsHandle ogre-next option

Signed-off-by: Silvio Traversaro <silvio.traversaro@iit.it>
  • Loading branch information
traversaro committed Apr 23, 2024
1 parent df019bb commit f829d80
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ogre2/src/Ogre2RenderEngine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,22 @@ std::string Ogre2RenderEngine::CreateRenderWindow(const std::string &_handle,
{
params["externalGLControl"] = "true";
params["currentGLContext"] = "true";

#if defined(_MSC_VER)
if (!this->winID.empty())
{
params["externalWindowHandle"] = this->winID;
}
else
{
gzerr << "useCurrentGLContext option specified, "
<< "but no winID specified." << std::endl
<< "On Windows if useCurrentGLContext is specified, "
<< "the ogre2 rendering requires that also winID is specified."
<< std::endl;
return std::string();
}
#endif
}

#if !defined(__APPLE__) && !defined(_MSC_VER)
Expand Down

0 comments on commit f829d80

Please sign in to comment.