mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 04:41:05 +08:00
Improved SFML integration with Cocoa
This commit is contained in:
parent
d6a40cf062
commit
32563cdc6f
@ -109,12 +109,12 @@ PoolWrapper::~PoolWrapper()
|
||||
#ifdef SFML_DEBUG
|
||||
if (count < 0) {
|
||||
sf::Err() << "~PoolWrapper : count is less than zero! "
|
||||
"You called ReleasePool from a thread too many times."
|
||||
<< std::endl;
|
||||
"You called ReleasePool from a thread too many times."
|
||||
<< std::endl;
|
||||
} else if (count > 0) {
|
||||
sf::Err() << "~PoolWrapper : count is greater than zero! "
|
||||
"You called ReleasePool from a thread to few times."
|
||||
<< std::endl;
|
||||
"You called ReleasePool from a thread to few times."
|
||||
<< std::endl;
|
||||
} else { // count == 0
|
||||
sf::Err() << "~PoolWrapper is HAPPY!" << std::endl;
|
||||
}
|
||||
|
@ -29,6 +29,17 @@
|
||||
#include <SFML/Window/OSX/HIDJoystickManager.hpp>
|
||||
#include <SFML/Window/OSX/HIDInputManager.hpp>
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Private data
|
||||
////////////////////////////////////////////////////////////
|
||||
namespace
|
||||
{
|
||||
// Using a custom run loop mode solve some issues that appears when SFML
|
||||
// is used with Cocoa.
|
||||
CFStringRef const runLoopMode = CFSTR("SFML_RUN_LOOP_MODE");
|
||||
}
|
||||
|
||||
|
||||
namespace sf
|
||||
{
|
||||
namespace priv
|
||||
@ -74,7 +85,7 @@ HIDJoystickManager::HIDJoystickManager()
|
||||
|
||||
IOHIDManagerScheduleWithRunLoop(myHIDManager,
|
||||
CFRunLoopGetCurrent(),
|
||||
kCFRunLoopDefaultMode);
|
||||
runLoopMode);
|
||||
|
||||
IOHIDManagerOpen(myHIDManager, kIOHIDOptionsTypeNone);
|
||||
}
|
||||
@ -85,7 +96,7 @@ HIDJoystickManager::~HIDJoystickManager()
|
||||
{
|
||||
IOHIDManagerUnscheduleFromRunLoop(myHIDManager,
|
||||
CFRunLoopGetCurrent(),
|
||||
kCFRunLoopDefaultMode);
|
||||
runLoopMode);
|
||||
|
||||
IOHIDManagerRegisterDeviceMatchingCallback(myHIDManager, NULL, 0);
|
||||
IOHIDManagerRegisterDeviceRemovalCallback(myHIDManager, NULL, 0);
|
||||
@ -100,7 +111,7 @@ void HIDJoystickManager::Update()
|
||||
SInt32 status = kCFRunLoopRunHandledSource;
|
||||
|
||||
while (status == kCFRunLoopRunHandledSource) {
|
||||
status = CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true);
|
||||
status = CFRunLoopRunInMode(runLoopMode, 0, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user