/** Invalidates the VertexBufferObject so a new OpenGL buffer handle is created. Use this in case of a context loss. */ @Override public void invalidate () { bufferHandle = Gdx.gl20.glGenBuffer(); isDirty = true; }
/** Invalidates the IndexBufferObject so a new OpenGL buffer handle is created. Use this in case of a context loss. */ public void invalidate () { bufferHandle = Gdx.gl20.glGenBuffer(); isDirty = true; }
@Override public void invalidate() { bufferHandle = Gdx.gl20.glGenBuffer(); isDirty = true; vaoDirty = true; }
/** Invalidates the VertexBufferObject so a new OpenGL buffer handle is created. Use this in case of a context loss. */ @Override public void invalidate () { bufferHandle = Gdx.gl20.glGenBuffer(); isDirty = true; }
/** Invalidates the IndexBufferObject so a new OpenGL buffer handle is created. Use this in case of a context loss. */ public void invalidate () { bufferHandle = Gdx.gl20.glGenBuffer(); isDirty = true; }
/** * Invalidates the VertexBufferObject so a new OpenGL buffer handle is created. Use this in case of a context loss. */ @Override public void invalidate () { bufferHandle = Gdx.gl20.glGenBuffer(); createVAO(); isDirty = true; }
@Override public int glGenBuffer () { calls++; int result = gl20.glGenBuffer(); check(); return result; }
@Override public int glGenBuffer () { calls++; int result = gl20.glGenBuffer(); check(); return result; }
/** * Invalidates the VertexBufferObject so a new OpenGL buffer handle is created. Use this in case of a context loss. */ @Override public void invalidate () { bufferHandle = Gdx.gl20.glGenBuffer(); createVAO(); isDirty = true; }
public OldVertexBufferObjectWithVAO (boolean isStatic, int numVertices, VertexAttributes attributes) { this.isStatic = isStatic; this.attributes = attributes; byteBuffer = BufferUtils.newUnsafeByteBuffer(this.attributes.vertexSize * numVertices); buffer = byteBuffer.asFloatBuffer(); buffer.flip(); byteBuffer.flip(); bufferHandle = Gdx.gl20.glGenBuffer(); usage = isStatic ? GL20.GL_STATIC_DRAW : GL20.GL_DYNAMIC_DRAW; }
protected VertexBufferObject (int usage, ByteBuffer data, boolean ownsBuffer, VertexAttributes attributes) { bufferHandle = Gdx.gl20.glGenBuffer(); setBuffer(data, ownsBuffer, attributes); setUsage(usage); }
protected VertexBufferObject (int usage, ByteBuffer data, boolean ownsBuffer, VertexAttributes attributes) { bufferHandle = Gdx.gl20.glGenBuffer(); setBuffer(data, ownsBuffer, attributes); setUsage(usage); }
private int createBufferObject () { int result = Gdx.gl20.glGenBuffer(); Gdx.gl20.glBindBuffer(GL20.GL_ELEMENT_ARRAY_BUFFER, result); Gdx.gl20.glBufferData(GL20.GL_ELEMENT_ARRAY_BUFFER, byteBuffer.capacity(), null, usage); Gdx.gl20.glBindBuffer(GL20.GL_ELEMENT_ARRAY_BUFFER, 0); return result; }
private int createBufferObject () { int result = Gdx.gl20.glGenBuffer(); Gdx.gl20.glBindBuffer(GL20.GL_ARRAY_BUFFER, result); Gdx.gl20.glBufferData(GL20.GL_ARRAY_BUFFER, byteBuffer.capacity(), null, usage); Gdx.gl20.glBindBuffer(GL20.GL_ARRAY_BUFFER, 0); return result; }
/** Constructs a new interleaved VertexBufferObject. * * @param isStatic whether the vertex data is static. * @param numVertices the maximum number of vertices * @param attributes the {@link VertexAttributes}. */ public VertexBufferObject (boolean isStatic, int numVertices, VertexAttributes attributes) { bufferHandle = Gdx.gl20.glGenBuffer(); ByteBuffer data = BufferUtils.newUnsafeByteBuffer(attributes.vertexSize * numVertices); data.limit(0); setBuffer(data, true, attributes); setUsage(isStatic ? GL20.GL_STATIC_DRAW : GL20.GL_DYNAMIC_DRAW); }
/** Constructs a new interleaved VertexBufferObject. * * @param isStatic whether the vertex data is static. * @param numVertices the maximum number of vertices * @param attributes the {@link VertexAttributes}. */ public VertexBufferObject (boolean isStatic, int numVertices, VertexAttributes attributes) { bufferHandle = Gdx.gl20.glGenBuffer(); ByteBuffer data = BufferUtils.newUnsafeByteBuffer(attributes.vertexSize * numVertices); data.limit(0); setBuffer(data, true, attributes); setUsage(isStatic ? GL20.GL_STATIC_DRAW : GL20.GL_DYNAMIC_DRAW); }
private int createBufferObject () { int result = Gdx.gl20.glGenBuffer(); Gdx.gl20.glBindBuffer(GL20.GL_ARRAY_BUFFER, result); Gdx.gl20.glBufferData(GL20.GL_ARRAY_BUFFER, byteBuffer.capacity(), null, usage); Gdx.gl20.glBindBuffer(GL20.GL_ARRAY_BUFFER, 0); return result; }
private int createBufferObject () { int result = Gdx.gl20.glGenBuffer(); Gdx.gl20.glBindBuffer(GL20.GL_ELEMENT_ARRAY_BUFFER, result); Gdx.gl20.glBufferData(GL20.GL_ELEMENT_ARRAY_BUFFER, byteBuffer.capacity(), null, usage); Gdx.gl20.glBindBuffer(GL20.GL_ELEMENT_ARRAY_BUFFER, 0); return result; }
/** * Constructs a new interleaved VertexBufferObjectWithVAO. * * @param isStatic whether the vertex data is static. * @param numVertices the maximum number of vertices * @param attributes the {@link VertexAttributes}. */ public VertexBufferObjectWithVAO (boolean isStatic, int numVertices, VertexAttributes attributes) { this.isStatic = isStatic; this.attributes = attributes; buffer = BufferUtils.newFloatBuffer(this.attributes.vertexSize / 4 * numVertices); buffer.flip(); bufferHandle = Gdx.gl20.glGenBuffer(); usage = isStatic ? GL20.GL_STATIC_DRAW : GL20.GL_DYNAMIC_DRAW; createVAO(); }
/** * Constructs a new interleaved VertexBufferObjectWithVAO. * * @param isStatic whether the vertex data is static. * @param numVertices the maximum number of vertices * @param attributes the {@link VertexAttributes}. */ public VertexBufferObjectWithVAO (boolean isStatic, int numVertices, VertexAttributes attributes) { this.isStatic = isStatic; this.attributes = attributes; buffer = BufferUtils.newFloatBuffer(this.attributes.vertexSize / 4 * numVertices); buffer.flip(); bufferHandle = Gdx.gl20.glGenBuffer(); usage = isStatic ? GL20.GL_STATIC_DRAW : GL20.GL_DYNAMIC_DRAW; createVAO(); }