@Override public void glDrawElements (int mode, int count, int type, int indices) { vertexCount.put(count); drawCalls++; calls++; gl20.glDrawElements(mode, count, type, indices); check(); }
@Override public void glDrawElements (int mode, int count, int type, int indices) { vertexCount.put(count); drawCalls++; calls++; gl20.glDrawElements(mode, count, type, indices); check(); }
@Override public void glDrawElements (int mode, int count, int type, Buffer indices) { vertexCount.put(count); drawCalls++; calls++; gl20.glDrawElements(mode, count, type, indices); check(); }
@Override public void glDrawElements (int mode, int count, int type, Buffer indices) { vertexCount.put(count); drawCalls++; calls++; gl20.glDrawElements(mode, count, type, indices); check(); }
buffer.position(offset); buffer.limit(offset + count); Gdx.gl20.glDrawElements(primitiveType, count, GL20.GL_UNSIGNED_SHORT, buffer); buffer.position(oldPosition); buffer.limit(oldLimit); Gdx.gl20.glDrawElements(primitiveType, count, GL20.GL_UNSIGNED_SHORT, offset * 2); } else { Gdx.gl20.glDrawArrays(primitiveType, offset, count);
buffer.position(offset); buffer.limit(offset + count); Gdx.gl20.glDrawElements(primitiveType, count, GL20.GL_UNSIGNED_SHORT, buffer); buffer.position(oldPosition); buffer.limit(oldLimit); Gdx.gl20.glDrawElements(primitiveType, count, GL20.GL_UNSIGNED_SHORT, offset * 2); } else { Gdx.gl20.glDrawArrays(primitiveType, offset, count);
@Override public void render () { // System.out.println( "render"); Gdx.gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); Gdx.gl.glEnable(GL20.GL_TEXTURE_2D); shader.begin(); shader.setUniformi("u_texture", 0); texture.bind(); vbo.bind(shader); ibo.bind(); Gdx.gl20.glDrawElements(GL20.GL_TRIANGLES, 3, GL20.GL_UNSIGNED_SHORT, 0); ibo.unbind(); vbo.unbind(shader); shader.end(); }
@Override public void render () { GL20 gl = Gdx.gl20; gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl.glClearColor(0.7f, 0, 0, 1); gl.glClear(GL20.GL_COLOR_BUFFER_BIT); gl.glEnable(GL20.GL_TEXTURE_2D); shader.begin(); shader.setUniformi("u_texture", 0); texture.bind(); vbo.bind(shader); indices.bind(); gl.glDrawElements(GL20.GL_TRIANGLES, 3, GL20.GL_UNSIGNED_SHORT, indices.getBuffer().position()); indices.unbind(); vbo.unbind(shader); shader.end(); }
@Override public void glDrawElements(int mode, int count, int type, int indices) { Gdx.gl.glDrawElements(mode, count, type, indices); }
@Override public void glDrawElements(int mode, int count, int type, int indices) { Gdx.gl.glDrawElements(mode, count, type, indices); }
public void drawQuadSet( FloatBuffer vertices, int size ) { if (size == 0) { return; } vertices.position( 0 ); aXY.vertexPointer( 2, 4, vertices ); vertices.position( 2 ); aUV.vertexPointer( 2, 4, vertices ); Gdx.gl.glDrawElements( GL20.GL_TRIANGLES, Quad.SIZE * size, GL20.GL_UNSIGNED_SHORT, 0 ); }
public void drawQuad( FloatBuffer vertices ) { vertices.position( 0 ); aXY.vertexPointer( 2, 4, vertices ); vertices.position( 2 ); aUV.vertexPointer( 2, 4, vertices ); Gdx.gl.glDrawElements( GL20.GL_TRIANGLES, Quad.SIZE, GL20.GL_UNSIGNED_SHORT, 0 ); }
@Override public void glDrawElements (int mode, int count, int type, int indices) { vertexCount.put(count); drawCalls++; calls++; gl20.glDrawElements(mode, count, type, indices); check(); }
@Override public void glDrawElements (int mode, int count, int type, Buffer indices) { vertexCount.put(count); drawCalls++; calls++; gl20.glDrawElements(mode, count, type, indices); check(); }
public void drawElements( FloatBuffer vertices, ShortBuffer indices, int size ) { vertices.position( 0 ); aXY.vertexPointer( 2, 4, vertices ); vertices.position( 2 ); aUV.vertexPointer( 2, 4, vertices ); Quad.releaseIndices(); Gdx.gl.glDrawElements( GL20.GL_TRIANGLES, size, GL20.GL_UNSIGNED_SHORT, indices ); Quad.bindIndices(); }
public void drawQuad( Vertexbuffer buffer ) { buffer.updateGLData(); buffer.bind(); aXY.vertexBuffer( 2, 4, 0 ); aUV.vertexBuffer( 2, 4, 2 ); buffer.release(); Gdx.gl.glDrawElements( GL20.GL_TRIANGLES, Quad.SIZE, GL20.GL_UNSIGNED_SHORT, 0 ); }
public void drawQuadSet( Vertexbuffer buffer, int length, int offset ){ if (length == 0) { return; } buffer.updateGLData(); buffer.bind(); aXY.vertexBuffer( 2, 4, 0 ); aUV.vertexBuffer( 2, 4, 2 ); buffer.release(); Gdx.gl.glDrawElements( GL20.GL_TRIANGLES, Quad.SIZE * length, GL20.GL_UNSIGNED_SHORT, Quad.SIZE * Short.SIZE/8 * offset ); }
buffer.position(offset); buffer.limit(offset + count); Gdx.gl20.glDrawElements(primitiveType, count, GL20.GL_UNSIGNED_SHORT, buffer); buffer.position(oldPosition); buffer.limit(oldLimit); Gdx.gl20.glDrawElements(primitiveType, count, GL20.GL_UNSIGNED_SHORT, offset * 2); } else { Gdx.gl20.glDrawArrays(primitiveType, offset, count);