OSDN Git Service

forceVBO in Mesh
authorfrustaci <frustaci@gmail.com>
Mon, 15 Apr 2013 03:22:17 +0000 (00:22 -0300)
committerfrustaci <frustaci@gmail.com>
Mon, 15 Apr 2013 03:22:17 +0000 (00:22 -0300)
At least one recent commit https://github.com/libgdx/libgdx/commit/7020231ca8b1e14995d398603de525581e3d1282 has completely disabled VBO support in the SpriteBatch class for not so clear reasons.
My project uses GL20 for now only and I would like to use/test VBOs, so at least there's a way to bring back VBOs in spritebatch by using the forceVBO flag.
If someone could clarify why SpriteBatch was changed I would appreciate as well.

gdx/src/com/badlogic/gdx/graphics/Mesh.java

index ab6083d..74ecf30 100644 (file)
@@ -176,7 +176,7 @@ public class Mesh implements Disposable {
        public Mesh (VertexDataType type, boolean isStatic, int maxVertices, int maxIndices, VertexAttribute... attributes) {\r
 // if (type == VertexDataType.VertexArray && Gdx.graphics.isGL20Available()) type = VertexDataType.VertexBufferObject;\r
 \r
-               if (type == VertexDataType.VertexBufferObject) {\r
+               if (type == VertexDataType.VertexBufferObject || Mesh.forceVBO) {\r
                        vertices = new VertexBufferObject(isStatic, maxVertices, attributes);\r
                        indices = new IndexBufferObject(isStatic, maxIndices);\r
                        isVertexArray = false;\r