简体   繁体   中英

Drawing Textures with OpenGL ES

I'm developing a 2D game for Android and i'm using the framework which has been told in the book which named Beginning Android Games by Mario Zechner.So my framework is well designed and using OpenGL 1.1.It's similar to libgdx.

When i put my textures adjacent each other in my 2d surface,there are some spaces size as 1 px.But this problem only occur on my tablet.There aren't a problem like this on my phone.It's like in this picture:

我的问题

What can be the problem?I can't fix it from one week.

UPDATE:

      batcher.beginBatch(Assets.ground);
      konum =(int) (dunya.myMan.position.x/500);
      for(int i=konum;i<8+konum;i++)
      batcher.drawSprite(500*i, 61, 500, 122, Assets.groundRegion);

      batcher.endBatch();

Likely you're translating your quads by non-integral values, which can cause textures to get sampled off-center, and can cause some artifacts like that.

If you make sure that all your 2d translations line up with screen pixels, I think you won't see the problem anymore.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM