Examples of WebGLBuffer


Examples of com.google.gwt.webgl.client.WebGLBuffer

  @Override
  public void glDeleteBuffers (int n, IntBuffer buffers) {
    for (int i = 0; i < n; i++) {
      int id = buffers.get();
      WebGLBuffer buffer = this.buffers.get(id);
      deallocateBufferId(id);
      gl.deleteBuffer(buffer);
    }
  }
View Full Code Here

Examples of com.google.gwt.webgl.client.WebGLBuffer

  }

  @Override
  public void glGenBuffers (int n, IntBuffer buffers) {
    for (int i = 0; i < n; i++) {
      WebGLBuffer buffer = gl.createBuffer();
      int id = allocateBufferId(buffer);
      buffers.put(id);
    }
  }
View Full Code Here

Examples of com.google.gwt.webgl.client.WebGLBuffer

  @Override
  public void glDeleteBuffers (int n, IntBuffer buffers) {
    for (int i = 0; i < n; i++) {
      int id = buffers.get();
      WebGLBuffer buffer = this.buffers.get(id);
      deallocateBufferId(id);
      gl.deleteBuffer(buffer);
    }
  }
View Full Code Here

Examples of com.google.gwt.webgl.client.WebGLBuffer

  }

  @Override
  public void glGenBuffers (int n, IntBuffer buffers) {
    for (int i = 0; i < n; i++) {
      WebGLBuffer buffer = gl.createBuffer();
      int id = allocateBufferId(buffer);
      buffers.put(id);
    }
  }
View Full Code Here

Examples of com.googlecode.gwtgl.binding.WebGLBuffer

   * Is buffer bound?
   * @return true if buffer is bound, false otherwise
   */
  // TODO check if this works and make the method public
  private boolean isBound() {
    WebGLBuffer buffer = glContext.getParameter(target.getBinding());
    if (buffer == nativeBufferObject || nativeBufferObject.equals(buffer)) {
      return true;
    }
    return false;
  }
View Full Code Here

Examples of com.googlecode.gwtgl.binding.WebGLBuffer

    vertices[4] = xMin;
    vertices[5] = yMax;
    vertices[6] = xMax;
    vertices[7] = yMax;

    WebGLBuffer buffer = mGlContext.createBuffer();
    mGlContext.bindBuffer(WebGLRenderingContext.ARRAY_BUFFER, buffer);
    mGlContext.bufferData(WebGLRenderingContext.ARRAY_BUFFER, Float32Array.create(vertices), WebGLRenderingContext.STREAM_DRAW);

    mGlContext.vertexAttribPointer(mCurrentShader.getAPosition(), 2, WebGLRenderingContext.FLOAT, false, 0, 0);
    mGlContext.drawArrays(WebGLRenderingContext.TRIANGLE_STRIP, 0, 4);
View Full Code Here

Examples of com.googlecode.gwtgl.binding.WebGLBuffer

    vertices[4] = dstRect.x;
    vertices[5] = (dstRect.y + dstRect.height);
    vertices[6] = (dstRect.x + dstRect.width);
    vertices[7] = (dstRect.y + dstRect.height);
   
    WebGLBuffer buffer = mGlContext.createBuffer();
    mGlContext.bindBuffer(WebGLRenderingContext.ARRAY_BUFFER, buffer);
    mGlContext.bufferData(WebGLRenderingContext.ARRAY_BUFFER, Float32Array.create(vertices), WebGLRenderingContext.STREAM_DRAW);
    mGlContext.vertexAttribPointer(mCurrentShader.getAPosition(), 2, WebGLRenderingContext.FLOAT, false, 0, 0);
   
    float texCoords[] = new float[8];
View Full Code Here

Examples of com.googlecode.gwtgl.binding.WebGLBuffer

     
      enableTexCoords(true);
     
      mGlContext.uniform1f(mCurrentShader.getUTextureSize(), mTextureBatchTextureSize);
     
      WebGLBuffer buffer = mGlContext.createBuffer();
      mGlContext.bindBuffer(WebGLRenderingContext.ARRAY_BUFFER, buffer);
      mGlContext.bufferData(WebGLRenderingContext.ARRAY_BUFFER, Int16Array.create(mTextureBatchData), WebGLRenderingContext.STREAM_DRAW);
      mGlContext.vertexAttribPointer(mCurrentShader.getAPosition(), 2, WebGLRenderingContext.SHORT, false, 8, 0);
      mGlContext.vertexAttribPointer(mCurrentShader.getATexCoord(), 2, WebGLRenderingContext.SHORT, false, 8, 4);
 
View Full Code Here

Examples of com.googlecode.gwtgl.binding.WebGLBuffer

    enableTexCoords(true);
   
    int[] mapData = new int[mSpriteBatchDrawCount * 8];
    System.arraycopy(mSpriteBatchData, 0, mapData, 0, mapData.length);
   
    WebGLBuffer buffer = mGlContext.createBuffer();
    mGlContext.bindBuffer(WebGLRenderingContext.ARRAY_BUFFER, buffer);
    mGlContext.bufferData(WebGLRenderingContext.ARRAY_BUFFER, Int16Array.create(mapData), WebGLRenderingContext.STREAM_DRAW);
    mGlContext.vertexAttribPointer(mCurrentShader.getAPosition(), 2, WebGLRenderingContext.SHORT, false, 8, 0);
    mGlContext.vertexAttribPointer(mCurrentShader.getATexCoord(), 2, WebGLRenderingContext.SHORT, false, 8, 4);

View Full Code Here

Examples of com.googlecode.gwtgl.binding.WebGLBuffer

   
    vertices[2] = (float)x2 + 0.5f;
    vertices[3] = (float)y2 + 0.5f;
   

    WebGLBuffer buffer = mGlContext.createBuffer();
    mGlContext.bindBuffer(WebGLRenderingContext.ARRAY_BUFFER, buffer);
    mGlContext.bufferData(WebGLRenderingContext.ARRAY_BUFFER, Float32Array.create(vertices), WebGLRenderingContext.STREAM_DRAW);

    mGlContext.vertexAttribPointer(mCurrentShader.getAPosition(), 2, WebGLRenderingContext.FLOAT, false, 0, 0);
    mGlContext.drawArrays(WebGLRenderingContext.LINE_STRIP, 0, 2);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.