コード例 #1
0
 private static VertexBufferPCT c(VertexBufferPCT paramVertexBufferPCT, int paramInt) {
   if (paramVertexBufferPCT == null) {
     return VertexBufferPCT.gNI.zN(paramInt);
   }
   if (paramVertexBufferPCT.bSW() < paramInt) {
     paramVertexBufferPCT.axl();
     return VertexBufferPCT.gNI.zN(paramInt);
   }
   return paramVertexBufferPCT;
 }
コード例 #2
0
 private static VertexBufferPCT recreate(final VertexBufferPCT vb, final int newLength) {
   if (vb == null) {
     return VertexBufferPCT.Factory.newPooledInstance(newLength);
   }
   if (vb.getMaxVertices() < newLength) {
     vb.removeReference();
     return VertexBufferPCT.Factory.newPooledInstance(newLength);
   }
   return vb;
 }
コード例 #3
0
 private void addGeometry(final TextData data) {
   final GeometryMesh geom =
       ((MemoryObject.ObjectFactory<GeometryMesh>) GLGeometryMesh.Factory).newPooledInstance();
   final int numVertices = 16;
   final VertexBufferPCT vertexBuffer = VertexBufferPCT.Factory.newPooledInstance(16);
   final IndexBuffer indexBuffer = IndexBuffer.INDICES;
   vertexBuffer.setNumVertices(16);
   for (int i = 0, size = vertexBuffer.getNumVertices(); i < size; ++i) {
     vertexBuffer.setVertexColor(i, 1.0f, 1.0f, 1.0f, 1.0f);
   }
   geom.create(GeometryMesh.MeshType.Line, vertexBuffer, indexBuffer);
   this.m_entity3D.addGeometry(geom);
   geom.removeReference();
   vertexBuffer.removeReference();
 }
コード例 #4
0
 private void setTextGeometryPosition(final VertexBufferPCT vertexBuffer, final TextData data) {
   final float[] positionBuffer = {
     data.getX(),
     data.getY(),
     data.getX() + data.getWidth(),
     data.getY(),
     data.getX() + data.getWidth(),
     data.getY(),
     data.getX() + data.getWidth(),
     data.getY() + data.getHeight(),
     data.getX() + data.getWidth(),
     data.getY() + data.getHeight(),
     data.getX(),
     data.getY() + data.getHeight(),
     data.getX(),
     data.getY() + data.getHeight(),
     data.getX(),
     data.getY()
   };
   vertexBuffer.setPositionBuffer(positionBuffer);
 }