Mac build - Link Carbon so window can receive focus/input

actorid
Ardekantur 15 years ago
parent 3c5923686d
commit 9c6663019d

@ -82,6 +82,10 @@ configure_file(${OpenMW_SOURCE_DIR}/files/plugins.cfg.linux
"${OpenMW_BINARY_DIR}/plugins.cfg" COPYONLY)
endif (WIN32)
if (APPLE)
find_library(CARBON_FRAMEWORK Carbon)
endif (APPLE)
configure_file(${OpenMW_SOURCE_DIR}/files/openmw.cfg
"${OpenMW_BINARY_DIR}/openmw.cfg" COPYONLY)
@ -103,3 +107,8 @@ target_link_libraries(openmw
${OGRE_LIBRARIES}
${OIS_LIBRARIES}
${Boost_LIBRARIES})
if (APPLE)
target_link_libraries(openmw
${CARBON_FRAMEWORK})
endif (APPLE)

@ -6,6 +6,10 @@
#include "OgreRenderWindow.h"
#ifdef __APPLE_CC__
#include <Carbon/Carbon.h>
#endif
using namespace Input;
using namespace Ogre;
using namespace OIS;
@ -50,6 +54,13 @@ OISManager::OISManager(Render::OgreRenderer &rend)
#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 );
// Create all devices

Loading…
Cancel
Save