mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
-update old USE_OS_X_VERSION_10_* macros
-fix setCursorPositionToX:Y: git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1752 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
9b25dc5641
commit
a1eade38f4
@ -51,9 +51,9 @@ namespace sf {
|
||||
/// as handle to WindowImpl.
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef USE_OS_X_VERSION_10_4
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 // NSWindowDelegate is only define since 10.6
|
||||
@interface SFWindowController : NSResponder <WindowImplDelegateProtocol> {
|
||||
#else /* USE_OS_X_VERSION_10_6 */
|
||||
#else
|
||||
@interface SFWindowController : NSResponder <WindowImplDelegateProtocol, NSWindowDelegate> {
|
||||
#endif
|
||||
NSWindow* myWindow;
|
||||
|
@ -109,7 +109,7 @@
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:NO];
|
||||
/*
|
||||
"YES" make some "invalid drawable".
|
||||
"YES" produces some "invalid drawable".
|
||||
See http://www.cocoabuilder.com/archive/cocoa/152482-nsviews-and-nsopenglcontext-invalid-drawable-error.html
|
||||
|
||||
[...]
|
||||
@ -226,6 +226,11 @@
|
||||
////////////////////////////////////////////////////////
|
||||
-(void)setCursorPositionToX:(unsigned int)x Y:(unsigned int)y
|
||||
{
|
||||
// Create a SFML event.
|
||||
if (myRequester == 0) return;
|
||||
|
||||
myRequester->MouseMovedAt(x, y);
|
||||
|
||||
// Flip for SFML window coordinate system
|
||||
y = NSHeight([myWindow frame]) - y;
|
||||
|
||||
@ -243,6 +248,12 @@
|
||||
|
||||
// Place the cursor.
|
||||
CGDisplayMoveCursorToPoint(screenNumber, CGPointMake(screenCoord.x, screenCoord.y));
|
||||
/*
|
||||
CGDisplayMoveCursorToPoint -- Discussion :
|
||||
|
||||
No events are generated as a result of this move.
|
||||
Points that lie outside the desktop are clipped to the desktop.
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user