Android opengles 2.0 :different resolutions rendering and input

Posted by kkan on Game Development See other posts from Game Development or by kkan
Published on 2012-03-18T05:09:42Z Indexed on 2012/03/18 18:24 UTC
Read the original article Hit count: 242

Filed under:
|

I'm currently developing a sprite based 2D game for android using opengles 2.0. I've got some basic rendering done that mimics the spritebatch functionality of xna (draw sprite, rotation, color). But all of this works for a fixed projection matrix, but android has a lot of screen sizes.

Q1)Would this be an okay method to scale up/down the drawing?

1)Draw the whole screen to a texture. 2)Draw the above texture as a quad to the device.

I found the above through some searching, not sure if it's the best one, are there any alternatives?

Q2)How do you handle inputs for different resolutions? I currently get the position of a touch and use it raw. Would it be okay to get the position, and then scale the position to size of the texture used for rendering, and the perform calculations on it?

Thanks.

© Game Development or respective owner

Related posts about android

Related posts about opengl-es2