/** * 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.gl30.glGenBuffer(); createVAO(); 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; }
/** * 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.gl30.glGenBuffer(); createVAO(); 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; }
/** * 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; 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; 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; 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; 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(); }
/** * 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(); }
/** * 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.gl30.glGenBuffer(); createVAO(); isDirty = true; }
/** * 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; 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; createVAO(); }