Skip to content

Conversation

@NetzwergX
Copy link
Contributor

As discussed in:
https://hub.jmonkeyengine.org/t/indexbuffer-suggestions-improvements-consistency/42022/4

  • [Fix] createIndexBuffer(int, int): return IndexByteBuffer as well for
    vertexCount < 128
  • [Enhancement] Make put(int i, int value) fluid interface
  • [Enhancement] Add relative put(int i) to allow easier chaining (parity
    with other buffer implementations)
  • [Enhancement] Add getFormat() to allow setting an IndexBuffer to a
    Mesh directly without type inspection.
  • [Fix] Fix WrappedIndexBuffer
    API changes make it possible that IndexByteBuffer is now a valid type
    for outBuf, leverage the new getFormat() method to set the buffer to the
    mesh regardless of its type.

NetzwergX added 2 commits July 3, 2019 14:44
As discussed in:
https://hub.jmonkeyengine.org/t/indexbuffer-suggestions-improvements-consistency/42022/4

* [Fix] createIndexBuffer(int, int): return IndexByteBuffer as well for
	vertexCount < 128
* [Enhancement] Make put(int i, int value) fluid interface
* [Enhancement] Add relative put(int i) to allow easier chaining (parity
	with other buffer implementations)
* [Enhancement] Add getFormat() to allow setting an IndexBuffer to a
	Mesh directly without type inspection.
* [Fix] Fix WrappedIndexBuffer
	API changes make it possible that IndexByteBuffer is now a valid  type
for outBuf, leverage the new getFormat() method to set the buffer to the
mesh regardless of its type.
Copy link
Member

@riccardobl riccardobl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NetzwergX
Copy link
Contributor Author

There are likely more places inside JME where IndexBuffer should be used. I remarked the above place in the forum thread, but I didn't want to clutter this PR also with updates of the whole codebase. If wanted I can include that change in this PR.

@riccardobl
Copy link
Member

I think it should be done. Mostly because with the current code, mesh2.extractVertexData(meshWithByteIndex) will make a short index buffer instead of a byte one.

@stephengold stephengold merged commit 0ffc612 into jMonkeyEngine:master Jul 8, 2019
@stephengold stephengold added this to the v3.3.0 milestone Jul 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants