Using libgdx for multiple platforms?

As per the Javadocs, that method of OrthographicCamera is only applicable in a GLES 1.x environment. With GLES 2.0 you’d submit the camera matrices to your shader.

To ensure your app works across all platforms, try to stick to what libgdx provides. This includes things like file i/o (use Gdx.app.files), networking (Gdx.app.net) and so on. The reason is that Android, HTML5 and iOS do not support all classes in the JRE. That’s why we provide replacements which are sometimes even a bit better than their JRE equivalents in terms of say memory consumption and GC friendliness.

In terms of OpenGL ES, you can chose between 1.x (fixed function) or 2.0 (shaders). The higher level classes like SpriteBatch, BitmapFont and so on are all agnostic about which version you use. If you only issue OpenGL ES commands via the GLCommon interface (Gdx.gl) and leave the rest to the higher level classes, you will not run into any issues. If you want more control, you’ll have to special case your rendering depending on what’s available on the system. The gdx-invaders example in the repo demonstrates this. It has one renderer for OpenGL ES 1.x and another one for 2.0. Again, this is only necessary if you want to get your hands dirty with low-level OpenGL ES yourself.

TL;DR: use what libgdx provides, stay away from JRE classes if you target HTML5.

The only JRE class that I use is only Math, just to abs and round >.>

Also if you go with Libgdx and want to convert to html5, there are certain things you can’t do in html5
This is as of no fault of libgdx, but of the google GWT, you can’t use certain things for GWT. The most specific example is Reflection. Although its usually half decent to rewrite code to not use it.

Uh oh… okey… I was using [icode]Box2DDebugRenderer[/icode], so giving [icode]cam.combined[/icode] to [icode]renderer.render(world, cam.combined);[/icode] was enough.

Thanks :slight_smile:

more off-topic stuff: Having guys hanging out at #libgdx irc would be pretty cool, since I often have quick questions, but can’t get an answer anywhere… And using a forum topic is sometimes too much. (And sometimes I want a really quick answer, instant message is often pretty good).

Sorry for posting so much off-topic…

Try #libgdx on FreeNode. Usually some ~60 people in there.

Wth… I think I have a serious brain damage :smiley: