Tag: metal

将uintptr_t转换为id

我想创建简单的iOS插件,可以将纹理绘制到统一的Texture2D。 我已经通过CreateExternalTexture()和UpdateExternalTexture()完成了它,它工作正常,但我很好奇我是否可以直接从iOS端填充Unity纹理。 这是我的iOS插件代码: // // testTexturePlugin.m // Unity-iPhone // // Created by user on 18/01/16. // // #import #import #import #include “UnityMetalSupport.h” #include #include static UIImage* LoadImage() { NSString* imageName = @”logo”; //[NSString stringWithUTF8String: filename]; NSString* imagePath = [[NSBundle mainBundle] pathForResource: imageName ofType: @”png”]; return [UIImage imageWithContentsOfFile: imagePath]; } // you need to free this […]