From afd33cb33a92a03c4eb3628a951eeb05d8092dbd Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Wed, 21 Feb 2018 17:45:05 -0500 Subject: [PATCH] [metalkit] Add 'MTKTextureLoader' missing bindings (fix xtro) (#3561) --- src/metalkit.cs | 51 ++++++++++++++++++++++++++ tests/xtro-sharpie/macOS-MetalKit.todo | 3 -- 2 files changed, 51 insertions(+), 3 deletions(-) delete mode 100644 tests/xtro-sharpie/macOS-MetalKit.todo diff --git a/src/metalkit.cs b/src/metalkit.cs index 98833b0c5116..b4028c2a8638 100644 --- a/src/metalkit.cs +++ b/src/metalkit.cs @@ -9,8 +9,17 @@ using OpenTK; +#if MONOMAC +using AppKit; +#endif + namespace MetalKit { +#if !MONOMAC + // stubs to ease compilation using [NoiOS], [NoTV] + interface NSDisplayGamut {} +#endif + [iOS (9,0)][Mac (10,11, onlyOn64 : true)] [Static] interface MTKModel { @@ -288,6 +297,20 @@ interface MTKTextureLoader { [Async] void FromName (string name, nfloat scaleFactor, [NullAllowed] NSBundle bundle, [NullAllowed] MTKTextureLoaderOptions options, MTKTextureLoaderCallback completionHandler); + [NoiOS] + [NoTV] + [Mac (10,12, onlyOn64 : true)] + [Export ("newTextureWithName:scaleFactor:displayGamut:bundle:options:completionHandler:")] + [Async] + void FromName (string name, nfloat scaleFactor, NSDisplayGamut displayGamut, [NullAllowed] NSBundle bundle, [NullAllowed] NSDictionary options, MTKTextureLoaderCallback completionHandler); + + [NoiOS] + [NoTV] + [Mac (10,12, onlyOn64 : true)] + [Wrap ("FromName (name, scaleFactor, displayGamut, bundle, options == null ? null : options.Dictionary, completionHandler)")] + [Async] + void FromName (string name, nfloat scaleFactor, NSDisplayGamut displayGamut, [NullAllowed] NSBundle bundle, [NullAllowed] MTKTextureLoaderOptions options, MTKTextureLoaderCallback completionHandler); + [iOS (10,0)][Mac (10,12, onlyOn64 : true)] [Export ("newTexturesWithNames:scaleFactor:bundle:options:completionHandler:")] [Async] @@ -298,6 +321,20 @@ interface MTKTextureLoader { [Async] void FromNames (string[] names, nfloat scaleFactor, [NullAllowed] NSBundle bundle, [NullAllowed] MTKTextureLoaderOptions options, MTKTextureLoaderArrayCallback completionHandler); + [NoiOS] + [NoTV] + [Mac (10,12, onlyOn64 : true)] + [Async] + [Export ("newTexturesWithNames:scaleFactor:displayGamut:bundle:options:completionHandler:")] + void FromNames (string[] names, nfloat scaleFactor, NSDisplayGamut displayGamut, [NullAllowed] NSBundle bundle, [NullAllowed] NSDictionary options, MTKTextureLoaderArrayCallback completionHandler); + + [NoiOS] + [NoTV] + [Mac (10,12, onlyOn64 : true)] + [Wrap ("FromNames (names, scaleFactor, displayGamut, bundle, options == null ? null : options.Dictionary, completionHandler)")] + [Async] + void FromNames (string[] names, nfloat scaleFactor, NSDisplayGamut displayGamut, [NullAllowed] NSBundle bundle, [NullAllowed] MTKTextureLoaderOptions options, MTKTextureLoaderArrayCallback completionHandler); + [iOS (10,0)][Mac (10,12, onlyOn64 : true)] [Export ("newTextureWithMDLTexture:options:completionHandler:")] [Async] @@ -327,6 +364,20 @@ interface MTKTextureLoader { [Wrap ("FromName (name, scaleFactor, bundle, options == null ? null : options.Dictionary, out error)")] [return: NullAllowed] IMTLTexture FromName (string name, nfloat scaleFactor, [NullAllowed] NSBundle bundle, [NullAllowed] MTKTextureLoaderOptions options, out NSError error); + + [NoiOS] + [NoTV] + [Mac (10,12, onlyOn64 : true)] + [Export ("newTextureWithName:scaleFactor:displayGamut:bundle:options:error:")] + [return: NullAllowed] + IMTLTexture FromName (string name, nfloat scaleFactor, NSDisplayGamut displayGamut, [NullAllowed] NSBundle bundle, [NullAllowed] NSDictionary options, [NullAllowed] out NSError error); + + [NoiOS] + [NoTV] + [Mac (10,12, onlyOn64 : true)] + [Wrap ("FromName (name, scaleFactor, displayGamut, bundle, options == null ? null : options.Dictionary, out error)")] + [return: NullAllowed] + IMTLTexture FromName (string name, nfloat scaleFactor, NSDisplayGamut displayGamut, [NullAllowed] NSBundle bundle, [NullAllowed] MTKTextureLoaderOptions options, [NullAllowed] out NSError error); } [iOS (9,0)][Mac (10,11, onlyOn64 : true)] diff --git a/tests/xtro-sharpie/macOS-MetalKit.todo b/tests/xtro-sharpie/macOS-MetalKit.todo deleted file mode 100644 index d5a5f33984e1..000000000000 --- a/tests/xtro-sharpie/macOS-MetalKit.todo +++ /dev/null @@ -1,3 +0,0 @@ -!missing-selector! MTKTextureLoader::newTexturesWithNames:scaleFactor:displayGamut:bundle:options:completionHandler: not bound -!missing-selector! MTKTextureLoader::newTextureWithName:scaleFactor:displayGamut:bundle:options:completionHandler: not bound -!missing-selector! MTKTextureLoader::newTextureWithName:scaleFactor:displayGamut:bundle:options:error: not bound