title: Healthy way of drawing grid lines in LibGdx
body: <p>So, I wanted to draw a grid in my game and as I was writing it out, it seemed incredibly unusual (at least to me) in terms of efficiency.  I've got two for loops inside a render method which is used to render the game, so it is called very often and fast.</p>
  
  <p>Is this ShapeRenderer portion a red flag?</p>
  
  <pre><code>public void render(float deltaTime) {
      Gdx.gl.glClearColor(Color.GRAY.r, Color.GRAY.g, Color.GRAY.b, 1);
      Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);       
  
      batch.begin();
      this.world.getPlayer().render(deltaTime, batch);
      batch.end();
  
      // Gridlines
      shape.begin(ShapeType.Line);
      shape.setColor(Color.BLACK);
      for (int i = 0; i &lt; Gdx.graphics.getHeight() / 32; i++) {
          shape.line(0, i * 32, Gdx.graphics.getWidth(), i * 32);
      }
      for (int i = 0; i &lt; Gdx.graphics.getWidth() / 32; i++) {
          shape.line(i * 32, 0, i * 32, Gdx.graphics.getHeight());
      }
      shape.end();
  }
  </code></pre>