Skip to content

Commit

Permalink
feat(tinyexr) update to 1.0.2
Browse files Browse the repository at this point in the history
Also integrated tinyexr with the LWJGL memory allocator.
  • Loading branch information
Spasi committed Apr 1, 2023
1 parent 8773a0b commit 85a5a44
Show file tree
Hide file tree
Showing 8 changed files with 655 additions and 295 deletions.
1 change: 1 addition & 0 deletions doc/notes/3.3.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ This build includes the following changes:
- SPIRV-Cross: Updated to 0.51.0 (up from 0.48.0)
- stb
* Updated `stb_image` to 2.28 (up from 2.27)
- tinyexr: Updated to 1.0.2 (up from 1.0.1)
- tinyfiledialogs: Updated to 3.9.0 (up from 3.8.8)
- vma: Updated to 3.0.1 (up from 3.0.0-development)
- Vulkan: Updated to 1.3.245 (up from 1.3.206)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ enum class Module(
tinyexr is a small, single header-only library to load and save OpenEXR(.exr) images.
""",
library = JNILibrary.simple(),
library = JNILibrary.create("LibTinyEXR", setupAllocator = true, cpp = true),
arrayOverloads = false
),
TINYFD(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
#include "common_tools.h"
#define LWJGL_MALLOC_LIB org_lwjgl_util_tinyexr_LibTinyEXR
#include "lwjgl_malloc.h"
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.tinyexr;

import org.lwjgl.system.*;

import static org.lwjgl.system.MemoryUtil.*;

/** Initializes the tinyexr shared library. */
final class LibTinyEXR {

static {
String libName = Platform.mapLibraryNameBundled("lwjgl_tinyexr");
Library.loadSystem(System::load, System::loadLibrary, LibTinyEXR.class, "org.lwjgl.tinyexr", libName);

MemoryAllocator allocator = getAllocator(Configuration.DEBUG_MEMORY_ALLOCATOR_INTERNAL.get(true));
setupMalloc(
allocator.getMalloc(),
allocator.getCalloc(),
allocator.getRealloc(),
allocator.getFree(),
allocator.getAlignedAlloc(),
allocator.getAlignedFree()
);
}

private LibTinyEXR() {
}

static void initialize() {
// intentionally empty to trigger static initializer
}

private static native void setupMalloc(
long malloc,
long calloc,
long realloc,
long free,
long aligned_alloc,
long aligned_free
);

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
public class TinyEXR {

static { Library.loadSystem(System::load, System::loadLibrary, TinyEXR.class, "org.lwjgl.tinyexr", Platform.mapLibraryNameBundled("lwjgl_tinyexr")); }
static { LibTinyEXR.initialize(); }

/** Error codes. */
public static final int
Expand Down
Loading

0 comments on commit 85a5a44

Please sign in to comment.