Пример #1
0
 public void prepareAll() {
   if (vertexVBO != null) {
     vertexVBO.prepare();
   }
   if (colourVBO != null) {
     colourVBO.prepare();
   }
   if (textureVBO != null) {
     textureVBO.prepare();
   }
 }
Пример #2
0
 private int getNumElements() {
   if (vertexVBO != null) {
     return vertexVBO.getNumElements();
   }
   if (colourVBO != null) {
     return colourVBO.getNumElements();
   }
   if (textureVBO != null) {
     return textureVBO.getNumElements();
   }
   return 0; // We have no VBOs to ask.
 }
Пример #3
0
  private void updateData() {
    // top left
    vertices[0].setXY(position.x - dimension.x, position.y + dimension.y);
    // bottom left
    vertices[1].setXY(position.x - dimension.x, position.y - dimension.y);
    // bottom right
    vertices[2].setXY(position.x + dimension.x, position.y - dimension.y);
    // top right
    vertices[3].setXY(position.x + dimension.x, position.y + dimension.y);

    vbo.setVertices(vertices);
  }
Пример #4
0
 public void destroy() {
   vbo.destroy();
 }