From 54ba19d2f35a2ca220d75c0fe8322185c494afba Mon Sep 17 00:00:00 2001 From: TJ Lambert Date: Thu, 24 Mar 2022 08:25:26 -0500 Subject: [PATCH 1/3] Remove Defines --- src/scenekit.cs | 47 +++++++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/src/scenekit.cs b/src/scenekit.cs index dd4eb406eb02..554258a00814 100644 --- a/src/scenekit.cs +++ b/src/scenekit.cs @@ -68,9 +68,13 @@ #if MONOMAC using AppKit; +using EAGLContext = Foundation.NSObject; using GLContext = global::OpenGL.CGLContext; #else using UIKit; +using CAOpenGLLayer = System.Object; +using NSOpenGLContext = System.Object; +using NSOpenGLPixelFormat = System.Object; #if HAS_OPENGLES using OpenGLES; @@ -82,6 +86,7 @@ #if WATCH using NSView = global::Foundation.NSObject; // won't be used -> [NoWatch] but must compile using SCNGeometryTessellator = global::Foundation.NSObject; // won't be used -> [NoWatch] but must compile +using EAGLContext = global::Foundation.NSObject; #else using NSView = global::UIKit.UIView; #endif @@ -92,6 +97,10 @@ using NSBezierPath = global::UIKit.UIBezierPath; #endif +#if __MACCATALYST__ +using EAGLContext = System.Object; +#endif + #if !NET using NativeHandle = System.IntPtr; #endif @@ -1219,8 +1228,7 @@ interface SCNHitTestResult { CGPoint GetTextureCoordinatesWithMappingChannel (nint channel); } -#if MONOMAC - [iOS (8,0)] + [NoiOS][NoTV][NoWatch][NoMacCatalyst] [Deprecated (PlatformName.MacOSX, 10, 14, message: "Please use Metal instead of OpenGL API.")] [NoMacCatalyst] [BaseType (typeof (CAOpenGLLayer))] @@ -1229,7 +1237,6 @@ interface SCNLayer : SCNSceneRenderer, SCNTechniqueSupport { // [Export ("scene", ArgumentSemantic.Retain)] // SCNScene Scene { get; set; } } -#endif [Watch (3,0)] [iOS (8,0)] @@ -1494,7 +1501,7 @@ interface SCNLightType { NSString Area { get; } } -#if MONOMAC + [NoiOS][NoTV][NoWatch][NoMacCatalyst] [Deprecated (PlatformName.MacOSX, 10, 10)] [Static] interface SCNLightAttribute { @@ -1519,7 +1526,6 @@ interface SCNLightAttribute { [Field ("SCNLightShadowFarClippingKey")] NSString ShadowFarClippingKey { get; } } -#endif [Watch (3,0)] [iOS (8,0)] @@ -1784,7 +1790,6 @@ interface SCNSceneLoadingOptions { [Export ("SCNSceneSourceLoading.OptionPreserveOriginalTopology")] bool PreserveOriginalTopology { get; set; } -#if !TVOS && !WATCH // note: generator's StrongDictionary does not support No* attributes yet [NoTV] [NoWatch] @@ -1792,7 +1797,6 @@ interface SCNSceneLoadingOptions { [NoTV] [NoWatch] bool ConvertToYUp { get; set; } -#endif [Internal, Export ("SCNSceneSourceLoading.AnimationImportPolicyKey")] NSString _AnimationImportPolicyKey { get; set; } @@ -2498,35 +2502,28 @@ interface SCNProgram : NSCopying, NSSecureCoding { [BaseType (typeof (NSObject))] [Model, Protocol] interface SCNProgramDelegate { -#if MONOMAC - #if XAMCORE_3_0 + [Unavailable (PlatformName.iOS)] - #endif + [NoTV][NoMacCatalyst] [Deprecated (PlatformName.MacOSX, 10, 10)] [Export ("program:bindValueForSymbol:atLocation:programID:renderer:")] bool BindValue (SCNProgram program, string symbol, uint /* unsigned int */ location, uint /* unsigned int */ programID, SCNRenderer renderer); - #if XAMCORE_3_0 [Unavailable (PlatformName.iOS)] - #endif + [NoTV][NoMacCatalyst] [Deprecated (PlatformName.MacOSX, 10, 10)] [Export ("program:unbindValueForSymbol:atLocation:programID:renderer:")] void UnbindValue (SCNProgram program, string symbol, uint /* unsigned int */ location, uint /* unsigned int */ programID, SCNRenderer renderer); -#endif [Export ("program:handleError:")] void HandleError (SCNProgram program, NSError error); -#if MONOMAC - #if XAMCORE_3_0 [NoiOS] [NoTV, NoWatch] - #endif [Deprecated (PlatformName.MacOSX, 10, 10, message: "Use the SCNProgram's Opaque property instead.")] [NoMacCatalyst] [Export ("programIsOpaque:")] bool IsProgramOpaque (SCNProgram program); -#endif } [Watch (3,0)] @@ -3058,15 +3055,14 @@ interface SCNSceneRenderer { [Export ("context")] IntPtr Context { get; } -#if MONOMAC #if NET [Abstract] #endif + [NoTV][NoWatch][NoMacCatalyst] [Deprecated (PlatformName.MacOSX, 10, 10)] [NoiOS] [Export ("currentTime")] double CurrentTime { get; set; } -#endif [Abstract] [Export ("hitTest:options:")] @@ -3322,11 +3318,10 @@ interface SCNText { [Export ("containerFrame")] CGRect ContainerFrame { get; set; } -#if MONOMAC // removed in iOS8 beta 5 - but it was already existing in 10.8 ? + [NoiOS][NoTV][NoWatch] [Export ("textSize")] CGSize TextSize { get; } -#endif [Export ("truncationMode", ArgumentSemantic.Copy)] string TruncationMode { get; set; } @@ -3489,31 +3484,31 @@ interface SCNView : SCNSceneRenderer, SCNTechniqueSupport { // [Export ("scene", ArgumentSemantic.Retain)] // SCNScene Scene { get; set; } -#if MONOMAC + [NoiOS][NoTV][NoWatch][NoMacCatalyst] [Export ("backgroundColor", ArgumentSemantic.Copy)] NSColor BackgroundColor { get; set; } -#endif [Export ("allowsCameraControl")] bool AllowsCameraControl { get; set; } -#if MONOMAC + [NoiOS][NoTV][NoWatch][NoMacCatalyst] [Deprecated (PlatformName.MacOSX, 10, 14, message: "Please use Metal instead of OpenGL API.")] [Export ("openGLContext", ArgumentSemantic.Retain)] [NullAllowed] NSOpenGLContext OpenGLContext { get; set; } + [NoiOS][NoTV][NoWatch][NoMacCatalyst] [Deprecated (PlatformName.MacOSX, 10, 14, message: "Please use Metal instead of OpenGL API.")] [Export ("pixelFormat", ArgumentSemantic.Retain)] [NullAllowed] NSOpenGLPixelFormat PixelFormat { get; set; } -#elif !WATCH && !__MACCATALYST__ + + [NoMac][NoWatch][NoMacCatalyst] [Deprecated (PlatformName.iOS, 12, 0, message: "Please use Metal instead of OpenGL API.")] [Deprecated (PlatformName.TvOS, 12, 0, message: "Please use Metal instead of OpenGL API.")] [Export ("eaglContext", ArgumentSemantic.Retain)] [NullAllowed] EAGLContext EAGLContext { get; set; } -#endif #if !WATCH [iOS (9,0)][Mac (10,11)] From f907ab8abc132b5f911c73a6f51b3128ee0eb2e7 Mon Sep 17 00:00:00 2001 From: TJ Lambert Date: Mon, 28 Mar 2022 12:23:31 -0500 Subject: [PATCH 2/3] consolidate the usings to one --- src/scenekit.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/scenekit.cs b/src/scenekit.cs index 554258a00814..4fd06621e6fb 100644 --- a/src/scenekit.cs +++ b/src/scenekit.cs @@ -65,10 +65,13 @@ using GameplayKit; #endif +#if MONOMAC || WATCH || __MACCATALYST__ +using EAGLContext = System.Object; +#endif + #if MONOMAC using AppKit; -using EAGLContext = Foundation.NSObject; using GLContext = global::OpenGL.CGLContext; #else using UIKit; @@ -86,7 +89,6 @@ #if WATCH using NSView = global::Foundation.NSObject; // won't be used -> [NoWatch] but must compile using SCNGeometryTessellator = global::Foundation.NSObject; // won't be used -> [NoWatch] but must compile -using EAGLContext = global::Foundation.NSObject; #else using NSView = global::UIKit.UIView; #endif @@ -97,10 +99,6 @@ using NSBezierPath = global::UIKit.UIBezierPath; #endif -#if __MACCATALYST__ -using EAGLContext = System.Object; -#endif - #if !NET using NativeHandle = System.IntPtr; #endif From 4252aed9a9125809fa9d44af518bd5174d092847 Mon Sep 17 00:00:00 2001 From: TJ Lambert Date: Tue, 29 Mar 2022 12:34:04 -0500 Subject: [PATCH 3/3] add NoMacCatalyst --- src/scenekit.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scenekit.cs b/src/scenekit.cs index 4fd06621e6fb..7ec4e4ef1e94 100644 --- a/src/scenekit.cs +++ b/src/scenekit.cs @@ -3317,7 +3317,7 @@ interface SCNText { CGRect ContainerFrame { get; set; } // removed in iOS8 beta 5 - but it was already existing in 10.8 ? - [NoiOS][NoTV][NoWatch] + [NoiOS][NoTV][NoWatch][NoMacCatalyst] [Export ("textSize")] CGSize TextSize { get; }