Пример #1
0
  private void begin(Writer writer, IndWriter indexer, int mode, int blockSize) {
    mDraw.checkErr();

    mActiveWriter = writer;
    mActiveIndexer = indexer;
    mActiveMode = mode;
    mVertBuf.clear();

    int bytes = mVertBuf.capacity();
    int vertBytes = writer.mVertWriter.bytesPerElem();
    mActiveCap = (bytes / (vertBytes * blockSize)) * blockSize;
    mActivePos = 0;

    writer.mProgram.bind(mDraw);
    writer.mVao.bind(mDraw);
    mVbo.bind(mDraw);

    if (indexer != null) {
      indexer.reset();
      mIndBuf.clear();
      mIbo.bind(mDraw);
    }

    DrawUtil.checkErr();
  }
Пример #2
0
  public void init(DrawEnv d) {
    mDraw = d;

    if (mVbo.id() != 0) {
      return;
    }

    mVbo.alloc(mVertBuf.capacity());
    mVbo.init(d);
    mIbo.alloc(mIndBuf.capacity());
    mIbo.init(d);
    d.checkErr();
  }