Skip to content

Commit

Permalink
Optimizations for GL30
Browse files Browse the repository at this point in the history
(cherry picked from commit e312cc9)
  • Loading branch information
Anuken authored and buthed010203 committed Mar 29, 2024
1 parent 1e7a155 commit b011409
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arc-core/src/arc/graphics/g2d/SpriteBatch.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ public SpriteBatch(int size, Shader defaultShader){
}else{
shader = defaultShader;
}

//mark indices as dirty once for GL30
mesh.getIndicesBuffer();
}else{
vertices = new float[0];
shader = null;
Expand Down Expand Up @@ -126,8 +129,6 @@ protected void flush(){
// }
Mesh mesh = this.mesh;
mesh.setVertices(vertices, 0, idx);
mesh.getIndicesBuffer().position(0);
mesh.getIndicesBuffer().limit(count);
mesh.render(getShader(), Gl.triangles, 0, count);

idx = 0;
Expand Down

0 comments on commit b011409

Please sign in to comment.