Virtual screen size with libgdx and GLES 2

Posted by David Saltares Márquez on Game Development See other posts from Game Development or by David Saltares Márquez
Published on 2012-04-15T00:44:48Z Indexed on 2012/04/15 5:44 UTC
Read the original article Hit count: 296

Filed under:
|
|
|

I've been trying to use a virtual screen size for my libgdx desktop-android game. I'd like to always use a 16:9 aspect ratio but with a virtual screen size so everything would adapt automatically depending on the device size.

This post illustrates the process pretty well but my game crashes when camera.apply(Gdx.Gl10) is called. This is because I'm using GLES 2.0 (for not having to use multiple of 2 texture sizes). As stated in the OrthographicCamera doc, the apply method only works with GLES 1 and GLES 1.1.

Is there another way of applying my GL transformation to the camera so I can use a virtual screen resolution? Having to resize everything manually it's a total pain.

Thanks a lot.

© Game Development or respective owner

Related posts about java

Related posts about android