I get strange behaviour when I use the following code to load an image multiple times:
NSDictionary *options = @{GLKTextureLoaderOriginBottomLeft: @YES};
textureInfo = [GLKTextureLoader textureWithCGImage:[UIImage imageNamed:@"name"].CGImage
options:options
error:nil];
It works as expected when I run load the image the first time, but when I try to load the same image again it's drawn upside down.
I think this has to do with the fact that it's actually the same CGImage that gets passed to the texture loader because of the use of imageNamed:. The flip transformation is therefore applied a second time on the same image.
Is there a way to get around this issue?