From c20b26af8d35e647232f3283f106394a53e71d90 Mon Sep 17 00:00:00 2001 From: squid233 <60126026+squid233@users.noreply.github.com> Date: Sun, 30 Jul 2023 15:33:11 +0800 Subject: [PATCH 01/14] [Core] Added MemoryUtil::segmentAllocator, renamed Struct::sizeof to sizeofThis; etc. --- build.gradle.kts | 11 +++++------ .../src/main/java/overrungl/Struct.java | 2 +- .../src/main/java/overrungl/util/MemoryUtil.java | 11 +++++++++++ .../main/java/overrungl/glfw/GLFWGamepadState.java | 9 ++++++++- .../src/main/java/overrungl/glfw/GLFWGammaRamp.java | 9 ++++++++- .../src/main/java/overrungl/glfw/GLFWImage.java | 13 ++++++++++--- .../src/main/java/overrungl/glfw/GLFWVidMode.java | 11 +++++++++-- .../src/main/java/overrungl/nfd/NFDEnumerator.java | 7 +++++++ .../src/main/java/overrungl/nfd/NFDNFilterItem.java | 11 +++++++++-- .../main/java/overrungl/nfd/NFDU8FilterItem.java | 11 +++++++++-- modules/overrungl.opengl/build.gradle.kts | 2 +- .../overrungl/opengl/DrawArraysIndirectCommand.java | 11 +++++++++-- .../opengl/DrawElementsIndirectCommand.java | 11 +++++++++-- .../main/java/overrungl/stb/STBIIoCallbacks.java | 9 ++++++++- settings.gradle.kts | 4 ++-- 15 files changed, 106 insertions(+), 26 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 569fe3a3..c630cfb0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -197,8 +197,7 @@ subprojects { archives(tasks["javadocJar"]) } - val idea: IdeaModel by extensions - idea.module.inheritOutputDirs = true + the().module.inheritOutputDirs = true } tasks.register("assembleJavadocArgs") { @@ -223,13 +222,13 @@ tasks.register("aggregateJavadoc") { val projectsToDoc = Artifact.values().map { project(it.subprojectName) } dependsOn(projectsToDoc.map { it.getTasksByName("classes", true) }) source(projectsToDoc.map { it.sourceSets["main"].java }) - destinationDir = file("$buildDir/docs/javadoc") + destinationDir = File("$buildDir/docs/javadoc") classpath = files(projectsToDoc.map { it.configurations["compileClasspath"].files }) executable = project.findProperty("javadocExecutable") as String? - options.optionFiles = listOf(file("${rootProject.buildDir}/tmp/modulesourcepath.args")) + options.optionFiles = listOf(File("${rootProject.buildDir}/tmp/modulesourcepath.args")) } allprojects { @@ -320,9 +319,9 @@ publishing.publications { } module.nativeBinding?.platforms?.forEach { val nativeName = module.nativeFileName(it)!! - val file = file("${rootProject.projectDir}/natives/$nativeName") + val file = File("${rootProject.projectDir}/natives/$nativeName") if (file.exists()) { - val nativeParent = file(nativeName).parent + val nativeParent = File(nativeName).parent artifact(tasks.create("nativeJar${module.mavenName}${it.taskSuffix}") { archiveBaseName.set(module.artifactName) archiveClassifier.set(it.classifier) diff --git a/modules/overrungl.core/src/main/java/overrungl/Struct.java b/modules/overrungl.core/src/main/java/overrungl/Struct.java index badce7a4..3cc7769d 100644 --- a/modules/overrungl.core/src/main/java/overrungl/Struct.java +++ b/modules/overrungl.core/src/main/java/overrungl/Struct.java @@ -74,7 +74,7 @@ public MemoryLayout layout() { /** * {@return the elements size of this struct in bytes} */ - public long sizeof() { + public long sizeofThis() { return layout() != null ? layout().byteSize() : 0; } } diff --git a/modules/overrungl.core/src/main/java/overrungl/util/MemoryUtil.java b/modules/overrungl.core/src/main/java/overrungl/util/MemoryUtil.java index 9820fc45..7f1d60d0 100644 --- a/modules/overrungl.core/src/main/java/overrungl/util/MemoryUtil.java +++ b/modules/overrungl.core/src/main/java/overrungl/util/MemoryUtil.java @@ -61,6 +61,17 @@ private MemoryUtil() { throw new IllegalStateException("Do not construct instance"); } + /** + * {@return a segment allocator of this} + * The returned memory must be released explicitly by {@link #free(MemorySegment)}. + */ + public static SegmentAllocator segmentAllocator() { + class Holder { + private static final SegmentAllocator ALLOCATOR = (byteSize, byteAlignment) -> calloc(byteSize / byteAlignment, byteAlignment); + } + return Holder.ALLOCATOR; + } + /** * {@return {@code true} if {@code segment} is a null pointer} * diff --git a/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWGamepadState.java b/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWGamepadState.java index 4053c5d5..700554e1 100644 --- a/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWGamepadState.java +++ b/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWGamepadState.java @@ -35,7 +35,7 @@ * @author squid233 * @since 0.1.0 */ -public class GLFWGamepadState extends Struct { +public final class GLFWGamepadState extends Struct { /** * The struct member layout. */ @@ -63,6 +63,13 @@ public GLFWGamepadState(MemorySegment address) { super(address, LAYOUT); } + /** + * {@return the elements size of this struct in bytes} + */ + public static long sizeof() { + return LAYOUT.byteSize(); + } + /** * Creates a {@code GLFWgamepadstate} instance with the given allocator. * diff --git a/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWGammaRamp.java b/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWGammaRamp.java index f49fb96b..4f4d81b7 100644 --- a/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWGammaRamp.java +++ b/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWGammaRamp.java @@ -41,7 +41,7 @@ * @see GLFW#setGammaRamp * @since 0.1.0 */ -public class GLFWGammaRamp extends Struct { +public final class GLFWGammaRamp extends Struct { private static final AddressLayout SHORT_ARRAY = ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_SHORT)); /** * The struct layout. @@ -70,6 +70,13 @@ public GLFWGammaRamp(MemorySegment address) { super(address, LAYOUT); } + /** + * {@return the elements size of this struct in bytes} + */ + public static long sizeof() { + return LAYOUT.byteSize(); + } + /** * Creates a {@code GLFWgammaramp} instance with the given allocator. * diff --git a/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWImage.java b/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWImage.java index fcf863a3..d4119be3 100644 --- a/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWImage.java +++ b/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWImage.java @@ -40,7 +40,7 @@ * @author squid233 * @since 0.1.0 */ -public class GLFWImage extends Struct { +public sealed class GLFWImage extends Struct { /** * The struct layout. */ @@ -55,7 +55,7 @@ public class GLFWImage extends Struct { pPixels = LAYOUT.varHandle(PathElement.groupElement("pixels")); /** - * Create a {@code GLFWimage} instance. + * Create a {@code GLFWImage} instance. * * @param address the address. */ @@ -73,6 +73,13 @@ protected GLFWImage(MemorySegment address, MemoryLayout layout) { super(address, layout); } + /** + * {@return the elements size of this struct in bytes} + */ + public static long sizeof() { + return LAYOUT.byteSize(); + } + /** * Creates a {@code GLFWImage} instance with the given allocator. * @@ -160,7 +167,7 @@ public MemorySegment pixels() { * @author squid233 * @since 0.1.0 */ - public static class Buffer extends GLFWImage implements ArrayPointer { + public static final class Buffer extends GLFWImage implements ArrayPointer { private final VarHandle pWidth, pHeight, pPixels; /** diff --git a/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWVidMode.java b/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWVidMode.java index 217244e6..68523fa5 100644 --- a/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWVidMode.java +++ b/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWVidMode.java @@ -42,7 +42,7 @@ * @see GLFW#getVideoModes * @since 0.1.0 */ -public class GLFWVidMode extends Struct { +public sealed class GLFWVidMode extends Struct { /** * The struct layout. */ @@ -81,6 +81,13 @@ protected GLFWVidMode(MemorySegment address, MemoryLayout layout) { super(address, layout); } + /** + * {@return the elements size of this struct in bytes} + */ + public static long sizeof() { + return LAYOUT.byteSize(); + } + /** * Creates a {@code GLFWVidMode} instance with the given allocator. * @@ -179,7 +186,7 @@ public int refreshRate() { * @author squid233 * @since 0.1.0 */ - public static class Buffer extends GLFWVidMode implements ArrayPointer { + public static final class Buffer extends GLFWVidMode implements ArrayPointer { private final VarHandle pWidth, pHeight, pRedBits, pGreenBits, pBlueBits, pRefreshRate; /** diff --git a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDEnumerator.java b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDEnumerator.java index 1c5262ce..a788e148 100644 --- a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDEnumerator.java +++ b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDEnumerator.java @@ -109,6 +109,13 @@ public String next() { } } + /** + * {@return the elements size of this struct in bytes} + */ + public static long sizeof() { + return LAYOUT.byteSize(); + } + private static Tuple2 fromPathSet(Kind kind, SegmentAllocator allocator, MemorySegment pathSet) { final MemorySegment seg = allocator.allocate(ADDRESS); final NFDResult result = NFD.pathSetGetEnum(pathSet, seg); diff --git a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDNFilterItem.java b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDNFilterItem.java index e6d00236..95de19fd 100644 --- a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDNFilterItem.java +++ b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDNFilterItem.java @@ -35,7 +35,7 @@ * @author squid233 * @since 0.1.0 */ -public class NFDNFilterItem extends Struct { +public sealed class NFDNFilterItem extends Struct { /** * The struct layout. */ @@ -66,6 +66,13 @@ protected NFDNFilterItem(MemorySegment address, MemoryLayout layout) { super(address, layout); } + /** + * {@return the elements size of this struct in bytes} + */ + public static long sizeof() { + return LAYOUT.byteSize(); + } + /** * Creates a {@code NFDNFilterItem} instance with the given allocator. * @@ -135,7 +142,7 @@ public String spec() { * @author squid233 * @since 0.1.0 */ - public static class Buffer extends NFDNFilterItem implements ArrayPointer { + public static final class Buffer extends NFDNFilterItem implements ArrayPointer { private final VarHandle pName, pSpec; /** diff --git a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDU8FilterItem.java b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDU8FilterItem.java index aaa9442c..f0ef323f 100644 --- a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDU8FilterItem.java +++ b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDU8FilterItem.java @@ -35,7 +35,7 @@ * @author squid233 * @since 0.1.0 */ -public class NFDU8FilterItem extends Struct { +public sealed class NFDU8FilterItem extends Struct { /** * The struct layout. */ @@ -66,6 +66,13 @@ protected NFDU8FilterItem(MemorySegment address, MemoryLayout layout) { super(address, layout); } + /** + * {@return the elements size of this struct in bytes} + */ + public static long sizeof() { + return LAYOUT.byteSize(); + } + /** * Creates a {@code NFDU8FilterItem} instance with the given allocator. * @@ -135,7 +142,7 @@ public String spec() { * @author squid233 * @since 0.1.0 */ - public static class Buffer extends NFDU8FilterItem implements ArrayPointer { + public static final class Buffer extends NFDU8FilterItem implements ArrayPointer { private final VarHandle pName, pSpec; /** diff --git a/modules/overrungl.opengl/build.gradle.kts b/modules/overrungl.opengl/build.gradle.kts index 78e8bbd2..63e2c606 100644 --- a/modules/overrungl.opengl/build.gradle.kts +++ b/modules/overrungl.opengl/build.gradle.kts @@ -6,5 +6,5 @@ tasks.register("generate") { classpath(sourceSets["generator"].runtimeClasspath) jvmArgs("--enable-preview") mainClass.set("overrungl.opengl.OpenGLGenerator") - workingDir = file("src/main/java/overrungl/opengl") + workingDir = File("src/main/java/overrungl/opengl") } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/DrawArraysIndirectCommand.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/DrawArraysIndirectCommand.java index 44f8ae00..485c1dec 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/DrawArraysIndirectCommand.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/DrawArraysIndirectCommand.java @@ -38,7 +38,7 @@ * @author squid233 * @since 0.1.0 */ -public class DrawArraysIndirectCommand extends Struct { +public sealed class DrawArraysIndirectCommand extends Struct { /** * The struct layout. */ @@ -73,6 +73,13 @@ protected DrawArraysIndirectCommand(MemorySegment address, MemoryLayout layout) super(address, layout); } + /** + * {@return the elements size of this struct in bytes} + */ + public static long sizeof() { + return LAYOUT.byteSize(); + } + /** * Creates a command instance with the given allocator. * @@ -172,7 +179,7 @@ public int baseInstance() { * @author squid233 * @since 0.1.0 */ - public static class Buffer extends DrawArraysIndirectCommand implements ArrayPointer { + public static final class Buffer extends DrawArraysIndirectCommand implements ArrayPointer { private final VarHandle pCount, pPrimCount, pFirst, pBaseInstance; /** diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/DrawElementsIndirectCommand.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/DrawElementsIndirectCommand.java index e1f5af12..9b18ca61 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/DrawElementsIndirectCommand.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/DrawElementsIndirectCommand.java @@ -39,7 +39,7 @@ * @author squid233 * @since 0.1.0 */ -public class DrawElementsIndirectCommand extends Struct { +public sealed class DrawElementsIndirectCommand extends Struct { /** * The struct layout. */ @@ -76,6 +76,13 @@ protected DrawElementsIndirectCommand(MemorySegment address, MemoryLayout layout super(address, layout); } + /** + * {@return the elements size of this struct in bytes} + */ + public static long sizeof() { + return LAYOUT.byteSize(); + } + /** * Creates a command instance with the given allocator. * @@ -193,7 +200,7 @@ public int baseInstance() { * @author squid233 * @since 0.1.0 */ - public static class Buffer extends DrawElementsIndirectCommand implements ArrayPointer { + public static final class Buffer extends DrawElementsIndirectCommand implements ArrayPointer { private final VarHandle pCount, pPrimCount, pFirstIndex, pBaseVertex, pBaseInstance; /** diff --git a/modules/overrungl.stb/src/main/java/overrungl/stb/STBIIoCallbacks.java b/modules/overrungl.stb/src/main/java/overrungl/stb/STBIIoCallbacks.java index 5dc459bf..2710be90 100644 --- a/modules/overrungl.stb/src/main/java/overrungl/stb/STBIIoCallbacks.java +++ b/modules/overrungl.stb/src/main/java/overrungl/stb/STBIIoCallbacks.java @@ -41,7 +41,7 @@ * @author squid233 * @since 0.1.0 */ -public class STBIIoCallbacks extends Struct { +public final class STBIIoCallbacks extends Struct { /** * The struct layout. */ @@ -155,6 +155,13 @@ default MethodHandle handle(MethodHandles.Lookup lookup) throws NoSuchMethodExce } } + /** + * {@return the elements size of this struct in bytes} + */ + public static long sizeof() { + return LAYOUT.byteSize(); + } + /** * Creates a {@code stbi_io_callbacks} instance with the given allocator. * diff --git a/settings.gradle.kts b/settings.gradle.kts index 74d812ae..ac8a1d16 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -14,8 +14,8 @@ rootProject.name = projName projModules.split(',').map { it.trim() }.forEach { include(it) - project(":$it").projectDir = file("modules/overrungl.$it/") + project(":$it").projectDir = File("modules/overrungl.$it/") } include("samples") -project(":samples").projectDir = file("modules/samples/") +project(":samples").projectDir = File("modules/samples/") From f720360ab57b2375e34bf7d77d40686ea0de9078 Mon Sep 17 00:00:00 2001 From: squid233 <60126026+squid233@users.noreply.github.com> Date: Sun, 30 Jul 2023 17:10:46 +0800 Subject: [PATCH 02/14] [Core] Added Platform and Architecture, removed OperatingSystem --- README.md | 6 +- build.gradle.kts | 4 +- doc/legal/LICENSE_gradle | 420 ---------------- doc/legal/README.md | 10 - .../overrungl/internal/RuntimeHelper.java | 25 +- .../main/java/overrungl/os/Architecture.java | 59 +++ .../java/overrungl/os/OperatingSystem.java | 470 ------------------ .../java/overrungl/os/OperatingSystems.java | 58 --- .../src/main/java/overrungl/os/Platform.java | 185 +++++++ .../src/main/java/overrungl/nfd/NFD.java | 8 +- 10 files changed, 266 insertions(+), 979 deletions(-) delete mode 100644 doc/legal/LICENSE_gradle create mode 100644 modules/overrungl.core/src/main/java/overrungl/os/Architecture.java delete mode 100644 modules/overrungl.core/src/main/java/overrungl/os/OperatingSystem.java delete mode 100644 modules/overrungl.core/src/main/java/overrungl/os/OperatingSystems.java create mode 100644 modules/overrungl.core/src/main/java/overrungl/os/Platform.java diff --git a/README.md b/README.md index 3705bf75..cd23597d 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ natives │ │ │ └─ libglfw3.so │ │ └─ x64 │ │ └─ libglfw3.so -│ ├─ os x +│ ├─ macos │ │ ├─ arm64 │ │ │ └─ libglfw3.dylib │ │ └─ x64 @@ -127,7 +127,7 @@ natives │ │ │ └─ libnfd.so │ │ └─ x64 │ │ └─ libnfd.so -│ ├─ os x +│ ├─ macos │ │ ├─ arm64 │ │ │ └─ libnfd.dylib │ │ └─ x64 @@ -145,7 +145,7 @@ natives │ │ └─ libstb.so │ └─ x64 │ └─ libstb.so - ├─ os x + ├─ macos │ ├─ arm64 │ │ └─ libstb.dylib │ └─ x64 diff --git a/build.gradle.kts b/build.gradle.kts index c630cfb0..3bc534f8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -43,8 +43,8 @@ enum class NativePlatform( LINUX_64("linux", "x64", "linux", "lib", ".so", "Linux64"), LINUX_ARM32("linux", "arm32", "linux-arm32", "lib", ".so", "LinuxArm32"), LINUX_ARM64("linux", "arm64", "linux-arm64", "lib", ".so", "LinuxArm64"), - MACOS("os x", "x64", "macos", "lib", ".dylib", "Macos"), - MACOS_ARM64("os x", "arm64", "macos-arm64", "lib", ".dylib", "MacosArm64"); + MACOS("macos", "x64", "macos", "lib", ".dylib", "Macos"), + MACOS_ARM64("macos", "arm64", "macos-arm64", "lib", ".dylib", "MacosArm64"); companion object { val ALL = values() diff --git a/doc/legal/LICENSE_gradle b/doc/legal/LICENSE_gradle deleted file mode 100644 index 42ac08d8..00000000 --- a/doc/legal/LICENSE_gradle +++ /dev/null @@ -1,420 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -============================================================================== -Licenses for included components: - ------------------------------------------------------------------------------- -Eclipse Public License 1.0 -https://opensource.org/licenses/EPL-1.0 - -junit:junit -org.sonatype.aether:aether-api -org.sonatype.aether:aether-connector-wagon -org.sonatype.aether:aether-impl -org.sonatype.aether:aether-spi -org.sonatype.aether:aether-util - ------------------------------------------------------------------------------- -3-Clause BSD -https://opensource.org/licenses/BSD-3-Clause - -com.google.code.findbugs:jsr305 - -org.hamcrest:hamcrest-core -BSD License - -Copyright (c) 2000-2015 www.hamcrest.org -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of -conditions and the following disclaimer. Redistributions in binary form must reproduce -the above copyright notice, this list of conditions and the following disclaimer in -the documentation and/or other materials provided with the distribution. - -Neither the name of Hamcrest nor the names of its contributors may be used to endorse -or promote products derived from this software without specific prior written -permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT -SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -com.esotericsoftware.kryo:kryo -com.esotericsoftware.minlog:minlog -Copyright (c) 2008-2018, Nathan Sweet All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -Neither the name of Esoteric Software nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -org.ow2.asm:asm -org.ow2.asm:asm-analysis -org.ow2.asm:asm-commons -org.ow2.asm:asm-tree -org.ow2.asm:asm-util -ASM: a very small and fast Java bytecode manipulation framework - Copyright (c) 2000-2011 INRIA, France Telecom - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holders nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - THE POSSIBILITY OF SUCH DAMAGE. - ------------------------------------------------------------------------------- -MIT - -com.googlecode.plist:dd-plist -dd-plist - An open source library to parse and generate property lists -Copyright (C) 2016 Daniel Dreibrodt - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -org.bouncycastle:bcpg-jdk15on -org.bouncycastle:bcprov-jdk15on -Copyright (c) 2000 - 2019 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -org.slf4j:jcl-over-slf4j -org.slf4j:jul-to-slf4j -org.slf4j:log4j-over-slf4j -org.slf4j:slf4j-api - Copyright (c) 2004-2017 QOS.ch - All rights reserved. - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - ------------------------------------------------------------------------------- -CDDL -https://opensource.org/licenses/CDDL-1.0 - -com.sun.xml.bind:jaxb-impl - ------------------------------------------------------------------------------- -LGPL 2.1 -https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html - -org.samba.jcifs:jcifs - -org.jetbrains.intellij.deps:trove4j - ------------------------------------------------------------------------------- -License for the GNU Trove library included by the Kotlin embeddable compiler ------------------------------------------------------------------------------- -The source code for GNU Trove is licensed under the Lesser GNU Public License (LGPL). - - Copyright (c) 2001, Eric D. Friedman All Rights Reserved. This library is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - -Two classes (HashFunctions and PrimeFinder) included in Trove are licensed under the following terms: - - Copyright (c) 1999 CERN - European Organization for Nuclear Research. Permission to use, copy, modify, distribute and sell this software - and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and - that both that copyright notice and this permission notice appear in supporting documentation. CERN makes no representations about the - suitability of this software for any purpose. It is provided "as is" without expressed or implied warranty. - -The source code of modified GNU Trove library is available at - https://github.com/JetBrains/intellij-deps-trove4j (with trove4j_changes.txt describing the changes) - ------------------------------------------------------------------------------- -Eclipse Distribution License 1.0 -https://www.eclipse.org/org/documents/edl-v10.php - -org.eclipse.jgit:org.eclipse.jgit - ------------------------------------------------------------------------------- -BSD-style - -com.jcraft:jsch -com.jcraft:jzlib - -Copyright (c) 2000-2011 ymnk, JCraft,Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the distribution. - - 3. The names of the authors may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, -INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, -OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ------------------------------------------------------------------------------- -Eclipse Public License 2.0 -https://www.eclipse.org/legal/epl-2.0/ - -org.junit.platform:junit-platform-launcher - ------------------------------------------------------------------------------- -Mozilla Public License 2.0 -https://www.mozilla.org/en-US/MPL/2.0/ - -org.mozilla:rhino diff --git a/doc/legal/README.md b/doc/legal/README.md index c0fa9851..2a772a03 100644 --- a/doc/legal/README.md +++ b/doc/legal/README.md @@ -1,15 +1,5 @@ We redistributed code from these libraries: -## Gradle - -[Repository](https://github.com/gradle/gradle) - -[LICENSE](LICENSE_gradle) - -Files: - -- subprojects/base-services/src/main/java/org/gradle/internal/os/OperatingSystem.java -> [modules/overrungl.core/src/main/java/overrungl/os/OperatingSystem.java](../../modules/overrungl.core/src/main/java/overrungl/os/OperatingSystem.java) - ## LWJGL 3 [Repository](https://github.com/LWJGL/lwjgl3) diff --git a/modules/overrungl.core/src/main/java/overrungl/internal/RuntimeHelper.java b/modules/overrungl.core/src/main/java/overrungl/internal/RuntimeHelper.java index 8194cc16..90573bd8 100644 --- a/modules/overrungl.core/src/main/java/overrungl/internal/RuntimeHelper.java +++ b/modules/overrungl.core/src/main/java/overrungl/internal/RuntimeHelper.java @@ -18,8 +18,8 @@ import org.jetbrains.annotations.Nullable; import overrungl.FunctionDescriptors; -import overrungl.os.OperatingSystem; -import overrungl.os.OperatingSystems; +import overrungl.os.Architecture; +import overrungl.os.Platform; import overrungl.util.MemoryUtil; import java.io.File; @@ -51,6 +51,7 @@ public final class RuntimeHelper { * An unbounded address layout. */ public static final AddressLayout ADDRESS_UNBOUNDED = MemoryUtil.ADDRESS_UNBOUNDED; + private static final StackWalker STACK_WALKER = StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE); /** * constructor @@ -136,7 +137,7 @@ public static String unknownToken(int token) { * @return the string is formatted in {@code STR."\{description} [0x\{toHexString(token)}]"}. */ public static String unknownToken(String description, int token) { - return STR."\{description} [0x\{Integer.toHexString(token)}]"; + return description + "[0x" + Integer.toHexString(token) + "]"; } /** @@ -150,13 +151,13 @@ public static String unknownToken(String description, int token) { */ public static SymbolLookup load(String module, String basename, String version) throws IllegalStateException { - final var os = OperatingSystem.current(); - final var suffix = os.getSharedLibrarySuffix(); - final var path = os.getSharedLibraryName(basename); + final Platform os = Platform.current(); + final var suffix = os.sharedLibrarySuffix(); + final var path = os.sharedLibraryName(basename); URI uri; // 1. Load from classpath try { - var file = new File(tmpdir, STR."overrungl\{System.getProperty("user.name")}"); + var file = new File(tmpdir, "overrungl" + System.getProperty("user.name")); if (!file.exists()) { // Create directory file.mkdir(); @@ -166,11 +167,11 @@ public static SymbolLookup load(String module, String basename, String version) // Create directory file.mkdir(); } - var libFile = new File(file, STR."\{basename}-\{version}\{suffix}"); + var libFile = new File(file, basename + "-" + version + suffix); if (!libFile.exists()) { // Extract - try (var is = RuntimeHelper.class.getClassLoader().getResourceAsStream( - STR."\{module}/\{os.getFamilyName()}/\{OperatingSystems.getNativeLibArch()}/\{path}" + try (var is = STACK_WALKER.getCallerClass().getClassLoader().getResourceAsStream( + module + "/" + os.familyName() + "/" + Architecture.current() + "/" + path )) { Files.copy(Objects.requireNonNull(is), Path.of(libFile.getAbsolutePath())); } @@ -178,9 +179,9 @@ public static SymbolLookup load(String module, String basename, String version) uri = libFile.toURI(); } catch (Exception e) { // 2. Load from natives directory - var file = new File(STR."\{System.getProperty("overrungl.natives", ".")}/\{path}"); + var file = new File(System.getProperty("overrungl.natives", "."), path); if (!file.exists()) { - var exception = new IllegalStateException(STR."File not found: \{file}; Try to set property -Doverrungl.natives to a valid path"); + var exception = new IllegalStateException("File not found: " + file + "; Try setting property -Doverrungl.natives to a valid path"); exception.addSuppressed(e); throw exception; } diff --git a/modules/overrungl.core/src/main/java/overrungl/os/Architecture.java b/modules/overrungl.core/src/main/java/overrungl/os/Architecture.java new file mode 100644 index 00000000..3239f4fd --- /dev/null +++ b/modules/overrungl.core/src/main/java/overrungl/os/Architecture.java @@ -0,0 +1,59 @@ +/* + * MIT License + * + * Copyright (c) 2023 Overrun Organization + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + */ + +package overrungl.os; + +import java.util.Locale; + +/** + * The architecture of the {@link Platform}. + * + * @author squid233 + * @since 0.1.0 + */ +public enum Architecture { + X64, + ARM64, + ARM32; + + /** + * {@return the current architecture of the current {@linkplain Platform platform}} + */ + public static Architecture current() { + class Holder { + private static final Architecture CURRENT; + + static { + final Platform platform = Platform.current(); + final String arch = System.getProperty("os.arch").toLowerCase(Locale.ROOT); + CURRENT = switch (platform) { + case Platform.Linux _ -> arch.startsWith("arm") || arch.startsWith("aarch64") ? + (arch.contains("64") || arch.startsWith("armv8") ? ARM64 : ARM32) : + X64; + case Platform.MacOSX _ -> arch.startsWith("aarch64") ? ARM64 : X64; + case Platform.Windows _ when arch.contains("64") -> arch.startsWith("aarch64") ? ARM64 : X64; + default -> throw new IllegalStateException("Unrecognized or unsupported architecture: " + arch); + }; + } + } + return Holder.CURRENT; + } + + @Override + public String toString() { + return name().toLowerCase(Locale.ROOT); + } +} diff --git a/modules/overrungl.core/src/main/java/overrungl/os/OperatingSystem.java b/modules/overrungl.core/src/main/java/overrungl/os/OperatingSystem.java deleted file mode 100644 index 89042092..00000000 --- a/modules/overrungl.core/src/main/java/overrungl/os/OperatingSystem.java +++ /dev/null @@ -1,470 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2023 Overrun Organization - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - */ - -package overrungl.os; - -import org.jetbrains.annotations.Nullable; - -import java.io.File; -import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.regex.Pattern; - -import static overrungl.os.OperatingSystems.*; - -/** - * The operating system. - * - * @author Gradle - * @since 0.1.0 - */ -public abstract class OperatingSystem { - private static OperatingSystem currentOs; - private final String toStringValue; - private final String osName; - private final String osVersion; - private final String osArch; - - OperatingSystem() { - osName = System.getProperty("os.name"); - osVersion = System.getProperty("os.version"); - osArch = System.getProperty("os.arch"); - toStringValue = getName() + " " + getVersion() + " " + getArch(); - } - - public static OperatingSystem current() { - if (currentOs == null) { - currentOs = forName(System.getProperty("os.name")); - } - return currentOs; - } - - // for testing current() - static void resetCurrent() { - currentOs = null; - } - - public static OperatingSystem forName(String os) { - String osName = os.toLowerCase(); - if (osName.contains("windows")) { - return WINDOWS; - } else if (osName.contains("mac os x") || osName.contains("darwin") || osName.contains("osx")) { - return MAC_OS; - } else if (osName.contains("sunos") || osName.contains("solaris")) { - return SOLARIS; - } else if (osName.contains("linux")) { - return LINUX; - } else if (osName.contains("freebsd")) { - return FREE_BSD; - } else { - // Not strictly true - return UNIX; - } - } - - @Override - public String toString() { - return toStringValue; - } - - public String getName() { - return osName; - } - - public String getVersion() { - return osVersion; - } - - public String getArch() { - return osArch; - } - - public boolean isWindows() { - return false; - } - - public boolean isUnix() { - return false; - } - - public boolean isMacOsX() { - return false; - } - - public boolean isLinux() { - return false; - } - - public abstract String getNativePrefix(); - - public abstract String getScriptName(String scriptPath); - - public abstract String getExecutableName(String executablePath); - - public abstract String getExecutableSuffix(); - - public abstract String getSharedLibraryName(String libraryName); - - public abstract String getSharedLibrarySuffix(); - - public abstract String getStaticLibraryName(String libraryName); - - public abstract String getStaticLibrarySuffix(); - - public abstract String getLinkLibrarySuffix(); - - public abstract String getLinkLibraryName(String libraryPath); - - public abstract String getFamilyName(); - - /** - * Locates the given executable in the system path. Returns null if not found. - */ - @Nullable - public File findInPath(String name) { - String exeName = getExecutableName(name); - if (exeName.contains(File.separator)) { - File candidate = new File(exeName); - if (candidate.isFile()) { - return candidate; - } - return null; - } - for (File dir : getPath()) { - File candidate = new File(dir, exeName); - if (candidate.isFile()) { - return candidate; - } - } - - return null; - } - - public List findAllInPath(String name) { - List all = new LinkedList(); - - for (File dir : getPath()) { - File candidate = new File(dir, name); - if (candidate.isFile()) { - all.add(candidate); - } - } - - return all; - } - - public List getPath() { - String path = System.getenv(getPathVar()); - if (path == null) { - return Collections.emptyList(); - } - List entries = new ArrayList(); - for (String entry : path.split(Pattern.quote(File.pathSeparator))) { - entries.add(new File(entry)); - } - return entries; - } - - public String getPathVar() { - return "PATH"; - } - - static class Windows extends OperatingSystem { - private final String nativePrefix; - - Windows() { - nativePrefix = resolveNativePrefix(); - } - - @Override - public boolean isWindows() { - return true; - } - - @Override - public String getFamilyName() { - return "windows"; - } - - @Override - public String getScriptName(String scriptPath) { - return withExtension(scriptPath, ".bat"); - } - - @Override - public String getExecutableSuffix() { - return ".exe"; - } - - @Override - public String getExecutableName(String executablePath) { - return withExtension(executablePath, ".exe"); - } - - @Override - public String getSharedLibrarySuffix() { - return ".dll"; - } - - @Override - public String getSharedLibraryName(String libraryPath) { - return withExtension(libraryPath, ".dll"); - } - - @Override - public String getLinkLibrarySuffix() { - return ".lib"; - } - - @Override - public String getLinkLibraryName(String libraryPath) { - return withExtension(libraryPath, ".lib"); - } - - @Override - public String getStaticLibrarySuffix() { - return ".lib"; - } - - @Override - public String getStaticLibraryName(String libraryName) { - return withExtension(libraryName, ".lib"); - } - - @Override - public String getNativePrefix() { - return nativePrefix; - } - - private String resolveNativePrefix() { - String arch = System.getProperty("os.arch"); - if ("i386".equals(arch)) { - arch = "x86"; - } - return "win32-" + arch; - } - - @Override - public String getPathVar() { - return "Path"; - } - } - - static class Unix extends OperatingSystem { - private final String nativePrefix; - - Unix() { - this.nativePrefix = resolveNativePrefix(); - } - - @Override - public String getScriptName(String scriptPath) { - return scriptPath; - } - - @Override - public String getFamilyName() { - return "unknown"; - } - - @Override - public String getExecutableSuffix() { - return ""; - } - - @Override - public String getExecutableName(String executablePath) { - return executablePath; - } - - @Override - public String getSharedLibraryName(String libraryName) { - return getLibraryName(libraryName, getSharedLibrarySuffix()); - } - - private String getLibraryName(String libraryName, String suffix) { - if (libraryName.endsWith(suffix)) { - return libraryName; - } - int pos = libraryName.lastIndexOf('/'); - if (pos >= 0) { - return libraryName.substring(0, pos + 1) + "lib" + libraryName.substring(pos + 1) + suffix; - } else { - return "lib" + libraryName + suffix; - } - } - - @Override - public String getSharedLibrarySuffix() { - return ".so"; - } - - @Override - public String getLinkLibrarySuffix() { - return getSharedLibrarySuffix(); - } - - @Override - public String getLinkLibraryName(String libraryPath) { - return getSharedLibraryName(libraryPath); - } - - @Override - public String getStaticLibrarySuffix() { - return ".a"; - } - - @Override - public String getStaticLibraryName(String libraryName) { - return getLibraryName(libraryName, ".a"); - } - - @Override - public boolean isUnix() { - return true; - } - - @Override - public String getNativePrefix() { - return nativePrefix; - } - - private String resolveNativePrefix() { - String arch = getArch(); - String osPrefix = getOsPrefix(); - osPrefix += "-" + arch; - return osPrefix; - } - - public String getArch() { - String arch = super.getArch(); - if ("x86".equals(arch)) { - arch = "i386"; - } - if ("x86_64".equals(arch)) { - arch = "amd64"; - } - if ("powerpc".equals(arch)) { - arch = "ppc"; - } - return arch; - } - - protected String getOsPrefix() { - String osPrefix = getName().toLowerCase(); - int space = osPrefix.indexOf(" "); - if (space != -1) { - osPrefix = osPrefix.substring(0, space); - } - return osPrefix; - } - } - - static class MacOs extends Unix { - @Override - public boolean isMacOsX() { - return true; - } - - @Override - public String getFamilyName() { - return "os x"; - } - - @Override - public String getSharedLibrarySuffix() { - return ".dylib"; - } - - @Override - public String getNativePrefix() { - return "darwin"; - } - } - - static class Linux extends Unix { - @Override - public boolean isLinux() { - return true; - } - - @Override - public String getFamilyName() { - return "linux"; - } - } - - static class FreeBSD extends Unix { - } - - static class Solaris extends Unix { - @Override - public String getFamilyName() { - return "solaris"; - } - - @Override - protected String getOsPrefix() { - return "sunos"; - } - - @Override - public String getArch() { - String arch = System.getProperty("os.arch"); - if (arch.equals("i386") || arch.equals("x86")) { - return "x86"; - } - return super.getArch(); - } - } - - /** - * Returns a representation of the file path with an alternate extension. If the file path has no extension, - * then the provided extension is simply concatenated. If the file path has an extension, the extension is - * stripped and replaced with the provided extension. - *

- * e.g. with a provided extension of ".bar" - * foo -> foo.bar - * foo.baz -> foo.bar - * - * @param filePath the file path to transform - * @param extension the extension to use in the transformed path - * @return the transformed path - */ - public static String withExtension(String filePath, String extension) { - if (filePath.toLowerCase().endsWith(extension)) { - return filePath; - } - return removeExtension(filePath) + extension; - } - - /** - * Removes the extension (if any) from the file path. If the file path has no extension, then it returns the same string. - * - * @return the file path without an extension - */ - public static String removeExtension(String filePath) { - int fileNameStart = Math.max(filePath.lastIndexOf('/'), filePath.lastIndexOf('\\')); - int extensionPos = filePath.lastIndexOf('.'); - - if (extensionPos > fileNameStart) { - return filePath.substring(0, extensionPos); - } - return filePath; - } -} diff --git a/modules/overrungl.core/src/main/java/overrungl/os/OperatingSystems.java b/modules/overrungl.core/src/main/java/overrungl/os/OperatingSystems.java deleted file mode 100644 index c83b07ee..00000000 --- a/modules/overrungl.core/src/main/java/overrungl/os/OperatingSystems.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2022-2023 Overrun Organization - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - */ - -package overrungl.os; - -import overrungl.os.OperatingSystem.*; - -import java.util.Locale; - -/** - * The operating systems. - * - * @author squid233 - * @see OperatingSystem - * @since 0.1.0 - */ -public final class OperatingSystems { - public static final Windows WINDOWS = new Windows(); - public static final MacOs MAC_OS = new MacOs(); - public static final Solaris SOLARIS = new Solaris(); - public static final Linux LINUX = new Linux(); - public static final FreeBSD FREE_BSD = new FreeBSD(); - public static final Unix UNIX = new Unix(); - - private OperatingSystems() { - //no instance - } - - /** - * {@return the arch in native library path} - */ - public static String getNativeLibArch() { - var os = OperatingSystem.current(); - var arch = System.getProperty("os.arch").toLowerCase(Locale.ROOT); - if (os == LINUX) { - return arch.startsWith("arm") || arch.startsWith("aarch64") ? - (arch.contains("64") || arch.startsWith("armv8") ? "arm64" : "arm32") : - "x64"; - } - if (os == MAC_OS || (os == WINDOWS && arch.contains("64"))) { - return arch.startsWith("aarch64") ? "arm64" : "x64"; - } - throw new IllegalStateException(STR."Doesn't support to os \{os} or arch \{arch}; only support to Linux, macOS and Windows"); - } -} diff --git a/modules/overrungl.core/src/main/java/overrungl/os/Platform.java b/modules/overrungl.core/src/main/java/overrungl/os/Platform.java new file mode 100644 index 00000000..d833d158 --- /dev/null +++ b/modules/overrungl.core/src/main/java/overrungl/os/Platform.java @@ -0,0 +1,185 @@ +/* + * MIT License + * + * Copyright (c) 2023 Overrun Organization + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + */ + +package overrungl.os; + +/** + * The native platform, identifying the operating system and the architecture. + * + * @author squid233 + * @since 0.1.0 + */ +public sealed interface Platform { + /** + * {@return the current native platform} + */ + static Platform current() { + class Holder { + private static final Platform CURRENT; + + static { + final String os = System.getProperty("os.name"); + if (os.startsWith("Linux") || os.startsWith("FreeBSD") || os.startsWith("SunOS") || os.startsWith("Unit")) + CURRENT = Linux.INSTANCE; + else if (os.startsWith("Mac OS X") || os.startsWith("Darwin")) + CURRENT = MacOSX.INSTANCE; + else if (os.startsWith("Windows")) + CURRENT = Windows.INSTANCE; + else throw new IllegalStateException("Unrecognized or unsupported platform: " + os); + } + } + return Holder.CURRENT; + } + + /** + * {@return the family name of this platform} + */ + String familyName(); + + /** + * {@return the suffix of shared library on this platform, including dot} + */ + String sharedLibrarySuffix(); + + /** + * Converts the given library name for this platform. + * + * @param libraryName the original library name. + * @return the processed library name. + */ + String sharedLibraryName(String libraryName); + + /** + * Linux + * + * @author squid233 + * @since 0.1.0 + */ + final class Linux implements Platform { + private static final Linux INSTANCE = new Linux(); + + @Override + public String familyName() { + return "linux"; + } + + @Override + public String sharedLibrarySuffix() { + return ".so"; + } + + @Override + public String sharedLibraryName(String libraryName) { + return Platform.unixSharedLibraryName(libraryName, sharedLibrarySuffix()); + } + } + + /** + * Mac OS X + * + * @author squid233 + * @since 0.1.0 + */ + final class MacOSX implements Platform { + private static final MacOSX INSTANCE = new MacOSX(); + + @Override + public String familyName() { + return "macos"; + } + + @Override + public String sharedLibrarySuffix() { + return ".dylib"; + } + + @Override + public String sharedLibraryName(String libraryName) { + return Platform.unixSharedLibraryName(libraryName, sharedLibrarySuffix()); + } + } + + /** + * Windows + * + * @author squid233 + * @since 0.1.0 + */ + final class Windows implements Platform { + private static final Windows INSTANCE = new Windows(); + + @Override + public String familyName() { + return "windows"; + } + + @Override + public String sharedLibrarySuffix() { + return ".dll"; + } + + @Override + public String sharedLibraryName(String libraryName) { + return Platform.withExtension(libraryName, sharedLibrarySuffix()); + } + } + + private static String unixSharedLibraryName(String libraryName, String suffix) { + if (libraryName.endsWith(suffix)) { + return libraryName; + } + int pos = libraryName.lastIndexOf('/'); + if (pos >= 0) { + return libraryName.substring(0, pos + 1) + "lib" + libraryName.substring(pos + 1) + suffix; + } + return "lib" + libraryName + suffix; + } + + /** + * Returns a representation of the file path with an alternate extension. If the file path has no extension, + * then the provided extension is simply concatenated. If the file path has an extension, the extension is + * stripped and replaced with the provided extension. + *

+ * e.g. with a provided extension of ".bar" + * foo -> foo.bar + * foo.baz -> foo.bar + * + * @param filePath the file path to transform + * @param extension the extension to use in the transformed path + * @return the transformed path + */ + private static String withExtension(String filePath, String extension) { + if (filePath.toLowerCase().endsWith(extension)) { + return filePath; + } + return removeExtension(filePath) + extension; + } + + /** + * Removes the extension (if any) from the file path. If the file path has no extension, then it returns the same string. + * + * @return the file path without an extension + */ + private static String removeExtension(String filePath) { + int fileNameStart = Math.max(filePath.lastIndexOf('/'), filePath.lastIndexOf('\\')); + int extensionPos = filePath.lastIndexOf('.'); + + if (extensionPos > fileNameStart) { + return filePath.substring(0, extensionPos); + } + return filePath; + } +} diff --git a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java index 11c6e557..14ccc1f7 100644 --- a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java +++ b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java @@ -20,7 +20,7 @@ import overrungl.NativeType; import overrungl.OverrunGL; import overrungl.internal.RuntimeHelper; -import overrungl.os.OperatingSystem; +import overrungl.os.Platform; import overrungl.util.MemoryStack; import overrungl.util.value.Tuple2; @@ -120,9 +120,9 @@ */ public final class NFD { private static final SymbolLookup LOOKUP = RuntimeHelper.load("nfd", "nfd", OverrunGL.VERSION); - private static final OperatingSystem os = OperatingSystem.current(); - private static final boolean isOsWin = os.isWindows(); - private static final boolean isOsWinOrApple = os.isWindows() || os.isMacOsX(); + private static final Platform os = Platform.current(); + private static final boolean isOsWin = os instanceof Platform.Windows; + private static final boolean isOsWinOrApple = isOsWin || os instanceof Platform.MacOSX; /** * The type of the path-set size ({@code long} for Windows and Mac OS X, {@code int} for others). */ From ba12dba858fe1bf10ac67d2b979d256a6ebf0e90 Mon Sep 17 00:00:00 2001 From: squid233 <60126026+squid233@users.noreply.github.com> Date: Sun, 30 Jul 2023 17:25:36 +0800 Subject: [PATCH 03/14] Update README.md --- .github/ISSUE_TEMPLATE/feature_request.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 76e9c8a8..de5ea061 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,7 +1,7 @@ name: Feature request description: Suggest an idea for this project title: "Feature: " -labels: [ "enhancement", "P4" ] +labels: [ "enhancement", "P5" ] assignees: - "squid233" body: diff --git a/README.md b/README.md index cd23597d..9afaa80d 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ unstable, so you have to use `-SNAPSHOT` version. You can import with `io.github.over-run:overrungl-bom:{the version}` and other submodules. -We will provide a module customizer soon. +We have provided an artifacts customizer [here](https://over-run.github.io/overrungl-gen/). ### Using -SNAPSHOT Versions From a6f43dc43b10cc71113d87307bb7d107a420e27e Mon Sep 17 00:00:00 2001 From: squid233 <60126026+squid233@users.noreply.github.com> Date: Mon, 31 Jul 2023 22:34:43 +0800 Subject: [PATCH 04/14] Load native library from specified path first --- .../overrungl/internal/RuntimeHelper.java | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/modules/overrungl.core/src/main/java/overrungl/internal/RuntimeHelper.java b/modules/overrungl.core/src/main/java/overrungl/internal/RuntimeHelper.java index 90573bd8..570bcf6d 100644 --- a/modules/overrungl.core/src/main/java/overrungl/internal/RuntimeHelper.java +++ b/modules/overrungl.core/src/main/java/overrungl/internal/RuntimeHelper.java @@ -155,8 +155,12 @@ public static SymbolLookup load(String module, String basename, String version) final var suffix = os.sharedLibrarySuffix(); final var path = os.sharedLibraryName(basename); URI uri; - // 1. Load from classpath - try { + // 1. Load from natives directory + var localFile = new File(System.getProperty("overrungl.natives", "."), path); + if (localFile.exists()) { + uri = localFile.toURI(); + } else { + // 2. Load from classpath var file = new File(tmpdir, "overrungl" + System.getProperty("user.name")); if (!file.exists()) { // Create directory @@ -174,18 +178,13 @@ public static SymbolLookup load(String module, String basename, String version) module + "/" + os.familyName() + "/" + Architecture.current() + "/" + path )) { Files.copy(Objects.requireNonNull(is), Path.of(libFile.getAbsolutePath())); + } catch (Exception e) { + var exception = new IllegalStateException("File not found: " + file + "; try setting property -Doverrungl.natives to a valid path"); + exception.addSuppressed(e); + throw exception; } } uri = libFile.toURI(); - } catch (Exception e) { - // 2. Load from natives directory - var file = new File(System.getProperty("overrungl.natives", "."), path); - if (!file.exists()) { - var exception = new IllegalStateException("File not found: " + file + "; Try setting property -Doverrungl.natives to a valid path"); - exception.addSuppressed(e); - throw exception; - } - uri = file.toURI(); } // Load the library by the path with the global arena return SymbolLookup.libraryLookup(Path.of(uri), Arena.global()); From 229c299b8c6cf0de92b9174840ece71d846598cc Mon Sep 17 00:00:00 2001 From: squid233 <60126026+squid233@users.noreply.github.com> Date: Tue, 1 Aug 2023 17:36:36 +0800 Subject: [PATCH 05/14] [Core] Fix ExceptionInInitializerError --- .../src/main/java/overrungl/FunctionDescriptors.java | 5 ++--- .../src/main/java/overrungl/util/MemoryUtil.java | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/modules/overrungl.core/src/main/java/overrungl/FunctionDescriptors.java b/modules/overrungl.core/src/main/java/overrungl/FunctionDescriptors.java index 021b5e61..77b8d514 100644 --- a/modules/overrungl.core/src/main/java/overrungl/FunctionDescriptors.java +++ b/modules/overrungl.core/src/main/java/overrungl/FunctionDescriptors.java @@ -16,7 +16,7 @@ package overrungl; -import overrungl.internal.RuntimeHelper; +import overrungl.util.MemoryUtil; import java.lang.foreign.FunctionDescriptor; import java.lang.foreign.ValueLayout; @@ -25,7 +25,6 @@ /** * The function descriptors. - * *

Mappings

* {@snippet lang = java: * switch (c) { @@ -123,7 +122,7 @@ public static ValueLayout ofValue(char c) throws IllegalArgumentException { case 'F' -> JAVA_FLOAT; case 'D' -> JAVA_DOUBLE; case 'P' -> ADDRESS; - case 'p' -> RuntimeHelper.ADDRESS_UNBOUNDED; + case 'p' -> MemoryUtil.ADDRESS_UNBOUNDED; default -> throw new IllegalArgumentException( STR."Invalid argument c: expected one of B, S, I, J, C, Z, F, D, P or p; got '\{c}'" diff --git a/modules/overrungl.core/src/main/java/overrungl/util/MemoryUtil.java b/modules/overrungl.core/src/main/java/overrungl/util/MemoryUtil.java index 7f1d60d0..9c35282b 100644 --- a/modules/overrungl.core/src/main/java/overrungl/util/MemoryUtil.java +++ b/modules/overrungl.core/src/main/java/overrungl/util/MemoryUtil.java @@ -34,6 +34,10 @@ * @since 0.1.0 */ public final class MemoryUtil { + /** + * An unbounded address layout. + */ + public static final AddressLayout ADDRESS_UNBOUNDED = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(ValueLayout.JAVA_BYTE)); private static final SymbolLookup LOOKUP = RuntimeHelper.LINKER.defaultLookup(); private static final MethodHandle m_malloc = downcall("malloc", JP), @@ -48,10 +52,6 @@ public final class MemoryUtil { * The address of {@code NULL}. */ public static final long NULL = 0x0L; - /** - * An unbounded address layout. - */ - public static final AddressLayout ADDRESS_UNBOUNDED = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(ValueLayout.JAVA_BYTE)); private static MethodHandle downcall(String name, FunctionDescriptors function) { return RuntimeHelper.downcallThrow(LOOKUP.find(name), function); From 40e1b3c59d00e9f791daadae0f619d3beee73b45 Mon Sep 17 00:00:00 2001 From: squid233 <60126026+squid233@users.noreply.github.com> Date: Wed, 9 Aug 2023 13:21:39 +0800 Subject: [PATCH 06/14] [Core] Removed CheckUtil::checkNotNull --- .../main/java/overrungl/util/CheckUtil.java | 39 ------------------- .../java/overrungl/opengl/GLLoadFunc.java | 5 +-- .../demo/glfw/GLFWWindowIconTest.java | 3 +- .../java/overrungl/demo/opengl/GL10Test.java | 3 +- .../java/overrungl/demo/opengl/GL15Test.java | 3 +- .../java/overrungl/demo/opengl/GL30Test.java | 3 +- .../java/overrungl/demo/opengl/GL33Test.java | 3 +- 7 files changed, 12 insertions(+), 47 deletions(-) diff --git a/modules/overrungl.core/src/main/java/overrungl/util/CheckUtil.java b/modules/overrungl.core/src/main/java/overrungl/util/CheckUtil.java index cef3861e..058d20c3 100644 --- a/modules/overrungl.core/src/main/java/overrungl/util/CheckUtil.java +++ b/modules/overrungl.core/src/main/java/overrungl/util/CheckUtil.java @@ -107,43 +107,4 @@ public static void checkNotNullptr(MemorySegment segment, Supplier messa public static void checkNotNullptr(MemorySegment segment, String message) throws IllegalStateException { if (MemoryUtil.isNullptr(segment)) throw new IllegalStateException(message); } - - /** - * Checks whether the given object is not {@code null}. - * - * @param o the object. - * @throws IllegalStateException if {@code object} is {@code null}. - * @see #checkNotNull(Object, Supplier) - * @see #checkNotNull(Object, String) - */ - public static void checkNotNull(Object o) throws IllegalStateException { - checkNotNull(o, "condition == false"); - } - - /** - * Checks whether the given object is not {@code null}. The message of the exception is wrapped in a supplier - * to avoid side effect. - * - * @param o the object. - * @param messageSupplier the message supplier of the exception. - * @throws IllegalStateException if {@code object} is {@code null}. - * @see #checkNotNull(Object) - * @see #checkNotNull(Object, String) - */ - public static void checkNotNull(Object o, Supplier messageSupplier) throws IllegalStateException { - if (o == null) throw new IllegalStateException(messageSupplier.get()); - } - - /** - * Checks whether the given object is not {@code null}. - * - * @param o the object. - * @param message the message of the exception. - * @throws IllegalStateException if {@code object} is {@code null}. - * @see #checkNotNull(Object) - * @see #checkNotNull(Object, Supplier) - */ - public static void checkNotNull(Object o, String message) throws IllegalStateException { - if (o == null) throw new IllegalStateException(message); - } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLLoadFunc.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLLoadFunc.java index ad225af9..bfe76fd0 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLLoadFunc.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLLoadFunc.java @@ -26,12 +26,11 @@ /** * The OpenGL loading function. - * *

Example

* {@snippet lang = java: * // loads OpenGL forward-compatible profile - * import overrungl.util.CheckUtil; - * CheckUtil.checkNotNull(GLLoader.load(GLFW::getProcAddress, true), "Failed to load OpenGL"); + * import java.util.Objects; + * Objects.requireNonNull(GLLoader.load(GLFW::getProcAddress, true), "Failed to load OpenGL"); * } * * @author squid233 diff --git a/modules/samples/src/test/java/overrungl/demo/glfw/GLFWWindowIconTest.java b/modules/samples/src/test/java/overrungl/demo/glfw/GLFWWindowIconTest.java index 127f4f22..debe9522 100644 --- a/modules/samples/src/test/java/overrungl/demo/glfw/GLFWWindowIconTest.java +++ b/modules/samples/src/test/java/overrungl/demo/glfw/GLFWWindowIconTest.java @@ -29,6 +29,7 @@ import java.io.IOException; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; +import java.util.Objects; import static java.lang.foreign.ValueLayout.JAVA_INT; @@ -105,7 +106,7 @@ private void init(Arena arena) { } private void load() { - CheckUtil.checkNotNull(GLLoader.load(GLFW::getProcAddress, true), "Failed to load OpenGL"); + Objects.requireNonNull(GLLoader.load(GLFW::getProcAddress, true), "Failed to load OpenGL"); GL.clearColor(0.4f, 0.6f, 0.9f, 1.0f); } diff --git a/modules/samples/src/test/java/overrungl/demo/opengl/GL10Test.java b/modules/samples/src/test/java/overrungl/demo/opengl/GL10Test.java index 1b1cbdf7..98b5774f 100644 --- a/modules/samples/src/test/java/overrungl/demo/opengl/GL10Test.java +++ b/modules/samples/src/test/java/overrungl/demo/opengl/GL10Test.java @@ -25,6 +25,7 @@ import overrungl.util.CheckUtil; import java.lang.foreign.MemorySegment; +import java.util.Objects; /** * Tests basic GLFW and OpenGL @@ -79,7 +80,7 @@ private void init() { } private void load() { - CheckUtil.checkNotNull(GLLoader.load(GLFW::getProcAddress), "Failed to load OpenGL"); + Objects.requireNonNull(GLLoader.load(GLFW::getProcAddress), "Failed to load OpenGL"); GL.clearColor(0.4f, 0.6f, 0.9f, 1.0f); } diff --git a/modules/samples/src/test/java/overrungl/demo/opengl/GL15Test.java b/modules/samples/src/test/java/overrungl/demo/opengl/GL15Test.java index 025c0ce1..0b099931 100644 --- a/modules/samples/src/test/java/overrungl/demo/opengl/GL15Test.java +++ b/modules/samples/src/test/java/overrungl/demo/opengl/GL15Test.java @@ -29,6 +29,7 @@ import java.io.IOException; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; +import java.util.Objects; import static java.lang.foreign.ValueLayout.JAVA_INT; @@ -91,7 +92,7 @@ private void init() { } private void load(Arena arena) { - CheckUtil.checkNotNull(GLLoader.load(GLFW::getProcAddress), "Failed to load OpenGL"); + Objects.requireNonNull(GLLoader.load(GLFW::getProcAddress), "Failed to load OpenGL"); GL.clearColor(0.4f, 0.6f, 0.9f, 1.0f); GL.enable(GL.TEXTURE_2D); diff --git a/modules/samples/src/test/java/overrungl/demo/opengl/GL30Test.java b/modules/samples/src/test/java/overrungl/demo/opengl/GL30Test.java index c9a39a86..e18537d6 100644 --- a/modules/samples/src/test/java/overrungl/demo/opengl/GL30Test.java +++ b/modules/samples/src/test/java/overrungl/demo/opengl/GL30Test.java @@ -29,6 +29,7 @@ import java.io.IOException; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; +import java.util.Objects; import static java.lang.foreign.ValueLayout.JAVA_INT; @@ -97,7 +98,7 @@ private void init() { } private void load(Arena arena) { - CheckUtil.checkNotNull(GLLoader.load(GLFW::getProcAddress, true), "Failed to load OpenGL"); + Objects.requireNonNull(GLLoader.load(GLFW::getProcAddress, true), "Failed to load OpenGL"); GL.clearColor(0.4f, 0.6f, 0.9f, 1.0f); diff --git a/modules/samples/src/test/java/overrungl/demo/opengl/GL33Test.java b/modules/samples/src/test/java/overrungl/demo/opengl/GL33Test.java index 307c9e50..751463b9 100644 --- a/modules/samples/src/test/java/overrungl/demo/opengl/GL33Test.java +++ b/modules/samples/src/test/java/overrungl/demo/opengl/GL33Test.java @@ -31,6 +31,7 @@ import java.lang.foreign.Arena; import java.lang.foreign.MemoryLayout; import java.lang.foreign.MemorySegment; +import java.util.Objects; /** * Tests OpenGL 3.3 instanced rendering @@ -109,7 +110,7 @@ private void init() { } private void load(Arena arena) { - CheckUtil.checkNotNull(GLLoader.load(GLFW::getProcAddress, true), "Failed to load OpenGL"); + Objects.requireNonNull(GLLoader.load(GLFW::getProcAddress, true), "Failed to load OpenGL"); debugProc = GLUtil.setupDebugMessageCallback(); GL.clearColor(0.4f, 0.6f, 0.9f, 1.0f); From 381c7432b10762de2fbeed81220570777be4c243 Mon Sep 17 00:00:00 2001 From: squid233 <60126026+squid233@users.noreply.github.com> Date: Wed, 9 Aug 2023 17:10:49 +0800 Subject: [PATCH 07/14] [Core] Update MemoryStack (#30) - [Core] Added value variants of MemoryStack::malloc and ::calloc - [Core] Removed MemoryStack::nmalloc - [Core] Removed container of MemoryStack - [Core] Make MemoryStack implement Arena --- .../main/java/overrungl/util/MemoryStack.java | 257 ++++++++++++++---- .../src/main/java/overrungl/glfw/GLFW.java | 125 ++++----- .../main/java/overrungl/glfw/GLFWNative.java | 16 +- .../main/java/overrungl/glfw/GLFWVulkan.java | 2 +- .../src/main/java/overrungl/nfd/NFD.java | 20 +- .../src/main/java/overrungl/opengl/GL10.java | 27 +- .../src/main/java/overrungl/opengl/GL10C.java | 14 +- .../src/main/java/overrungl/opengl/GL11C.java | 4 +- .../src/main/java/overrungl/opengl/GL15C.java | 14 +- .../src/main/java/overrungl/opengl/GL20C.java | 14 +- .../src/main/java/overrungl/opengl/GL30C.java | 24 +- .../src/main/java/overrungl/opengl/GL31C.java | 2 +- .../src/main/java/overrungl/opengl/GL32C.java | 8 +- .../src/main/java/overrungl/opengl/GL33C.java | 14 +- .../src/main/java/overrungl/opengl/GL40C.java | 10 +- .../src/main/java/overrungl/opengl/GL41C.java | 12 +- .../src/main/java/overrungl/opengl/GL42C.java | 4 +- .../src/main/java/overrungl/opengl/GL43C.java | 6 +- .../src/main/java/overrungl/opengl/GL45C.java | 50 ++-- .../opengl/ext/GLINTELPerformanceQuery.java | 6 +- .../opengl/ext/GLMESAFramebufferFlipY.java | 4 +- .../opengl/ext/amd/GLAMDNameGenDelete.java | 2 +- .../ext/amd/GLAMDPerformanceMonitor.java | 2 +- .../opengl/ext/apple/GLAPPLEFence.java | 2 +- .../ext/apple/GLAPPLEVertexArrayObject.java | 2 +- .../opengl/ext/arb/GLARBFragmentProgram.java | 2 +- .../src/main/java/overrungl/stb/STBImage.java | 70 ++--- .../test/java/overrungl/demo/nfd/NFDTest.java | 4 +- 28 files changed, 433 insertions(+), 284 deletions(-) diff --git a/modules/overrungl.core/src/main/java/overrungl/util/MemoryStack.java b/modules/overrungl.core/src/main/java/overrungl/util/MemoryStack.java index de8c5067..7c7c664d 100644 --- a/modules/overrungl.core/src/main/java/overrungl/util/MemoryStack.java +++ b/modules/overrungl.core/src/main/java/overrungl/util/MemoryStack.java @@ -16,7 +16,6 @@ package overrungl.util; -import org.jetbrains.annotations.Nullable; import overrungl.Configurations; import overrungl.OverrunGL; import overrungl.Pointer; @@ -39,7 +38,7 @@ * @see Configurations#DEBUG_STACK * @since 0.1.0 */ -public sealed class MemoryStack extends Pointer implements SegmentAllocator, AutoCloseable { +public sealed class MemoryStack extends Pointer implements Arena { private static final boolean CHECKS = Configurations.CHECKS.get(); private static final boolean DEBUG = Configurations.DEBUG.get(); private static final boolean DEBUG_STACK = Configurations.DEBUG_STACK.get(); @@ -52,10 +51,6 @@ public sealed class MemoryStack extends Pointer implements SegmentAllocator, Aut CheckUtil.check(DEFAULT_STACK_FRAMES > 0, "Invalid stack frames."); } - @SuppressWarnings({"FieldCanBeLocal", "unused"}) - @Nullable - private final MemorySegment container; - private final long size; private long pointer; @@ -68,13 +63,11 @@ public sealed class MemoryStack extends Pointer implements SegmentAllocator, Aut * *

In the initial state, there is no active stack frame. The {@link #push} method must be used before any allocations.

* - * @param container the backing memory buffer, may be null - * @param address the backing memory address - * @param size the backing memory size + * @param address the backing memory address + * @param size the backing memory size */ - protected MemoryStack(@Nullable MemorySegment container, MemorySegment address, long size) { + protected MemoryStack(MemorySegment address, long size) { super(address); - this.container = container; this.size = size; this.pointer = size; @@ -124,22 +117,8 @@ public static MemoryStack create(long capacity, Arena arena) { */ public static MemoryStack create(MemorySegment buffer, long size) { return DEBUG_STACK - ? new DebugMemoryStack(buffer, buffer, size) - : new MemoryStack(buffer, buffer, size); - } - - /** - * Creates a new {@code MemoryStack} backed by the specified memory region. - * - *

In the initial state, there is no active stack frame. The {@link #push} method must be used before any allocations.

- * - * @param address the backing memory address - * @param size the backing memory size - */ - public static MemoryStack ncreate(MemorySegment address, long size) { - return DEBUG_STACK - ? new DebugMemoryStack(null, address, size) - : new MemoryStack(null, address, size); + ? new DebugMemoryStack(buffer, size) + : new MemoryStack(buffer, size); } /** @@ -183,6 +162,11 @@ public MemoryStack pop() { return this; } + @Override + public MemorySegment.Scope scope() { + return address().scope(); + } + /** * Calls {@link #pop} on this {@code MemoryStack}. * @@ -202,8 +186,8 @@ public void close() { private static final class DebugMemoryStack extends MemoryStack { private Object[] debugFrames; - DebugMemoryStack(@Nullable MemorySegment buffer, MemorySegment address, long size) { - super(buffer, address, size); + DebugMemoryStack(MemorySegment address, long size) { + super(address, size); debugFrames = new Object[DEFAULT_STACK_FRAMES]; } @@ -326,7 +310,11 @@ private void checkPointer(long pointer) { * @param size the allocation size * @return the memory address on the stack for the requested allocation */ - public MemorySegment nmalloc(long alignment, long size) { + public MemorySegment malloc(long alignment, long size) { + if (DEBUG) { + MemoryUtil.checkAlignment(alignment); + } + // Align address to the specified alignment long rawLong = address().address(); long address = (rawLong + pointer - size) & -alignment; @@ -349,35 +337,22 @@ public MemorySegment nmalloc(long alignment, long size) { * @return the memory address on the stack for the requested allocation */ public MemorySegment ncalloc(long alignment, long num, long size) { + if (DEBUG) { + MemoryUtil.checkAlignment(alignment); + } + long bytes = num * size; - var address = nmalloc(alignment, bytes); + var address = malloc(alignment, bytes); address.fill((byte) 0); return address; } // ------------------------------------------------- - /** - * Allocates an aligned {@link MemorySegment} on the stack. - * - * @param alignment the required buffer alignment - * @param size the number of elements in the buffer - * @return the allocated buffer - */ - public MemorySegment malloc(long alignment, long size) { - if (DEBUG) { - MemoryUtil.checkAlignment(alignment); - } - return nmalloc(alignment, size); - } - /** * Calloc version of {@link #malloc(long, long)}. */ public MemorySegment calloc(long alignment, long size) { - if (DEBUG) { - MemoryUtil.checkAlignment(alignment); - } return ncalloc(alignment, 1, size); } @@ -388,28 +363,200 @@ public MemorySegment calloc(long alignment, long size) { * @return the memory address on the stack for the requested allocation */ public MemorySegment malloc(long size) { - return nmalloc(ADDRESS.byteSize(), size); + return malloc(ADDRESS.byteAlignment(), size); + } + + public MemorySegment malloc(MemoryLayout layout, long num) { + return malloc(layout.byteAlignment(), num * layout.byteSize()); } public MemorySegment malloc(MemoryLayout layout) { - return malloc(layout.byteSize()); + return malloc(layout.byteAlignment(), layout.byteSize()); } /** * Calloc version of {@link #malloc(long)}. */ public MemorySegment calloc(long size) { - return ncalloc(ADDRESS.byteSize(), 1, size); + return ncalloc(ADDRESS.byteAlignment(), 1, size); } public MemorySegment calloc(MemoryLayout layout, long num) { - return ncalloc(ADDRESS.byteSize(), num, layout.byteSize()); + return ncalloc(layout.byteAlignment(), num, layout.byteSize()); } public MemorySegment calloc(MemoryLayout layout) { return calloc(layout, 1); } + /** + * Short version of {@link #malloc(long)}. + */ + public MemorySegment mallocShort(long size) { + return malloc(JAVA_SHORT, size); + } + + /** + * Short version of {@link #calloc(long)}. + */ + public MemorySegment callocShort(long size) { + return calloc(JAVA_SHORT, size); + } + + /** + * Int version of {@link #malloc(long)}. + */ + public MemorySegment mallocInt(long size) { + return malloc(JAVA_INT, size); + } + + /** + * Int version of {@link #calloc(long)}. + */ + public MemorySegment callocInt(long size) { + return calloc(JAVA_INT, size); + } + + /** + * Long version of {@link #malloc(long)}. + */ + public MemorySegment mallocLong(long size) { + return malloc(JAVA_LONG, size); + } + + /** + * Long version of {@link #calloc(long)}. + */ + public MemorySegment callocLong(long size) { + return calloc(JAVA_LONG, size); + } + + /** + * Float version of {@link #malloc(long)}. + */ + public MemorySegment mallocFloat(long size) { + return malloc(JAVA_FLOAT, size); + } + + /** + * Float version of {@link #calloc(long)}. + */ + public MemorySegment callocFloat(long size) { + return calloc(JAVA_FLOAT, size); + } + + /** + * Double version of {@link #malloc(long)}. + */ + public MemorySegment mallocDouble(long size) { + return malloc(JAVA_DOUBLE, size); + } + + /** + * Double version of {@link #calloc(long)}. + */ + public MemorySegment callocDouble(long size) { + return calloc(JAVA_DOUBLE, size); + } + + /** + * Pointer version of {@link #malloc(long)}. + */ + public MemorySegment mallocPointer(long size) { + return malloc(ADDRESS, size); + } + + /** + * Pointer version of {@link #calloc(long)}. + */ + public MemorySegment callocPointer(long size) { + return calloc(ADDRESS, size); + } + + /** + * Short version of {@link #malloc(long)}. + */ + public MemorySegment mallocShort() { + return malloc(JAVA_SHORT, 1); + } + + /** + * Short version of {@link #calloc(long)}. + */ + public MemorySegment callocShort() { + return calloc(JAVA_SHORT, 1); + } + + /** + * Int version of {@link #malloc(long)}. + */ + public MemorySegment mallocInt() { + return malloc(JAVA_INT, 1); + } + + /** + * Int version of {@link #calloc(long)}. + */ + public MemorySegment callocInt() { + return calloc(JAVA_INT, 1); + } + + /** + * Long version of {@link #malloc(long)}. + */ + public MemorySegment mallocLong() { + return malloc(JAVA_LONG, 1); + } + + /** + * Long version of {@link #calloc(long)}. + */ + public MemorySegment callocLong() { + return calloc(JAVA_LONG, 1); + } + + /** + * Float version of {@link #malloc(long)}. + */ + public MemorySegment mallocFloat() { + return malloc(JAVA_FLOAT, 1); + } + + /** + * Float version of {@link #calloc(long)}. + */ + public MemorySegment callocFloat() { + return calloc(JAVA_FLOAT, 1); + } + + /** + * Double version of {@link #malloc(long)}. + */ + public MemorySegment mallocDouble() { + return malloc(JAVA_DOUBLE, 1); + } + + /** + * Double version of {@link #calloc(long)}. + */ + public MemorySegment callocDouble() { + return calloc(JAVA_DOUBLE, 1); + } + + /** + * Pointer version of {@link #malloc(long)}. + */ + public MemorySegment mallocPointer() { + return malloc(ADDRESS, 1); + } + + /** + * Pointer version of {@link #calloc(long)}. + */ + public MemorySegment callocPointer() { + return calloc(ADDRESS, 1); + } + @Override public MemorySegment allocate(long byteSize, long byteAlignment) throws IllegalArgumentException { MemoryUtil.checkByteSize(byteSize); @@ -818,10 +965,10 @@ public static MemoryStack stackPop() { } /** - * Thread-local version of {@link #nmalloc(long, long)}. + * Thread-local version of {@link #malloc(long, long)}. */ - public static MemorySegment nstackMalloc(long alignment, long size) { - return stackGet().nmalloc(alignment, size); + public static MemorySegment stackMalloc(long alignment, long size) { + return stackGet().malloc(alignment, size); } /** diff --git a/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFW.java b/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFW.java index 4011e222..bfc4465a 100644 --- a/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFW.java +++ b/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFW.java @@ -26,6 +26,7 @@ import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; +import java.lang.invoke.VarHandle; import static java.lang.foreign.ValueLayout.*; import static overrungl.glfw.Handles.*; @@ -1007,9 +1008,9 @@ public static void getVersion(int @Nullable [] major, int @Nullable [] minor, in var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pMajor = major != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; - var pMinor = minor != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; - var pRev = rev != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; + var pMajor = major != null ? stack.callocInt() : MemorySegment.NULL; + var pMinor = minor != null ? stack.callocInt() : MemorySegment.NULL; + var pRev = rev != null ? stack.callocInt() : MemorySegment.NULL; ngetVersion(pMajor, pMinor, pRev); if (major != null && major.length > 0) { major[0] = pMajor.get(JAVA_INT, 0); @@ -1035,9 +1036,9 @@ public static Triplet.OfInt getVersion() { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pMajor = stack.calloc(JAVA_INT); - var pMinor = stack.calloc(JAVA_INT); - var pRev = stack.calloc(JAVA_INT); + var pMajor = stack.callocInt(); + var pMinor = stack.callocInt(); + var pRev = stack.callocInt(); ngetVersion(pMajor, pMinor, pRev); return new Triplet.OfInt(pMajor.get(JAVA_INT, 0), pMinor.get(JAVA_INT, 0), @@ -1122,7 +1123,7 @@ public static int getError(String @Nullable [] description) { final MemoryStack stack = MemoryStack.stackGet(); final long stackPointer = stack.getPointer(); try { - final MemorySegment seg = description != null ? stack.malloc(ADDRESS) : MemorySegment.NULL; + final MemorySegment seg = description != null ? stack.mallocPointer() : MemorySegment.NULL; final int err = ngetError(seg); if (description != null && description.length > 0) { description[0] = RuntimeHelper.unboundPointerString(seg); @@ -1143,7 +1144,7 @@ public static Tuple2.OfObjInt getError() { final MemoryStack stack = MemoryStack.stackGet(); final long stackPointer = stack.getPointer(); try { - final MemorySegment seg = stack.malloc(ADDRESS); + final MemorySegment seg = stack.mallocPointer(); final int err = ngetError(seg); return new Tuple2.OfObjInt<>(RuntimeHelper.unboundPointerString(seg), err); } finally { @@ -1235,7 +1236,7 @@ public static MemorySegment ngetMonitors(MemorySegment count) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pCount = stack.calloc(JAVA_INT); + var pCount = stack.callocInt(); var pMonitors = ngetMonitors(pCount); return RuntimeHelper.isNullptr(pMonitors) ? null : @@ -1303,8 +1304,8 @@ public static void getMonitorPos(MemorySegment monitor, int @Nullable [] xpos, i var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var px = xpos != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; - var py = ypos != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; + var px = xpos != null ? stack.callocInt() : MemorySegment.NULL; + var py = ypos != null ? stack.callocInt() : MemorySegment.NULL; ngetMonitorPos(monitor, px, py); if (xpos != null && xpos.length > 0) { xpos[0] = px.get(JAVA_INT, 0); @@ -1328,8 +1329,8 @@ public static Pair.OfInt getMonitorPos(MemorySegment monitor) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var px = stack.calloc(JAVA_INT); - var py = stack.calloc(JAVA_INT); + var px = stack.callocInt(); + var py = stack.callocInt(); ngetMonitorPos(monitor, px, py); return new Pair.OfInt(px.get(JAVA_INT, 0), py.get(JAVA_INT, 0)); } finally { @@ -1381,10 +1382,10 @@ public static void getMonitorWorkarea(MemorySegment monitor, int @Nullable [] xp var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var px = xpos != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; - var py = ypos != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; - var pw = width != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; - var ph = height != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; + var px = xpos != null ? stack.callocInt() : MemorySegment.NULL; + var py = ypos != null ? stack.callocInt() : MemorySegment.NULL; + var pw = width != null ? stack.callocInt() : MemorySegment.NULL; + var ph = height != null ? stack.callocInt() : MemorySegment.NULL; ngetMonitorWorkarea(monitor, px, py, pw, ph); if (xpos != null && xpos.length > 0) { xpos[0] = px.get(JAVA_INT, 0); @@ -1414,10 +1415,10 @@ public static Quad.OfInt getMonitorWorkarea(MemorySegment monitor) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var px = stack.calloc(JAVA_INT); - var py = stack.calloc(JAVA_INT); - var pw = stack.calloc(JAVA_INT); - var ph = stack.calloc(JAVA_INT); + var px = stack.callocInt(); + var py = stack.callocInt(); + var pw = stack.callocInt(); + var ph = stack.callocInt(); ngetMonitorWorkarea(monitor, px, py, pw, ph); return new Quad.OfInt(px.get(JAVA_INT, 0), py.get(JAVA_INT, 0), @@ -1474,8 +1475,8 @@ public static void getMonitorPhysicalSize(MemorySegment monitor, int @Nullable [ var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pw = widthMM != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; - var ph = heightMM != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; + var pw = widthMM != null ? stack.callocInt() : MemorySegment.NULL; + var ph = heightMM != null ? stack.callocInt() : MemorySegment.NULL; ngetMonitorPhysicalSize(monitor, pw, ph); if (widthMM != null && widthMM.length > 0) { widthMM[0] = pw.get(JAVA_INT, 0); @@ -1499,8 +1500,8 @@ public static Pair.OfInt getMonitorPhysicalSize(MemorySegment monitor) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pw = stack.calloc(JAVA_INT); - var ph = stack.calloc(JAVA_INT); + var pw = stack.callocInt(); + var ph = stack.callocInt(); ngetMonitorPhysicalSize(monitor, pw, ph); return new Pair.OfInt(pw.get(JAVA_INT, 0), ph.get(JAVA_INT, 0)); } finally { @@ -1551,8 +1552,8 @@ public static void getMonitorContentScale(MemorySegment monitor, float @Nullable var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var px = xscale != null ? stack.calloc(JAVA_FLOAT) : MemorySegment.NULL; - var py = yscale != null ? stack.calloc(JAVA_FLOAT) : MemorySegment.NULL; + var px = xscale != null ? stack.callocFloat() : MemorySegment.NULL; + var py = yscale != null ? stack.callocFloat() : MemorySegment.NULL; ngetMonitorContentScale(monitor, px, py); if (xscale != null && xscale.length > 0) { xscale[0] = px.get(JAVA_FLOAT, 0); @@ -1576,8 +1577,8 @@ public static Pair.OfFloat getMonitorContentScale(MemorySegment monitor) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var px = stack.calloc(JAVA_FLOAT); - var py = stack.calloc(JAVA_FLOAT); + var px = stack.callocFloat(); + var py = stack.callocFloat(); ngetMonitorContentScale(monitor, px, py); return new Pair.OfFloat(px.get(JAVA_FLOAT, 0), py.get(JAVA_FLOAT, 0)); } finally { @@ -1752,7 +1753,7 @@ public static MemorySegment ngetVideoModes(MemorySegment monitor, MemorySegment var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pCount = stack.calloc(JAVA_INT); + var pCount = stack.callocInt(); var pModes = ngetVideoModes(monitor, pCount); return RuntimeHelper.isNullptr(pModes) ? null : @@ -2453,8 +2454,8 @@ public static void getWindowPos(MemorySegment window, int @Nullable [] xpos, int var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var px = xpos != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; - var py = ypos != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; + var px = xpos != null ? stack.callocInt() : MemorySegment.NULL; + var py = ypos != null ? stack.callocInt() : MemorySegment.NULL; ngetWindowPos(window, px, py); if (xpos != null && xpos.length > 1) { xpos[0] = px.get(JAVA_INT, 0); @@ -2477,8 +2478,8 @@ public static Pair.OfInt getWindowPos(MemorySegment window) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var px = stack.calloc(JAVA_INT); - var py = stack.calloc(JAVA_INT); + var px = stack.callocInt(); + var py = stack.callocInt(); ngetWindowPos(window, px, py); return new Pair.OfInt(px.get(JAVA_INT, 0), py.get(JAVA_INT, 0)); } finally { @@ -2561,8 +2562,8 @@ public static void getWindowSize(MemorySegment window, int @Nullable [] width, i var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pw = width != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; - var ph = height != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; + var pw = width != null ? stack.callocInt() : MemorySegment.NULL; + var ph = height != null ? stack.callocInt() : MemorySegment.NULL; ngetWindowSize(window, pw, ph); if (width != null && width.length > 0) { width[0] = pw.get(JAVA_INT, 0); @@ -2586,8 +2587,8 @@ public static Pair.OfInt getWindowSize(MemorySegment window) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pw = stack.calloc(JAVA_INT); - var ph = stack.calloc(JAVA_INT); + var pw = stack.callocInt(); + var ph = stack.callocInt(); ngetWindowSize(window, pw, ph); return new Pair.OfInt(pw.get(JAVA_INT, 0), ph.get(JAVA_INT, 0)); } finally { @@ -2758,8 +2759,8 @@ public static void getFramebufferSize(MemorySegment window, int @Nullable [] wid var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pw = width != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; - var ph = height != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; + var pw = width != null ? stack.callocInt() : MemorySegment.NULL; + var ph = height != null ? stack.callocInt() : MemorySegment.NULL; ngetFramebufferSize(window, pw, ph); if (width != null && width.length > 0) { width[0] = pw.get(JAVA_INT, 0); @@ -2783,8 +2784,8 @@ public static Pair.OfInt getFramebufferSize(MemorySegment window) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pw = stack.calloc(JAVA_INT); - var ph = stack.calloc(JAVA_INT); + var pw = stack.callocInt(); + var ph = stack.callocInt(); ngetFramebufferSize(window, pw, ph); return new Pair.OfInt(pw.get(JAVA_INT, 0), ph.get(JAVA_INT, 0)); } finally { @@ -2847,10 +2848,10 @@ public static void getWindowFrameSize(MemorySegment window, int @Nullable [] lef var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pl = left != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; - var pt = top != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; - var pr = right != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; - var pb = bottom != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; + var pl = left != null ? stack.callocInt() : MemorySegment.NULL; + var pt = top != null ? stack.callocInt() : MemorySegment.NULL; + var pr = right != null ? stack.callocInt() : MemorySegment.NULL; + var pb = bottom != null ? stack.callocInt() : MemorySegment.NULL; ngetWindowFrameSize(window, pl, pt, pr, pb); if (left != null && left.length > 0) { left[0] = pl.get(JAVA_INT, 0); @@ -2881,10 +2882,10 @@ public static Quad.OfInt getWindowFrameSize(MemorySegment window) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pl = stack.calloc(JAVA_INT); - var pt = stack.calloc(JAVA_INT); - var pr = stack.calloc(JAVA_INT); - var pb = stack.calloc(JAVA_INT); + var pl = stack.callocInt(); + var pt = stack.callocInt(); + var pr = stack.callocInt(); + var pb = stack.callocInt(); ngetWindowFrameSize(window, pl, pt, pr, pb); return new Quad.OfInt(pl.get(JAVA_INT, 0), pt.get(JAVA_INT, 0), @@ -2939,8 +2940,8 @@ public static void getWindowContentScale(MemorySegment window, float @Nullable [ var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var px = xscale != null ? stack.calloc(JAVA_FLOAT) : MemorySegment.NULL; - var py = yscale != null ? stack.calloc(JAVA_FLOAT) : MemorySegment.NULL; + var px = xscale != null ? stack.callocFloat() : MemorySegment.NULL; + var py = yscale != null ? stack.callocFloat() : MemorySegment.NULL; ngetWindowContentScale(window, px, py); if (xscale != null && xscale.length > 0) { xscale[0] = px.get(JAVA_FLOAT, 0); @@ -2964,8 +2965,8 @@ public static Pair.OfFloat getWindowContentScale(MemorySegment window) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var px = stack.calloc(JAVA_FLOAT); - var py = stack.calloc(JAVA_FLOAT); + var px = stack.callocFloat(); + var py = stack.callocFloat(); ngetWindowContentScale(window, px, py); return new Pair.OfFloat(px.get(JAVA_FLOAT, 0), py.get(JAVA_FLOAT, 0)); } finally { @@ -4270,8 +4271,8 @@ public static void getCursorPos(MemorySegment window, double @Nullable [] xpos, var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var px = xpos != null ? stack.calloc(JAVA_DOUBLE) : MemorySegment.NULL; - var py = ypos != null ? stack.calloc(JAVA_DOUBLE) : MemorySegment.NULL; + var px = xpos != null ? stack.callocDouble() : MemorySegment.NULL; + var py = ypos != null ? stack.callocDouble() : MemorySegment.NULL; ngetCursorPos(window, px, py); if (xpos != null && xpos.length > 0) { xpos[0] = px.get(JAVA_DOUBLE, 0); @@ -4296,8 +4297,8 @@ public static Pair.OfDouble getCursorPos(MemorySegment window) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var px = stack.calloc(JAVA_DOUBLE); - var py = stack.calloc(JAVA_DOUBLE); + var px = stack.callocDouble(); + var py = stack.callocDouble(); ngetCursorPos(window, px, py); return new Pair.OfDouble(px.get(JAVA_DOUBLE, 0), py.get(JAVA_DOUBLE, 0)); } finally { @@ -4861,7 +4862,7 @@ public static MemorySegment ngetJoystickAxes(int jid, MemorySegment count) { MemorySegment pAxes; final int count; try { - var pCount = stack.calloc(JAVA_INT); + var pCount = stack.callocInt(); pAxes = ngetJoystickAxes(jid, pCount); count = pCount.get(JAVA_INT, 0); } finally { @@ -4923,7 +4924,7 @@ public static MemorySegment ngetJoystickButtons(int jid, MemorySegment count) { MemorySegment pButtons; final int count; try { - var pCount = stack.calloc(JAVA_INT); + var pCount = stack.callocInt(); pButtons = ngetJoystickButtons(jid, pCount); count = pCount.get(JAVA_INT, 0); } finally { @@ -5004,7 +5005,7 @@ public static byte[] getJoystickHats(int jid) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pCount = stack.calloc(JAVA_INT); + var pCount = stack.callocInt(); var pHats = ngetJoystickHats(jid, pCount); return RuntimeHelper.toArray(pHats, new byte[pCount.get(JAVA_INT, 0)]); } finally { @@ -5874,7 +5875,7 @@ public static MemorySegment ngetRequiredInstanceExtensions(MemorySegment count) MemorySegment pExt; final int count; try { - var pCount = stack.calloc(JAVA_INT); + var pCount = stack.callocInt(); pExt = ngetRequiredInstanceExtensions(pCount); count = pCount.get(JAVA_INT, 0); } finally { diff --git a/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWNative.java b/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWNative.java index ddf3522d..71bd49f4 100644 --- a/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWNative.java +++ b/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWNative.java @@ -536,10 +536,10 @@ public static boolean getOSMesaColorBuffer(MemorySegment window, int @Nullable [ final MemoryStack stack = MemoryStack.stackGet(); final long stackPointer = stack.getPointer(); try { - final MemorySegment pWidth = width != null ? stack.calloc(ValueLayout.JAVA_INT) : MemorySegment.NULL; - final MemorySegment pHeight = height != null ? stack.calloc(ValueLayout.JAVA_INT) : MemorySegment.NULL; - final MemorySegment pFormat = format != null ? stack.calloc(ValueLayout.JAVA_INT) : MemorySegment.NULL; - final MemorySegment pBuffer = buffer != null ? stack.calloc(ValueLayout.ADDRESS) : MemorySegment.NULL; + final MemorySegment pWidth = width != null ? stack.callocInt() : MemorySegment.NULL; + final MemorySegment pHeight = height != null ? stack.callocInt() : MemorySegment.NULL; + final MemorySegment pFormat = format != null ? stack.callocInt() : MemorySegment.NULL; + final MemorySegment pBuffer = buffer != null ? stack.callocPointer() : MemorySegment.NULL; final boolean success = ngetOSMesaColorBuffer(window, pWidth, pHeight, pFormat, pBuffer); if (width != null && width.length > 0) { width[0] = pWidth.get(ValueLayout.JAVA_INT, 0); @@ -601,10 +601,10 @@ public static boolean getOSMesaDepthBuffer(MemorySegment window, int @Nullable [ final MemoryStack stack = MemoryStack.stackGet(); final long stackPointer = stack.getPointer(); try { - final MemorySegment pWidth = width != null ? stack.calloc(ValueLayout.JAVA_INT) : MemorySegment.NULL; - final MemorySegment pHeight = height != null ? stack.calloc(ValueLayout.JAVA_INT) : MemorySegment.NULL; - final MemorySegment pBPV = bytesPerValue != null ? stack.calloc(ValueLayout.JAVA_INT) : MemorySegment.NULL; - final MemorySegment pBuffer = buffer != null ? stack.calloc(ValueLayout.ADDRESS) : MemorySegment.NULL; + final MemorySegment pWidth = width != null ? stack.callocInt() : MemorySegment.NULL; + final MemorySegment pHeight = height != null ? stack.callocInt() : MemorySegment.NULL; + final MemorySegment pBPV = bytesPerValue != null ? stack.callocInt() : MemorySegment.NULL; + final MemorySegment pBuffer = buffer != null ? stack.callocPointer() : MemorySegment.NULL; final boolean success = ngetOSMesaDepthBuffer(window, pWidth, pHeight, pBPV, pBuffer); if (width != null && width.length > 0) { width[0] = pWidth.get(ValueLayout.JAVA_INT, 0); diff --git a/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWVulkan.java b/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWVulkan.java index 4a79afd5..afa7c88c 100644 --- a/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWVulkan.java +++ b/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWVulkan.java @@ -217,7 +217,7 @@ public static int glfwCreateWindowSurface(MemorySegment instance, MemorySegment var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pSurface = stack.calloc(ValueLayout.JAVA_LONG); + var pSurface = stack.callocLong(); int result = nglfwCreateWindowSurface(instance, window, allocator, pSurface); surface[0] = pSurface.get(ValueLayout.JAVA_LONG, 0); return result; diff --git a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java index 14ccc1f7..d69db9f7 100644 --- a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java +++ b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java @@ -272,7 +272,7 @@ public static NFDResult openDialogN(String[] outPath, NFDNFilterItem.Buffer filt final MemoryStack stack = MemoryStack.stackGet(); final long stackPointer = stack.getPointer(); try { - final MemorySegment seg = stack.calloc(ADDRESS); + final MemorySegment seg = stack.callocPointer(); final NFDResult result = nopenDialogN(seg, filterList != null ? filterList.address() : MemorySegment.NULL, filterList != null ? Math.toIntExact(filterList.elementCount()) : 0, @@ -356,7 +356,7 @@ public static NFDResult saveDialogN(String[] outPath, NFDNFilterItem.Buffer filt final MemoryStack stack = MemoryStack.stackGet(); final long stackPointer = stack.getPointer(); try { - final MemorySegment seg = stack.calloc(ADDRESS); + final MemorySegment seg = stack.callocPointer(); final NFDResult result = nsaveDialogN(seg, filterList != null ? filterList.address() : MemorySegment.NULL, filterList != null ? Math.toIntExact(filterList.elementCount()) : 0, @@ -401,7 +401,7 @@ public static NFDResult pickFolderN(String[] outPath, String defaultPath) { final MemoryStack stack = MemoryStack.stackGet(); final long stackPointer = stack.getPointer(); try { - final MemorySegment seg = stack.calloc(ADDRESS); + final MemorySegment seg = stack.callocPointer(); final NFDResult result = npickFolderN(seg, defaultPath != null ? allocateString(defaultPath) : MemorySegment.NULL); if (result == NFDResult.OKAY) { final MemorySegment path = seg.get(RuntimeHelper.ADDRESS_UNBOUNDED, 0); @@ -554,7 +554,7 @@ public static NFDResult pathSetGetPathN(@NativeType("const nfdpathset_t*") Memor final MemoryStack stack = MemoryStack.stackGet(); final long stackPointer = stack.getPointer(); try { - final MemorySegment seg = stack.calloc(ADDRESS); + final MemorySegment seg = stack.callocPointer(); final NFDResult result = npathSetGetPathN(pathSet, index, seg); if (result == NFDResult.OKAY) { final MemorySegment path = seg.get(RuntimeHelper.ADDRESS_UNBOUNDED, 0); @@ -643,7 +643,7 @@ public static NFDResult pathSetEnumNextN(@NativeType("nfdpathsetenum_t*") Memory final MemoryStack stack = MemoryStack.stackGet(); final long stackPointer = stack.getPointer(); try { - final MemorySegment seg = stack.calloc(ADDRESS); + final MemorySegment seg = stack.callocPointer(); final NFDResult result = npathSetEnumNextN(enumerator, seg); if (result == NFDResult.OKAY) { final MemorySegment path = seg.get(RuntimeHelper.ADDRESS_UNBOUNDED, 0); @@ -719,7 +719,7 @@ public static NFDResult openDialogU8(String[] outPath, NFDU8FilterItem.Buffer fi final MemoryStack stack = MemoryStack.stackGet(); final long stackPointer = stack.getPointer(); try { - final MemorySegment seg = stack.calloc(ADDRESS); + final MemorySegment seg = stack.callocPointer(); final NFDResult result = nopenDialogU8(seg, filterList != null ? filterList.address() : MemorySegment.NULL, filterList != null ? Math.toIntExact(filterList.elementCount()) : 0, @@ -813,7 +813,7 @@ public static NFDResult saveDialogU8(String[] outPath, NFDU8FilterItem.Buffer fi final MemoryStack stack = MemoryStack.stackGet(); final long stackPointer = stack.getPointer(); try { - final MemorySegment seg = stack.calloc(ADDRESS); + final MemorySegment seg = stack.callocPointer(); final NFDResult result = nsaveDialogU8(seg, filterList != null ? filterList.address() : MemorySegment.NULL, filterList != null ? Math.toIntExact(filterList.elementCount()) : 0, @@ -860,7 +860,7 @@ public static NFDResult pickFolderU8(String[] outPath, String defaultPath) { final MemoryStack stack = MemoryStack.stackGet(); final long stackPointer = stack.getPointer(); try { - final MemorySegment seg = stack.calloc(ADDRESS); + final MemorySegment seg = stack.callocPointer(); final NFDResult result = npickFolderU8(seg, defaultPath != null ? stack.allocateUtf8String(defaultPath) : MemorySegment.NULL); if (result == NFDResult.OKAY) { final MemorySegment path = seg.get(RuntimeHelper.ADDRESS_UNBOUNDED, 0); @@ -910,7 +910,7 @@ public static NFDResult pathSetGetPathU8(@NativeType("const nfdpathset_t*") Memo final MemoryStack stack = MemoryStack.stackGet(); final long stackPointer = stack.getPointer(); try { - final MemorySegment seg = stack.calloc(ADDRESS); + final MemorySegment seg = stack.callocPointer(); final NFDResult result = npathSetGetPathU8(pathSet, index, seg); if (result == NFDResult.OKAY) { final MemorySegment path = seg.get(RuntimeHelper.ADDRESS_UNBOUNDED, 0); @@ -956,7 +956,7 @@ public static NFDResult pathSetEnumNextU8(@NativeType("nfdpathsetenum_t*") Memor final MemoryStack stack = MemoryStack.stackGet(); final long stackPointer = stack.getPointer(); try { - final MemorySegment seg = stack.calloc(ADDRESS); + final MemorySegment seg = stack.callocPointer(); final NFDResult result = npathSetEnumNextU8(enumerator, seg); if (result == NFDResult.OKAY) { final MemorySegment path = seg.get(RuntimeHelper.ADDRESS_UNBOUNDED, 0); diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL10.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL10.java index 9b008943..c62d601b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL10.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL10.java @@ -1028,14 +1028,9 @@ public static double[] getClipPlane(int plane) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pEq = stack.calloc(JAVA_DOUBLE, 4); + var pEq = stack.callocDouble(4); getClipPlane(plane, pEq); - return new double[]{ - pEq.get(JAVA_DOUBLE, 0), - pEq.getAtIndex(JAVA_DOUBLE, 1), - pEq.getAtIndex(JAVA_DOUBLE, 2), - pEq.getAtIndex(JAVA_DOUBLE, 3) - }; + return RuntimeHelper.toArray(pEq, new double[4]); } finally { stack.setPointer(stackPointer); } @@ -1060,7 +1055,7 @@ public static float getLightf(int light, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pParams = stack.calloc(JAVA_FLOAT); + var pParams = stack.callocFloat(); getLightfv(light, pname, pParams); return pParams.get(JAVA_FLOAT, 0); } finally { @@ -1087,7 +1082,7 @@ public static int getLighti(int light, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pParams = stack.calloc(JAVA_INT); + var pParams = stack.callocInt(); getLightiv(light, pname, pParams); return pParams.get(JAVA_INT, 0); } finally { @@ -1114,7 +1109,7 @@ public static double getMapd(int target, int query) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pv = stack.calloc(JAVA_DOUBLE); + var pv = stack.callocDouble(); getMapdv(target, query, pv); return pv.get(JAVA_DOUBLE, 0); } finally { @@ -1141,7 +1136,7 @@ public static float getMapf(int target, int query) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pv = stack.calloc(JAVA_FLOAT); + var pv = stack.callocFloat(); getMapfv(target, query, pv); return pv.get(JAVA_FLOAT, 0); } finally { @@ -1168,7 +1163,7 @@ public static int getMapi(int target, int query) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pv = stack.calloc(JAVA_INT); + var pv = stack.callocInt(); getMapiv(target, query, pv); return pv.get(JAVA_INT, 0); } finally { @@ -1195,7 +1190,7 @@ public static float getMaterialf(int face, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pParams = stack.calloc(JAVA_FLOAT); + var pParams = stack.callocFloat(); getMaterialfv(face, pname, pParams); return pParams.get(JAVA_FLOAT, 0); } finally { @@ -1222,7 +1217,7 @@ public static int getMateriali(int face, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pParams = stack.calloc(JAVA_INT); + var pParams = stack.callocInt(); getMaterialiv(face, pname, pParams); return pParams.get(JAVA_INT, 0); } finally { @@ -1309,7 +1304,7 @@ public static float getTexEnvf(int target, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pParams = stack.calloc(JAVA_FLOAT); + var pParams = stack.callocFloat(); getTexEnvfv(target, pname, pParams); return pParams.get(JAVA_FLOAT, 0); } finally { @@ -1336,7 +1331,7 @@ public static int getTexEnvi(int target, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pParams = stack.calloc(JAVA_INT); + var pParams = stack.callocInt(); getTexEnviv(target, pname, pParams); return pParams.get(JAVA_INT, 0); } finally { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL10C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL10C.java index ac83d55d..1f16f453 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL10C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL10C.java @@ -464,7 +464,7 @@ public static double getDouble(int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pData = stack.calloc(JAVA_DOUBLE); + var pData = stack.callocDouble(); getDoublev(pname, pData); return pData.get(JAVA_DOUBLE, 0); } finally { @@ -500,7 +500,7 @@ public static float getFloat(int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pData = stack.calloc(JAVA_FLOAT); + var pData = stack.callocFloat(); getFloatv(pname, pData); return pData.get(JAVA_FLOAT, 0); } finally { @@ -527,7 +527,7 @@ public static int getInteger(int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pData = stack.calloc(JAVA_INT); + var pData = stack.callocInt(); getIntegerv(pname, pData); return pData.get(JAVA_INT, 0); } finally { @@ -578,7 +578,7 @@ public static float getTexLevelParameterf(int target, int level, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pParams = stack.calloc(JAVA_FLOAT); + var pParams = stack.callocFloat(); getTexLevelParameterfv(target, level, pname, pParams); return pParams.get(JAVA_FLOAT, 0); } finally { @@ -605,7 +605,7 @@ public static int getTexLevelParameteri(int target, int level, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pParams = stack.calloc(JAVA_INT); + var pParams = stack.callocInt(); getTexLevelParameteriv(target, level, pname, pParams); return pParams.get(JAVA_INT, 0); } finally { @@ -632,7 +632,7 @@ public static float getTexParameterf(int target, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pParams = stack.calloc(JAVA_FLOAT); + var pParams = stack.callocFloat(); getTexParameterfv(target, pname, pParams); return pParams.get(JAVA_FLOAT, 0); } finally { @@ -659,7 +659,7 @@ public static int getTexParameteri(int target, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pParams = stack.calloc(JAVA_INT); + var pParams = stack.callocInt(); getTexParameteriv(target, pname, pParams); return pParams.get(JAVA_INT, 0); } finally { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL11C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL11C.java index a48314fa..1ccadb33 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL11C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL11C.java @@ -209,7 +209,7 @@ public static int genTexture() { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pTex = stack.calloc(JAVA_INT); + var pTex = stack.callocInt(); genTextures(1, pTex); return pTex.get(JAVA_INT, 0); } finally { @@ -230,7 +230,7 @@ public static MemorySegment getPointer(int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pParams = stack.calloc(ADDRESS); + var pParams = stack.callocPointer(); getPointerv(pname, pParams); return pParams.get(RuntimeHelper.ADDRESS_UNBOUNDED, 0); } finally { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL15C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL15C.java index 2f5e6d2b..69fe470c 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL15C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL15C.java @@ -266,7 +266,7 @@ public static int genBuffer() { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); genBuffers(1, seg); return seg.get(JAVA_INT, 0); } finally { @@ -293,7 +293,7 @@ public static int genQuery() { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); genQueries(1, seg); return seg.get(JAVA_INT, 0); } finally { @@ -314,7 +314,7 @@ public static int getBufferParameteri(int target, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getBufferParameteriv(target, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -335,7 +335,7 @@ public static MemorySegment getBufferPointer(int target, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(ADDRESS); + var seg = stack.callocPointer(); getBufferPointerv(target, pname, seg); return seg.get(RuntimeHelper.ADDRESS_UNBOUNDED, 0); } finally { @@ -401,7 +401,7 @@ public static int getQueryObjecti(int id, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getQueryObjectiv(id, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -422,7 +422,7 @@ public static int getQueryObjectui(int id, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getQueryObjectuiv(id, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -443,7 +443,7 @@ public static int getQueryi(int target, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getQueryiv(target, pname, seg); return seg.get(JAVA_INT, 0); } finally { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL20C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL20C.java index 433a693c..2b91ea46 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL20C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL20C.java @@ -488,7 +488,7 @@ public static int getProgrami(int program, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getProgramiv(program, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -561,7 +561,7 @@ public static int getShaderi(int shader, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getShaderiv(shader, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -607,7 +607,7 @@ public static float getUniformf(int program, int location) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_FLOAT); + var seg = stack.callocFloat(); getUniformfv(program, location, seg); return seg.get(JAVA_FLOAT, 0); } finally { @@ -634,7 +634,7 @@ public static int getUniformi(int program, int location) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getUniformiv(program, location, seg); return seg.get(JAVA_INT, 0); } finally { @@ -700,7 +700,7 @@ public static double getVertexAttribd(int index, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_DOUBLE); + var seg = stack.callocDouble(); getVertexAttribdv(index, pname, seg); return seg.get(JAVA_DOUBLE, 0); } finally { @@ -727,7 +727,7 @@ public static float getVertexAttribf(int index, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_FLOAT); + var seg = stack.callocFloat(); getVertexAttribfv(index, pname, seg); return seg.get(JAVA_FLOAT, 0); } finally { @@ -754,7 +754,7 @@ public static int getVertexAttribi(int index, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getVertexAttribiv(index, pname, seg); return seg.get(JAVA_INT, 0); } finally { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL30C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL30C.java index aa0ed9f0..63f7834a 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL30C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL30C.java @@ -725,7 +725,7 @@ public static int genFramebuffer() { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); genFramebuffers(1, seg); return seg.get(JAVA_INT, 0); } finally { @@ -752,7 +752,7 @@ public static int genRenderbuffer() { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); genRenderbuffers(1, seg); return seg.get(JAVA_INT, 0); } finally { @@ -779,7 +779,7 @@ public static int genVertexArray() { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); genVertexArrays(1, seg); return seg.get(JAVA_INT, 0); } finally { @@ -855,7 +855,7 @@ public static int getFramebufferAttachmentParameteri(int target, int attachment, var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getFramebufferAttachmentParameteriv(target, attachment, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -882,7 +882,7 @@ public static int getIntegeri(int target, int index) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getIntegeri_v(target, index, seg); return seg.get(JAVA_INT, 0); } finally { @@ -903,7 +903,7 @@ public static void getRenderbufferParameteriv(int target, int pname, int[] param var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getRenderbufferParameteriv(target, pname, seg); params[0] = seg.get(JAVA_INT, 0); } finally { @@ -915,7 +915,7 @@ public static int getRenderbufferParameteri(int target, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getRenderbufferParameteriv(target, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -957,7 +957,7 @@ public static int getTexParameterIi(int target, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getTexParameterIiv(target, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -984,7 +984,7 @@ public static int getTexParameterIui(int target, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getTexParameterIuiv(target, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -1034,7 +1034,7 @@ public static int getUniformui(int program, int location) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getUniformuiv(program, location, seg); return seg.get(JAVA_INT, 0); } finally { @@ -1061,7 +1061,7 @@ public static int getVertexAttribIi(int index, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getVertexAttribIiv(index, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -1088,7 +1088,7 @@ public static int getVertexAttribIui(int index, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getVertexAttribIuiv(index, pname, seg); return seg.get(JAVA_INT, 0); } finally { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL31C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL31C.java index 0112c124..7fd27c0d 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL31C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL31C.java @@ -251,7 +251,7 @@ public static int getActiveUniformi(int program, int uniformIndex, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getActiveUniformsiv(program, 1, stack.ints(uniformIndex), pname, seg); return seg.get(JAVA_INT, 0); } finally { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL32C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL32C.java index 5c65c9b2..ee6ea795 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL32C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL32C.java @@ -247,7 +247,7 @@ public static long getBufferParameteri64(int target, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_LONG); + var seg = stack.callocLong(); getBufferParameteri64v(target, pname, seg); return seg.get(JAVA_LONG, 0); } finally { @@ -274,7 +274,7 @@ public static long getInteger64i(int target, int index) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_LONG); + var seg = stack.callocLong(); getInteger64i_v(target, index, seg); return seg.get(JAVA_LONG, 0); } finally { @@ -301,7 +301,7 @@ public static long getInteger64(int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pData = stack.calloc(JAVA_LONG); + var pData = stack.callocLong(); getInteger64v(pname, pData); return pData.get(JAVA_LONG, 0); } finally { @@ -353,7 +353,7 @@ public static int getSynci(MemorySegment sync, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getSynciv(sync, pname, 1, MemorySegment.NULL, seg); return seg.get(JAVA_INT, 0); } finally { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL33C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL33C.java index ea0f34a5..104ee734 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL33C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL33C.java @@ -169,7 +169,7 @@ public static int genSampler() { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); genSamplers(1, seg); return seg.get(JAVA_INT, 0); } finally { @@ -209,7 +209,7 @@ public static long getQueryObjecti64(int id, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_LONG); + var seg = stack.callocLong(); getQueryObjecti64v(id, pname, seg); return seg.get(JAVA_LONG, 0); } finally { @@ -230,7 +230,7 @@ public static long getQueryObjectui64(int id, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_LONG); + var seg = stack.callocLong(); getQueryObjectui64v(id, pname, seg); return seg.get(JAVA_LONG, 0); } finally { @@ -257,7 +257,7 @@ public static int getSamplerParameterIi(int sampler, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getSamplerParameterIiv(sampler, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -284,7 +284,7 @@ public static int getSamplerParameterIui(int sampler, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getSamplerParameterIuiv(sampler, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -311,7 +311,7 @@ public static float getSamplerParameterf(int sampler, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_FLOAT); + var seg = stack.callocFloat(); getSamplerParameterfv(sampler, pname, seg); return seg.get(JAVA_FLOAT, 0); } finally { @@ -338,7 +338,7 @@ public static int getSamplerParameteri(int sampler, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getSamplerParameteriv(sampler, pname, seg); return seg.get(JAVA_INT, 0); } finally { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL40C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL40C.java index e723c808..0ba158c3 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL40C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL40C.java @@ -346,7 +346,7 @@ public static int genTransformFeedback() { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); genTransformFeedbacks(1, seg); return seg.get(JAVA_INT, 0); } finally { @@ -403,7 +403,7 @@ public static int getActiveSubroutineUniformi(int program, int shaderType, int i var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getActiveSubroutineUniformiv(program, shaderType, index, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -424,7 +424,7 @@ public static int getProgramStagei(int program, int shaderType, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getProgramStageiv(program, shaderType, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -445,7 +445,7 @@ public static int getQueryIndexedi(int target, int index, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getQueryIndexediv(target, index, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -525,7 +525,7 @@ public static double getUniformd(int program, int location) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_DOUBLE); + var seg = stack.callocDouble(); getUniformdv(program, location, seg); return seg.get(JAVA_DOUBLE, 0); } finally { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL41C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL41C.java index bd26587a..7518051b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL41C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL41C.java @@ -315,7 +315,7 @@ public static int genProgramPipeline() { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); genProgramPipelines(1, seg); return seg.get(JAVA_INT, 0); } finally { @@ -342,7 +342,7 @@ public static double getDoublei(int target, int index) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_DOUBLE); + var seg = stack.callocDouble(); getDoublei_v(target, index, seg); return seg.get(JAVA_DOUBLE, 0); } finally { @@ -369,7 +369,7 @@ public static float getFloati(int target, int index) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_FLOAT); + var seg = stack.callocFloat(); getFloati_v(target, index, seg); return seg.get(JAVA_FLOAT, 0); } finally { @@ -390,8 +390,8 @@ public static void getProgramBinary(int program, int bufSize, int @Nullable [] l var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pl = length != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; - var pf = stack.calloc(JAVA_INT); + var pl = length != null ? stack.callocInt() : MemorySegment.NULL; + var pf = stack.callocInt(); getProgramBinary(program, bufSize, pl, pf, binary); if (length != null && length.length > 0) { length[0] = pl.get(JAVA_INT, 0); @@ -445,7 +445,7 @@ public static int getProgramPipelinei(int pipeline, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getProgramPipelineiv(pipeline, pname, seg); return seg.get(JAVA_INT, 0); } finally { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL42C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL42C.java index d8fdaeaa..4e2ba6f6 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL42C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL42C.java @@ -275,7 +275,7 @@ public static int getActiveAtomicCounterBufferi(int program, int bufferIndex, in var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getActiveAtomicCounterBufferiv(program, bufferIndex, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -302,7 +302,7 @@ public static int getInternalformati(int target, int internalFormat, int pname) var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getInternalformativ(target, internalFormat, pname, 1, seg); return seg.get(JAVA_INT, 0); } finally { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL43C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL43C.java index f012a7ce..4fe8f96c 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL43C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL43C.java @@ -524,7 +524,7 @@ public static int getFramebufferParameteri(int target, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getFramebufferParameteriv(target, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -551,7 +551,7 @@ public static long getInternalformati64(int target, int internalFormat, int pnam var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_LONG); + var seg = stack.callocLong(); getInternalformati64v(target, internalFormat, pname, 1, seg); return seg.get(JAVA_LONG, 0); } finally { @@ -626,7 +626,7 @@ public static int getProgramInterfacei(int program, int programInterface, int pn var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getProgramInterfaceiv(program, programInterface, pname, seg); return seg.get(JAVA_INT, 0); } finally { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL45C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL45C.java index 0e6f1d5a..10ee62a5 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL45C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL45C.java @@ -386,7 +386,7 @@ public static int createBuffer() { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); createBuffers(1, seg); return seg.get(JAVA_INT, 0); } finally { @@ -413,7 +413,7 @@ public static int createFramebuffer() { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); createFramebuffers(1, seg); return seg.get(JAVA_INT, 0); } finally { @@ -440,7 +440,7 @@ public static int createProgramPipeline() { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); createProgramPipelines(1, seg); return seg.get(JAVA_INT, 0); } finally { @@ -467,7 +467,7 @@ public static int createQuery(int target) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); createQueries(target, 1, seg); return seg.get(JAVA_INT, 0); } finally { @@ -494,7 +494,7 @@ public static int createRenderbuffer() { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); createRenderbuffers(1, seg); return seg.get(JAVA_INT, 0); } finally { @@ -521,7 +521,7 @@ public static int createSampler() { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); createSamplers(1, seg); return seg.get(JAVA_INT, 0); } finally { @@ -549,7 +549,7 @@ public static int createTexture(int target) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pTex = stack.calloc(JAVA_INT); + var pTex = stack.callocInt(); createTextures(target, 1, pTex); return pTex.get(JAVA_INT, 0); } finally { @@ -576,7 +576,7 @@ public static int createTransformFeedback() { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); createTransformFeedbacks(1, seg); return seg.get(JAVA_INT, 0); } finally { @@ -603,7 +603,7 @@ public static int createVertexArray() { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); createVertexArrays(1, seg); return seg.get(JAVA_INT, 0); } finally { @@ -687,7 +687,7 @@ public static long getNamedBufferParameteri64(int buffer, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_LONG); + var seg = stack.callocLong(); getNamedBufferParameteri64v(buffer, pname, seg); return seg.get(JAVA_LONG, 0); } finally { @@ -708,7 +708,7 @@ public static int getNamedBufferParameteri(int buffer, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getNamedBufferParameteriv(buffer, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -729,7 +729,7 @@ public static MemorySegment getNamedBufferPointer(int target, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(ADDRESS); + var seg = stack.callocPointer(); getNamedBufferPointerv(target, pname, seg); return seg.get(RuntimeHelper.ADDRESS_UNBOUNDED, 0); } finally { @@ -795,7 +795,7 @@ public static int getNamedFramebufferAttachmentParameteri(int framebuffer, int a var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getNamedFramebufferAttachmentParameteriv(framebuffer, attachment, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -816,7 +816,7 @@ public static int getNamedFramebufferParameteri(int framebuffer, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getNamedFramebufferParameteriv(framebuffer, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -837,7 +837,7 @@ public static void getNamedRenderbufferParameteriv(int renderbuffer, int pname, var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getNamedRenderbufferParameteriv(renderbuffer, pname, seg); params[0] = seg.get(JAVA_INT, 0); } finally { @@ -849,7 +849,7 @@ public static int getNamedRenderbufferParameteri(int renderbuffer, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getNamedRenderbufferParameteriv(renderbuffer, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -921,7 +921,7 @@ public static float getTextureLevelParameterf(int texture, int level, int pname) var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pParams = stack.calloc(JAVA_FLOAT); + var pParams = stack.callocFloat(); getTextureLevelParameterfv(texture, level, pname, pParams); return pParams.get(JAVA_FLOAT, 0); } finally { @@ -948,7 +948,7 @@ public static int getTextureLevelParameteri(int texture, int level, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pParams = stack.calloc(JAVA_INT); + var pParams = stack.callocInt(); getTextureLevelParameteriv(texture, level, pname, pParams); return pParams.get(JAVA_INT, 0); } finally { @@ -975,7 +975,7 @@ public static int getTextureParameterIi(int texture, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getTextureParameterIiv(texture, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -1002,7 +1002,7 @@ public static int getTextureParameterIui(int texture, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getTextureParameterIuiv(texture, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -1029,7 +1029,7 @@ public static float getTextureParameterf(int texture, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pParams = stack.calloc(JAVA_FLOAT); + var pParams = stack.callocFloat(); getTextureParameterfv(texture, pname, pParams); return pParams.get(JAVA_FLOAT, 0); } finally { @@ -1056,7 +1056,7 @@ public static int getTextureParameteri(int texture, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var pParams = stack.calloc(JAVA_INT); + var pParams = stack.callocInt(); getTextureParameteriv(texture, pname, pParams); return pParams.get(JAVA_INT, 0); } finally { @@ -1155,7 +1155,7 @@ public static long getVertexArrayIndexed64i(int vaobj, int index, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_LONG); + var seg = stack.callocLong(); getVertexArrayIndexed64iv(vaobj, index, pname, seg); return seg.get(JAVA_LONG, 0); } finally { @@ -1176,7 +1176,7 @@ public static int getVertexArrayIndexedi(int vaobj, int index, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getVertexArrayIndexediv(vaobj, index, pname, seg); return seg.get(JAVA_INT, 0); } finally { @@ -1197,7 +1197,7 @@ public static int getVertexArrayi(int vaobj, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); getVertexArrayiv(vaobj, pname, seg); return seg.get(JAVA_INT, 0); } finally { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLINTELPerformanceQuery.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLINTELPerformanceQuery.java index 4360a0aa..dc31ffcc 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLINTELPerformanceQuery.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLINTELPerformanceQuery.java @@ -91,7 +91,7 @@ public static int glCreatePerfQueryINTEL(int queryId) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); glCreatePerfQueryINTEL(queryId, seg); return seg.get(JAVA_INT, 0); } finally { @@ -130,7 +130,7 @@ public static int glGetFirstPerfQueryIdINTEL() { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); glGetFirstPerfQueryIdINTEL(seg); return seg.get(JAVA_INT, 0); } finally { @@ -151,7 +151,7 @@ public static int glGetNextPerfQueryIdINTEL(int queryId) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); glGetNextPerfQueryIdINTEL(queryId, seg); return seg.get(JAVA_INT, 0); } finally { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLMESAFramebufferFlipY.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLMESAFramebufferFlipY.java index b4935a45..429b3dab 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLMESAFramebufferFlipY.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLMESAFramebufferFlipY.java @@ -68,11 +68,11 @@ public static void glGetFramebufferParameterivMESA(SegmentAllocator allocator, i RuntimeHelper.toArray(seg, params); } - public static int glGetFramebufferParameteriMESA(SegmentAllocator allocator, int target, int pname) { + public static int glGetFramebufferParameteriMESA(int target, int pname) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(ValueLayout.JAVA_INT); + var seg = stack.callocInt(); glGetFramebufferParameterivMESA(target, pname, seg); return seg.get(ValueLayout.JAVA_INT, 0); } finally { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDNameGenDelete.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDNameGenDelete.java index e7d888a2..8ac23f19 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDNameGenDelete.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDNameGenDelete.java @@ -84,7 +84,7 @@ public static int glGenNameAMD(int identifier) { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); glGenNamesAMD(identifier, 1, seg); return seg.get(JAVA_INT, 0); } finally { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDPerformanceMonitor.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDPerformanceMonitor.java index 681b7b16..11904519 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDPerformanceMonitor.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDPerformanceMonitor.java @@ -113,7 +113,7 @@ public static int glGenPerfMonitorAMD() { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); glGenPerfMonitorsAMD(1, seg); return seg.get(JAVA_INT, 0); } finally { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEFence.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEFence.java index 8e8b15a9..b4f0bd33 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEFence.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEFence.java @@ -94,7 +94,7 @@ public static int glGenFenceAPPLE() { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); glGenFencesAPPLE(1, seg); return seg.get(JAVA_INT, 0); } finally { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEVertexArrayObject.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEVertexArrayObject.java index 1b93fcb2..3376e209 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEVertexArrayObject.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEVertexArrayObject.java @@ -88,7 +88,7 @@ public static int glGenVertexArrayAPPLE() { var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var seg = stack.calloc(JAVA_INT); + var seg = stack.callocInt(); glGenVertexArraysAPPLE(1, seg); return seg.get(JAVA_INT, 0); } finally { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBFragmentProgram.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBFragmentProgram.java index 7a0bb007..b2bea9d9 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBFragmentProgram.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBFragmentProgram.java @@ -106,7 +106,7 @@ public static int glGenProgramARB() { MemoryStack stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - MemorySegment segment = stack.calloc(JAVA_INT); + MemorySegment segment = stack.callocInt(); glGenProgramsARB(1, segment); return segment.get(JAVA_INT, 0); } finally { diff --git a/modules/overrungl.stb/src/main/java/overrungl/stb/STBImage.java b/modules/overrungl.stb/src/main/java/overrungl/stb/STBImage.java index 858b9508..7a08617c 100644 --- a/modules/overrungl.stb/src/main/java/overrungl/stb/STBImage.java +++ b/modules/overrungl.stb/src/main/java/overrungl/stb/STBImage.java @@ -205,9 +205,9 @@ public static boolean infoFromCallbacks(STBIIoCallbacks clbk, MemorySegment user var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var px = stack.calloc(JAVA_INT); - var py = stack.calloc(JAVA_INT); - var pc = stack.calloc(JAVA_INT); + var px = stack.callocInt(); + var py = stack.callocInt(); + var pc = stack.callocInt(); boolean b = ninfoFromCallbacks(clbk.address(), user, px, py, pc); x[0] = px.get(JAVA_INT, 0); y[0] = py.get(JAVA_INT, 0); @@ -230,9 +230,9 @@ public static boolean infoFromFile(MemorySegment f, int[] x, int[] y, int[] comp var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var px = stack.calloc(JAVA_INT); - var py = stack.calloc(JAVA_INT); - var pc = stack.calloc(JAVA_INT); + var px = stack.callocInt(); + var py = stack.callocInt(); + var pc = stack.callocInt(); boolean b = ninfoFromFile(f, px, py, pc); x[0] = px.get(JAVA_INT, 0); y[0] = py.get(JAVA_INT, 0); @@ -256,14 +256,20 @@ public static boolean infoFromMemory(MemorySegment buffer, MemorySegment x, Memo } public static boolean infoFromMemory(SegmentAllocator allocator, byte[] buffer, int[] x, int[] y, int[] comp) { - var px = allocator.allocate(JAVA_INT); - var py = allocator.allocate(JAVA_INT); - var pc = allocator.allocate(JAVA_INT); - boolean b = infoFromMemory(allocator.allocateArray(JAVA_BYTE, buffer), px, py, pc); - x[0] = px.get(JAVA_INT, 0); - y[0] = py.get(JAVA_INT, 0); - comp[0] = pc.get(JAVA_INT, 0); - return b; + var stack = MemoryStack.stackGet(); + long stackPointer = stack.getPointer(); + try { + var px = stack.callocInt(); + var py = stack.callocInt(); + var pc = stack.callocInt(); + boolean b = infoFromMemory(allocator.allocateArray(JAVA_BYTE, buffer), px, py, pc); + x[0] = px.get(JAVA_INT, 0); + y[0] = py.get(JAVA_INT, 0); + comp[0] = pc.get(JAVA_INT, 0); + return b; + } finally { + stack.setPointer(stackPointer); + } } public static boolean nis16Bit(MemorySegment filename) { @@ -452,9 +458,9 @@ public static MemorySegment load16FromCallbacks(STBIIoCallbacks clbk, MemorySegm var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var px = stack.calloc(JAVA_INT); - var py = stack.calloc(JAVA_INT); - var pc = stack.calloc(JAVA_INT); + var px = stack.callocInt(); + var py = stack.callocInt(); + var pc = stack.callocInt(); var addr = nload16FromCallbacks(clbk.address(), user, px, py, pc, desiredChannels); x[0] = px.get(JAVA_INT, 0); y[0] = py.get(JAVA_INT, 0); @@ -500,9 +506,9 @@ public static MemorySegment loadFromCallbacks(STBIIoCallbacks clbk, MemorySegmen var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var px = stack.calloc(JAVA_INT); - var py = stack.calloc(JAVA_INT); - var pc = stack.calloc(JAVA_INT); + var px = stack.callocInt(); + var py = stack.callocInt(); + var pc = stack.callocInt(); var addr = nloadFromCallbacks(clbk.address(), user, px, py, pc, desiredChannels); x[0] = px.get(JAVA_INT, 0); y[0] = py.get(JAVA_INT, 0); @@ -525,9 +531,9 @@ public static MemorySegment loadFromFile(MemorySegment f, int[] x, int[] y, int[ var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var px = stack.calloc(JAVA_INT); - var py = stack.calloc(JAVA_INT); - var pc = stack.calloc(JAVA_INT); + var px = stack.callocInt(); + var py = stack.callocInt(); + var pc = stack.callocInt(); var addr = nloadFromFile(f, px, py, pc, desiredChannels); x[0] = px.get(JAVA_INT, 0); y[0] = py.get(JAVA_INT, 0); @@ -550,9 +556,9 @@ public static MemorySegment loadFromFile16(MemorySegment f, int[] x, int[] y, in var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var px = stack.calloc(JAVA_INT); - var py = stack.calloc(JAVA_INT); - var pc = stack.calloc(JAVA_INT); + var px = stack.callocInt(); + var py = stack.callocInt(); + var pc = stack.callocInt(); var addr = nloadFromFile16(f, px, py, pc, desiredChannels); x[0] = px.get(JAVA_INT, 0); y[0] = py.get(JAVA_INT, 0); @@ -651,9 +657,9 @@ public static MemorySegment loadfFromCallbacks(STBIIoCallbacks clbk, MemorySegme var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var px = stack.calloc(JAVA_INT); - var py = stack.calloc(JAVA_INT); - var pc = stack.calloc(JAVA_INT); + var px = stack.callocInt(); + var py = stack.callocInt(); + var pc = stack.callocInt(); var addr = nloadfFromCallbacks(clbk.address(), user, px, py, pc, desiredChannels); x[0] = px.get(JAVA_INT, 0); y[0] = py.get(JAVA_INT, 0); @@ -676,9 +682,9 @@ public static MemorySegment loadfFromFile(MemorySegment f, int[] x, int[] y, int var stack = MemoryStack.stackGet(); long stackPointer = stack.getPointer(); try { - var px = stack.calloc(JAVA_INT); - var py = stack.calloc(JAVA_INT); - var pc = stack.calloc(JAVA_INT); + var px = stack.callocInt(); + var py = stack.callocInt(); + var pc = stack.callocInt(); var addr = nloadfFromFile(f, px, py, pc, desiredChannels); x[0] = px.get(JAVA_INT, 0); y[0] = py.get(JAVA_INT, 0); diff --git a/modules/samples/src/test/java/overrungl/demo/nfd/NFDTest.java b/modules/samples/src/test/java/overrungl/demo/nfd/NFDTest.java index cbee2a60..75be4ada 100644 --- a/modules/samples/src/test/java/overrungl/demo/nfd/NFDTest.java +++ b/modules/samples/src/test/java/overrungl/demo/nfd/NFDTest.java @@ -68,7 +68,7 @@ private static void openDialogMultiple() { NFD.init(); try (MemoryStack stack = MemoryStack.stackPush()) { - MemorySegment pOutPaths = stack.calloc(ValueLayout.ADDRESS); + MemorySegment pOutPaths = stack.callocPointer(); String[] outPath = new String[1]; // prepare filters for the dialog @@ -109,7 +109,7 @@ private static void openDialogMultipleEnum() { NFD.init(); try (MemoryStack stack = MemoryStack.stackPush()) { - MemorySegment pOutPaths = stack.calloc(ValueLayout.ADDRESS); + MemorySegment pOutPaths = stack.callocPointer(); // prepare filters for the dialog final NFDNFilterItem.Buffer filterItem = NFDNFilterItem.create(stack, From 727bbf7578dcd964a9b6ad2d5d4473085d88e9ab Mon Sep 17 00:00:00 2001 From: squid233 <60126026+squid233@users.noreply.github.com> Date: Wed, 9 Aug 2023 17:26:07 +0800 Subject: [PATCH 08/14] Removal of SegmentAllocator (#31) - [Core] Remove MemoryUtil::segmentAllocator - [OpenGL] Remove allocator from GL20C::getProgramInfoLog and ::getShaderInfoLog --- .../main/java/overrungl/util/MemoryUtil.java | 11 ---- .../src/main/java/overrungl/opengl/GL20C.java | 59 +++++++++++++------ 2 files changed, 41 insertions(+), 29 deletions(-) diff --git a/modules/overrungl.core/src/main/java/overrungl/util/MemoryUtil.java b/modules/overrungl.core/src/main/java/overrungl/util/MemoryUtil.java index 9c35282b..569cc35b 100644 --- a/modules/overrungl.core/src/main/java/overrungl/util/MemoryUtil.java +++ b/modules/overrungl.core/src/main/java/overrungl/util/MemoryUtil.java @@ -61,17 +61,6 @@ private MemoryUtil() { throw new IllegalStateException("Do not construct instance"); } - /** - * {@return a segment allocator of this} - * The returned memory must be released explicitly by {@link #free(MemorySegment)}. - */ - public static SegmentAllocator segmentAllocator() { - class Holder { - private static final SegmentAllocator ALLOCATOR = (byteSize, byteAlignment) -> calloc(byteSize / byteAlignment, byteAlignment); - } - return Holder.ALLOCATOR; - } - /** * {@return {@code true} if {@code segment} is a null pointer} * diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL20C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL20C.java index 2b91ea46..99d60b1f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL20C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL20C.java @@ -23,6 +23,7 @@ import overrungl.internal.RuntimeHelper; import overrungl.util.MemoryStack; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; @@ -455,18 +456,29 @@ public static void getProgramInfoLog(int program, int bufSize, MemorySegment len } } - public static String getProgramInfoLog(SegmentAllocator allocator, int program, int bufSize, int @Nullable [] length) { - var pLen = length != null ? allocator.allocate(JAVA_INT) : MemorySegment.NULL; - var pLog = allocator.allocateArray(JAVA_BYTE, bufSize); - getProgramInfoLog(program, bufSize, pLen, pLog); - if (length != null && length.length > 0) { - length[0] = pLen.get(JAVA_INT, 0); + public static String getProgramInfoLog(int program, int bufSize, int @Nullable [] length) { + final MemoryStack stack = MemoryStack.stackGet(); + final long stackPointer = stack.getPointer(); + try { + var pLen = length != null ? stack.calloc(JAVA_INT) : MemorySegment.NULL; + final Arena allocator = stack.getPointer() < bufSize ? Arena.ofConfined() : stack; + try { + var pLog = allocator.allocateArray(JAVA_BYTE, bufSize); + getProgramInfoLog(program, bufSize, pLen, pLog); + if (length != null && length.length > 0) { + length[0] = pLen.get(JAVA_INT, 0); + } + return pLog.getUtf8String(0); + } finally { + if (!(allocator instanceof MemoryStack)) allocator.close(); + } + } finally { + stack.setPointer(stackPointer); } - return pLog.getUtf8String(0); } - public static String getProgramInfoLog(SegmentAllocator allocator, int program) { - return getProgramInfoLog(allocator, program, getProgrami(program, INFO_LOG_LENGTH), null); + public static String getProgramInfoLog(int program) { + return getProgramInfoLog(program, getProgrami(program, INFO_LOG_LENGTH), null); } public static void getProgramiv(int program, int pname, MemorySegment params) { @@ -505,18 +517,29 @@ public static void getShaderInfoLog(int shader, int bufSize, MemorySegment lengt } } - public static String getShaderInfoLog(SegmentAllocator allocator, int shader, int bufSize, int @Nullable [] length) { - var pLen = length != null ? allocator.allocate(JAVA_INT) : MemorySegment.NULL; - var pLog = allocator.allocateArray(JAVA_BYTE, bufSize); - getShaderInfoLog(shader, bufSize, pLen, pLog); - if (length != null && length.length > 0) { - length[0] = pLen.get(JAVA_INT, 0); + public static String getShaderInfoLog(int shader, int bufSize, int @Nullable [] length) { + final MemoryStack stack = MemoryStack.stackGet(); + final long stackPointer = stack.getPointer(); + try { + var pLen = length != null ? stack.callocInt() : MemorySegment.NULL; + final Arena allocator = stack.getPointer() < bufSize ? Arena.ofConfined() : stack; + try { + var pLog = allocator.allocateArray(JAVA_BYTE, bufSize); + getShaderInfoLog(shader, bufSize, pLen, pLog); + if (length != null && length.length > 0) { + length[0] = pLen.get(JAVA_INT, 0); + } + return pLog.getUtf8String(0); + } finally { + if (!(allocator instanceof MemoryStack)) allocator.close(); + } + } finally { + stack.setPointer(stackPointer); } - return pLog.getUtf8String(0); } - public static String getShaderInfoLog(SegmentAllocator allocator, int shader) { - return getShaderInfoLog(allocator, shader, getShaderi(shader, INFO_LOG_LENGTH), null); + public static String getShaderInfoLog(int shader) { + return getShaderInfoLog(shader, getShaderi(shader, INFO_LOG_LENGTH), null); } public static void getShaderSource(int shader, int bufSize, MemorySegment length, MemorySegment source) { From 0020316ee148b7e06c381733b8111c669945db41 Mon Sep 17 00:00:00 2001 From: squid233 <60126026+squid233@users.noreply.github.com> Date: Tue, 22 Aug 2023 19:01:57 +0800 Subject: [PATCH 09/14] Upgrade Gradle to 8.3 --- build.gradle.kts | 6 +++--- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 3bc534f8..0e6decf0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -202,7 +202,7 @@ subprojects { tasks.register("assembleJavadocArgs") { group = "build" - val mspFile = Path("${rootProject.buildDir}/tmp/modulesourcepath.args") + val mspFile = Path("${rootProject.layout.buildDirectory.get().asFile}/tmp/modulesourcepath.args") outputs.file(mspFile) doLast { @@ -222,13 +222,13 @@ tasks.register("aggregateJavadoc") { val projectsToDoc = Artifact.values().map { project(it.subprojectName) } dependsOn(projectsToDoc.map { it.getTasksByName("classes", true) }) source(projectsToDoc.map { it.sourceSets["main"].java }) - destinationDir = File("$buildDir/docs/javadoc") + destinationDir = File("${layout.buildDirectory.get().asFile}/docs/javadoc") classpath = files(projectsToDoc.map { it.configurations["compileClasspath"].files }) executable = project.findProperty("javadocExecutable") as String? - options.optionFiles = listOf(File("${rootProject.buildDir}/tmp/modulesourcepath.args")) + options.optionFiles = listOf(File("${rootProject.layout.buildDirectory.get().asFile}/tmp/modulesourcepath.args")) } allprojects { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9f4197d5..ac72c34e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From ee0459f101bc0658444cd15423b4489f7c4d2b99 Mon Sep 17 00:00:00 2001 From: squid233 <60126026+squid233@users.noreply.github.com> Date: Sun, 17 Sep 2023 11:33:42 +0800 Subject: [PATCH 10/14] Uses string templates --- .../java/overrungl/FunctionDescriptors.java | 7 ++- .../java/overrungl/internal/Exceptions.java | 37 ++++++++++++++++ .../overrungl/internal/RuntimeHelper.java | 10 ++--- .../main/java/overrungl/os/Architecture.java | 8 +++- .../src/main/java/overrungl/os/Platform.java | 23 ++++++++-- .../main/java/overrungl/util/CheckUtil.java | 2 +- .../java/overrungl/util/DebugAllocator.java | 43 +++++++------------ .../src/main/java/overrungl/glfw/GLFW.java | 2 + .../overrungl/glfw/GLFWErrorCallback.java | 13 ++---- .../src/main/java/overrungl/nfd/NFD.java | 4 +- .../java/overrungl/nfd/NFDEnumerator.java | 2 +- .../main/java/overrungl/opengl/GLUtil.java | 24 +++-------- .../test/java/overrungl/demo/nfd/NFDTest.java | 20 ++++----- 13 files changed, 113 insertions(+), 82 deletions(-) create mode 100644 modules/overrungl.core/src/main/java/overrungl/internal/Exceptions.java diff --git a/modules/overrungl.core/src/main/java/overrungl/FunctionDescriptors.java b/modules/overrungl.core/src/main/java/overrungl/FunctionDescriptors.java index 77b8d514..8a8ba594 100644 --- a/modules/overrungl.core/src/main/java/overrungl/FunctionDescriptors.java +++ b/modules/overrungl.core/src/main/java/overrungl/FunctionDescriptors.java @@ -16,6 +16,7 @@ package overrungl; +import overrungl.internal.Exceptions; import overrungl.util.MemoryUtil; import java.lang.foreign.FunctionDescriptor; @@ -38,7 +39,7 @@ * case 'D' -> JAVA_DOUBLE; * case 'P' -> ADDRESS; * case 'p' -> MemoryUtil.ADDRESS_UNBOUNDED; - * default -> throw new IllegalStateException(); + * default -> throw new IllegalArgumentException(); * }} * * @author squid233 @@ -124,9 +125,7 @@ public static ValueLayout ofValue(char c) throws IllegalArgumentException { case 'P' -> ADDRESS; case 'p' -> MemoryUtil.ADDRESS_UNBOUNDED; default -> - throw new IllegalArgumentException( - STR."Invalid argument c: expected one of B, S, I, J, C, Z, F, D, P or p; got '\{c}'" - ); + throw Exceptions.IAE. "Invalid argument c: expected one of B, S, I, J, C, Z, F, D, P or p; got '\{ c }'" ; }; } diff --git a/modules/overrungl.core/src/main/java/overrungl/internal/Exceptions.java b/modules/overrungl.core/src/main/java/overrungl/internal/Exceptions.java new file mode 100644 index 00000000..54e12662 --- /dev/null +++ b/modules/overrungl.core/src/main/java/overrungl/internal/Exceptions.java @@ -0,0 +1,37 @@ +/* + * MIT License + * + * Copyright (c) 2023 Overrun Organization + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + */ + +package overrungl.internal; + +/** + * Quick create exceptions + * + * @author squid233 + * @since 0.1.0 + */ +public final class Exceptions { + /** + * {@link IllegalStateException} + */ + public static final StringTemplate.Processor ISE = stringTemplate -> + new IllegalStateException(stringTemplate.interpolate()); + + /** + * {@link IllegalArgumentException} + */ + public static final StringTemplate.Processor IAE = stringTemplate -> + new IllegalArgumentException(stringTemplate.interpolate()); +} diff --git a/modules/overrungl.core/src/main/java/overrungl/internal/RuntimeHelper.java b/modules/overrungl.core/src/main/java/overrungl/internal/RuntimeHelper.java index 570bcf6d..00c87c5f 100644 --- a/modules/overrungl.core/src/main/java/overrungl/internal/RuntimeHelper.java +++ b/modules/overrungl.core/src/main/java/overrungl/internal/RuntimeHelper.java @@ -137,7 +137,7 @@ public static String unknownToken(int token) { * @return the string is formatted in {@code STR."\{description} [0x\{toHexString(token)}]"}. */ public static String unknownToken(String description, int token) { - return description + "[0x" + Integer.toHexString(token) + "]"; + return STR. "\{ description } [0x\{ Integer.toHexString(token) }]" ; } /** @@ -161,7 +161,7 @@ public static SymbolLookup load(String module, String basename, String version) uri = localFile.toURI(); } else { // 2. Load from classpath - var file = new File(tmpdir, "overrungl" + System.getProperty("user.name")); + var file = new File(tmpdir, STR. "overrungl\{ System.getProperty("user.name") }" ); if (!file.exists()) { // Create directory file.mkdir(); @@ -171,15 +171,15 @@ public static SymbolLookup load(String module, String basename, String version) // Create directory file.mkdir(); } - var libFile = new File(file, basename + "-" + version + suffix); + var libFile = new File(file, STR. "\{ basename }-\{ version }\{ suffix }" ); if (!libFile.exists()) { // Extract try (var is = STACK_WALKER.getCallerClass().getClassLoader().getResourceAsStream( - module + "/" + os.familyName() + "/" + Architecture.current() + "/" + path + STR. "\{ module }/\{ os.familyName() }/\{ Architecture.current() }/\{ path }" )) { Files.copy(Objects.requireNonNull(is), Path.of(libFile.getAbsolutePath())); } catch (Exception e) { - var exception = new IllegalStateException("File not found: " + file + "; try setting property -Doverrungl.natives to a valid path"); + var exception = new IllegalStateException(STR. "File not found: \{ file }; try setting property -Doverrungl.natives to a valid path" ); exception.addSuppressed(e); throw exception; } diff --git a/modules/overrungl.core/src/main/java/overrungl/os/Architecture.java b/modules/overrungl.core/src/main/java/overrungl/os/Architecture.java index 3239f4fd..a29af38a 100644 --- a/modules/overrungl.core/src/main/java/overrungl/os/Architecture.java +++ b/modules/overrungl.core/src/main/java/overrungl/os/Architecture.java @@ -16,6 +16,8 @@ package overrungl.os; +import overrungl.internal.Exceptions; + import java.util.Locale; /** @@ -29,6 +31,8 @@ public enum Architecture { ARM64, ARM32; + private final String toStringValue = name().toLowerCase(Locale.ROOT); + /** * {@return the current architecture of the current {@linkplain Platform platform}} */ @@ -45,7 +49,7 @@ class Holder { X64; case Platform.MacOSX _ -> arch.startsWith("aarch64") ? ARM64 : X64; case Platform.Windows _ when arch.contains("64") -> arch.startsWith("aarch64") ? ARM64 : X64; - default -> throw new IllegalStateException("Unrecognized or unsupported architecture: " + arch); + default -> throw Exceptions.ISE. "Unrecognized or unsupported architecture: \{ arch }" ; }; } } @@ -54,6 +58,6 @@ class Holder { @Override public String toString() { - return name().toLowerCase(Locale.ROOT); + return toStringValue; } } diff --git a/modules/overrungl.core/src/main/java/overrungl/os/Platform.java b/modules/overrungl.core/src/main/java/overrungl/os/Platform.java index d833d158..72183c55 100644 --- a/modules/overrungl.core/src/main/java/overrungl/os/Platform.java +++ b/modules/overrungl.core/src/main/java/overrungl/os/Platform.java @@ -16,6 +16,8 @@ package overrungl.os; +import overrungl.internal.Exceptions; + /** * The native platform, identifying the operating system and the architecture. * @@ -38,7 +40,7 @@ else if (os.startsWith("Mac OS X") || os.startsWith("Darwin")) CURRENT = MacOSX.INSTANCE; else if (os.startsWith("Windows")) CURRENT = Windows.INSTANCE; - else throw new IllegalStateException("Unrecognized or unsupported platform: " + os); + else throw Exceptions.ISE. "Unrecognized or unsupported platform: \{ os }" ; } } return Holder.CURRENT; @@ -85,6 +87,11 @@ public String sharedLibrarySuffix() { public String sharedLibraryName(String libraryName) { return Platform.unixSharedLibraryName(libraryName, sharedLibrarySuffix()); } + + @Override + public String toString() { + return familyName(); + } } /** @@ -110,6 +117,11 @@ public String sharedLibrarySuffix() { public String sharedLibraryName(String libraryName) { return Platform.unixSharedLibraryName(libraryName, sharedLibrarySuffix()); } + + @Override + public String toString() { + return familyName(); + } } /** @@ -135,6 +147,11 @@ public String sharedLibrarySuffix() { public String sharedLibraryName(String libraryName) { return Platform.withExtension(libraryName, sharedLibrarySuffix()); } + + @Override + public String toString() { + return familyName(); + } } private static String unixSharedLibraryName(String libraryName, String suffix) { @@ -143,9 +160,9 @@ private static String unixSharedLibraryName(String libraryName, String suffix) { } int pos = libraryName.lastIndexOf('/'); if (pos >= 0) { - return libraryName.substring(0, pos + 1) + "lib" + libraryName.substring(pos + 1) + suffix; + return STR. "\{ libraryName.substring(0, pos + 1) }lib\{ libraryName.substring(pos + 1) }\{ suffix }" ; } - return "lib" + libraryName + suffix; + return STR. "lib\{ libraryName }\{ suffix }" ; } /** diff --git a/modules/overrungl.core/src/main/java/overrungl/util/CheckUtil.java b/modules/overrungl.core/src/main/java/overrungl/util/CheckUtil.java index 058d20c3..41743db4 100644 --- a/modules/overrungl.core/src/main/java/overrungl/util/CheckUtil.java +++ b/modules/overrungl.core/src/main/java/overrungl/util/CheckUtil.java @@ -78,7 +78,7 @@ public static void check(boolean condition, String message) throws IllegalStateE * @see #checkNotNullptr(MemorySegment, String) */ public static void checkNotNullptr(MemorySegment segment) throws IllegalStateException { - checkNotNullptr(segment, "condition == false"); + checkNotNullptr(segment, "segment is NULL"); } /** diff --git a/modules/overrungl.core/src/main/java/overrungl/util/DebugAllocator.java b/modules/overrungl.core/src/main/java/overrungl/util/DebugAllocator.java index c7de2ad2..28d6309d 100644 --- a/modules/overrungl.core/src/main/java/overrungl/util/DebugAllocator.java +++ b/modules/overrungl.core/src/main/java/overrungl/util/DebugAllocator.java @@ -20,6 +20,7 @@ import org.jetbrains.annotations.Nullable; import overrungl.Configurations; import overrungl.OverrunGL; +import overrungl.internal.Exceptions; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; @@ -44,22 +45,16 @@ final class DebugAllocator { for (Allocation allocation : ALLOCATIONS.keySet()) { StringBuilder sb = new StringBuilder(512); - sb.append("[OverrunGL] ") - .append(allocation.size) - .append(" bytes leaked, thread ") - .append(allocation.threadId) - .append(" (") - .append(THREADS.get(allocation.threadId)) - .append("), address: 0x") - .append(Long.toHexString(allocation.address).toUpperCase()) - .append("\n"); + sb.append(STR. """ + [OverrunGL] \{ allocation.size } bytes leaked,\ + thread \{ allocation.threadId } (\{ THREADS.get(allocation.threadId) }),\ + address: 0x\{ Long.toHexString(allocation.address).toUpperCase() } + """ ); StackTraceElement[] stackTrace = allocation.getElements(); if (stackTrace != null) { for (Object el : stackTrace) { - sb.append("\tat ") - .append(el.toString()) - .append("\n"); + sb.append(STR. "\tat \{ el.toString() }\n" ); } } else { missingStacktrace = true; @@ -104,30 +99,22 @@ private static void trackAbort(long address, Allocation allocationOld, Allocatio trackAbortPrint(allocationOld, "Old", addressHex); trackAbortPrint(allocationNew, "New", addressHex); - throw new IllegalStateException(STR."The memory address specified is already being tracked: 0x\{addressHex}"); + throw Exceptions.ISE. "The memory address specified is already being tracked: 0x\{ addressHex }" ; } private static void trackAbortPrint(Allocation allocation, String name, String address) { StringBuilder sb = new StringBuilder(512); - sb.append("[OverrunGL] ") - .append(name) - .append(" allocation with size ") - .append(allocation.size) - .append(", thread ") - .append(allocation.threadId) - .append(" (") - .append(THREADS.get(allocation.threadId)) - .append("), address: 0x") - .append(address) - .append("\n"); + sb.append(STR. """ + [OverrunGL] \{ name } allocation with size \{ allocation.size },\ + thread \{ allocation.threadId } (\{ THREADS.get(allocation.threadId) }),\ + address: 0x\{ address } + """ ); StackTraceElement[] stackTrace = allocation.getElements(); if (stackTrace != null) { for (Object el : stackTrace) { - sb.append("\tat ") - .append(el.toString()) - .append("\n"); + sb.append(STR. "\tat \{ el.toString() }\n" ); } } @@ -151,7 +138,7 @@ static long untrack(long address) { private static void untrackAbort(long address) { String addressHex = Long.toHexString(address).toUpperCase(); - throw new IllegalStateException(STR."The memory address specified is not being tracked: 0x\{addressHex}"); + throw Exceptions.ISE. "The memory address specified is not being tracked: 0x\{ addressHex }" ; } private record Allocation(long address, long size, long threadId, @Nullable Object[] stacktrace) { diff --git a/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFW.java b/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFW.java index bfc4465a..7fe07306 100644 --- a/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFW.java +++ b/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFW.java @@ -855,6 +855,8 @@ private GLFW() { /** * Converts the given error code to a readable string. + *

+ * This method is created by OverrunGL and does not belong to the original GLFW library. * * @param errorCode the error code. * @return the error string. diff --git a/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWErrorCallback.java b/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWErrorCallback.java index 5531ac1f..a96b6c37 100644 --- a/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWErrorCallback.java +++ b/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWErrorCallback.java @@ -17,6 +17,7 @@ package overrungl.glfw; import overrungl.OverrunGL; +import overrungl.internal.Exceptions; import java.io.PrintStream; import java.util.function.Consumer; @@ -37,7 +38,7 @@ private GLFWErrorCallback() { */ public static IGLFWErrorFun createThrow() { return (errorCode, description) -> { - throw new IllegalStateException(String.format("GLFW error [0x%X]: %s", errorCode, description)); + throw Exceptions.ISE. "GLFW error [0x\{ Integer.toHexString(errorCode) }]: \{ description }" ; }; } @@ -49,16 +50,10 @@ public static IGLFWErrorFun createThrow() { public static IGLFWErrorFun createLog(Consumer logger) { return (errorCode, description) -> { var sb = new StringBuilder(512); - sb.append("[OverrunGL] GLFW ") - .append(GLFW.getErrorString(errorCode)) - .append(" error: ") - .append(description) - .append("\n"); + sb.append(STR. "[OverrunGL] GLFW \{ GLFW.getErrorString(errorCode) } error: \{ description }\n" ); var stack = Thread.currentThread().getStackTrace(); for (int i = 3; i < stack.length; i++) { - sb.append(" at ") - .append(stack[i]) - .append("\n"); + sb.append(STR. " at \{ stack[i] }\n" ); } logger.accept(sb.toString()); }; diff --git a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java index d69db9f7..9ee4deef 100644 --- a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java +++ b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java @@ -64,8 +64,8 @@ * new Pair<>("Image file", "png,jpg")); * var result = NFD.openDialogN(outPath, filterItem, null); * switch (result) { - * case ERROR -> System.err.println("Error: " + NFD.getError()); - * case OKAY -> System.out.println("Success! " + outPath[0]); + * case ERROR -> System.err.println(STR. "Error: \{ NFD.getError() }" ); + * case OKAY -> System.out.println(STR. "Success! \{ outPath[0] }" ); * case CANCEL -> System.out.println("User pressed cancel."); * } * } diff --git a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDEnumerator.java b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDEnumerator.java index a788e148..6a92ed55 100644 --- a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDEnumerator.java +++ b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDEnumerator.java @@ -148,7 +148,7 @@ public static Tuple2 fromPathSetU8(SegmentAllocator al } private static IllegalStateException errorIterating() { - return new IllegalStateException("Error iterating: " + NFD.getError()); + return new IllegalStateException(STR. "Error iterating: \{ NFD.getError() }" ); } @NotNull diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLUtil.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLUtil.java index d6424a57..ca34423a 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLUtil.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLUtil.java @@ -78,16 +78,14 @@ public static Arena setupDebugMessageCallback(Consumer logger) { GL.debugMessageCallback(arena, (source, type, id, severity, message, userParam) -> { var sb = new StringBuilder(768); sb.append("[OverrunGL] OpenGL debug message\n"); - printDetail(sb, "ID", STR."0x\{Integer.toHexString(id).toUpperCase(Locale.ROOT)}"); + printDetail(sb, "ID", STR. "0x\{ Integer.toHexString(id).toUpperCase(Locale.ROOT) }" ); printDetail(sb, "Source", getDebugSource(source)); printDetail(sb, "Type", getDebugType(type)); printDetail(sb, "Severity", getDebugSeverity(severity)); printDetail(sb, "Message", message); var stack = Thread.currentThread().getStackTrace(); for (int i = 3; i < stack.length; i++) { - sb.append(" at ") - .append(stack[i]) - .append("\n"); + sb.append(STR. " at \{ stack[i] }\n" ); } logger.accept(sb.toString()); }, MemorySegment.NULL); @@ -106,16 +104,14 @@ public static Arena setupDebugMessageCallback(Consumer logger) { glDebugMessageCallbackARB(arena, (source, type, id, severity, message, userParam) -> { var sb = new StringBuilder(768); sb.append("[OverrunGL] ARB_debug_output message\n"); - printDetail(sb, "ID", STR."0x\{Integer.toHexString(id).toUpperCase(Locale.ROOT)}"); + printDetail(sb, "ID", STR. "0x\{ Integer.toHexString(id).toUpperCase(Locale.ROOT) }" ); printDetail(sb, "Source", getSourceARB(source)); printDetail(sb, "Type", getTypeARB(type)); printDetail(sb, "Severity", getSeverityARB(severity)); printDetail(sb, "Message", message); var stack = Thread.currentThread().getStackTrace(); for (int i = 3; i < stack.length; i++) { - sb.append(" at ") - .append(stack[i]) - .append("\n"); + sb.append(STR. " at \{ stack[i] }\n" ); } logger.accept(sb.toString()); }, MemorySegment.NULL); @@ -128,15 +124,13 @@ public static Arena setupDebugMessageCallback(Consumer logger) { glDebugMessageCallbackAMD(arena, (id, category, severity, message, userParam) -> { var sb = new StringBuilder(768); sb.append("[OverrunGL] AMD_debug_output message\n"); - printDetail(sb, "ID", STR."0x\{Integer.toHexString(id).toUpperCase(Locale.ROOT)}"); + printDetail(sb, "ID", STR. "0x\{ Integer.toHexString(id).toUpperCase(Locale.ROOT) }" ); printDetail(sb, "Category", getCategoryAMD(category)); printDetail(sb, "Severity", getSeverityAMD(severity)); printDetail(sb, "Message", message); var stack = Thread.currentThread().getStackTrace(); for (int i = 3; i < stack.length; i++) { - sb.append(" at ") - .append(stack[i]) - .append("\n"); + sb.append(STR. " at \{ stack[i] }\n" ); } logger.accept(sb.toString()); }, MemorySegment.NULL); @@ -148,11 +142,7 @@ public static Arena setupDebugMessageCallback(Consumer logger) { } private static void printDetail(StringBuilder sb, String type, String message) { - sb.append(" ") - .append(type) - .append(": ") - .append(message) - .append("\n"); + sb.append(STR. " \{ type }: \{ message }\n" ); } private static String getDebugSource(int source) { diff --git a/modules/samples/src/test/java/overrungl/demo/nfd/NFDTest.java b/modules/samples/src/test/java/overrungl/demo/nfd/NFDTest.java index 75be4ada..7374f897 100644 --- a/modules/samples/src/test/java/overrungl/demo/nfd/NFDTest.java +++ b/modules/samples/src/test/java/overrungl/demo/nfd/NFDTest.java @@ -50,8 +50,8 @@ private static void openDialog() { final NFDResult result = NFD.openDialogN(outPath, filterItem, null); switch (result) { - case ERROR -> System.err.println("Error: " + NFD.getError()); - case OKAY -> System.out.println("Success! " + outPath[0]); + case ERROR -> System.err.println(STR. "Error: \{ NFD.getError() }" ); + case OKAY -> System.out.println(STR. "Success! \{ outPath[0] }" ); case CANCEL -> System.out.println("User pressed cancel."); } } @@ -81,13 +81,13 @@ private static void openDialogMultiple() { MemorySegment outPaths = pOutPaths.get(ValueLayout.ADDRESS, 0); switch (result) { - case ERROR -> System.err.println("Error: " + NFD.getError()); + case ERROR -> System.err.println(STR. "Error: \{ NFD.getError() }" ); case OKAY -> { System.out.println("Success!"); for (long i = 0, numPaths = NFD.pathSetGetCount(outPaths).y(); i < numPaths; i++) { NFD.pathSetGetPathN(outPaths, i, outPath); - System.out.println("Path " + i + ": " + outPath[0]); + System.out.println(STR. "Path \{ i }: \{ outPath[0] }" ); } // remember to free the path-set memory (since NFDResult::OKAY is returned) @@ -121,14 +121,14 @@ private static void openDialogMultipleEnum() { MemorySegment outPaths = pOutPaths.get(ValueLayout.ADDRESS, 0); switch (result) { - case ERROR -> System.err.println("Error: " + NFD.getError()); + case ERROR -> System.err.println(STR. "Error: \{ NFD.getError() }" ); case OKAY -> { System.out.println("Success!"); try (NFDEnumerator enumerator = NFDEnumerator.fromPathSetN(stack, outPaths).y()) { int i = 0; for (String path : enumerator) { - System.out.println("Path " + i + ": " + path); + System.out.println(STR. "Path \{ i }: \{ path }" ); i++; } } @@ -157,8 +157,8 @@ private static void pickFolder() { // show the dialog final NFDResult result = NFD.pickFolderN(outPath, null); switch (result) { - case ERROR -> System.err.println("Error: " + NFD.getError()); - case OKAY -> System.out.println("Success! " + outPath[0]); + case ERROR -> System.err.println(STR. "Error: \{ NFD.getError() }" ); + case OKAY -> System.out.println(STR. "Success! \{ outPath[0] }" ); case CANCEL -> System.out.println("User pressed cancel."); } } @@ -185,8 +185,8 @@ private static void saveDialog() { // show the dialog final NFDResult result = NFD.saveDialogN(savePath, filterItem, null, "Untitled.java"); switch (result) { - case ERROR -> System.err.println("Error: " + NFD.getError()); - case OKAY -> System.out.println("Success! " + savePath[0]); + case ERROR -> System.err.println(STR. "Error: \{ NFD.getError() }" ); + case OKAY -> System.out.println(STR. "Success! \{ savePath[0] }" ); case CANCEL -> System.out.println("User pressed cancel."); } } From 0188777c41700a415853e05cd5df85214dab8be1 Mon Sep 17 00:00:00 2001 From: squid233 <60126026+squid233@users.noreply.github.com> Date: Sat, 23 Sep 2023 19:51:27 +0800 Subject: [PATCH 11/14] Update project information --- .github/workflows/gradle.yml | 3 +-- README.md | 4 ++-- gradle.properties | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 8c5e506a..be47646f 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: java: [ - 21-ea + 21 ] os: [ ubuntu-latest, windows-latest ] runs-on: ${{ matrix.os }} @@ -25,7 +25,6 @@ jobs: with: java-version: | ${{ matrix.java }} - 20 distribution: 'temurin' - name: Grant execute permission for gradlew if: ${{ runner.os != 'Windows' }} diff --git a/README.md b/README.md index 9afaa80d..36cbea26 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ ## Introduction -Overrun Game Library is a high-performance library that implemented with Java 21, +Overrun Game Library is a high-performance library implemented with Java 21, enables cross-platform access to a set of C/C++ library bindings, and provides some useful utilities. ### OverrunGL vs. LWJGL @@ -19,7 +19,7 @@ enables cross-platform access to a set of C/C++ library bindings, and provides s [LWJGL 3](https://github.com/LWJGL/lwjgl3) is also a Java library that enables native access. LWJGL 3 uses JNI to access native functions, -but OverrunGL uses [FFM API](https://openjdk.org/jeps/434), which has better performance. +but OverrunGL uses [FFM API](https://openjdk.org/jeps/442), which has better performance. ## Getting Started diff --git a/gradle.properties b/gradle.properties index b646765c..10e64037 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ projArtifactId=overrungl projName=overrungl projVersion=0.1.0-SNAPSHOT projVcs=Over-Run/overrungl -projBranch=0.x +projBranch=main # Organization orgName=Overrun Organization From a8260bb9e1a9a69295872c2a3b1a2b6c65c76676 Mon Sep 17 00:00:00 2001 From: squid233 <60126026+squid233@users.noreply.github.com> Date: Sat, 30 Sep 2023 09:28:37 +0800 Subject: [PATCH 12/14] Remove trivial function invoke --- .../src/main/java/overrungl/glfw/Handles.java | 134 +++++++++--------- .../src/main/java/overrungl/nfd/NFD.java | 14 +- .../src/main/java/overrungl/opengl/GL10C.java | 78 +++++----- .../src/main/java/overrungl/opengl/GL11C.java | 10 +- .../src/main/java/overrungl/opengl/GL13C.java | 4 +- .../src/main/java/overrungl/opengl/GL14C.java | 14 +- .../src/main/java/overrungl/opengl/GL15C.java | 22 +-- .../src/main/java/overrungl/opengl/GL20C.java | 50 +++---- .../src/main/java/overrungl/opengl/GL30C.java | 56 ++++---- .../src/main/java/overrungl/opengl/GL31C.java | 16 +-- .../src/main/java/overrungl/opengl/GL32C.java | 18 +-- .../src/main/java/overrungl/opengl/GL33C.java | 32 ++--- .../src/main/java/overrungl/opengl/GL40C.java | 38 ++--- .../src/main/java/overrungl/opengl/GL41C.java | 30 ++-- .../src/main/java/overrungl/opengl/GL42C.java | 4 +- .../src/main/java/overrungl/opengl/GL43C.java | 10 +- .../src/main/java/overrungl/opengl/GL45C.java | 78 +++++----- .../src/main/java/overrungl/opengl/GL46C.java | 2 +- .../java/overrungl/opengl/GLLoadFunc.java | 11 -- .../src/main/java/overrungl/stb/Handles.java | 3 +- .../main/java/overrungl/stb/STBEasyFont.java | 8 +- .../src/main/java/overrungl/stb/STBImage.java | 16 +-- .../java/overrungl/stb/STBImageWrite.java | 14 +- 23 files changed, 325 insertions(+), 337 deletions(-) diff --git a/modules/overrungl.glfw/src/main/java/overrungl/glfw/Handles.java b/modules/overrungl.glfw/src/main/java/overrungl/glfw/Handles.java index 5fcf3cb0..82903ca9 100644 --- a/modules/overrungl.glfw/src/main/java/overrungl/glfw/Handles.java +++ b/modules/overrungl.glfw/src/main/java/overrungl/glfw/Handles.java @@ -133,57 +133,57 @@ static void create() { STR."\{GLFW.VERSION_MAJOR}.\{GLFW.VERSION_MINOR}.\{GLFW.VERSION_REVISION}"); glfwInit = downcall("glfwInit", I); glfwTerminate = downcall("glfwTerminate", V); - glfwInitHint = downcallTrivial("glfwInitHint", IIV); + glfwInitHint = downcall("glfwInitHint", IIV); glfwGetVersion = downcallTrivial("glfwGetVersion", PPPV); glfwGetVersionString = downcallTrivial("glfwGetVersionString", p); glfwGetError = downcallTrivial("glfwGetError", fd_PI); glfwSetErrorCallback = downcall("glfwSetErrorCallback", PP); - glfwGetMonitors = downcallTrivial("glfwGetMonitors", Pp); - glfwGetPrimaryMonitor = downcallTrivial("glfwGetPrimaryMonitor", P); - glfwGetMonitorPos = downcallTrivial("glfwGetMonitorPos", PPPV); - glfwGetMonitorWorkarea = downcallTrivial("glfwGetMonitorWorkarea", PPPPPV); - glfwGetMonitorPhysicalSize = downcallTrivial("glfwGetMonitorPhysicalSize", PPPV); - glfwGetMonitorContentScale = downcallTrivial("glfwGetMonitorContentScale", PPPV); - glfwGetMonitorName = downcallTrivial("glfwGetMonitorName", Pp); + glfwGetMonitors = downcall("glfwGetMonitors", Pp); + glfwGetPrimaryMonitor = downcall("glfwGetPrimaryMonitor", P); + glfwGetMonitorPos = downcall("glfwGetMonitorPos", PPPV); + glfwGetMonitorWorkarea = downcall("glfwGetMonitorWorkarea", PPPPPV); + glfwGetMonitorPhysicalSize = downcall("glfwGetMonitorPhysicalSize", PPPV); + glfwGetMonitorContentScale = downcall("glfwGetMonitorContentScale", PPPV); + glfwGetMonitorName = downcall("glfwGetMonitorName", Pp); glfwSetMonitorUserPointer = downcallTrivial("glfwSetMonitorUserPointer", PPV); glfwGetMonitorUserPointer = downcallTrivial("glfwGetMonitorUserPointer", PP); glfwSetMonitorCallback = downcall("glfwSetMonitorCallback", PP); - glfwGetVideoModes = downcallTrivial("glfwGetVideoModes", PPp); - glfwGetVideoMode = downcall("glfwGetVideoMode", FunctionDescriptor.of(ADDRESS.withTargetLayout(GLFWVidMode.LAYOUT), ADDRESS), Linker.Option.isTrivial()); - glfwSetGamma = downcallTrivial("glfwSetGamma", PFV); - glfwGetGammaRamp = downcall("glfwGetGammaRamp", FunctionDescriptor.of(ADDRESS.withTargetLayout(GLFWGammaRamp.LAYOUT), ADDRESS), Linker.Option.isTrivial()); - glfwSetGammaRamp = downcallTrivial("glfwSetGammaRamp", PPV); - glfwDefaultWindowHints = downcallTrivial("glfwDefaultWindowHints", V); - glfwWindowHint = downcallTrivial("glfwWindowHint", IIV); - glfwWindowHintString = downcallTrivial("glfwWindowHintString", IPV); + glfwGetVideoModes = downcall("glfwGetVideoModes", PPp); + glfwGetVideoMode = downcall("glfwGetVideoMode", FunctionDescriptor.of(ADDRESS.withTargetLayout(GLFWVidMode.LAYOUT), ADDRESS)); + glfwSetGamma = downcall("glfwSetGamma", PFV); + glfwGetGammaRamp = downcall("glfwGetGammaRamp", FunctionDescriptor.of(ADDRESS.withTargetLayout(GLFWGammaRamp.LAYOUT), ADDRESS)); + glfwSetGammaRamp = downcall("glfwSetGammaRamp", PPV); + glfwDefaultWindowHints = downcall("glfwDefaultWindowHints", V); + glfwWindowHint = downcall("glfwWindowHint", IIV); + glfwWindowHintString = downcall("glfwWindowHintString", IPV); glfwCreateWindow = downcall("glfwCreateWindow", IIPPPP); glfwDestroyWindow = downcall("glfwDestroyWindow", PV); glfwWindowShouldClose = downcallTrivial("glfwWindowShouldClose", fd_PI); glfwSetWindowShouldClose = downcallTrivial("glfwSetWindowShouldClose", PIV); - glfwSetWindowTitle = downcallTrivial("glfwSetWindowTitle", PPV); - glfwSetWindowIcon = downcallTrivial("glfwSetWindowIcon", PIPV); - glfwGetWindowPos = downcallTrivial("glfwGetWindowPos", PPPV); - glfwSetWindowPos = downcallTrivial("glfwSetWindowPos", PIIV); - glfwGetWindowSize = downcallTrivial("glfwGetWindowSize", PPPV); - glfwSetWindowSizeLimits = downcallTrivial("glfwSetWindowSizeLimits", PIIIIV); - glfwSetWindowAspectRatio = downcallTrivial("glfwSetWindowAspectRatio", PIIV); - glfwSetWindowSize = downcallTrivial("glfwSetWindowSize", PIIV); - glfwGetFramebufferSize = downcallTrivial("glfwGetFramebufferSize", PPPV); - glfwGetWindowFrameSize = downcallTrivial("glfwGetWindowFrameSize", PPPPPV); - glfwGetWindowContentScale = downcallTrivial("glfwGetWindowContentScale", PPPV); - glfwGetWindowOpacity = downcallTrivial("glfwGetWindowOpacity", PF); - glfwSetWindowOpacity = downcallTrivial("glfwSetWindowOpacity", PFV); - glfwIconifyWindow = downcallTrivial("glfwIconifyWindow", PV); - glfwRestoreWindow = downcallTrivial("glfwRestoreWindow", PV); - glfwMaximizeWindow = downcallTrivial("glfwMaximizeWindow", PV); - glfwShowWindow = downcallTrivial("glfwShowWindow", PV); - glfwHideWindow = downcallTrivial("glfwHideWindow", PV); - glfwFocusWindow = downcallTrivial("glfwFocusWindow", PV); - glfwRequestWindowAttention = downcallTrivial("glfwRequestWindowAttention", PV); - glfwGetWindowMonitor = downcallTrivial("glfwGetWindowMonitor", PP); - glfwSetWindowMonitor = downcallTrivial("glfwSetWindowMonitor", PPIIIIIV); - glfwGetWindowAttrib = downcallTrivial("glfwGetWindowAttrib", PII); - glfwSetWindowAttrib = downcallTrivial("glfwSetWindowAttrib", PIIV); + glfwSetWindowTitle = downcall("glfwSetWindowTitle", PPV); + glfwSetWindowIcon = downcall("glfwSetWindowIcon", PIPV); + glfwGetWindowPos = downcall("glfwGetWindowPos", PPPV); + glfwSetWindowPos = downcall("glfwSetWindowPos", PIIV); + glfwGetWindowSize = downcall("glfwGetWindowSize", PPPV); + glfwSetWindowSizeLimits = downcall("glfwSetWindowSizeLimits", PIIIIV); + glfwSetWindowAspectRatio = downcall("glfwSetWindowAspectRatio", PIIV); + glfwSetWindowSize = downcall("glfwSetWindowSize", PIIV); + glfwGetFramebufferSize = downcall("glfwGetFramebufferSize", PPPV); + glfwGetWindowFrameSize = downcall("glfwGetWindowFrameSize", PPPPPV); + glfwGetWindowContentScale = downcall("glfwGetWindowContentScale", PPPV); + glfwGetWindowOpacity = downcall("glfwGetWindowOpacity", PF); + glfwSetWindowOpacity = downcall("glfwSetWindowOpacity", PFV); + glfwIconifyWindow = downcall("glfwIconifyWindow", PV); + glfwRestoreWindow = downcall("glfwRestoreWindow", PV); + glfwMaximizeWindow = downcall("glfwMaximizeWindow", PV); + glfwShowWindow = downcall("glfwShowWindow", PV); + glfwHideWindow = downcall("glfwHideWindow", PV); + glfwFocusWindow = downcall("glfwFocusWindow", PV); + glfwRequestWindowAttention = downcall("glfwRequestWindowAttention", PV); + glfwGetWindowMonitor = downcall("glfwGetWindowMonitor", PP); + glfwSetWindowMonitor = downcall("glfwSetWindowMonitor", PPIIIIIV); + glfwGetWindowAttrib = downcall("glfwGetWindowAttrib", PII); + glfwSetWindowAttrib = downcall("glfwSetWindowAttrib", PIIV); glfwSetWindowUserPointer = downcallTrivial("glfwSetWindowUserPointer", PPV); glfwGetWindowUserPointer = downcallTrivial("glfwGetWindowUserPointer", PP); glfwSetWindowPosCallback = downcall("glfwSetWindowPosCallback", PPP); @@ -199,19 +199,19 @@ static void create() { glfwWaitEvents = downcall("glfwWaitEvents", V); glfwWaitEventsTimeout = downcall("glfwWaitEventsTimeout", DV); glfwPostEmptyEvent = downcallTrivial("glfwPostEmptyEvent", V); - glfwGetInputMode = downcallTrivial("glfwGetInputMode", PII); - glfwSetInputMode = downcallTrivial("glfwSetInputMode", PIIV); - glfwRawMouseMotionSupported = downcallTrivial("glfwRawMouseMotionSupported", I); - glfwGetKeyName = downcallTrivial("glfwGetKeyName", IIp); + glfwGetInputMode = downcall("glfwGetInputMode", PII); + glfwSetInputMode = downcall("glfwSetInputMode", PIIV); + glfwRawMouseMotionSupported = downcall("glfwRawMouseMotionSupported", I); + glfwGetKeyName = downcall("glfwGetKeyName", IIp); glfwGetKeyScancode = downcallTrivial("glfwGetKeyScancode", II); - glfwGetKey = downcallTrivial("glfwGetKey", PII); - glfwGetMouseButton = downcallTrivial("glfwGetMouseButton", PII); - glfwGetCursorPos = downcallTrivial("glfwGetCursorPos", PPPV); - glfwSetCursorPos = downcallTrivial("glfwSetCursorPos", PDDV); - glfwCreateCursor = downcallTrivial("glfwCreateCursor", PIIP); - glfwCreateStandardCursor = downcallTrivial("glfwCreateStandardCursor", IP); - glfwDestroyCursor = downcallTrivial("glfwDestroyCursor", PV); - glfwSetCursor = downcallTrivial("glfwSetCursor", PPV); + glfwGetKey = downcall("glfwGetKey", PII); + glfwGetMouseButton = downcall("glfwGetMouseButton", PII); + glfwGetCursorPos = downcall("glfwGetCursorPos", PPPV); + glfwSetCursorPos = downcall("glfwSetCursorPos", PDDV); + glfwCreateCursor = downcall("glfwCreateCursor", PIIP); + glfwCreateStandardCursor = downcall("glfwCreateStandardCursor", IP); + glfwDestroyCursor = downcall("glfwDestroyCursor", PV); + glfwSetCursor = downcall("glfwSetCursor", PPV); glfwSetKeyCallback = downcall("glfwSetKeyCallback", PPP); glfwSetCharCallback = downcall("glfwSetCharCallback", PPP); glfwSetMouseButtonCallback = downcall("glfwSetMouseButtonCallback", PPP); @@ -219,21 +219,21 @@ static void create() { glfwSetCursorEnterCallback = downcall("glfwSetCursorEnterCallback", PPP); glfwSetScrollCallback = downcall("glfwSetScrollCallback", PPP); glfwSetDropCallback = downcall("glfwSetDropCallback", PPP); - glfwJoystickPresent = downcallTrivial("glfwJoystickPresent", II); - glfwGetJoystickAxes = downcallTrivial("glfwGetJoystickAxes", IPp); - glfwGetJoystickButtons = downcallTrivial("glfwGetJoystickButtons", IPp); - glfwGetJoystickHats = downcallTrivial("glfwGetJoystickHats", IPP); - glfwGetJoystickName = downcallTrivial("glfwGetJoystickName", Ip); - glfwGetJoystickGUID = downcallTrivial("glfwGetJoystickGUID", Ip); + glfwJoystickPresent = downcall("glfwJoystickPresent", II); + glfwGetJoystickAxes = downcall("glfwGetJoystickAxes", IPp); + glfwGetJoystickButtons = downcall("glfwGetJoystickButtons", IPp); + glfwGetJoystickHats = downcall("glfwGetJoystickHats", IPP); + glfwGetJoystickName = downcall("glfwGetJoystickName", Ip); + glfwGetJoystickGUID = downcall("glfwGetJoystickGUID", Ip); glfwSetJoystickUserPointer = downcallTrivial("glfwSetJoystickUserPointer", IPV); glfwGetJoystickUserPointer = downcallTrivial("glfwGetJoystickUserPointer", IP); - glfwJoystickIsGamepad = downcallTrivial("glfwJoystickIsGamepad", II); + glfwJoystickIsGamepad = downcall("glfwJoystickIsGamepad", II); glfwSetJoystickCallback = downcall("glfwSetJoystickCallback", PP); glfwUpdateGamepadMappings = downcall("glfwUpdateGamepadMappings", fd_PI); - glfwGetGamepadName = downcallTrivial("glfwGetGamepadName", Ip); - glfwGetGamepadState = downcallTrivial("glfwGetGamepadState", IPI); - glfwSetClipboardString = downcallTrivial("glfwSetClipboardString", PPV); - glfwGetClipboardString = downcallTrivial("glfwGetClipboardString", Pp); + glfwGetGamepadName = downcall("glfwGetGamepadName", Ip); + glfwGetGamepadState = downcall("glfwGetGamepadState", IPI); + glfwSetClipboardString = downcall("glfwSetClipboardString", PPV); + glfwGetClipboardString = downcall("glfwGetClipboardString", Pp); glfwGetTime = downcallTrivial("glfwGetTime", D); glfwSetTime = downcallTrivial("glfwSetTime", DV); glfwGetTimerValue = downcallTrivial("glfwGetTimerValue", J); @@ -241,11 +241,11 @@ static void create() { glfwMakeContextCurrent = downcall("glfwMakeContextCurrent", PV); glfwGetCurrentContext = downcallTrivial("glfwGetCurrentContext", P); glfwSwapBuffers = downcall("glfwSwapBuffers", PV); - glfwSwapInterval = downcallTrivial("glfwSwapInterval", IV); - glfwExtensionSupported = downcallTrivial("glfwExtensionSupported", fd_PI); + glfwSwapInterval = downcall("glfwSwapInterval", IV); + glfwExtensionSupported = downcall("glfwExtensionSupported", fd_PI); glfwGetProcAddress = downcall("glfwGetProcAddress", PP); - glfwVulkanSupported = downcallTrivial("glfwVulkanSupported", I); - glfwGetRequiredInstanceExtensions = downcallTrivial("glfwGetRequiredInstanceExtensions", Pp); + glfwVulkanSupported = downcall("glfwVulkanSupported", I); + glfwGetRequiredInstanceExtensions = downcall("glfwGetRequiredInstanceExtensions", Pp); // GLFW Vulkan glfwGetInstanceProcAddress = downcall("glfwGetInstanceProcAddress", PPP); diff --git a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java index 9ee4deef..2f4478f6 100644 --- a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java +++ b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java @@ -119,7 +119,7 @@ * @since 0.1.0 */ public final class NFD { - private static final SymbolLookup LOOKUP = RuntimeHelper.load("nfd", "nfd", OverrunGL.VERSION); + private static final SymbolLookup LOOKUP = RuntimeHelper.load("nfd", "nfd", "0.1.0.0"); private static final Platform os = Platform.current(); private static final boolean isOsWin = os instanceof Platform.Windows; private static final boolean isOsWinOrApple = isOsWin || os instanceof Platform.MacOSX; @@ -133,23 +133,23 @@ public final class NFD { } private static final MethodHandle - NFD_FreePathN = downcallTrivial("NFD_FreePathN", PV), + NFD_FreePathN = downcall("NFD_FreePathN", PV), NFD_Init = downcall("NFD_Init", I), NFD_Quit = downcall("NFD_Quit", V), NFD_OpenDialogN = downcall("NFD_OpenDialogN", PPIPI), NFD_OpenDialogMultipleN = downcall("NFD_OpenDialogMultipleN", PPIPI), NFD_SaveDialogN = downcall("NFD_SaveDialogN", PPIPPI), NFD_PickFolderN = downcall("NFD_PickFolderN", PPI), - NFD_GetError = downcallTrivial("NFD_GetError", p), - NFD_ClearError = downcallTrivial("NFD_ClearError", V), + NFD_GetError = downcall("NFD_GetError", p), + NFD_ClearError = downcall("NFD_ClearError", V), NFD_PathSet_GetCount = downcall("NFD_PathSet_GetCount", PPI), NFD_PathSet_GetPathN = downcall("NFD_PathSet_GetPathN", FunctionDescriptor.of(JAVA_INT, ADDRESS, PATH_SET_SIZE, ADDRESS)), - NFD_PathSet_FreePathN = downcallSafeTrivial("NFD_PathSet_FreePathN", PV), + NFD_PathSet_FreePathN = downcallSafe("NFD_PathSet_FreePathN", PV), NFD_PathSet_GetEnum = downcall("NFD_PathSet_GetEnum", PPI), NFD_PathSet_FreeEnum = downcall("NFD_PathSet_FreeEnum", PV), NFD_PathSet_EnumNextN = downcall("NFD_PathSet_EnumNextN", PPI), - NFD_PathSet_Free = downcallTrivial("NFD_PathSet_Free", PV), - NFD_FreePathU8 = downcallSafeTrivial("NFD_FreePathU8", PV), + NFD_PathSet_Free = downcall("NFD_PathSet_Free", PV), + NFD_FreePathU8 = downcallSafe("NFD_FreePathU8", PV), NFD_OpenDialogU8 = downcallSafe("NFD_OpenDialogU8", PPIPI), NFD_OpenDialogMultipleU8 = downcallSafe("NFD_OpenDialogMultipleU8", PPIPI), NFD_SaveDialogU8 = downcallSafe("NFD_SaveDialogU8", PPIPPI), diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL10C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL10C.java index 1f16f453..51eb83a9 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL10C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL10C.java @@ -224,54 +224,54 @@ static boolean isSupported(GLCapabilities caps) { } static void load(GLCapabilities caps, GLLoadFunc load) { - caps.glBlendFunc = load.trivialHandle("glBlendFunc", IIV); + caps.glBlendFunc = load.invoke("glBlendFunc", IIV); caps.glClear = load.invoke("glClear", IV); - caps.glClearColor = load.trivialHandle("glClearColor", FFFFV); - caps.glClearDepth = load.trivialHandle("glClearDepth", DV); - caps.glClearStencil = load.trivialHandle("glClearStencil", IV); - caps.glColorMask = load.trivialHandle("glColorMask", ZZZZV); - caps.glCullFace = load.trivialHandle("glCullFace", IV); - caps.glDepthFunc = load.trivialHandle("glDepthFunc", IV); - caps.glDepthMask = load.trivialHandle("glDepthMask", ZV); - caps.glDepthRange = load.trivialHandle("glDepthRange", DDV); - caps.glDisable = load.trivialHandle("glDisable", IV); + caps.glClearColor = load.invoke("glClearColor", FFFFV); + caps.glClearDepth = load.invoke("glClearDepth", DV); + caps.glClearStencil = load.invoke("glClearStencil", IV); + caps.glColorMask = load.invoke("glColorMask", ZZZZV); + caps.glCullFace = load.invoke("glCullFace", IV); + caps.glDepthFunc = load.invoke("glDepthFunc", IV); + caps.glDepthMask = load.invoke("glDepthMask", ZV); + caps.glDepthRange = load.invoke("glDepthRange", DDV); + caps.glDisable = load.invoke("glDisable", IV); caps.glDrawBuffer = load.invoke("glDrawBuffer", IV); - caps.glEnable = load.trivialHandle("glEnable", IV); + caps.glEnable = load.invoke("glEnable", IV); caps.glFinish = load.invoke("glFinish", V); caps.glFlush = load.invoke("glFlush", V); - caps.glFrontFace = load.trivialHandle("glFrontFace", IV); - caps.glGetBooleanv = load.trivialHandle("glGetBooleanv", IPV); - caps.glGetDoublev = load.trivialHandle("glGetDoublev", IPV); - caps.glGetError = load.trivialHandle("glGetError", I); - caps.glGetFloatv = load.trivialHandle("glGetFloatv", IPV); - caps.glGetIntegerv = load.trivialHandle("glGetIntegerv", IPV); - caps.glGetString = load.trivialHandle("glGetString", Ip); + caps.glFrontFace = load.invoke("glFrontFace", IV); + caps.glGetBooleanv = load.invoke("glGetBooleanv", IPV); + caps.glGetDoublev = load.invoke("glGetDoublev", IPV); + caps.glGetError = load.invoke("glGetError", I); + caps.glGetFloatv = load.invoke("glGetFloatv", IPV); + caps.glGetIntegerv = load.invoke("glGetIntegerv", IPV); + caps.glGetString = load.invoke("glGetString", Ip); caps.glGetTexImage = load.invoke("glGetTexImage", IIIIPV); - caps.glGetTexLevelParameterfv = load.trivialHandle("glGetTexLevelParameterfv", IIIPV); - caps.glGetTexLevelParameteriv = load.trivialHandle("glGetTexLevelParameteriv", IIIPV); - caps.glGetTexParameterfv = load.trivialHandle("glGetTexParameterfv", IIPV); - caps.glGetTexParameteriv = load.trivialHandle("glGetTexParameteriv", IIPV); - caps.glHint = load.trivialHandle("glHint", IIV); - caps.glIsEnabled = load.trivialHandle("glIsEnabled", IZ); - caps.glLineWidth = load.trivialHandle("glLineWidth", FV); - caps.glLogicOp = load.trivialHandle("glLogicOp", IV); - caps.glPixelStoref = load.trivialHandle("glPixelStoref", IFV); - caps.glPixelStorei = load.trivialHandle("glPixelStorei", IIV); - caps.glPointSize = load.trivialHandle("glPointSize", FV); - caps.glPolygonMode = load.trivialHandle("glPolygonMode", IIV); + caps.glGetTexLevelParameterfv = load.invoke("glGetTexLevelParameterfv", IIIPV); + caps.glGetTexLevelParameteriv = load.invoke("glGetTexLevelParameteriv", IIIPV); + caps.glGetTexParameterfv = load.invoke("glGetTexParameterfv", IIPV); + caps.glGetTexParameteriv = load.invoke("glGetTexParameteriv", IIPV); + caps.glHint = load.invoke("glHint", IIV); + caps.glIsEnabled = load.invoke("glIsEnabled", IZ); + caps.glLineWidth = load.invoke("glLineWidth", FV); + caps.glLogicOp = load.invoke("glLogicOp", IV); + caps.glPixelStoref = load.invoke("glPixelStoref", IFV); + caps.glPixelStorei = load.invoke("glPixelStorei", IIV); + caps.glPointSize = load.invoke("glPointSize", FV); + caps.glPolygonMode = load.invoke("glPolygonMode", IIV); caps.glReadBuffer = load.invoke("glReadBuffer", IV); caps.glReadPixels = load.invoke("glReadPixels", IIIIIIPV); - caps.glScissor = load.trivialHandle("glScissor", IIIIV); - caps.glStencilFunc = load.trivialHandle("glStencilFunc", IIIV); - caps.glStencilMask = load.trivialHandle("glStencilMask", IV); - caps.glStencilOp = load.trivialHandle("glStencilOp", IIIV); + caps.glScissor = load.invoke("glScissor", IIIIV); + caps.glStencilFunc = load.invoke("glStencilFunc", IIIV); + caps.glStencilMask = load.invoke("glStencilMask", IV); + caps.glStencilOp = load.invoke("glStencilOp", IIIV); caps.glTexImage1D = load.invoke("glTexImage1D", IIIIIIIPV); caps.glTexImage2D = load.invoke("glTexImage2D", IIIIIIIIPV); - caps.glTexParameterf = load.trivialHandle("glTexParameterf", IIFV); - caps.glTexParameterfv = load.trivialHandle("glTexParameterfv", IIPV); - caps.glTexParameteri = load.trivialHandle("glTexParameteri", IIIV); - caps.glTexParameteriv = load.trivialHandle("glTexParameteriv", IIPV); - caps.glViewport = load.trivialHandle("glViewport", IIIIV); + caps.glTexParameterf = load.invoke("glTexParameterf", IIFV); + caps.glTexParameterfv = load.invoke("glTexParameterfv", IIPV); + caps.glTexParameteri = load.invoke("glTexParameteri", IIIV); + caps.glTexParameteriv = load.invoke("glTexParameteriv", IIPV); + caps.glViewport = load.invoke("glViewport", IIIIV); } public static void blendFunc(int sfactor, int dfactor) { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL11C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL11C.java index 1ccadb33..5571a51a 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL11C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL11C.java @@ -77,13 +77,13 @@ static void load(GLCapabilities caps, GLLoadFunc load) { caps.glCopyTexImage2D = load.invoke("glCopyTexImage2D", IIIIIIIIV); caps.glCopyTexSubImage1D = load.invoke("glCopyTexSubImage1D", IIIIIIV); caps.glCopyTexSubImage2D = load.invoke("glCopyTexSubImage2D", IIIIIIIIV); - caps.glDeleteTextures = load.trivialHandle("glDeleteTextures", IPV); + caps.glDeleteTextures = load.invoke("glDeleteTextures", IPV); caps.glDrawArrays = load.invoke("glDrawArrays", IIIV); caps.glDrawElements = load.invoke("glDrawElements", IIIPV); - caps.glGenTextures = load.trivialHandle("glGenTextures", IPV); - caps.glGetPointerv = load.trivialHandle("glGetPointerv", IPV); - caps.glIsTexture = load.trivialHandle("glIsTexture", IZ); - caps.glPolygonOffset = load.trivialHandle("glPolygonOffset", FFV); + caps.glGenTextures = load.invoke("glGenTextures", IPV); + caps.glGetPointerv = load.invoke("glGetPointerv", IPV); + caps.glIsTexture = load.invoke("glIsTexture", IZ); + caps.glPolygonOffset = load.invoke("glPolygonOffset", FFV); caps.glTexSubImage1D = load.invoke("glTexSubImage1D", IIIIIIPV); caps.glTexSubImage2D = load.invoke("glTexSubImage2D", IIIIIIIIPV); } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL13C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL13C.java index 7ed64ac7..7620ae15 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL13C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL13C.java @@ -105,7 +105,7 @@ static boolean isSupported(GLCapabilities caps) { } static void load(GLCapabilities caps, GLLoadFunc load) { - caps.glActiveTexture = load.trivialHandle("glActiveTexture", IV); + caps.glActiveTexture = load.invoke("glActiveTexture", IV); caps.glCompressedTexImage1D = load.invoke("glCompressedTexImage1D", IIIIIIPV); caps.glCompressedTexImage2D = load.invoke("glCompressedTexImage2D", IIIIIIIPV); caps.glCompressedTexImage3D = load.invoke("glCompressedTexImage3D", IIIIIIIIPV); @@ -113,7 +113,7 @@ static void load(GLCapabilities caps, GLLoadFunc load) { caps.glCompressedTexSubImage2D = load.invoke("glCompressedTexSubImage2D", IIIIIIIIPV); caps.glCompressedTexSubImage3D = load.invoke("glCompressedTexSubImage3D", IIIIIIIIIIPV); caps.glGetCompressedTexImage = load.invoke("glGetCompressedTexImage", IIPV); - caps.glSampleCoverage = load.trivialHandle("glSampleCoverage", FZV); + caps.glSampleCoverage = load.invoke("glSampleCoverage", FZV); } public static void activeTexture(int texture) { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL14C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL14C.java index 52a5d942..c656e322 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL14C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL14C.java @@ -76,15 +76,15 @@ static boolean isSupported(GLCapabilities caps) { } static void load(GLCapabilities caps, GLLoadFunc load) { - caps.glBlendColor = load.trivialHandle("glBlendColor", FFFFV); - caps.glBlendEquation = load.trivialHandle("glBlendEquation", IV); - caps.glBlendFuncSeparate = load.trivialHandle("glBlendFuncSeparate", IIIIV); + caps.glBlendColor = load.invoke("glBlendColor", FFFFV); + caps.glBlendEquation = load.invoke("glBlendEquation", IV); + caps.glBlendFuncSeparate = load.invoke("glBlendFuncSeparate", IIIIV); caps.glMultiDrawArrays = load.invoke("glMultiDrawArrays", IPPIV); caps.glMultiDrawElements = load.invoke("glMultiDrawElements", IPIPIV); - caps.glPointParameterf = load.trivialHandle("glPointParameterf", IFV); - caps.glPointParameterfv = load.trivialHandle("glPointParameterfv", IPV); - caps.glPointParameteri = load.trivialHandle("glPointParameteri", IIV); - caps.glPointParameteriv = load.trivialHandle("glPointParameteriv", IPV); + caps.glPointParameterf = load.invoke("glPointParameterf", IFV); + caps.glPointParameterfv = load.invoke("glPointParameterfv", IPV); + caps.glPointParameteri = load.invoke("glPointParameteri", IIV); + caps.glPointParameteriv = load.invoke("glPointParameteriv", IPV); } public static void blendColor(float red, float green, float blue, float alpha) { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL15C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL15C.java index 69fe470c..ade6a7de 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL15C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL15C.java @@ -79,19 +79,19 @@ static void load(GLCapabilities caps, GLLoadFunc load) { caps.glBindBuffer = load.invoke("glBindBuffer", IIV); caps.glBufferData = load.invoke("glBufferData", IJPIV); caps.glBufferSubData = load.invoke("glBufferSubData", IJJPV); - caps.glDeleteBuffers = load.trivialHandle("glDeleteBuffers", IPV); - caps.glDeleteQueries = load.trivialHandle("glDeleteQueries", IPV); + caps.glDeleteBuffers = load.invoke("glDeleteBuffers", IPV); + caps.glDeleteQueries = load.invoke("glDeleteQueries", IPV); caps.glEndQuery = load.invoke("glEndQuery", IV); - caps.glGenBuffers = load.trivialHandle("glGenBuffers", IPV); - caps.glGenQueries = load.trivialHandle("glGenQueries", IPV); - caps.glGetBufferParameteriv = load.trivialHandle("glGetBufferParameteriv", IIPV); - caps.glGetBufferPointerv = load.trivialHandle("glGetBufferPointerv", IIPV); + caps.glGenBuffers = load.invoke("glGenBuffers", IPV); + caps.glGenQueries = load.invoke("glGenQueries", IPV); + caps.glGetBufferParameteriv = load.invoke("glGetBufferParameteriv", IIPV); + caps.glGetBufferPointerv = load.invoke("glGetBufferPointerv", IIPV); caps.glGetBufferSubData = load.invoke("glGetBufferSubData", IJJPV); - caps.glGetQueryObjectiv = load.trivialHandle("glGetQueryObjectiv", IIPV); - caps.glGetQueryObjectuiv = load.trivialHandle("glGetQueryObjectuiv", IIPV); - caps.glGetQueryiv = load.trivialHandle("glGetQueryiv", IIPV); - caps.glIsBuffer = load.trivialHandle("glIsBuffer", IZ); - caps.glIsQuery = load.trivialHandle("glIsQuery", IZ); + caps.glGetQueryObjectiv = load.invoke("glGetQueryObjectiv", IIPV); + caps.glGetQueryObjectuiv = load.invoke("glGetQueryObjectuiv", IIPV); + caps.glGetQueryiv = load.invoke("glGetQueryiv", IIPV); + caps.glIsBuffer = load.invoke("glIsBuffer", IZ); + caps.glIsQuery = load.invoke("glIsQuery", IZ); caps.glMapBuffer = load.invoke("glMapBuffer", IIp); caps.glUnmapBuffer = load.invoke("glUnmapBuffer", IZ); } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL20C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL20C.java index 99d60b1f..1b7a26eb 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL20C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL20C.java @@ -148,39 +148,39 @@ static boolean isSupported(GLCapabilities caps) { static void load(GLCapabilities caps, GLLoadFunc load) { caps.glAttachShader = load.invoke("glAttachShader", IIV); caps.glBindAttribLocation = load.invoke("glBindAttribLocation", IIPV); - caps.glBlendEquationSeparate = load.trivialHandle("glBlendEquationSeparate", IIV); + caps.glBlendEquationSeparate = load.invoke("glBlendEquationSeparate", IIV); caps.glCompileShader = load.invoke("glCompileShader", IV); - caps.glCreateProgram = load.trivialHandle("glCreateProgram", I); - caps.glCreateShader = load.trivialHandle("glCreateShader", II); - caps.glDeleteProgram = load.trivialHandle("glDeleteProgram", IV); - caps.glDeleteShader = load.trivialHandle("glDeleteShader", IV); + caps.glCreateProgram = load.invoke("glCreateProgram", I); + caps.glCreateShader = load.invoke("glCreateShader", II); + caps.glDeleteProgram = load.invoke("glDeleteProgram", IV); + caps.glDeleteShader = load.invoke("glDeleteShader", IV); caps.glDetachShader = load.invoke("glDetachShader", IIV); - caps.glDisableVertexAttribArray = load.trivialHandle("glDisableVertexAttribArray", IV); + caps.glDisableVertexAttribArray = load.invoke("glDisableVertexAttribArray", IV); caps.glDrawBuffers = load.invoke("glDrawBuffers", IPV); - caps.glEnableVertexAttribArray = load.trivialHandle("glEnableVertexAttribArray", IV); - caps.glGetActiveAttrib = load.trivialHandle("glGetActiveAttrib", IIIPPPPV); - caps.glGetActiveUniform = load.trivialHandle("glGetActiveUniform", IIIPPPPV); - caps.glGetAttachedShaders = load.trivialHandle("glGetAttachedShaders", IIPPV); - caps.glGetAttribLocation = load.trivialHandle("glGetAttribLocation", IPI); + caps.glEnableVertexAttribArray = load.invoke("glEnableVertexAttribArray", IV); + caps.glGetActiveAttrib = load.invoke("glGetActiveAttrib", IIIPPPPV); + caps.glGetActiveUniform = load.invoke("glGetActiveUniform", IIIPPPPV); + caps.glGetAttachedShaders = load.invoke("glGetAttachedShaders", IIPPV); + caps.glGetAttribLocation = load.invoke("glGetAttribLocation", IPI); caps.glGetProgramInfoLog = load.invoke("glGetProgramInfoLog", IIPPV); - caps.glGetProgramiv = load.trivialHandle("glGetProgramiv", IIPV); + caps.glGetProgramiv = load.invoke("glGetProgramiv", IIPV); caps.glGetShaderInfoLog = load.invoke("glGetShaderInfoLog", IIPPV); caps.glGetShaderSource = load.invoke("glGetShaderSource", IIPV); - caps.glGetShaderiv = load.trivialHandle("glGetShaderiv", IIPV); - caps.glGetUniformLocation = load.trivialHandle("glGetUniformLocation", IPI); - caps.glGetUniformfv = load.trivialHandle("glGetUniformfv", IIPV); - caps.glGetUniformiv = load.trivialHandle("glGetUniformiv", IIPV); - caps.glGetVertexAttribPointerv = load.trivialHandle("glGetVertexAttribPointerv", IIPV); - caps.glGetVertexAttribdv = load.trivialHandle("glGetVertexAttribdv", IIPV); - caps.glGetVertexAttribfv = load.trivialHandle("glGetVertexAttribfv", IIPV); - caps.glGetVertexAttribiv = load.trivialHandle("glGetVertexAttribiv", IIPV); - caps.glIsProgram = load.trivialHandle("glIsProgram", IZ); - caps.glIsShader = load.trivialHandle("glIsShader", IZ); + caps.glGetShaderiv = load.invoke("glGetShaderiv", IIPV); + caps.glGetUniformLocation = load.invoke("glGetUniformLocation", IPI); + caps.glGetUniformfv = load.invoke("glGetUniformfv", IIPV); + caps.glGetUniformiv = load.invoke("glGetUniformiv", IIPV); + caps.glGetVertexAttribPointerv = load.invoke("glGetVertexAttribPointerv", IIPV); + caps.glGetVertexAttribdv = load.invoke("glGetVertexAttribdv", IIPV); + caps.glGetVertexAttribfv = load.invoke("glGetVertexAttribfv", IIPV); + caps.glGetVertexAttribiv = load.invoke("glGetVertexAttribiv", IIPV); + caps.glIsProgram = load.invoke("glIsProgram", IZ); + caps.glIsShader = load.invoke("glIsShader", IZ); caps.glLinkProgram = load.invoke("glLinkProgram", IV); caps.glShaderSource = load.invoke("glShaderSource", IIPPV); - caps.glStencilFuncSeparate = load.trivialHandle("glStencilFuncSeparate", IIIIV); - caps.glStencilMaskSeparate = load.trivialHandle("glStencilMaskSeparate", IIV); - caps.glStencilOpSeparate = load.trivialHandle("glStencilOpSeparate", IIIIV); + caps.glStencilFuncSeparate = load.invoke("glStencilFuncSeparate", IIIIV); + caps.glStencilMaskSeparate = load.invoke("glStencilMaskSeparate", IIV); + caps.glStencilOpSeparate = load.invoke("glStencilOpSeparate", IIIIV); caps.glUniform1f = load.invoke("glUniform1f", IFV); caps.glUniform1fv = load.invoke("glUniform1fv", IIPV); caps.glUniform1i = load.invoke("glUniform1i", IIV); diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL30C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL30C.java index 63f7834a..c0232e0b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL30C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL30C.java @@ -305,17 +305,17 @@ static void load(GLCapabilities caps, GLLoadFunc load) { caps.glBindVertexArray = load.invoke("glBindVertexArray", IV); caps.glBlitFramebuffer = load.invoke("glBlitFramebuffer", IIIIIIIIIIV); caps.glCheckFramebufferStatus = load.invoke("glCheckFramebufferStatus", II); - caps.glClampColor = load.trivialHandle("glClampColor", IIV); + caps.glClampColor = load.invoke("glClampColor", IIV); caps.glClearBufferfi = load.invoke("glClearBufferfi", IIFIV); caps.glClearBufferfv = load.invoke("glClearBufferfv", IIPV); caps.glClearBufferiv = load.invoke("glClearBufferiv", IIPV); caps.glClearBufferuiv = load.invoke("glClearBufferuiv", IIPV); - caps.glColorMaski = load.trivialHandle("glColorMaski", IZZZZV); - caps.glDeleteFramebuffers = load.trivialHandle("glDeleteFramebuffers", IPV); - caps.glDeleteRenderbuffers = load.trivialHandle("glDeleteRenderbuffers", IPV); - caps.glDeleteVertexArrays = load.trivialHandle("glDeleteVertexArrays", IPV); - caps.glDisablei = load.trivialHandle("glDisablei", IIV); - caps.glEnablei = load.trivialHandle("glEnablei", IIV); + caps.glColorMaski = load.invoke("glColorMaski", IZZZZV); + caps.glDeleteFramebuffers = load.invoke("glDeleteFramebuffers", IPV); + caps.glDeleteRenderbuffers = load.invoke("glDeleteRenderbuffers", IPV); + caps.glDeleteVertexArrays = load.invoke("glDeleteVertexArrays", IPV); + caps.glDisablei = load.invoke("glDisablei", IIV); + caps.glEnablei = load.invoke("glEnablei", IIV); caps.glEndConditionalRender = load.invoke("glEndConditionalRender", V); caps.glEndTransformFeedback = load.invoke("glEndTransformFeedback", V); caps.glFlushMappedBufferRange = load.invoke("glFlushMappedBufferRange", IJJV); @@ -324,31 +324,31 @@ static void load(GLCapabilities caps, GLLoadFunc load) { caps.glFramebufferTexture2D = load.invoke("glFramebufferTexture2D", IIIIIV); caps.glFramebufferTexture3D = load.invoke("glFramebufferTexture3D", IIIIIIV); caps.glFramebufferTextureLayer = load.invoke("glFramebufferTextureLayer", IIIIIV); - caps.glGenFramebuffers = load.trivialHandle("glGenFramebuffers", IPV); - caps.glGenRenderbuffers = load.trivialHandle("glGenRenderbuffers", IPV); - caps.glGenVertexArrays = load.trivialHandle("glGenVertexArrays", IPV); + caps.glGenFramebuffers = load.invoke("glGenFramebuffers", IPV); + caps.glGenRenderbuffers = load.invoke("glGenRenderbuffers", IPV); + caps.glGenVertexArrays = load.invoke("glGenVertexArrays", IPV); caps.glGenerateMipmap = load.invoke("glGenerateMipmap", IV); - caps.glGetBooleani_v = load.trivialHandle("glGetBooleani_v", IIPV); - caps.glGetFragDataLocation = load.trivialHandle("glGetFragDataLocation", IPI); - caps.glGetFramebufferAttachmentParameteriv = load.trivialHandle("glGetFramebufferAttachmentParameteriv", IIIPV); - caps.glGetIntegeri_v = load.trivialHandle("glGetIntegeri_v", IIPV); - caps.glGetRenderbufferParameteriv = load.trivialHandle("glGetRenderbufferParameteriv", IIPV); - caps.glGetStringi = load.trivialHandle("glGetStringi", IIp); - caps.glGetTexParameterIiv = load.trivialHandle("glGetTexParameterIiv", IIPV); - caps.glGetTexParameterIuiv = load.trivialHandle("glGetTexParameterIuiv", IIPV); - caps.glGetTransformFeedbackVarying = load.trivialHandle("glGetTransformFeedbackVarying", IIIPPPPV); - caps.glGetUniformuiv = load.trivialHandle("glGetUniformuiv", IIPV); - caps.glGetVertexAttribIiv = load.trivialHandle("glGetVertexAttribIiv", IIPV); - caps.glGetVertexAttribIuiv = load.trivialHandle("glGetVertexAttribIuiv", IIPV); - caps.glIsEnabledi = load.trivialHandle("glIsEnabledi", IIZ); - caps.glIsFramebuffer = load.trivialHandle("glIsFramebuffer", IZ); - caps.glIsRenderbuffer = load.trivialHandle("glIsRenderbuffer", IZ); - caps.glIsVertexArray = load.trivialHandle("glIsVertexArray", IZ); + caps.glGetBooleani_v = load.invoke("glGetBooleani_v", IIPV); + caps.glGetFragDataLocation = load.invoke("glGetFragDataLocation", IPI); + caps.glGetFramebufferAttachmentParameteriv = load.invoke("glGetFramebufferAttachmentParameteriv", IIIPV); + caps.glGetIntegeri_v = load.invoke("glGetIntegeri_v", IIPV); + caps.glGetRenderbufferParameteriv = load.invoke("glGetRenderbufferParameteriv", IIPV); + caps.glGetStringi = load.invoke("glGetStringi", IIp); + caps.glGetTexParameterIiv = load.invoke("glGetTexParameterIiv", IIPV); + caps.glGetTexParameterIuiv = load.invoke("glGetTexParameterIuiv", IIPV); + caps.glGetTransformFeedbackVarying = load.invoke("glGetTransformFeedbackVarying", IIIPPPPV); + caps.glGetUniformuiv = load.invoke("glGetUniformuiv", IIPV); + caps.glGetVertexAttribIiv = load.invoke("glGetVertexAttribIiv", IIPV); + caps.glGetVertexAttribIuiv = load.invoke("glGetVertexAttribIuiv", IIPV); + caps.glIsEnabledi = load.invoke("glIsEnabledi", IIZ); + caps.glIsFramebuffer = load.invoke("glIsFramebuffer", IZ); + caps.glIsRenderbuffer = load.invoke("glIsRenderbuffer", IZ); + caps.glIsVertexArray = load.invoke("glIsVertexArray", IZ); caps.glMapBufferRange = load.invoke("glMapBufferRange", IJJIP); caps.glRenderbufferStorage = load.invoke("glRenderbufferStorage", IIIIV); caps.glRenderbufferStorageMultisample = load.invoke("glRenderbufferStorageMultisample", IIIIIV); - caps.glTexParameterIiv = load.trivialHandle("glTexParameterIiv", IIPV); - caps.glTexParameterIuiv = load.trivialHandle("glTexParameterIuiv", IIPV); + caps.glTexParameterIiv = load.invoke("glTexParameterIiv", IIPV); + caps.glTexParameterIuiv = load.invoke("glTexParameterIuiv", IIPV); caps.glTransformFeedbackVaryings = load.invoke("glTransformFeedbackVaryings", IIPIV); caps.glUniform1ui = load.invoke("glUniform1ui", IIV); caps.glUniform1uiv = load.invoke("glUniform1uiv", IIPV); diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL31C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL31C.java index 7fd27c0d..e093b03c 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL31C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL31C.java @@ -115,14 +115,14 @@ static void load(GLCapabilities caps, GLLoadFunc load) { caps.glCopyBufferSubData = load.invoke("glCopyBufferSubData", IIJJJV); caps.glDrawArraysInstanced = load.invoke("glDrawArraysInstanced", IIIIV); caps.glDrawElementsInstanced = load.invoke("glDrawElementsInstanced", IIIPIV); - caps.glGetActiveUniformBlockName = load.trivialHandle("glGetActiveUniformBlockName", IIIPPV); - caps.glGetActiveUniformBlockiv = load.trivialHandle("glGetActiveUniformBlockiv", IIIPV); - caps.glGetActiveUniformName = load.trivialHandle("glGetActiveUniformName", IIIPPV); - caps.glGetActiveUniformsiv = load.trivialHandle("glGetActiveUniformsiv", IIPIPV); - caps.glGetIntegeri_v = load.trivialHandle("glGetIntegeri_v", IIPV); - caps.glGetUniformBlockIndex = load.trivialHandle("glGetUniformBlockIndex", IPI); - caps.glGetUniformIndices = load.trivialHandle("glGetUniformIndices", IIPPV); - caps.glPrimitiveRestartIndex = load.trivialHandle("glPrimitiveRestartIndex", IV); + caps.glGetActiveUniformBlockName = load.invoke("glGetActiveUniformBlockName", IIIPPV); + caps.glGetActiveUniformBlockiv = load.invoke("glGetActiveUniformBlockiv", IIIPV); + caps.glGetActiveUniformName = load.invoke("glGetActiveUniformName", IIIPPV); + caps.glGetActiveUniformsiv = load.invoke("glGetActiveUniformsiv", IIPIPV); + caps.glGetIntegeri_v = load.invoke("glGetIntegeri_v", IIPV); + caps.glGetUniformBlockIndex = load.invoke("glGetUniformBlockIndex", IPI); + caps.glGetUniformIndices = load.invoke("glGetUniformIndices", IIPPV); + caps.glPrimitiveRestartIndex = load.invoke("glPrimitiveRestartIndex", IV); caps.glTexBuffer = load.invoke("glTexBuffer", IIIV); caps.glUniformBlockBinding = load.invoke("glUniformBlockBinding", IIIV); } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL32C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL32C.java index ee6ea795..318fdc5c 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL32C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL32C.java @@ -115,21 +115,21 @@ static boolean isSupported(GLCapabilities caps) { static void load(GLCapabilities caps, GLLoadFunc load) { caps.glClientWaitSync = load.invoke("glClientWaitSync", PIJI); - caps.glDeleteSync = load.trivialHandle("glDeleteSync", PV); + caps.glDeleteSync = load.invoke("glDeleteSync", PV); caps.glDrawElementsBaseVertex = load.invoke("glDrawElementsBaseVertex", IIIPIV); caps.glDrawElementsInstancedBaseVertex = load.invoke("glDrawElementsInstancedBaseVertex", IIIPIIV); caps.glDrawRangeElementsBaseVertex = load.invoke("glDrawRangeElementsBaseVertex", IIIIIPIV); caps.glFenceSync = load.invoke("glFenceSync", IIP); caps.glFramebufferTexture = load.invoke("glFramebufferTexture", IIIIV); - caps.glGetBufferParameteri64v = load.trivialHandle("glGetBufferParameteri64v", IIPV); - caps.glGetInteger64i_v = load.trivialHandle("glGetInteger64i_v", IIPV); - caps.glGetInteger64v = load.trivialHandle("glGetInteger64v", IPV); - caps.glGetMultisamplefv = load.trivialHandle("glGetMultisamplefv", IIPV); - caps.glGetSynciv = load.trivialHandle("glGetSynciv", PIIPPV); - caps.glIsSync = load.trivialHandle("glIsSync", PZ); + caps.glGetBufferParameteri64v = load.invoke("glGetBufferParameteri64v", IIPV); + caps.glGetInteger64i_v = load.invoke("glGetInteger64i_v", IIPV); + caps.glGetInteger64v = load.invoke("glGetInteger64v", IPV); + caps.glGetMultisamplefv = load.invoke("glGetMultisamplefv", IIPV); + caps.glGetSynciv = load.invoke("glGetSynciv", PIIPPV); + caps.glIsSync = load.invoke("glIsSync", PZ); caps.glMultiDrawElementsBaseVertex = load.invoke("glMultiDrawElementsBaseVertex", IPIPIPV); - caps.glProvokingVertex = load.trivialHandle("glProvokingVertex", IV); - caps.glSampleMaski = load.trivialHandle("glSampleMaski", IIV); + caps.glProvokingVertex = load.invoke("glProvokingVertex", IV); + caps.glSampleMaski = load.invoke("glSampleMaski", IIV); caps.glTexImage2DMultisample = load.invoke("glTexImage2DMultisample", IIIIIZV); caps.glTexImage3DMultisample = load.invoke("glTexImage3DMultisample", IIIIIIZV); caps.glWaitSync = load.invoke("glWaitSync", PIJV); diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL33C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL33C.java index 104ee734..1c0eece5 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL33C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL33C.java @@ -71,23 +71,23 @@ static boolean isSupported(GLCapabilities caps) { static void load(GLCapabilities caps, GLLoadFunc load) { caps.glBindFragDataLocationIndexed = load.invoke("glBindFragDataLocationIndexed", IIIPV); caps.glBindSampler = load.invoke("glBindSampler", IIV); - caps.glDeleteSamplers = load.trivialHandle("glDeleteSamplers", IPV); - caps.glGenSamplers = load.trivialHandle("glGenSamplers", IIPV); - caps.glGetFragDataIndex = load.trivialHandle("glGetFragDataIndex", IPI); - caps.glGetQueryObjecti64v = load.trivialHandle("glGetQueryObjecti64v", IIPV); - caps.glGetQueryObjectui64v = load.trivialHandle("glGetQueryObjectui64v", IIPV); - caps.glGetSamplerParameterIiv = load.trivialHandle("glGetSamplerParameterIiv", IIPV); - caps.glGetSamplerParameterIuiv = load.trivialHandle("glGetSamplerParameterIuiv", IIPV); - caps.glGetSamplerParameterfv = load.trivialHandle("glGetSamplerParameterfv", IIPV); - caps.glGetSamplerParameteriv = load.trivialHandle("glGetSamplerParameteriv", IIPV); - caps.glIsSampler = load.trivialHandle("glIsSampler", IZ); + caps.glDeleteSamplers = load.invoke("glDeleteSamplers", IPV); + caps.glGenSamplers = load.invoke("glGenSamplers", IIPV); + caps.glGetFragDataIndex = load.invoke("glGetFragDataIndex", IPI); + caps.glGetQueryObjecti64v = load.invoke("glGetQueryObjecti64v", IIPV); + caps.glGetQueryObjectui64v = load.invoke("glGetQueryObjectui64v", IIPV); + caps.glGetSamplerParameterIiv = load.invoke("glGetSamplerParameterIiv", IIPV); + caps.glGetSamplerParameterIuiv = load.invoke("glGetSamplerParameterIuiv", IIPV); + caps.glGetSamplerParameterfv = load.invoke("glGetSamplerParameterfv", IIPV); + caps.glGetSamplerParameteriv = load.invoke("glGetSamplerParameteriv", IIPV); + caps.glIsSampler = load.invoke("glIsSampler", IZ); caps.glQueryCounter = load.invoke("glQueryCounter", IIV); - caps.glSamplerParameterIiv = load.trivialHandle("glSamplerParameterIiv", IIPV); - caps.glSamplerParameterIuiv = load.trivialHandle("glSamplerParameterIuiv", IIPV); - caps.glSamplerParameterf = load.trivialHandle("glSamplerParameterf", IIFV); - caps.glSamplerParameterfv = load.trivialHandle("glSamplerParameterfv", IIPV); - caps.glSamplerParameteri = load.trivialHandle("glSamplerParameteri", IIIV); - caps.glSamplerParameteriv = load.trivialHandle("glSamplerParameteriv", IIPV); + caps.glSamplerParameterIiv = load.invoke("glSamplerParameterIiv", IIPV); + caps.glSamplerParameterIuiv = load.invoke("glSamplerParameterIuiv", IIPV); + caps.glSamplerParameterf = load.invoke("glSamplerParameterf", IIFV); + caps.glSamplerParameterfv = load.invoke("glSamplerParameterfv", IIPV); + caps.glSamplerParameteri = load.invoke("glSamplerParameteri", IIIV); + caps.glSamplerParameteriv = load.invoke("glSamplerParameteriv", IIPV); caps.glVertexAttribDivisor = load.invoke("glVertexAttribDivisor", IIV); caps.glVertexAttribP1ui = load.invoke("glVertexAttribP1ui", IIZIV); caps.glVertexAttribP1uiv = load.invoke("glVertexAttribP1uiv", IIZPV); diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL40C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL40C.java index 0ba158c3..a3889377 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL40C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL40C.java @@ -143,30 +143,30 @@ static boolean isSupported(GLCapabilities caps) { static void load(GLCapabilities caps, GLLoadFunc load) { caps.glBeginQueryIndexed = load.invoke("glBeginQueryIndexed", IIIV); caps.glBindTransformFeedback = load.invoke("glBindTransformFeedback", IIV); - caps.glBlendEquationSeparatei = load.trivialHandle("glBlendEquationSeparatei", IIIV); - caps.glBlendEquationi = load.trivialHandle("glBlendEquationi", IIV); - caps.glBlendFuncSeparatei = load.trivialHandle("glBlendFuncSeparatei", IIIIIV); - caps.glBlendFunci = load.trivialHandle("glBlendFunci", IIIV); - caps.glDeleteTransformFeedbacks = load.trivialHandle("glDeleteTransformFeedbacks", IPV); + caps.glBlendEquationSeparatei = load.invoke("glBlendEquationSeparatei", IIIV); + caps.glBlendEquationi = load.invoke("glBlendEquationi", IIV); + caps.glBlendFuncSeparatei = load.invoke("glBlendFuncSeparatei", IIIIIV); + caps.glBlendFunci = load.invoke("glBlendFunci", IIIV); + caps.glDeleteTransformFeedbacks = load.invoke("glDeleteTransformFeedbacks", IPV); caps.glDrawArraysIndirect = load.invoke("glDrawArraysIndirect", IPV); caps.glDrawElementsIndirect = load.invoke("glDrawElementsIndirect", IIPV); caps.glDrawTransformFeedback = load.invoke("glDrawTransformFeedback", IIV); caps.glDrawTransformFeedbackStream = load.invoke("glDrawTransformFeedbackStream", IIIV); caps.glEndQueryIndexed = load.invoke("glEndQueryIndexed", IIV); - caps.glGenTransformFeedbacks = load.trivialHandle("glGenTransformFeedbacks", IPV); - caps.glGetActiveSubroutineName = load.trivialHandle("glGetActiveSubroutineName", IIIIPPV); - caps.glGetActiveSubroutineUniformName = load.trivialHandle("glGetActiveSubroutineUniformName", IIIIPPV); - caps.glGetActiveSubroutineUniformiv = load.trivialHandle("glGetActiveSubroutineUniformiv", IIIIPV); - caps.glGetProgramStageiv = load.trivialHandle("glGetProgramStageiv", IIIPV); - caps.glGetQueryIndexediv = load.trivialHandle("glGetQueryIndexediv", IIIPV); - caps.glGetSubroutineIndex = load.trivialHandle("glGetSubroutineIndex", IIPI); - caps.glGetSubroutineUniformLocation = load.trivialHandle("glGetSubroutineUniformLocation", IIPI); - caps.glGetUniformSubroutineuiv = load.trivialHandle("glGetUniformSubroutineuiv", IIPV); - caps.glGetUniformdv = load.trivialHandle("glGetUniformdv", IIPV); - caps.glIsTransformFeedback = load.trivialHandle("glIsTransformFeedback", IZ); - caps.glMinSampleShading = load.trivialHandle("glMinSampleShading", FV); - caps.glPatchParameterfv = load.trivialHandle("glPatchParameterfv", IPV); - caps.glPatchParameteri = load.trivialHandle("glPatchParameteri", IIV); + caps.glGenTransformFeedbacks = load.invoke("glGenTransformFeedbacks", IPV); + caps.glGetActiveSubroutineName = load.invoke("glGetActiveSubroutineName", IIIIPPV); + caps.glGetActiveSubroutineUniformName = load.invoke("glGetActiveSubroutineUniformName", IIIIPPV); + caps.glGetActiveSubroutineUniformiv = load.invoke("glGetActiveSubroutineUniformiv", IIIIPV); + caps.glGetProgramStageiv = load.invoke("glGetProgramStageiv", IIIPV); + caps.glGetQueryIndexediv = load.invoke("glGetQueryIndexediv", IIIPV); + caps.glGetSubroutineIndex = load.invoke("glGetSubroutineIndex", IIPI); + caps.glGetSubroutineUniformLocation = load.invoke("glGetSubroutineUniformLocation", IIPI); + caps.glGetUniformSubroutineuiv = load.invoke("glGetUniformSubroutineuiv", IIPV); + caps.glGetUniformdv = load.invoke("glGetUniformdv", IIPV); + caps.glIsTransformFeedback = load.invoke("glIsTransformFeedback", IZ); + caps.glMinSampleShading = load.invoke("glMinSampleShading", FV); + caps.glPatchParameterfv = load.invoke("glPatchParameterfv", IPV); + caps.glPatchParameteri = load.invoke("glPatchParameteri", IIV); caps.glPauseTransformFeedback = load.invoke("glPauseTransformFeedback", V); caps.glResumeTransformFeedback = load.invoke("glResumeTransformFeedback", V); caps.glUniform1d = load.invoke("glUniform1d", IDV); diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL41C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL41C.java index 7518051b..ebac495c 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL41C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL41C.java @@ -100,21 +100,21 @@ static boolean isSupported(GLCapabilities caps) { static void load(GLCapabilities caps, GLLoadFunc load) { caps.glActiveShaderProgram = load.invoke("glActiveShaderProgram", IIV); caps.glBindProgramPipeline = load.invoke("glBindProgramPipeline", IV); - caps.glClearDepthf = load.trivialHandle("glClearDepthf", FV); - caps.glCreateShaderProgramv = load.trivialHandle("glCreateShaderProgramv", IIPI); - caps.glDeleteProgramPipelines = load.trivialHandle("glDeleteProgramPipelines", IPV); - caps.glDepthRangeArrayv = load.trivialHandle("glDepthRangeArrayv", IIPV); - caps.glDepthRangeIndexed = load.trivialHandle("glDepthRangeIndexed", IDDV); - caps.glDepthRangef = load.trivialHandle("glDepthRangef", FFV); - caps.glGenProgramPipelines = load.trivialHandle("glGenProgramPipelines", IPV); - caps.glGetDoublei_v = load.trivialHandle("glGetDoublei_v", IIPV); - caps.glGetFloati_v = load.trivialHandle("glGetFloati_v", IIPV); + caps.glClearDepthf = load.invoke("glClearDepthf", FV); + caps.glCreateShaderProgramv = load.invoke("glCreateShaderProgramv", IIPI); + caps.glDeleteProgramPipelines = load.invoke("glDeleteProgramPipelines", IPV); + caps.glDepthRangeArrayv = load.invoke("glDepthRangeArrayv", IIPV); + caps.glDepthRangeIndexed = load.invoke("glDepthRangeIndexed", IDDV); + caps.glDepthRangef = load.invoke("glDepthRangef", FFV); + caps.glGenProgramPipelines = load.invoke("glGenProgramPipelines", IPV); + caps.glGetDoublei_v = load.invoke("glGetDoublei_v", IIPV); + caps.glGetFloati_v = load.invoke("glGetFloati_v", IIPV); caps.glGetProgramBinary = load.invoke("glGetProgramBinary", IIPPPV); caps.glGetProgramPipelineInfoLog = load.invoke("glGetProgramPipelineInfoLog", IIPPV); - caps.glGetProgramPipelineiv = load.trivialHandle("glGetProgramPipelineiv", IIPV); - caps.glGetShaderPrecisionFormat = load.trivialHandle("glGetShaderPrecisionFormat", IIPPV); - caps.glGetVertexAttribLdv = load.trivialHandle("glGetVertexAttribLdv", IIPV); - caps.glIsProgramPipeline = load.trivialHandle("glIsProgramPipeline", IZ); + caps.glGetProgramPipelineiv = load.invoke("glGetProgramPipelineiv", IIPV); + caps.glGetShaderPrecisionFormat = load.invoke("glGetShaderPrecisionFormat", IIPPV); + caps.glGetVertexAttribLdv = load.invoke("glGetVertexAttribLdv", IIPV); + caps.glIsProgramPipeline = load.invoke("glIsProgramPipeline", IZ); caps.glProgramBinary = load.invoke("glProgramBinary", IIPIV); caps.glProgramParameteri = load.invoke("glProgramParameteri", IIIV); caps.glProgramUniform1d = load.invoke("glProgramUniform1d", IIDV); @@ -169,8 +169,8 @@ static void load(GLCapabilities caps, GLLoadFunc load) { caps.glProgramUniformMatrix4x3fv = load.invoke("glProgramUniformMatrix4x3fv", IIIZPV); caps.glReleaseShaderCompiler = load.invoke("glReleaseShaderCompiler", V); caps.glScissorArrayv = load.invoke("glScissorArrayv", IIPV); - caps.glScissorIndexed = load.trivialHandle("glScissorIndexed", IIIIIV); - caps.glScissorIndexedv = load.trivialHandle("glScissorIndexedv", IPV); + caps.glScissorIndexed = load.invoke("glScissorIndexed", IIIIIV); + caps.glScissorIndexedv = load.invoke("glScissorIndexedv", IPV); caps.glShaderBinary = load.invoke("glShaderBinary", IPIPIV); caps.glUseProgramStages = load.invoke("glUseProgramStages", IIIV); caps.glValidateProgramPipeline = load.invoke("glValidateProgramPipeline", IV); diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL42C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL42C.java index 4e2ba6f6..950b0073 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL42C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL42C.java @@ -170,8 +170,8 @@ static void load(GLCapabilities caps, GLLoadFunc load) { caps.glDrawElementsInstancedBaseVertexBaseInstance = load.invoke("glDrawElementsInstancedBaseVertexBaseInstance", IIIPIIIV); caps.glDrawTransformFeedbackInstanced = load.invoke("glDrawTransformFeedbackInstanced", IIIV); caps.glDrawTransformFeedbackStreamInstanced = load.invoke("glDrawTransformFeedbackStreamInstanced", IIIIV); - caps.glGetActiveAtomicCounterBufferiv = load.trivialHandle("glGetActiveAtomicCounterBufferiv", IIIPV); - caps.glGetInternalformativ = load.trivialHandle("glGetInternalformativ", IIIIPV); + caps.glGetActiveAtomicCounterBufferiv = load.invoke("glGetActiveAtomicCounterBufferiv", IIIPV); + caps.glGetInternalformativ = load.invoke("glGetInternalformativ", IIIIPV); caps.glMemoryBarrier = load.invoke("glMemoryBarrier", IV); caps.glTexStorage1D = load.invoke("glTexStorage1D", IIIIV); caps.glTexStorage2D = load.invoke("glTexStorage2D", IIIIIV); diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL43C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL43C.java index 4fe8f96c..ef05dc51 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL43C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL43C.java @@ -338,11 +338,11 @@ static void load(GLCapabilities caps, GLLoadFunc load) { caps.glDispatchComputeIndirect = load.invoke("glDispatchComputeIndirect", JV); caps.glFramebufferParameteri = load.invoke("glFramebufferParameteri", IIIV); caps.glGetDebugMessageLog = load.invoke("glGetDebugMessageLog", IIPPPPPPI); - caps.glGetFramebufferParameteriv = load.trivialHandle("glGetFramebufferParameteriv", IIPV); - caps.glGetInternalformati64v = load.trivialHandle("glGetInternalformati64v", IIIIPV); - caps.glGetObjectLabel = load.trivialHandle("glGetObjectLabel", IIIPPV); - caps.glGetObjectPtrLabel = load.trivialHandle("glGetObjectPtrLabel", PIPPV); - caps.glGetPointerv = load.trivialHandle("glGetPointerv", IPV); + caps.glGetFramebufferParameteriv = load.invoke("glGetFramebufferParameteriv", IIPV); + caps.glGetInternalformati64v = load.invoke("glGetInternalformati64v", IIIIPV); + caps.glGetObjectLabel = load.invoke("glGetObjectLabel", IIIPPV); + caps.glGetObjectPtrLabel = load.invoke("glGetObjectPtrLabel", PIPPV); + caps.glGetPointerv = load.invoke("glGetPointerv", IPV); caps.glGetProgramInterfaceiv = load.invoke("glGetProgramInterfaceiv", IIIPV); caps.glGetProgramResourceIndex = load.invoke("glGetProgramResourceIndex", IIPI); caps.glGetProgramResourceLocation = load.invoke("glGetProgramResourceLocation", IIPI); diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL45C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL45C.java index 10ee62a5..40796a95 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL45C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL45C.java @@ -107,47 +107,47 @@ static void load(GLCapabilities caps, GLLoadFunc load) { caps.glCopyTextureSubImage1D = load.invoke("glCopyTextureSubImage1D", IIIIIIV); caps.glCopyTextureSubImage2D = load.invoke("glCopyTextureSubImage2D", IIIIIIIIV); caps.glCopyTextureSubImage3D = load.invoke("glCopyTextureSubImage3D", IIIIIIIIIV); - caps.glCreateBuffers = load.trivialHandle("glCreateBuffers", IPV); - caps.glCreateFramebuffers = load.trivialHandle("glCreateFramebuffers", IPV); - caps.glCreateProgramPipelines = load.trivialHandle("glCreateProgramPipelines", IPV); - caps.glCreateQueries = load.trivialHandle("glCreateQueries", IIPV); - caps.glCreateRenderbuffers = load.trivialHandle("glCreateRenderbuffers", IPV); - caps.glCreateSamplers = load.trivialHandle("glCreateSamplers", IPV); - caps.glCreateTextures = load.trivialHandle("glCreateTextures", IIPV); - caps.glCreateTransformFeedbacks = load.trivialHandle("glCreateTransformFeedbacks", IPV); - caps.glCreateVertexArrays = load.trivialHandle("glCreateVertexArrays", IPV); - caps.glDisableVertexArrayAttrib = load.trivialHandle("glDisableVertexArrayAttrib", IIV); - caps.glEnableVertexArrayAttrib = load.trivialHandle("glEnableVertexArrayAttrib", IIV); + caps.glCreateBuffers = load.invoke("glCreateBuffers", IPV); + caps.glCreateFramebuffers = load.invoke("glCreateFramebuffers", IPV); + caps.glCreateProgramPipelines = load.invoke("glCreateProgramPipelines", IPV); + caps.glCreateQueries = load.invoke("glCreateQueries", IIPV); + caps.glCreateRenderbuffers = load.invoke("glCreateRenderbuffers", IPV); + caps.glCreateSamplers = load.invoke("glCreateSamplers", IPV); + caps.glCreateTextures = load.invoke("glCreateTextures", IIPV); + caps.glCreateTransformFeedbacks = load.invoke("glCreateTransformFeedbacks", IPV); + caps.glCreateVertexArrays = load.invoke("glCreateVertexArrays", IPV); + caps.glDisableVertexArrayAttrib = load.invoke("glDisableVertexArrayAttrib", IIV); + caps.glEnableVertexArrayAttrib = load.invoke("glEnableVertexArrayAttrib", IIV); caps.glFlushMappedNamedBufferRange = load.invoke("glFlushMappedNamedBufferRange", IJJV); caps.glGenerateTextureMipmap = load.invoke("glGenerateTextureMipmap", IV); caps.glGetCompressedTextureImage = load.invoke("glGetCompressedTextureImage", IIIPV); caps.glGetCompressedTextureSubImage = load.invoke("glGetCompressedTextureSubImage", IIIIIIIIIPV); caps.glGetGraphicsResetStatus = load.invoke("glGetGraphicsResetStatus", I); - caps.glGetNamedBufferParameteri64v = load.trivialHandle("glGetNamedBufferParameteri64v", IIPV); - caps.glGetNamedBufferParameteriv = load.trivialHandle("glGetNamedBufferParameteriv", IIPV); - caps.glGetNamedBufferPointerv = load.trivialHandle("glGetNamedBufferPointerv", IIPV); + caps.glGetNamedBufferParameteri64v = load.invoke("glGetNamedBufferParameteri64v", IIPV); + caps.glGetNamedBufferParameteriv = load.invoke("glGetNamedBufferParameteriv", IIPV); + caps.glGetNamedBufferPointerv = load.invoke("glGetNamedBufferPointerv", IIPV); caps.glGetNamedBufferSubData = load.invoke("glGetNamedBufferSubData", IJJPV); - caps.glGetNamedFramebufferAttachmentParameteriv = load.trivialHandle("glGetNamedFramebufferAttachmentParameteriv", IIIPV); - caps.glGetNamedFramebufferParameteriv = load.trivialHandle("glGetNamedFramebufferParameteriv", IIPV); - caps.glGetNamedRenderbufferParameteriv = load.trivialHandle("glGetNamedRenderbufferParameteriv", IIPV); - caps.glGetQueryBufferObjecti64v = load.trivialHandle("glGetQueryBufferObjecti64v", IIIJV); - caps.glGetQueryBufferObjectiv = load.trivialHandle("glGetQueryBufferObjectiv", IIIJV); - caps.glGetQueryBufferObjectui64v = load.trivialHandle("glGetQueryBufferObjectui64v", IIIJV); - caps.glGetQueryBufferObjectuiv = load.trivialHandle("glGetQueryBufferObjectuiv", IIIJV); + caps.glGetNamedFramebufferAttachmentParameteriv = load.invoke("glGetNamedFramebufferAttachmentParameteriv", IIIPV); + caps.glGetNamedFramebufferParameteriv = load.invoke("glGetNamedFramebufferParameteriv", IIPV); + caps.glGetNamedRenderbufferParameteriv = load.invoke("glGetNamedRenderbufferParameteriv", IIPV); + caps.glGetQueryBufferObjecti64v = load.invoke("glGetQueryBufferObjecti64v", IIIJV); + caps.glGetQueryBufferObjectiv = load.invoke("glGetQueryBufferObjectiv", IIIJV); + caps.glGetQueryBufferObjectui64v = load.invoke("glGetQueryBufferObjectui64v", IIIJV); + caps.glGetQueryBufferObjectuiv = load.invoke("glGetQueryBufferObjectuiv", IIIJV); caps.glGetTextureImage = load.invoke("glGetTextureImage", IIIIIPV); - caps.glGetTextureLevelParameterfv = load.trivialHandle("glGetTextureLevelParameterfv", IIIPV); - caps.glGetTextureLevelParameteriv = load.trivialHandle("glGetTextureLevelParameteriv", IIIPV); - caps.glGetTextureParameterIiv = load.trivialHandle("glGetTextureParameterIiv", IIPV); - caps.glGetTextureParameterIuiv = load.trivialHandle("glGetTextureParameterIuiv", IIPV); - caps.glGetTextureParameterfv = load.trivialHandle("glGetTextureParameterfv", IIPV); - caps.glGetTextureParameteriv = load.trivialHandle("glGetTextureParameteriv", IIPV); + caps.glGetTextureLevelParameterfv = load.invoke("glGetTextureLevelParameterfv", IIIPV); + caps.glGetTextureLevelParameteriv = load.invoke("glGetTextureLevelParameteriv", IIIPV); + caps.glGetTextureParameterIiv = load.invoke("glGetTextureParameterIiv", IIPV); + caps.glGetTextureParameterIuiv = load.invoke("glGetTextureParameterIuiv", IIPV); + caps.glGetTextureParameterfv = load.invoke("glGetTextureParameterfv", IIPV); + caps.glGetTextureParameteriv = load.invoke("glGetTextureParameteriv", IIPV); caps.glGetTextureSubImage = load.invoke("glGetTextureSubImage", IIIIIIIIIIIPV); - caps.glGetTransformFeedbacki64_v = load.trivialHandle("glGetTransformFeedbacki64_v", IIIPV); - caps.glGetTransformFeedbacki_v = load.trivialHandle("glGetTransformFeedbacki_v", IIIPV); - caps.glGetTransformFeedbackiv = load.trivialHandle("glGetTransformFeedbackiv", IIPV); - caps.glGetVertexArrayIndexed64iv = load.trivialHandle("glGetVertexArrayIndexed64iv", IIIPV); - caps.glGetVertexArrayIndexediv = load.trivialHandle("glGetVertexArrayIndexediv", IIIPV); - caps.glGetVertexArrayiv = load.trivialHandle("glGetVertexArrayiv", IIPV); + caps.glGetTransformFeedbacki64_v = load.invoke("glGetTransformFeedbacki64_v", IIIPV); + caps.glGetTransformFeedbacki_v = load.invoke("glGetTransformFeedbacki_v", IIIPV); + caps.glGetTransformFeedbackiv = load.invoke("glGetTransformFeedbackiv", IIPV); + caps.glGetVertexArrayIndexed64iv = load.invoke("glGetVertexArrayIndexed64iv", IIIPV); + caps.glGetVertexArrayIndexediv = load.invoke("glGetVertexArrayIndexediv", IIIPV); + caps.glGetVertexArrayiv = load.invoke("glGetVertexArrayiv", IIPV); caps.glGetnCompressedTexImage = load.invoke("glGetnCompressedTexImage", IIIPV); caps.glGetnTexImage = load.invoke("glGetnTexImage", IIIIIPV); caps.glGetnUniformdv = load.invoke("glGetnUniformdv", IIIPV); @@ -175,12 +175,12 @@ static void load(GLCapabilities caps, GLLoadFunc load) { caps.glTextureBarrier = load.invoke("glTextureBarrier", V); caps.glTextureBuffer = load.invoke("glTextureBuffer", IIIV); caps.glTextureBufferRange = load.invoke("glTextureBufferRange", IIIJJV); - caps.glTextureParameterIiv = load.trivialHandle("glTextureParameterIiv", IIPV); - caps.glTextureParameterIuiv = load.trivialHandle("glTextureParameterIuiv", IIPV); - caps.glTextureParameterf = load.trivialHandle("glTextureParameterf", IIFV); - caps.glTextureParameterfv = load.trivialHandle("glTextureParameterfv", IIPV); - caps.glTextureParameteri = load.trivialHandle("glTextureParameteri", IIIV); - caps.glTextureParameteriv = load.trivialHandle("glTextureParameteriv", IIPV); + caps.glTextureParameterIiv = load.invoke("glTextureParameterIiv", IIPV); + caps.glTextureParameterIuiv = load.invoke("glTextureParameterIuiv", IIPV); + caps.glTextureParameterf = load.invoke("glTextureParameterf", IIFV); + caps.glTextureParameterfv = load.invoke("glTextureParameterfv", IIPV); + caps.glTextureParameteri = load.invoke("glTextureParameteri", IIIV); + caps.glTextureParameteriv = load.invoke("glTextureParameteriv", IIPV); caps.glTextureStorage1D = load.invoke("glTextureStorage1D", IIIIV); caps.glTextureStorage2D = load.invoke("glTextureStorage2D", IIIIIV); caps.glTextureStorage2DMultisample = load.invoke("glTextureStorage2DMultisample", IIIIIZV); diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL46C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL46C.java index 3adc377b..6004b5c2 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL46C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL46C.java @@ -76,7 +76,7 @@ static boolean isSupported(GLCapabilities caps) { static void load(GLCapabilities caps, GLLoadFunc load) { caps.glMultiDrawArraysIndirectCount = load.invoke("glMultiDrawArraysIndirectCount", IPJIIV); caps.glMultiDrawElementsIndirectCount = load.invoke("glMultiDrawElementsIndirectCount", IIPJIIV); - caps.glPolygonOffsetClamp = load.trivialHandle("glPolygonOffsetClamp", FFFV); + caps.glPolygonOffsetClamp = load.invoke("glPolygonOffsetClamp", FFFV); caps.glSpecializeShader = load.invoke("glSpecializeShader", IPIPPV); } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLLoadFunc.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLLoadFunc.java index bfe76fd0..a62a7830 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLLoadFunc.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLLoadFunc.java @@ -58,15 +58,4 @@ public interface GLLoadFunc { default MethodHandle invoke(String procName, FunctionDescriptors function, Linker.Option... options) { return RuntimeHelper.downcallSafe(invoke(procName), function, options); } - - /** - * Load a trivial function by the given name and creates a downcall handle or {@code null}. - * - * @param procName the function name - * @param function the function descriptor of the target function. - * @return a downcall method handle, or {@code null} if the symbol is {@link MemorySegment#NULL} - */ - default MethodHandle trivialHandle(String procName, FunctionDescriptors function) { - return invoke(procName, function, Linker.Option.isTrivial()); - } } diff --git a/modules/overrungl.stb/src/main/java/overrungl/stb/Handles.java b/modules/overrungl.stb/src/main/java/overrungl/stb/Handles.java index 24accfa1..8d9e3a28 100644 --- a/modules/overrungl.stb/src/main/java/overrungl/stb/Handles.java +++ b/modules/overrungl.stb/src/main/java/overrungl/stb/Handles.java @@ -17,7 +17,6 @@ package overrungl.stb; import overrungl.FunctionDescriptors; -import overrungl.OverrunGL; import overrungl.internal.RuntimeHelper; import java.lang.foreign.Linker; @@ -52,6 +51,6 @@ static MethodHandle downcallTrivial(String name, public static void initialize() { if (loaded) return; loaded = true; - lookup = RuntimeHelper.load("stb", "stb", OverrunGL.VERSION); + lookup = RuntimeHelper.load("stb", "stb", "0.1.0.0"); } } diff --git a/modules/overrungl.stb/src/main/java/overrungl/stb/STBEasyFont.java b/modules/overrungl.stb/src/main/java/overrungl/stb/STBEasyFont.java index e183f1b7..f91581dd 100644 --- a/modules/overrungl.stb/src/main/java/overrungl/stb/STBEasyFont.java +++ b/modules/overrungl.stb/src/main/java/overrungl/stb/STBEasyFont.java @@ -73,11 +73,11 @@ private STBEasyFont() { private static void create() { stb_easy_font_draw_segs = downcall("stb_easy_font_draw_segs", FFPIIPPIII); - stb_easy_font_get_spacing = downcallTrivial("stb_easy_font_get_spacing", F); - stb_easy_font_spacing = downcallTrivial("stb_easy_font_spacing", FV); + stb_easy_font_get_spacing = downcall("stb_easy_font_get_spacing", F); + stb_easy_font_spacing = downcall("stb_easy_font_spacing", FV); stb_easy_font_print = downcall("stb_easy_font_print", FFPPPII); - stb_easy_font_width = downcallTrivial("stb_easy_font_width", fd_PI); - stb_easy_font_height = downcallTrivial("stb_easy_font_height", fd_PI); + stb_easy_font_width = downcall("stb_easy_font_width", fd_PI); + stb_easy_font_height = downcall("stb_easy_font_height", fd_PI); } public static int ndrawSegs(float x, float y, MemorySegment segs, int numSegs, boolean vertical, MemorySegment c, MemorySegment vbuf, int vbufSize, int offset) { diff --git a/modules/overrungl.stb/src/main/java/overrungl/stb/STBImage.java b/modules/overrungl.stb/src/main/java/overrungl/stb/STBImage.java index 7a08617c..1aaeafe2 100644 --- a/modules/overrungl.stb/src/main/java/overrungl/stb/STBImage.java +++ b/modules/overrungl.stb/src/main/java/overrungl/stb/STBImage.java @@ -65,12 +65,12 @@ public final class STBImage { } private static void create() { - stbi_convert_iphone_png_to_rgb = downcallTrivial("stbi_convert_iphone_png_to_rgb", IV); - stbi_convert_iphone_png_to_rgb_thread = downcallTrivial("stbi_convert_iphone_png_to_rgb_thread", IV); - stbi_failure_reason = downcallTrivial("stbi_failure_reason", p); - stbi_hdr_to_ldr_gamma = downcallTrivial("stbi_hdr_to_ldr_gamma", FV); - stbi_hdr_to_ldr_scale = downcallTrivial("stbi_hdr_to_ldr_scale", FV); - stbi_image_free = downcallTrivial("stbi_image_free", PV); + stbi_convert_iphone_png_to_rgb = downcall("stbi_convert_iphone_png_to_rgb", IV); + stbi_convert_iphone_png_to_rgb_thread = downcall("stbi_convert_iphone_png_to_rgb_thread", IV); + stbi_failure_reason = downcall("stbi_failure_reason", p); + stbi_hdr_to_ldr_gamma = downcall("stbi_hdr_to_ldr_gamma", FV); + stbi_hdr_to_ldr_scale = downcall("stbi_hdr_to_ldr_scale", FV); + stbi_image_free = downcall("stbi_image_free", PV); stbi_info = downcall("stbi_info", PPPPI); stbi_info_from_callbacks = downcall("stbi_info_from_callbacks", PPPPPI); stbi_info_from_file = downcall("stbi_info_from_file", PPPPI); @@ -98,9 +98,9 @@ private static void create() { stbi_loadf_from_callbacks = downcall("stbi_loadf_from_callbacks", PPPPPIp); stbi_loadf_from_file = downcall("stbi_loadf_from_file", PPPPIp); stbi_loadf_from_memory = downcall("stbi_loadf_from_memory", PIPPPIp); - stbi_set_flip_vertically_on_load = downcallTrivial("stbi_set_flip_vertically_on_load", IV); + stbi_set_flip_vertically_on_load = downcall("stbi_set_flip_vertically_on_load", IV); stbi_set_flip_vertically_on_load_thread = downcall("stbi_set_flip_vertically_on_load_thread", IV); - stbi_set_unpremultiply_on_load = downcallTrivial("stbi_set_unpremultiply_on_load", IV); + stbi_set_unpremultiply_on_load = downcall("stbi_set_unpremultiply_on_load", IV); stbi_set_unpremultiply_on_load_thread = downcall("stbi_set_unpremultiply_on_load_thread", IV); stbi_zlib_decode_buffer = downcall("stbi_zlib_decode_buffer", PIPII); stbi_zlib_decode_malloc = downcall("stbi_zlib_decode_malloc", PIPp); diff --git a/modules/overrungl.stb/src/main/java/overrungl/stb/STBImageWrite.java b/modules/overrungl.stb/src/main/java/overrungl/stb/STBImageWrite.java index 12358d64..7cbc8401 100644 --- a/modules/overrungl.stb/src/main/java/overrungl/stb/STBImageWrite.java +++ b/modules/overrungl.stb/src/main/java/overrungl/stb/STBImageWrite.java @@ -48,13 +48,13 @@ public final class STBImageWrite { } private static void create() { - stbi_flip_vertically_on_write = downcallTrivial("stbi_flip_vertically_on_write", IV); - stbi_get_write_force_png_filter = downcallTrivial("stbi_get_write_force_png_filter", I); - stbi_get_write_png_compression_level = downcallTrivial("stbi_get_write_png_compression_level", I); - stbi_get_write_tga_with_rle = downcallTrivial("stbi_get_write_tga_with_rle", I); - stbi_set_write_force_png_filter = downcallTrivial("stbi_set_write_force_png_filter", IV); - stbi_set_write_png_compression_level = downcallTrivial("stbi_set_write_png_compression_level", IV); - stbi_set_write_tga_with_rle = downcallTrivial("stbi_set_write_tga_with_rle", IV); + stbi_flip_vertically_on_write = downcall("stbi_flip_vertically_on_write", IV); + stbi_get_write_force_png_filter = downcall("stbi_get_write_force_png_filter", I); + stbi_get_write_png_compression_level = downcall("stbi_get_write_png_compression_level", I); + stbi_get_write_tga_with_rle = downcall("stbi_get_write_tga_with_rle", I); + stbi_set_write_force_png_filter = downcall("stbi_set_write_force_png_filter", IV); + stbi_set_write_png_compression_level = downcall("stbi_set_write_png_compression_level", IV); + stbi_set_write_tga_with_rle = downcall("stbi_set_write_tga_with_rle", IV); stbi_write_bmp = downcall("stbi_write_bmp", PIIIPI); stbi_write_bmp_to_func = downcall("stbi_write_bmp_to_func", PPIIIP); stbi_write_hdr = downcall("stbi_write_hdr", PIIIPI); From 4e9259f8288954bbb758866347137c25ffaa94a2 Mon Sep 17 00:00:00 2001 From: squid233 <60126026+squid233@users.noreply.github.com> Date: Sat, 30 Sep 2023 09:33:31 +0800 Subject: [PATCH 13/14] Update build script and workflow --- .github/workflows/gradle.yml | 2 +- build.gradle.kts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index be47646f..03985e3d 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -7,7 +7,7 @@ name: Java CI with Gradle -on: [ push, pull_request ] +on: [ push, pull_request, workflow_dispatch ] jobs: build: diff --git a/build.gradle.kts b/build.gradle.kts index 0e6decf0..e7c40cf7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -19,7 +19,7 @@ val orgName: String by project val orgUrl: String by project val developers: String by project -val jdkEABuildDoc: String? = "jdk21" +val jdkEABuildDoc: String? = null val targetJavaVersion = 21 val enablePreview = true From e74a40f87226538f87f7a0e27595573f2d3538c3 Mon Sep 17 00:00:00 2001 From: squid233 <60126026+squid233@users.noreply.github.com> Date: Sat, 30 Sep 2023 10:33:36 +0800 Subject: [PATCH 14/14] Hotfix: natives not loading --- build.gradle.kts | 2 +- gradle/wrapper/gradle-wrapper.jar | Bin 63375 -> 63721 bytes gradlew | 3 ++- .../java/overrungl/internal/Exceptions.java | 4 ++++ .../overrungl/internal/RuntimeHelper.java | 12 +++++------- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index e7c40cf7..8d882549 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -113,7 +113,7 @@ enum class Artifact( fun nativeFileName(platform: NativePlatform): String? { return if (nativeBinding == null) null - else "$nativeBinding/${platform.osFamilyName}/${platform.osArch}/${platform.nativeLibPrefix}${nativeBinding.basename}${platform.nativeLibSuffix}" + else "${nativeBinding.bindingName}/${platform.osFamilyName}/${platform.osArch}/${platform.nativeLibPrefix}${nativeBinding.basename}${platform.nativeLibSuffix}" } } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 033e24c4cdf41af1ab109bc7f253b2b887023340..7f93135c49b765f8051ef9d0a6055ff8e46073d8 100644 GIT binary patch delta 28216 zcmZ6yQ*@x+6TO*^ZQHip9ox2TJ8x{;wr$&H$LgqKv*-KI%$l`+bAK-CVxOv0&)z5g z2JHL}t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_>ABaxo zFLZIvLj3>ra^Bag{(;Qo-yurSrwcX!i~(rtf)Z5wZem)zo4NoVYmnfj6#&r|Bw!~9 zV!K8M_3j~qo-a`WzwAJWS3&?3d(h<-5yX8zN~@GT(#HRJE;r&|R8PTpVB zD4!67cZ3cKy(0uH7l88bxQPD=xcT2f-^=2lfkM#boeF@j93*xxO8k%K_&?n5ig%6} z)Oybbz#aNK%-cN=p#R5TlXUF;SNMUB_@C9pf0~z${1?RfJMp;(LcsYH=<>k;@HP+n syvPdje?%w#=c($S<~7S8@>K@hkBTtwU;THn!}mQ03j*TT&VOqE4-{M+YybcN diff --git a/gradlew b/gradlew index fcb6fca1..0adc8e1a 100644 --- a/gradlew +++ b/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/modules/overrungl.core/src/main/java/overrungl/internal/Exceptions.java b/modules/overrungl.core/src/main/java/overrungl/internal/Exceptions.java index 54e12662..7bfd1fd7 100644 --- a/modules/overrungl.core/src/main/java/overrungl/internal/Exceptions.java +++ b/modules/overrungl.core/src/main/java/overrungl/internal/Exceptions.java @@ -34,4 +34,8 @@ public final class Exceptions { */ public static final StringTemplate.Processor IAE = stringTemplate -> new IllegalArgumentException(stringTemplate.interpolate()); + + private Exceptions() { + //no instance + } } diff --git a/modules/overrungl.core/src/main/java/overrungl/internal/RuntimeHelper.java b/modules/overrungl.core/src/main/java/overrungl/internal/RuntimeHelper.java index 00c87c5f..d21b38a0 100644 --- a/modules/overrungl.core/src/main/java/overrungl/internal/RuntimeHelper.java +++ b/modules/overrungl.core/src/main/java/overrungl/internal/RuntimeHelper.java @@ -174,14 +174,12 @@ public static SymbolLookup load(String module, String basename, String version) var libFile = new File(file, STR. "\{ basename }-\{ version }\{ suffix }" ); if (!libFile.exists()) { // Extract - try (var is = STACK_WALKER.getCallerClass().getClassLoader().getResourceAsStream( - STR. "\{ module }/\{ os.familyName() }/\{ Architecture.current() }/\{ path }" - )) { - Files.copy(Objects.requireNonNull(is), Path.of(libFile.getAbsolutePath())); + final String fromPath = STR. "\{ module }/\{ os.familyName() }/\{ Architecture.current() }/\{ path }" ; + try (var is = STACK_WALKER.getCallerClass().getClassLoader().getResourceAsStream(fromPath)) { + Files.copy(Objects.requireNonNull(is, STR. "File not found: \{ fromPath }" ), + Path.of(libFile.getAbsolutePath())); } catch (Exception e) { - var exception = new IllegalStateException(STR. "File not found: \{ file }; try setting property -Doverrungl.natives to a valid path" ); - exception.addSuppressed(e); - throw exception; + throw new IllegalStateException(STR. "File not found: \{ file }; try setting property -Doverrungl.natives to a valid path" , e); } } uri = libFile.toURI();