hugo
hugo

Reputation: 13

Iphone programming : vertical black lines problem

when i load my game on simulator its fine, but when i load the game on my iPhone, there is vertical black lines which appears when i move the tileMap.

Someone have an idea? Texture? or Graphic? openGl?

Upvotes: 0

Views: 302

Answers (3)

Lockyer
Lockyer

Reputation: 1401

I had a similar problem using Open GL on the iPhone. The solution which worked for me was changing the call to the below function:

void glTexImage2D(  
    GLenum          target,
    GLint           level,
    GLint           internalFormat,
    GLsizei         width,
    GLsizei         height,
    GLint           border,
    GLenum          format,
    GLenum          type,
    const GLvoid *  data
);

I changed it to use GL_RGBA instead of GL_RGB for the format and internalFormat arguments. When I saved the file from photoshop I thought I specified not to include an alpha channel, so I'm not entirely certain why this worked, but you may have a similar problem.

Upvotes: 0

Bill Yan
Bill Yan

Reputation: 3468

I had a similar problem on Android before,

seems to be caused by rounding errors and float point precision .

Upvotes: 0

msgambel
msgambel

Reputation: 7340

I had a similar problem actually with a few of my sprite images. It turned out that I was packing my sprite sheets too close together, with not enough transparency around each sprite, and I was picking up parts of other images when I rendered them. Adding more space around each image fixed the problem. Hope that Helps!

Upvotes: 1

Related Questions