This pull request changes up toTextureRegion() a bit.
Enables the stencil buffer on the framebuffer to improve rendering.
Negative-size TVGs now behave correctly.
Negative- and zero-size TVGs no longer cause it to crash. I forgot this part. Will fix in another PR.
Handling of float to int conversion for framebuffer size has been improved.
Added a supersampling overload to work around FrameBuffer's lack of antialiasing support (it's infinitely faster than tvg-render but subject to texture size limits).
Removed the clear() because new framebuffers are always empty (in my experience) and clearing them takes time.
Made some subjective changes that you should just revert without discussion if you disagree with.
Known issues:
viewport.update() ignores the width and height passed into it. This has nothing to do with me removing viewport.apply() - it doesn't work with that either.
When supersampling pirate.tvg, his face is smoothened out nicely but the edges of his face are jaggy. Putting him on a solid background fixes this. Something is wrong with alpha. I've tried layering a semi-transparent rectangle down and that has the correct alpha, so I really don't know what is going on.
I'm unsure what the state is in tests because Assertions.assertTrue(lock.await(5, TimeUnit.SECONDS)); and its friends fail. Hopefully all is well. It's not identical to my test code due to a difference in Java versions and I didn't figure out how to do an mvn install on this library's source code.
This pull request is feature creep, considering it was only supposed to be a single-line change. You may just want to copy the line I came here for, with its original name of buffer, into the repository for now, since it's the important fix.
This pull request changes up
toTextureRegion()
a bit.Negative- and zero-size TVGs no longer cause it to crash.I forgot this part. Will fix in another PR.FrameBuffer
's lack of antialiasing support (it's infinitely faster than tvg-render but subject to texture size limits).clear()
because new framebuffers are always empty (in my experience) and clearing them takes time.Known issues:
viewport.update()
ignores the width and height passed into it. This has nothing to do with me removingviewport.apply()
- it doesn't work with that either.pirate.tvg
, his face is smoothened out nicely but the edges of his face are jaggy. Putting him on a solid background fixes this. Something is wrong with alpha. I've tried layering a semi-transparent rectangle down and that has the correct alpha, so I really don't know what is going on.I'm unsure what the state is in tests because
Assertions.assertTrue(lock.await(5, TimeUnit.SECONDS));
and its friends fail. Hopefully all is well. It's not identical to my test code due to a difference in Java versions and I didn't figure out how to do anmvn install
on this library's source code.This pull request is feature creep, considering it was only supposed to be a single-line change. You may just want to copy the line I came here for, with its original name of
buffer
, into the repository for now, since it's the important fix.https://github.com/lyze237/gdx-TinyVG/blob/7db63a4998af58c785c9653965dd3d934e830d62/src/main/java/dev/lyze/gdxtinyvg/TinyVGIO.java#L28