Ios GLKTextureLoader不加载任何内容,没有错误
此代码记录UIImage具有宽度,但加载的纹理具有0宽度:Ios GLKTextureLoader不加载任何内容,没有错误,ios,objective-c,opengl-es-2.0,glkit,Ios,Objective C,Opengl Es 2.0,Glkit,此代码记录UIImage具有宽度,但加载的纹理具有0宽度: NSDictionary * options = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES], GLKTextureLoaderOriginBottomLeft,
NSDictionary * options = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES],
GLKTextureLoaderOriginBottomLeft,
nil];
NSError * error;
UIImage * iu = [UIImage imageNamed:fileName];
CGImageRef cg=iu.CGImage;
NSLog(@"image size width: %f", iu.size.width);
self.textureInfo= [GLKTextureLoader textureWithCGImage:cg options:options error:&error];
if (self.textureInfo == nil) {
NSLog(@"Error loading file: %@", [error localizedDescription]);
return nil;
}
NSLog(@"texture width: %f", self.textureInfo.width);
如果最后一行日志显示
0
我做错了什么?没有记录错误。问题在于记录,而不是纹理加载。它是一个int
:
NSLog(@“纹理宽度:%i”,self.textureInfo.width)代码>问题在于日志记录,而不是纹理加载。它是一个int
:
NSLog(@“纹理宽度:%i”,self.textureInfo.width)代码>