Просмотр исходного кода

Canvas2D: removing direct calls to _gl

nockawa 9 лет назад
Родитель
Сommit
8328a70026
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      src/Canvas2d/babylon.group2d.ts

+ 4 - 4
src/Canvas2d/babylon.group2d.ts

@@ -558,16 +558,16 @@
                         if (pid._partBuffer) {
                             engine.deleteInstancesBuffer(pid._partBuffer);
                         }
-                        pid._partBuffer = engine.createInstancesBuffer(neededSize);
+                        pid._partBuffer = engine.createInstancesBuffer(neededSize); // Create + bind
                         pid._partBufferSize = neededSize;
                         setDirty(false);
 
                         // Update the WebGL buffer to match the new content of the instances data
-                        engine._gl.bufferSubData(engine._gl.ARRAY_BUFFER, 0, instanceData);
+                        engine.updateArrayBuffer(instanceData);
                     } else if (getDirty()) {
                         // Update the WebGL buffer to match the new content of the instances data
-                        engine._gl.bindBuffer(engine._gl.ARRAY_BUFFER, pid._partBuffer);
-                        engine._gl.bufferSubData(engine._gl.ARRAY_BUFFER, 0, instanceData);
+                        engine.bindArrayBuffer(pid._partBuffer);
+                        engine.updateArrayBuffer(instanceData);
 
                     }
                 }