示例#1
0
        public static Texture2D FromFile(GraphicsDevice graphicsDevice, Stream textureStream)
        {
            MonoMac.Foundation.NSData nsData = MonoMac.Foundation.NSData.FromStream(textureStream);

            NSImage image = new NSImage(nsData);

            if (image == null)
            {
                throw new ContentLoadException("Error loading Texture2D Stream");
            }

            ESImage   theTexture = new ESImage(image, graphicsDevice.PreferedFilter);
            Texture2D result     = new Texture2D(theTexture);

            return(result);
        }
示例#2
0
 public bool CreateFile(string path, NSData data, NSFileAttributes attributes)
 {
     return(CreateFile(path, data, attributes.ToDictionary()));
 }
示例#3
0
 public void DataLoaded(NSUrlProtocol protocol, NSData data)
 {
     Messaging.void_objc_msgSend_IntPtr_IntPtr(this.Handle, Selector.GetHandle(selUrlProtocolDidLoadData_), protocol.Handle, data.Handle);
 }
示例#4
0
 protected override void Dispose(bool disposing)
 {
     source = null;
     base.Dispose(disposing);
 }
示例#5
0
 public UnmanagedMemoryStreamWithMutableRef(NSData source) : base(source)
 {
     base_address = source.Bytes;
     this.source  = source;
 }
示例#6
0
 public UnmanagedMemoryStreamWithRef(NSData source) : base((byte *)source.Bytes, source.Length)
 {
     this.source = source;
 }
示例#7
0
 public UnmanagedMemoryStreamWithRef(NSData source, byte *pointer, long length) : base(pointer, length)
 {
     this.source = source;
 }
 public void SetData(string key, NSData value)
 {
     _SetData(value, key);
 }