Ejemplo n.º 1
0
 public virtual void setVertexBufferAt(int index, AsVertexBuffer3D buffer, int bufferOffset)
 {
     setVertexBufferAt(index, buffer, bufferOffset, "float4");
 }
Ejemplo n.º 2
0
 public virtual void setVertexBufferAt(int index, AsVertexBuffer3D buffer)
 {
     setVertexBufferAt(index, buffer, 0, "float4");
 }
Ejemplo n.º 3
0
 private void createBuffers()
 {
     int numVertices = mVertexData.getNumVertices();
     int numIndices = (int)(mIndexData.getLength());
     AsContext3D context = AsStarling.getContext();
     if(mVertexBuffer != null)
     {
         mVertexBuffer.dispose();
     }
     if(mIndexBuffer != null)
     {
         mIndexBuffer.dispose();
     }
     if(numVertices == 0)
     {
         return;
     }
     if(context == null)
     {
         throw new AsMissingContextError();
     }
     mVertexBuffer = context.createVertexBuffer(numVertices, AsVertexData.ELEMENTS_PER_VERTEX);
     mVertexBuffer.uploadFromVector(mVertexData.getRawData(), 0, numVertices);
     mIndexBuffer = context.createIndexBuffer(numIndices);
     mIndexBuffer.uploadFromVector(mIndexData, 0, numIndices);
     mSyncRequired = false;
 }
Ejemplo n.º 4
0
 public virtual void setVertexBufferAt(int index, AsVertexBuffer3D buffer, int bufferOffset, String format)
 {
     throw new AsNotImplementedError();
 }
 private void updateBuffers(AsContext3D context, AsRectangle bounds)
 {
     mVertexData.setPosition(0, bounds.x, bounds.y);
     mVertexData.setPosition(1, bounds.getRight(), bounds.y);
     mVertexData.setPosition(2, bounds.x, bounds.getBottom());
     mVertexData.setPosition(3, bounds.getRight(), bounds.getBottom());
     if(mVertexBuffer == null)
     {
         mVertexBuffer = context.createVertexBuffer(4, AsVertexData.ELEMENTS_PER_VERTEX);
         mIndexBuffer = context.createIndexBuffer(6);
         mIndexBuffer.uploadFromVector(mIndexData, 0, 6);
     }
     mVertexBuffer.uploadFromVector(mVertexData.getRawData(), 0, 4);
 }
 private void onContextCreated(Object _event)
 {
     mVertexBuffer = null;
     mIndexBuffer = null;
     mPassTextures = null;
     createPrograms();
 }
Ejemplo n.º 7
0
 public virtual void setVertexBufferAt(int index, AsVertexBuffer3D buffer)
 {
     setVertexBufferAt(index, buffer, 0, "float4");
 }
Ejemplo n.º 8
0
 public virtual void setVertexBufferAt(int index, AsVertexBuffer3D buffer, int bufferOffset)
 {
     setVertexBufferAt(index, buffer, bufferOffset, "float4");
 }
Ejemplo n.º 9
0
 public virtual void setVertexBufferAt(int index, AsVertexBuffer3D buffer, int bufferOffset, String format)
 {
     throw new AsNotImplementedError();
 }