title: LibGDX - Application crashes when call TiledMapRenderer.render()
body: <pre><code>@Override
  public void render(float delta) {
      Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
  
      camera.update();
      sprite.setProjectionMatrix(camera.combined);
  
      mLevel.getTiledMapRenderer().getProjectionMatrix().set(camera.combined);
      Vector3 tmp = new Vector3();
      tmp.set(0, 0, 0);
      camera.unproject(tmp);
      mLevel.getTiledMapRenderer().render(tmp.x, tmp.y, camera.viewportWidth, camera.viewportHeight);
  
      sprite.begin();
      ...
      sprite.end();
  }
  </code></pre>
  
  <p>Here is what I get when launching the desktop version :</p>
  
  <pre><code>Exception in thread "LWJGL Application" java.lang.IllegalArgumentException: Number of remaining buffer elements is 0, must be at least 1. Because at most 1 elements can be returned, a buffer with at least 1 elements is required, regardless of actual returned element count
      at org.lwjgl.BufferChecks.throwBufferSizeException(BufferChecks.java:162)
      at org.lwjgl.BufferChecks.checkBufferSize(BufferChecks.java:189)
      at org.lwjgl.BufferChecks.checkBuffer(BufferChecks.java:230)
      at org.lwjgl.opengl.GL15.glBufferData(GL15.java:141)
      at com.badlogic.gdx.backends.lwjgl.LwjglGL20.glBufferData(LwjglGL20.java:93)
      at com.badlogic.gdx.graphics.glutils.VertexBufferObject.bind(VertexBufferObject.java:208)
      at com.badlogic.gdx.graphics.Mesh.bind(Mesh.java:268)
      at com.badlogic.gdx.graphics.g2d.SpriteCache.begin(SpriteCache.java:868)
      at com.badlogic.gdx.graphics.g2d.tiled.TileMapRenderer.render(TileMapRenderer.java:336)
      at com.badlogic.gdx.graphics.g2d.tiled.TileMapRenderer.render(TileMapRenderer.java:286)
      at com.crunsh.libgdx.screens.GameScreen.render(GameScreen.java:102)
      at com.badlogic.gdx.Game.render(Game.java:46)
      at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:202)
      at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:131)
  </code></pre>
  
  <p>I've tried both <a href="http://code.google.com/p/libgdx-users/wiki/Tiles#Render" rel="noreferrer">this tuto</a> and <a href="http://dpk.net/2011/05/01/libgdx-box2d-tiled-maps-full-working-example-part-1/#p5" rel="noreferrer">this one</a>, and I get the same error at the same line <code>mLevel.getTiledMapRenderer().render(tmp.x, tmp.y, camera.viewportWidth, camera.viewportHeight);</code>.</p>
  
  <p><strong>EDIT :</strong> I just noticed that the data of my .tmx file was automatically encoded by Tiled Map Editor, so I just desactivated it, but still get the same error.<br />
  If I copy/paste <a href="http://dpk.net/2011/05/01/libgdx-box2d-tiled-maps-full-working-example-part-1/#p5" rel="noreferrer">this project</a> (I mean the whole project, not only the render() method) it works but when I try to load my own map in my own project it just crashes ...<br /></p>
  
  <p>So after that I decided to simplify my <code>render()</code> method by just doing like the link I gave before and by using the <code>TiledMapHelper class</code> the author provide, so there is my <code>render()</code> method now:</p>
  
  <pre><code>mHelper.getCamera().update();
  mHelper.render();
  </code></pre>
  
  <p>Still crashiiiiiiiiiiiiiingg.....<br />
  If someone can please provide some help it would be greatly appreciated because atm i'm really going mad !</p>