I have a home project where I'm using PRFilledPolygon. This class represents a b2body with a texture inside.
This used to work fine with iPhone 4, 4s, 5, but suddenly the texture stopped showing in iPhone 5s, 6, and 6 plus (while the b2body exists).
The Draw method looks like the following:
ccGLBindTexture2D( [self.texture name] );
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position | kCCVertexAttribFlag_TexCoords );
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, sizeof(CGPoint), areaTrianglePoints);
glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, sizeof(CGPoint), textureCoordinates);
glDrawArrays(GL_TRIANGLES, 0, areaTrianglePointCount); }
where prog is defined as
prog = [[CCShaderCache sharedShaderCache] programForKey:kCCShader_PositionTexture];
What changed in iPhone 5s and above that would make the texture disappear?
How can i change the draw method to accommodate for this change?
One thing to note while i was experimenting: I was able to make the texture disappear in iPhone 4, 4s, and 5 when I removed the following line:
glDrawArrays(GL_TRIANGLES, 0, areaTrianglePointCount);
So Obviously something needs to be changed in that line.
Your help is highly appreciated.