/** * @param index * @see com.jogamp.opengl.GL2ES2#glEnableVertexAttribArray(int) */ public void glEnableVertexAttribArray(int index) { try{delegate.glEnableVertexAttribArray(index);} catch(GLException e){glException(e); throw e;} } /**
@Override public void glEnableVertexAttribArray(int index) { GLContext.getCurrentGL().getGL3().glEnableVertexAttribArray(index); }
@Override public void createVertexAttribute(int glVertexArray, int target, int glBufferView, int attributeLocation, int size, int type, int stride, int offset) { gl.glBindVertexArray(glVertexArray); gl.glBindBuffer(target, glBufferView); gl.glVertexAttribPointer( attributeLocation, size, type, false, stride, offset); gl.glEnableVertexAttribArray(attributeLocation); }
@Override public Void call() throws Exception { final GL3 gl = gpu.getGl(); gl.glGenBuffers(1, ib); ib.clear(); dummyBufferID = ib.get(); gl.glBindBuffer(GL3.GL_ARRAY_BUFFER, dummyBufferID); gl.glBufferData(GL3.GL_ARRAY_BUFFER, 1, null, GL3.GL_STATIC_DRAW); gl.glEnableVertexAttribArray(0); gl.glVertexAttribPointer(0, 1, GL3.GL_BYTE, false, 0, 0); gl.glBindBuffer(GL3.GL_ARRAY_BUFFER, 0); return null; } });//end task0
gl.glEnableVertexAttribArray(vertexPosition); gl.glEnableVertexAttribArray(vertexColor); gl.glEnableVertexAttribArray(vertexColor);
vertices, GL.GL_STATIC_DRAW); mGL.getGL3().glEnableVertexAttribArray(0); mGL.getGL3() .glVertexAttribPointer(0, 3, GL.GL_FLOAT, false, 0, 0); normals, GL.GL_STATIC_DRAW); mGL.getGL3().glEnableVertexAttribArray(1); mGL.getGL3() .glVertexAttribPointer(1, 3, GL.GL_FLOAT, false, 0, 0); texCoords, GL.GL_STATIC_DRAW); mGL.getGL3().glEnableVertexAttribArray(2); mGL.getGL3() .glVertexAttribPointer(2, 2, GL.GL_FLOAT, false, 0, 0);
public void updateNormals(FloatBuffer pNormalBuffer) { if (!isDynamic()) throw new UnsupportedOperationException("Cannot update non dynamic buffers!"); getGL().getGL3().glBindVertexArray(mVertexArrayObject[0]); getGL().glBindBuffer(GL.GL_ARRAY_BUFFER, mVertexBuffers[1]); getGL().getGL3().glEnableVertexAttribArray(1); getGL().glBufferSubData(GL.GL_ARRAY_BUFFER, 0, pNormalBuffer.limit() * (Float.SIZE / Byte.SIZE), pNormalBuffer); getGL().getGL3().glVertexAttribPointer(1, mGeometrySize, GL.GL_FLOAT, false, 0, 0); getGL().getGL3().glBindVertexArray(0); getGL().glBindBuffer(GL.GL_ARRAY_BUFFER, 0); }
mVertexBuffers[mVertexBuffers.length - 1]); getGL().getGL3().glEnableVertexAttribArray(0); getGL().glBufferData(GL.GL_ARRAY_BUFFER, pBuffer.limit() * (Float.SIZE / Byte.SIZE),
assert position_attrib != -1; g.glEnableVertexAttribArray(position_attrib); g.glVertexAttribPointer( position_attrib, assert color_attrib != -1; g.glEnableVertexAttribArray(color_attrib); g.glVertexAttribPointer( color_attrib,
assert position_attrib != -1; g.glEnableVertexAttribArray(position_attrib); g.glVertexAttribPointer( position_attrib, assert color_attrib != -1; g.glEnableVertexAttribArray(color_attrib); g.glVertexAttribPointer( color_attrib,
public void addVertexAttributeArray(final GLVertexAttributeArray pGLVertexAttributeArray, final FloatBuffer pFloatBuffer) { bind(); final GLAttribute lAttribute = pGLVertexAttributeArray.getAttribute(); pGLVertexAttributeArray.bind(); final int lElementsPerIndex = pGLVertexAttributeArray.getElementsPerIndex(); mNumberOfIndices = pFloatBuffer.remaining() / lElementsPerIndex; getGL().glBufferData(GL.GL_ARRAY_BUFFER, pFloatBuffer.remaining() * (Float.SIZE / 8), pFloatBuffer, GL.GL_STATIC_DRAW); getGL().getGL3().glEnableVertexAttribArray(lAttribute.getIndex()); getGL().getGL3().glVertexAttribPointer(lAttribute.getIndex(), lElementsPerIndex, GL.GL_FLOAT, false, 0, 0); }
public void updateVertices(FloatBuffer pVertexBuffer) { mStoredPrimitiveCount = pVertexBuffer.remaining() / mGeometrySize; if (!isDynamic()) throw new UnsupportedOperationException("Cannot update non dynamic buffers!"); getGL().getGL3().glBindVertexArray(mVertexArrayObject[0]); getGL().glBindBuffer(GL.GL_ARRAY_BUFFER, mVertexBuffers[0]); getGL().getGL3().glEnableVertexAttribArray(0); getGL().glBufferData(GL.GL_ARRAY_BUFFER, pVertexBuffer.limit() * (Float.SIZE / Byte.SIZE), pVertexBuffer, isDynamic() ? GL.GL_DYNAMIC_DRAW : GL.GL_STATIC_DRAW); getGL().getGL3().glVertexAttribPointer(0, mGeometrySize, GL.GL_FLOAT, false, 0, 0); getGL().getGL3().glBindVertexArray(0); getGL().glBindBuffer(GL.GL_ARRAY_BUFFER, 0); }
public void setTextureCoordsAndCreateBuffer(FloatBuffer pTextureCoordsBuffer) { getGL().getGL3().glBindVertexArray(mVertexArrayObject[0]); getGL().glBindBuffer(GL.GL_ARRAY_BUFFER, mVertexBuffers[2]); getGL().getGL3().glEnableVertexAttribArray(2); getGL().glBufferData(GL.GL_ARRAY_BUFFER, pTextureCoordsBuffer.limit() * (Float.SIZE / Byte.SIZE), pTextureCoordsBuffer, isDynamic() ? GL.GL_DYNAMIC_DRAW : GL.GL_STATIC_DRAW); getGL().getGL3().glVertexAttribPointer(2, mTextureCoordSize, GL.GL_FLOAT, false, 0, 0); getGL().getGL3().glBindVertexArray(0); getGL().glBindBuffer(GL.GL_ARRAY_BUFFER, 0); }
public void setNormalsAndCreateBuffer(FloatBuffer pNormalBuffer) { getGL().getGL3().glBindVertexArray(mVertexArrayObject[0]); getGL().glBindBuffer(GL.GL_ARRAY_BUFFER, mVertexBuffers[1]); getGL().getGL3().glEnableVertexAttribArray(1); getGL().glBufferData(GL.GL_ARRAY_BUFFER, pNormalBuffer.limit() * (Float.SIZE / Byte.SIZE), pNormalBuffer, isDynamic() ? GL.GL_DYNAMIC_DRAW : GL.GL_STATIC_DRAW); getGL().getGL3().glVertexAttribPointer(1, mGeometrySize, GL.GL_FLOAT, false, 0, 0); getGL().getGL3().glBindVertexArray(0); getGL().glBindBuffer(GL.GL_ARRAY_BUFFER, 0); }
assert position_attrib != -1; g.glEnableVertexAttribArray(position_attrib); g.glVertexAttribPointer( position_attrib, assert uv_attrib != -1; g.glEnableVertexAttribArray(uv_attrib); g.glVertexAttribPointer( uv_attrib,
public void setVerticesAndCreateBuffer(FloatBuffer pVertexBuffer) { mStoredPrimitiveCount = pVertexBuffer.remaining() / mGeometrySize; getGL().getGL3().glBindVertexArray(mVertexArrayObject[0]); getGL().glBindBuffer(GL.GL_ARRAY_BUFFER, mVertexBuffers[0]); getGL().getGL3().glEnableVertexAttribArray(0); getGL().glBufferData(GL.GL_ARRAY_BUFFER, pVertexBuffer.limit() * (Float.SIZE / Byte.SIZE), pVertexBuffer, isDynamic() ? GL.GL_DYNAMIC_DRAW : GL.GL_STATIC_DRAW); getGL().getGL3().glVertexAttribPointer(0, mGeometrySize, GL.GL_FLOAT, false, 0, 0); getGL().getGL3().glBindVertexArray(0); getGL().glBindBuffer(GL.GL_ARRAY_BUFFER, 0); }
public void updateTextureCoords(FloatBuffer pTextureCoordsBuffer) { if (!isDynamic()) throw new UnsupportedOperationException("Cannot update non dynamic buffers!"); getGL().getGL3().glBindVertexArray(mVertexArrayObject[0]); GLError.printGLErrors(getGL(), "1"); getGL().getGL3().glBindBuffer(GL.GL_ARRAY_BUFFER, mVertexBuffers[2]); GLError.printGLErrors(getGL(), "2"); getGL().getGL3().glEnableVertexAttribArray(2); GLError.printGLErrors(getGL(), "3"); getGL().glBufferSubData(GL.GL_ARRAY_BUFFER, 0, pTextureCoordsBuffer.limit() * (Float.SIZE / Byte.SIZE), pTextureCoordsBuffer); GLError.printGLErrors(getGL(), "4"); getGL().getGL3().glVertexAttribPointer(2, mTextureCoordSize, GL.GL_FLOAT, false, 0, 0); GLError.printGLErrors(getGL(), "5"); getGL().getGL3().glBindVertexArray(0); GLError.printGLErrors(getGL(), "6"); getGL().glBindBuffer(GL.GL_ARRAY_BUFFER, 0); GLError.printGLErrors(getGL(), "7"); }
)*primsPerBlock; saveWindowViewportState(gl); gl.glEnableVertexAttribArray(0);