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); }
/** 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); }
protected VertexBufferObject (int usage, ByteBuffer data, boolean ownsBuffer, VertexAttributes attributes) { bufferHandle = Gdx.gl20.glGenBuffer(); setBuffer(data, ownsBuffer, attributes); setUsage(usage); }
/** 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); }