Fix macOS 10.12 deprecated

This commit is contained in:
Anaël Seghezzi 2019-03-07 14:51:12 +01:00
parent 340c1200fc
commit eea6b32f66

View File

@ -45,6 +45,8 @@
#define NSEventMaskAny NSAnyEventMask #define NSEventMaskAny NSAnyEventMask
#define NSEventTypeApplicationDefined NSApplicationDefined #define NSEventTypeApplicationDefined NSApplicationDefined
#define NSBitmapFormatAlphaNonpremultiplied NSAlphaNonpremultipliedBitmapFormat #define NSBitmapFormatAlphaNonpremultiplied NSAlphaNonpremultipliedBitmapFormat
#define NSEventSubtypeTabletPoint NSTabletPointEventSubtype
#define NSEventSubtypeTabletProximity NSTabletProximityEventSubtype
#endif #endif
// Returns the style mask corresponding to the window settings // Returns the style mask corresponding to the window settings
@ -465,7 +467,7 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
{ {
if ([window->ns.object isKeyWindow]) if ([window->ns.object isKeyWindow])
{ {
if ([event subtype] == NSTabletPointEventSubtype) if ([event subtype] == NSEventSubtypeTabletPoint)
{ {
const double pressure = [event pressure]; const double pressure = [event pressure];
const NSPoint tilt = [event tilt]; const NSPoint tilt = [event tilt];
@ -490,7 +492,7 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
_glfwInputPenTabletData( _glfwInputPenTabletData(
pos.x, pos.x,
transformY(pos.y), (double)transformY((float)pos.y),
posz / 1024.0, posz / 1024.0,
pressure, pressure,
pitch, pitch,
@ -498,7 +500,7 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
0.0); 0.0);
} }
if ([event subtype] == NSTabletProximityEventSubtype) if ([event subtype] == NSEventSubtypeTabletProximity)
{ {
static unsigned int s_cursor = 0; static unsigned int s_cursor = 0;
unsigned int cursor = [event pointingDeviceType]; unsigned int cursor = [event pointingDeviceType];