Skip to content

Commit

Permalink
[metalkit] Add 'MTKTextureLoader' missing bindings (fix xtro) (#3561)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentDondain committed Feb 21, 2018
1 parent 3f16223 commit afd33cb
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 3 deletions.
51 changes: 51 additions & 0 deletions src/metalkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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]
Expand All @@ -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]
Expand Down Expand Up @@ -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)]
Expand Down
3 changes: 0 additions & 3 deletions tests/xtro-sharpie/macOS-MetalKit.todo

This file was deleted.

0 comments on commit afd33cb

Please sign in to comment.