mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 15:22:15 +00:00
Enabled building with SDK 10.4
Game controllers support will disabled in this case
This commit is contained in:
parent
d53e860d28
commit
9e4a262c87
12 changed files with 180 additions and 0 deletions
|
@ -43,6 +43,11 @@
|
|||
// Copyright (C) 2009 Apple Inc. All Rights Reserved.
|
||||
//
|
||||
//*****************************************************
|
||||
|
||||
#include <AvailabilityMacros.h>
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
|
||||
#define LOG_SCORING 0
|
||||
|
||||
#include <stdlib.h> // malloc
|
||||
|
@ -917,3 +922,5 @@ int HIDGetElementConfig(HID_info_ptr inHIDInfoPtr, IOHIDDeviceRef *outIOHIDDevic
|
|||
return (inHIDInfoPtr->actionCookie);
|
||||
}
|
||||
} // HIDGetElementConfig
|
||||
|
||||
#endif // MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
|
|
|
@ -43,6 +43,11 @@
|
|||
// Copyright (C) 2009 Apple Inc. All Rights Reserved.
|
||||
//
|
||||
//*****************************************************
|
||||
|
||||
#include <AvailabilityMacros.h>
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
|
||||
#ifdef DEBUG // not used in release
|
||||
#if !defined (kBuildingLibrary)
|
||||
#define kVerboseErrors
|
||||
|
@ -99,3 +104,5 @@ void HIDReportError(const char *strError) {
|
|||
}
|
||||
#endif // kVerboseErrors
|
||||
} // HIDReportError
|
||||
|
||||
#endif // MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
|
|
|
@ -43,6 +43,11 @@
|
|||
// Copyright (C) 2009 Apple Inc. All Rights Reserved.
|
||||
//
|
||||
//*****************************************************
|
||||
|
||||
#include <AvailabilityMacros.h>
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
|
||||
#pragma mark - includes & imports
|
||||
//*****************************************************
|
||||
#include "HID_Utilities_External.h"
|
||||
|
@ -1201,3 +1206,5 @@ static Boolean hu_AddDeviceElementToUsageXML(IOHIDDeviceRef inIOHIDDeviceRef, IO
|
|||
return (results);
|
||||
} // hu_AddDeviceElementToUsageXML
|
||||
#endif
|
||||
|
||||
#endif // MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
|
|
|
@ -43,6 +43,11 @@
|
|||
// Copyright (C) 2009 Apple Inc. All Rights Reserved.
|
||||
//
|
||||
//*****************************************************
|
||||
|
||||
#include <AvailabilityMacros.h>
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
|
||||
#include "HID_Utilities_External.h"
|
||||
|
||||
// ==================================
|
||||
|
@ -352,3 +357,5 @@ unsigned char HIDGetEvent(IOHIDDeviceRef inIOHIDDeviceRef, IOHIDValueRef *pIOHID
|
|||
|
||||
return (false); // did not get event
|
||||
} /* HIDGetEvent */
|
||||
|
||||
#endif // MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
|
|
|
@ -43,6 +43,11 @@
|
|||
// Copyright (C) 2009 Apple Inc. All Rights Reserved.
|
||||
//
|
||||
//***************************************************
|
||||
|
||||
#include <AvailabilityMacros.h>
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
|
||||
#pragma mark - includes & imports
|
||||
//-----------------------------------------------------
|
||||
|
||||
|
@ -1059,3 +1064,5 @@ static CFMutableDictionaryRef hu_SetUpMatchingDictionary(UInt32 inUsagePage, UIn
|
|||
|
||||
return (refHIDMatchDictionary);
|
||||
} // hu_SetUpMatchingDictionary
|
||||
|
||||
#endif // MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
|
|
|
@ -43,6 +43,11 @@
|
|||
// Copyright (C) 2009 Apple Inc. All Rights Reserved.
|
||||
//
|
||||
//*****************************************************
|
||||
|
||||
#include <AvailabilityMacros.h>
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
|
||||
#pragma mark - includes & imports
|
||||
//-----------------------------------------------------
|
||||
|
||||
|
@ -610,3 +615,5 @@ static void IOHIDDevice_SetPtrProperty(IOHIDDeviceRef inIOHIDDeviceRef, CFString
|
|||
} // IOHIDDevice_SetPtrProperty
|
||||
|
||||
//*****************************************************
|
||||
|
||||
#endif // MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
|
|
|
@ -43,6 +43,11 @@
|
|||
// Copyright (C) 2009 Apple Inc. All Rights Reserved.
|
||||
//
|
||||
//*****************************************************
|
||||
|
||||
#include <AvailabilityMacros.h>
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
|
||||
#pragma mark - includes & imports
|
||||
//-----------------------------------------------------
|
||||
|
||||
|
@ -500,3 +505,5 @@ void IOHIDElement_SetLongProperty(IOHIDElementRef inElementRef, CFStringRef inKe
|
|||
} // IOHIDElement_SetLongProperty
|
||||
|
||||
//*****************************************************
|
||||
|
||||
#endif // MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
|
|
|
@ -43,6 +43,11 @@
|
|||
// Copyright (C) 2009 Apple Inc. All Rights Reserved.
|
||||
//
|
||||
//*****************************************************
|
||||
|
||||
#include <AvailabilityMacros.h>
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
|
||||
#include <mach/mach.h>
|
||||
#include <mach/mach_error.h>
|
||||
|
||||
|
@ -99,3 +104,5 @@ bool FreeHIDObject(io_service_t inHIDObject) {
|
|||
|
||||
return (kIOReturnSuccess == kr);
|
||||
} // FreeHIDObject
|
||||
|
||||
#endif // MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
|
|
|
@ -45,6 +45,80 @@
|
|||
#include <OpenGL/gl.h>
|
||||
#include <OpenGL/glext.h>
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
|
||||
|
||||
// Missing definitions for 10.4 and earlier
|
||||
|
||||
typedef unsigned int NSUInteger;
|
||||
typedef int NSInteger;
|
||||
|
||||
typedef float CGFloat;
|
||||
|
||||
// From HIToolbox/Events.h
|
||||
enum
|
||||
{
|
||||
kVK_Return = 0x24,
|
||||
kVK_Tab = 0x30,
|
||||
kVK_Space = 0x31,
|
||||
kVK_Delete = 0x33,
|
||||
kVK_Escape = 0x35,
|
||||
kVK_Command = 0x37,
|
||||
kVK_Shift = 0x38,
|
||||
kVK_CapsLock = 0x39,
|
||||
kVK_Option = 0x3A,
|
||||
kVK_Control = 0x3B,
|
||||
kVK_RightShift = 0x3C,
|
||||
kVK_RightOption = 0x3D,
|
||||
kVK_RightControl = 0x3E,
|
||||
kVK_Function = 0x3F,
|
||||
kVK_F17 = 0x40,
|
||||
kVK_VolumeUp = 0x48,
|
||||
kVK_VolumeDown = 0x49,
|
||||
kVK_Mute = 0x4A,
|
||||
kVK_F18 = 0x4F,
|
||||
kVK_F19 = 0x50,
|
||||
kVK_F20 = 0x5A,
|
||||
kVK_F5 = 0x60,
|
||||
kVK_F6 = 0x61,
|
||||
kVK_F7 = 0x62,
|
||||
kVK_F3 = 0x63,
|
||||
kVK_F8 = 0x64,
|
||||
kVK_F9 = 0x65,
|
||||
kVK_F11 = 0x67,
|
||||
kVK_F13 = 0x69,
|
||||
kVK_F16 = 0x6A,
|
||||
kVK_F14 = 0x6B,
|
||||
kVK_F10 = 0x6D,
|
||||
kVK_F12 = 0x6F,
|
||||
kVK_F15 = 0x71,
|
||||
kVK_Help = 0x72,
|
||||
kVK_Home = 0x73,
|
||||
kVK_PageUp = 0x74,
|
||||
kVK_ForwardDelete = 0x75,
|
||||
kVK_F4 = 0x76,
|
||||
kVK_End = 0x77,
|
||||
kVK_F2 = 0x78,
|
||||
kVK_PageDown = 0x79,
|
||||
kVK_F1 = 0x7A,
|
||||
kVK_LeftArrow = 0x7B,
|
||||
kVK_RightArrow = 0x7C,
|
||||
kVK_DownArrow = 0x7D,
|
||||
kVK_UpArrow = 0x7E
|
||||
};
|
||||
|
||||
@interface NSView(SupportOutdatedOSX)
|
||||
- (NSPoint)convertPointFromBase:(NSPoint)aPoint;
|
||||
@end
|
||||
|
||||
@implementation NSView(SupportOutdatedOSX)
|
||||
- (NSPoint)convertPointFromBase:(NSPoint)aPoint
|
||||
{
|
||||
return [self convertPoint:aPoint fromView:nil];
|
||||
}
|
||||
@end
|
||||
|
||||
#endif // prior to 10.5
|
||||
|
||||
#include <SDL.h>
|
||||
|
||||
// Avoid collision between DObject class and Objective-C
|
||||
|
|
|
@ -33,6 +33,10 @@
|
|||
|
||||
#include "m_joy.h"
|
||||
|
||||
#include <AvailabilityMacros.h>
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
|
||||
#include <CoreServices/CoreServices.h>
|
||||
|
||||
#include "HID_Utilities_External.h"
|
||||
|
@ -788,3 +792,37 @@ void I_ProcessJoysticks()
|
|||
s_joystickManager->Update();
|
||||
}
|
||||
}
|
||||
|
||||
#else // prior to 10.5
|
||||
|
||||
void I_StartupJoysticks()
|
||||
{
|
||||
}
|
||||
|
||||
void I_ShutdownJoysticks()
|
||||
{
|
||||
}
|
||||
|
||||
void I_GetJoysticks(TArray<IJoystickConfig*>& sticks)
|
||||
{
|
||||
sticks.Clear();
|
||||
}
|
||||
|
||||
void I_GetAxes(float axes[NUM_JOYAXIS])
|
||||
{
|
||||
for (size_t i = 0; i < NUM_JOYAXIS; ++i)
|
||||
{
|
||||
axes[i] = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
IJoystickConfig *I_UpdateDeviceList()
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void I_ProcessJoysticks()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // 10.5 or higher
|
||||
|
|
|
@ -50,6 +50,11 @@
|
|||
#include <wordexp.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
|
||||
// Missing type definition for 10.4 and earlier
|
||||
typedef unsigned int NSUInteger;
|
||||
#endif // prior to 10.5
|
||||
|
||||
CVAR(String, osx_additional_parameters, "", CVAR_ARCHIVE | CVAR_NOSET | CVAR_GLOBALCONFIG);
|
||||
|
||||
enum
|
||||
|
|
|
@ -550,6 +550,13 @@ void SDLFB::SetVSync (bool vsync)
|
|||
{
|
||||
// Apply vsync for native backend only (where OpenGL context is set)
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
|
||||
// Inconsistency between 10.4 and 10.5 SDKs:
|
||||
// third argument of CGLSetParameter() is const long* on 10.4 and const GLint* on 10.5
|
||||
// So, GLint typedef'ed to long instead of int to workaround this issue
|
||||
typedef long GLint;
|
||||
#endif // prior to 10.5
|
||||
|
||||
const GLint value = vsync ? 1 : 0;
|
||||
CGLSetParameter(context, kCGLCPSwapInterval, &value);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue