I had this kind of problem and working arround loaded a texture without glktextureloader.
Here is some code to load the texture without GLKtextureLoader:
bool lPowerOfTwo = false; UIImage *image = [UIImage imageNamed:@"texture.png"]; GLuint width = CGImageGetWidth(image.CGImage); GLuint height = CGImageGetHeight(image.CGImage); CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); void *imageData = malloc( height * width * 4 ); CGContextRef context = CGBitmapContextCreate( imageData, width, height, 8, 4 * width, colorSpace, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big ); CGColorSpaceRelease( colorSpace ); CGContextClearRect( context, CGRectMake( 0, 0, width, height ) ); CGRect bounds=CGRectMake( 0, 0, width, height ); CGContextScaleCTM(context, 1, -1); bounds.size.height = bounds.size.height*-1; CGContextDrawImage(context, bounds, image.CGImage); GLuint lTextId; glGenTextures(1, &lTextId); glBindTexture(GL_TEXTURE_2D, lTextId); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, imageData); if(!lPowerOfTwo) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); glGenerateMipmap(GL_TEXTURE_2D); }else { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); } CGContextRelease(context); free(imageData);
The variable lTextId has an opengl texture identifier.
Note. If the texture size is not equal to two, the texture will be displayed in black if GL_TEXTURE_WRAP_S and _T are not set to GL_GLAMP_TO_EDGE