diff --git a/CMakeLists.txt b/CMakeLists.txt index 1db852090c..c2cb5b06af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,10 +83,6 @@ set(OENGINE_OGRE ${LIBDIR}/openengine/ogre/imagerotate.cpp ) -if (APPLE) - set(OENGINE_OGRE ${OENGINE_OGRE} ${LIBDIR}/openengine/ogre/osx_utils.mm) -endif () - set(OENGINE_GUI ${LIBDIR}/openengine/gui/manager.cpp ) diff --git a/extern/sdl4ogre/CMakeLists.txt b/extern/sdl4ogre/CMakeLists.txt index 5b31974e5f..fb0832f712 100644 --- a/extern/sdl4ogre/CMakeLists.txt +++ b/extern/sdl4ogre/CMakeLists.txt @@ -8,6 +8,10 @@ set(SDL4OGRE_SOURCE_FILES sdlwindowhelper.cpp ) +if (APPLE) + set(SDL4OGRE_SOURCE_FILES ${SDL4OGRE_SOURCE_FILES} osx_utils.mm) +endif () + set(SDL4OGRE_HEADER_FILES OISCompat.h cursormanager.hpp diff --git a/extern/sdl4ogre/osx_utils.h b/extern/sdl4ogre/osx_utils.h new file mode 100644 index 0000000000..48149827ab --- /dev/null +++ b/extern/sdl4ogre/osx_utils.h @@ -0,0 +1,12 @@ +#ifndef SDL4OGRE_OSX_UTILS_H +#define SDL4OGRE_OSX_UTILS_H + +#include + +namespace SFO { + +extern unsigned long WindowContentViewHandle(SDL_SysWMinfo &info); + +} + +#endif // SDL4OGRE_OSX_UTILS_H diff --git a/libs/openengine/ogre/osx_utils.mm b/extern/sdl4ogre/osx_utils.mm similarity index 84% rename from libs/openengine/ogre/osx_utils.mm rename to extern/sdl4ogre/osx_utils.mm index 7e56601461..0ba17b30c1 100644 --- a/libs/openengine/ogre/osx_utils.mm +++ b/extern/sdl4ogre/osx_utils.mm @@ -2,8 +2,7 @@ #import -namespace OEngine { -namespace Render { +namespace SFO { unsigned long WindowContentViewHandle(SDL_SysWMinfo &info) { @@ -13,4 +12,3 @@ unsigned long WindowContentViewHandle(SDL_SysWMinfo &info) } } -} diff --git a/extern/sdl4ogre/sdlwindowhelper.cpp b/extern/sdl4ogre/sdlwindowhelper.cpp index 14371c947d..79a214753a 100644 --- a/extern/sdl4ogre/sdlwindowhelper.cpp +++ b/extern/sdl4ogre/sdlwindowhelper.cpp @@ -6,6 +6,10 @@ #include #include +#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE +#include "osx_utils.h" +#endif + namespace SFO { diff --git a/libs/openengine/ogre/osx_utils.h b/libs/openengine/ogre/osx_utils.h deleted file mode 100644 index f651db6046..0000000000 --- a/libs/openengine/ogre/osx_utils.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef OENGINE_OGRE_OSX_UTILS_H -#define OENGINE_OGRE_OSX_UTILS_H - -#include - -namespace OEngine { -namespace Render { - -extern unsigned long WindowContentViewHandle(SDL_SysWMinfo &info); - -} -} - -#endif diff --git a/libs/openengine/ogre/renderer.cpp b/libs/openengine/ogre/renderer.cpp index cda35b16c4..b87f0aa718 100644 --- a/libs/openengine/ogre/renderer.cpp +++ b/libs/openengine/ogre/renderer.cpp @@ -24,10 +24,6 @@ #include #include -#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE -#include "osx_utils.h" -#endif - using namespace Ogre; using namespace OEngine::Render;