У меня проблема с загрузкой текстур с помощью метода загрузки текстур.
+(Texture*) loadTexture: (NSString*) name path: (NSString*) path{
CGImageRef imageReference = [[UIImage imageNamed:path] CGImage];
GLKTextureInfo* textureInfo = [GLKTextureLoader textureWithCGImage:imageReference options:nil error:NULL];
Texture* texture = [[Texture alloc] init:textureInfo];
NSLog(@"width: %i height: %i data: %p", [texture Width], [texture Height], [texture getTextureInfo]);
if(!Textures) Textures = [[NSMutableDictionary alloc] init];
[Textures setObject:texture forKey:name];
NSLog(@"adding key %@ to dictionary with pointer %p", name, Textures);
NSLog( @"%@", Textures );
return texture;
}
В первый раз, когда я вызываю метод загрузки текстуры, все хорошо, но любые последующие вызовы для загрузки текстуры, textureInfo не инициализируется, и NSLog показывает «width: 0 height: 0 data: 0x0»