I'm making an iPhone application with OpenGL ES 2.0 using the GLKit. I'm using GLKTextureLoader to load textures. When my texture sits inside a mainBundle - EVERYTHING IS FINE. I get its name with command [[NSBundle mainBundle] pathForResource:@"brushRose.png" ofType:nil] and the texture has a following path:
/var/mobile/Containers/Bundle/Application/D79492CB-D03C-464D-B06E-00D0DE4389DF/Texture Test.app/brushRose.png
When I try to download an absolutely same texture from Internet and store it inside Application's Documents folder. Path is like follow:
/var/mobile/Containers/Data/Application/CD3FBAAB-B8AE-47F5-9C6E-51C854FC1620/Documents/brushes/ps_roses.png
I get a TERRIBLE END RESULT which can be observed on the picture below: First row - texture from mainBundle, second row - from Documents
Any ideas how to fix the second case are welcome.
Test project can be found here