Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Large refactoring of the Java Wrapper, focussing on error handling, documentation, completeness, and usability improvements. Fixes #880. This includes several breaking changes. Not all breaking changes are listed here explicitly. But in all cases, it should be easy for clients to update their code to the new state. The most important changes for the Java Wrapper are: - Made `deflateZstd`, `deflateZLIB`, and `createFromMemory` available in the `KtxTexture2` class - Fixed a bug where the `KtxBasisParams#setInputSwizzle` function caused data corruption - Increased the consistency of the naming and handling of constants: - All constant names are `UPPER_SNAKE_CASE`, omitting common prefixes - Classes that define constants offer a `stringFor` function that returns the string representation of a constant - The `KtxCreateStorage` class was renamed to `KtxTextureCreateStorage` - The `KtxPackUASTCFlagBits` class was renamed to `KtxPackUastcFlagBits` - Improved error handling: - When functions receive a parameter that is `null`, then this will no longer crash the JVM, but throw a `NullPointerException` instead - When `setInputSwizzle` receives invalid arguments, then an `IllegalArgumentException` will be thrown - When one of the `create...` family of functions causes an error, meaning that the respective `KtxTexture2` object cannot be created, then a `KtxException` will be thrown - Added JavaDocs, and enabled the generation of JavaDocs as part of the Maven build process - Internal improvements (like JNI field caching, and avoiding to call JNI functions with pending exceptions)
- Loading branch information