title: Libgdx Mesh rendering along with stage
body: <p>i am trying to render a textured mesh along with stage in Libgdx. I have problem rendering texture when i put the <code>stage.draw</code> on top of <code>mesh.render()</code>.</p>
  
  <p><strong>Case 1:</strong></p>
  
  <pre><code>public void render(float delta) {
      Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
      Gdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
      Gdx.gl.glEnable(GL10.GL_TEXTURE_2D);
  
      stage.act(delta);
      stage.draw();
      texture.bind();
      mesh.render(GL10.GL_TRIANGLES, 0, 3);
  
  }
  
  // -- This is in my create method:
          mesh = new Mesh(true, 3, 3, 
                  new VertexAttribute(Usage.Position, 3, "a_position"),
                  new VertexAttribute(Usage.ColorPacked, 4, "a_color"),
                  new VertexAttribute(Usage.TextureCoordinates, 2, "a_texCoords"));
  
          mesh.setVertices(new float[] { 50, 50, 0,Color.toFloatBits(255, 0, 0, 255),0,1,
                                          50, 500, 0,Color.toFloatBits(0, 255, 0, 255),0,0,
                                          500, 50, 0, Color.toFloatBits(0, 0, 255, 255),1,1                                                   });
  
          mesh.setIndices(new short[] { 0, 1, 2 });
  </code></pre>
  
  <p>In the above case I am not able to render texture but able to render gradient triangle.</p>
  
  <p><strong>Case 2:</strong> </p>
  
  <pre><code>public void render(float delta) {
      Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
      Gdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
      Gdx.gl.glEnable(GL10.GL_TEXTURE_2D);
  
      texture.bind();
      mesh.render(GL10.GL_TRIANGLES, 0, 3);
      stage.act(delta);
      stage.draw();
  }
  </code></pre>
  
  <p>In this case i am able to render texture properly on the triangle.</p>
  
  <p><strong>My Questions:</strong> </p>
  
  <ol>
  <li>Why does the order of <code>stage.draw()</code> and <code>mesh.render()</code> affect the texture although I can draw the triangle.</li>
  <li>How do I draw the mesh with a texture in an actor's <code>draw</code> method?</li>
  </ol>