mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-07 12:54:00 +00:00
Mac build - Link Carbon so window can receive focus/input
This commit is contained in:
parent
3c5923686d
commit
9c6663019d
@ -82,6 +82,10 @@ configure_file(${OpenMW_SOURCE_DIR}/files/plugins.cfg.linux
|
|||||||
"${OpenMW_BINARY_DIR}/plugins.cfg" COPYONLY)
|
"${OpenMW_BINARY_DIR}/plugins.cfg" COPYONLY)
|
||||||
endif (WIN32)
|
endif (WIN32)
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
|
find_library(CARBON_FRAMEWORK Carbon)
|
||||||
|
endif (APPLE)
|
||||||
|
|
||||||
configure_file(${OpenMW_SOURCE_DIR}/files/openmw.cfg
|
configure_file(${OpenMW_SOURCE_DIR}/files/openmw.cfg
|
||||||
"${OpenMW_BINARY_DIR}/openmw.cfg" COPYONLY)
|
"${OpenMW_BINARY_DIR}/openmw.cfg" COPYONLY)
|
||||||
|
|
||||||
@ -103,3 +107,8 @@ target_link_libraries(openmw
|
|||||||
${OGRE_LIBRARIES}
|
${OGRE_LIBRARIES}
|
||||||
${OIS_LIBRARIES}
|
${OIS_LIBRARIES}
|
||||||
${Boost_LIBRARIES})
|
${Boost_LIBRARIES})
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
|
target_link_libraries(openmw
|
||||||
|
${CARBON_FRAMEWORK})
|
||||||
|
endif (APPLE)
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
|
|
||||||
#include "OgreRenderWindow.h"
|
#include "OgreRenderWindow.h"
|
||||||
|
|
||||||
|
#ifdef __APPLE_CC__
|
||||||
|
#include <Carbon/Carbon.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace Input;
|
using namespace Input;
|
||||||
using namespace Ogre;
|
using namespace Ogre;
|
||||||
using namespace OIS;
|
using namespace OIS;
|
||||||
@ -50,6 +54,13 @@ OISManager::OISManager(Render::OgreRenderer &rend)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __APPLE_CC__
|
||||||
|
// Give the application window focus to receive input events
|
||||||
|
ProcessSerialNumber psn = { 0, kCurrentProcess };
|
||||||
|
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
|
||||||
|
SetFrontProcess(&psn);
|
||||||
|
#endif
|
||||||
|
|
||||||
inputMgr = InputManager::createInputSystem( pl );
|
inputMgr = InputManager::createInputSystem( pl );
|
||||||
|
|
||||||
// Create all devices
|
// Create all devices
|
||||||
|
Loading…
Reference in New Issue
Block a user