diff --git a/README.md b/README.md index e254196c..4350f1d1 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ See [doc/notes](doc/notes/README.md). Javadoc can be found [here](https://over-run.github.io/overrungl-doc/). -The documentation of OpenGL can be found [here](https://docs.gl/). +The documentation of OpenGL can be found [here](https://registry.khronos.org/OpenGL-Refpages/gl4/) and [here](https://docs.gl/). ### Credits diff --git a/gradle.properties b/gradle.properties index f0013a91..4e326780 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,5 +18,5 @@ jdkEnablePreview=true jdkEarlyAccessDoc=jdk22 kotlinTargetJdkVersion=21 -overrunMarshalVersion=0.1.0-alpha.10-jdk22 +overrunMarshalVersion=0.1.0-alpha.13-jdk22 overrunPlatformVersion=1.0.0 diff --git a/modules/overrungl.core/src/main/java/overrungl/Callback.java b/modules/overrungl.core/src/main/java/overrungl/Callback.java deleted file mode 100644 index 3436429b..00000000 --- a/modules/overrungl.core/src/main/java/overrungl/Callback.java +++ /dev/null @@ -1,96 +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; - -import overrungl.internal.RuntimeHelper; - -import java.lang.foreign.Arena; -import java.lang.foreign.FunctionDescriptor; -import java.lang.foreign.MemorySegment; -import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodHandles; -import java.util.function.Function; - -/** - * The upcall stub which can be passed to other foreign functions as a function pointer, - * with the given arena. - * - * @author squid233 - * @since 0.1.0 - */ -@Deprecated(since = "0.1.0") -public interface Callback { - /** - * Gets the address with the given arena. - * - * @param arena the arena. - * @return the memory address. - */ - default MemorySegment address(Arena arena) { - return segment(arena, descriptor()); - } - - /** - * {@return the function descriptor of this callback} - */ - FunctionDescriptor descriptor(); - - /** - * Finds the method handle from the given method handles lookup. - * - * @param lookup the lookup - * @return the method handle - * @throws NoSuchMethodException if the method does not exist - * @throws IllegalAccessException if access checking fails, or if the method is {@code static}, or if the method's - * variable arity modifier bit is set and {@code asVarargsCollector} fails - */ - MethodHandle handle(MethodHandles.Lookup lookup) throws NoSuchMethodException, IllegalAccessException; - - /** - * Creates a method handle that invokes a native function callback. - * - * @param segment the segment of the native function. - * @return the method handle - */ - default MethodHandle nativeHandle(MemorySegment segment) { - return RuntimeHelper.LINKER.downcallHandle(segment, descriptor()); - } - - /** - * Gets the memory segment of the upcall stub with the given arena. - * - * @param arena the arena. - * @param function the function descriptor. - * @return the memory segment. - */ - default MemorySegment segment(Arena arena, FunctionDescriptor function) { - try { - return RuntimeHelper.LINKER.upcallStub(handle(MethodHandles.publicLookup()).bindTo(this), function, arena); - } catch (NoSuchMethodException | IllegalAccessException e) { - throw new RuntimeException(e); - } - } - - /** - * Method handle getter. - * - * @author squid233 - * @since 0.1.0 - */ - interface Native extends Function { - } -} diff --git a/modules/overrungl.core/src/main/java/overrungl/Configurations.java b/modules/overrungl.core/src/main/java/overrungl/Configurations.java index baa4be91..7aea712b 100644 --- a/modules/overrungl.core/src/main/java/overrungl/Configurations.java +++ b/modules/overrungl.core/src/main/java/overrungl/Configurations.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2022-2023 Overrun Organization + * Copyright (c) 2022-2024 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 @@ -27,30 +27,12 @@ * @since 0.1.0 */ public final class Configurations { - /** - * The default stack size in KiB of {@link overrungl.util.MemoryStack MemoryStack}. - *

- * The default value is {@code 64}. - */ - public static final Entry STACK_SIZE = new Entry<>(() -> 64L); - /** - * The default stack frames of {@link overrungl.util.MemoryStack MemoryStack}. - *

- * The default value is {@code 8}. - */ - public static final Entry STACK_FRAMES = new Entry<>(() -> 8); /** * Enable debug messages and prints to {@link OverrunGL#apiLogger()}. *

* The default value is {@code false}. */ public static final Entry DEBUG = new Entry<>(() -> false); - /** - * Enable using debug memory stack. - *

- * The default value is {@code false}. - */ - public static final Entry DEBUG_STACK = new Entry<>(() -> false); /** * Enable debug memory util to check memory leaks. *

@@ -63,18 +45,6 @@ public final class Configurations { * The default value is {@code false}. */ public static final Entry DEBUG_MEM_UTIL_FAST = new Entry<>(() -> false); - /** - * Enable checks. - *

- * The default value is {@code true}. - */ - public static final Entry CHECKS = new Entry<>(() -> true); - /** - * Forcing to check all method handles for OpenGL. - *

- * The default value is {@code false}. - */ - public static final Entry GL_FORCE_CHECK_ALL = new Entry<>(() -> false); /** * The symbol lookup of GLFW. * The returned value must not be null. diff --git a/modules/overrungl.core/src/main/java/overrungl/FunctionDescriptors.java b/modules/overrungl.core/src/main/java/overrungl/FunctionDescriptors.java deleted file mode 100644 index f92c0b31..00000000 --- a/modules/overrungl.core/src/main/java/overrungl/FunctionDescriptors.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2022-2024 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; - -import overrungl.internal.Exceptions; -import overrungl.internal.RuntimeHelper; - -import java.lang.foreign.FunctionDescriptor; -import java.lang.foreign.ValueLayout; - -import static java.lang.foreign.ValueLayout.*; - -/** - * The function descriptors. - *

Mappings

- * {@snippet lang = java: - * switch (c) { - * case 'B' -> JAVA_BYTE; - * case 'S' -> JAVA_SHORT; - * case 'I' -> JAVA_INT; - * case 'J' -> JAVA_LONG; - * case 'C' -> JAVA_CHAR; - * case 'Z' -> JAVA_BOOLEAN; - * case 'F' -> JAVA_FLOAT; - * case 'D' -> JAVA_DOUBLE; - * case 'P' -> ADDRESS; - * default -> throw new IllegalArgumentException(); - * }} - * - * @author squid233 - * @since 0.1.0 - * @deprecated This class is going to be removed (but is not marked as removal). - */ -@Deprecated(since = "0.1.0") -public enum FunctionDescriptors { - // 1 - D, F, I, J, P, p, V, - // 2 - BV, DV, FV, II, IJ, IP, Ip, IV, IZ, JP, JV, JZ, PF, - /** - * Make it doesn't confuse with {@link Math#PI}. - */ - fd_PI("PI"), - PJ, PP, Pp, PV, PZ, SV, ZV, - // 3 - DDV, FFV, FZV, IDV, IFV, III, IIJ, IIP, IIp, IIV, IIZ, IJV, IPI, IPP, IPp, IPV, IPZ, ISV, JIV, JJP, PFV, PII, PIV, PJP, - PJp, PPI, PPP, PPp, PPV, SSV, - // 4 - BBBV, DDDV, FFFV, IDDV, IFFV, IIDV, IIFV, IIII, IIIV, IIJV, IIPI, IIPV, IJJV, IPIV, IPPV, IPPZ, ISSV, PDDV, PIIP, PIIV, - PIJI, PIJP, PIJV, PIPp, PIPV, PPII, PPIP, PPJP, PPPI, PPPP, PPPV, SSSV, - // 5 - BBBBV, DDDDV, FFFFV, IDDDV, IFFFV, IIDDV, IIFFV, IIFIV, IIIIV, IIIJV, IIIPV, IIJIV, IIJJV, IIPIV, IIPPV, IIZIV, IIZPV, - IJJIP, IJJJV, IJJPV, IJJZV, IJPIV, IPIIV, IPIPV, IPPIV, ISSSV, PIIIP, PIIPp, PIPII, PIPIp, PIPPP, PIPPV, PPIPI, PPPPI, PPPPV, - SSSSV, ZZZZV, - // 6 - FFFFFV, IBBBBV, IDDDDV, IFFFFV, IIDDDV, IIFFFV, IIIFIV, IIIIIV, IIIIPV, IIIJIV, IIIJJV, IIIPIV, IIIPPP, IIIPPV, IIIPZV, - IIIZIV, IIIZPV, IIJJJV, IIPIIV, IIPIPV, IIPPPP, IIPPPV, IIZIIJ, IJJJJV, IPIPIV, IPIPPV, IPJIIV, IPPIPV, ISSSSV, IZIIPV, - IZZZZV, PIIIIV, PIIIPI, PIIPIp, PIIPPV, PIPPIP, PIPPPI, PIPPPP, PPIIIP, PPIPPI, PPPIIV, PPPPIp, PPPPPI, PPPPPV, - // 7 - BBBBFFV, DDDDDDV, FFFFFFV, FFFFFIF, FFFIIIF, FFPPPII, IDDIDDV, IDDIIPV, IFFFFFV, IFFIFFV, IFFIIPV, IIDDDDV, IIFFFFV, - IIIIIIV, IIIIIPV, IIIIIZV, IIIIPPV, IIIIPZV, IIIIZIV, IIIPIIV, IIIPPIV, IIIPPPV, IIIZIPV, IIJJJJV, IIPJIIV, IPIPIPV, - PIIIIPp, PIIIPII, PIPPPIp, PPIIIPI, PPIPIIV, PPIPPPI, PPPPPIp, - // 8 - BBBBFFFV, FFFFFFIF, FFFIIIBF, FFFIIIIF, IFFFFFFV, IIDDIIPV, IIFFFFPV, IIFFIIPV, IIIIIIIV, IIIIIIPV, IIIIIIZV, IIIIIPIV, - IIIPIIIV, IIIPPPPV, IIIZIIIV, IIJJIIPV, IIPIIIIV, IIPPPPPI, IIPPPPPV, PPIIIIIV, - // 9 - FFFFFFFFV, IBBBBFFFV, IIIIIIIIV, IIIIIIIPV, IIIIPIPPV, IIPPPPPPI, PIPPPPPIp, - // 10 - FFBBBBFFFV, IFFFFFFFFV, IIIIIIIIIV, IIIIIIIIPV, IIIIIIIIZV, PIIIPIIIII, - // 11 - FFFFFFFFFFV, IDDIIDDIIPV, IFFIIFFIIPV, IIIIIIIIIIV, IIIIIIIIIPV, - // 12 - IFFFFFFFFFFV, IIDDIIDDIIPV, IIFFIIFFIIPV, IIIIIIIIIIPV, IIIPIPPPPPPV, PIIIPIIIIIII, - // 13 - FFFFFFFFFFFFV, IIIIIIIIIIIIV, IIIIIIIIIIIPV, PIIIPIIIIIIII, - // 14 - IFFFFFFFFFFFFV, - // 16 - FFFFFFFFFFFFFFFV, IIIIIIIIIIIIIIIV, PIIIPIIIIIIIIIPI, - // 19 - PIIIPIIIIIIIIIIIIPI, - // 23 - PIIIPIIIIIIIIIIIIPFFFFI, - ; - - private final FunctionDescriptor descriptor; - - FunctionDescriptors(String customName) { - descriptor = ofDescriptor(customName); - } - - FunctionDescriptors() { - descriptor = ofDescriptor(name()); - } - - /** - * {@return the value layout of the specified character} - * - * @param c the character - * @throws IllegalArgumentException if {@code c} is not a value layout mark. - */ - public static ValueLayout ofValue(char c) throws IllegalArgumentException { - return switch (c) { - case 'B' -> JAVA_BYTE; - case 'S' -> JAVA_SHORT; - case 'I' -> JAVA_INT; - case 'J' -> JAVA_LONG; - case 'C' -> JAVA_CHAR; - case 'Z' -> JAVA_BOOLEAN; - case 'F' -> JAVA_FLOAT; - case 'D' -> JAVA_DOUBLE; - case 'P' -> ADDRESS; - case 'p' -> RuntimeHelper.ADDRESS_UNBOUNDED; - default -> - throw Exceptions.IAE."Invalid argument c: expected one of B, S, I, J, C, Z, F, D or P; got '\{c}'"; - }; - } - - /** - * Creates the function descriptor of the string. - * - * @param str the string - * @return the function descriptor - */ - public static FunctionDescriptor ofDescriptor(String str) { - final int len = str.length(); - ValueLayout[] layouts = new ValueLayout[len - 1]; - for (int i = 0; i < layouts.length; i++) { - layouts[i] = ofValue(str.charAt(i)); - } - if (str.endsWith("V")) { - return FunctionDescriptor.ofVoid(layouts); - } - return FunctionDescriptor.of(ofValue(str.charAt(len - 1)), layouts); - } - - /** - * {@return the function descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } -} diff --git a/modules/overrungl.core/src/main/java/overrungl/Pointer.java b/modules/overrungl.core/src/main/java/overrungl/Pointer.java deleted file mode 100644 index 96c74e1b..00000000 --- a/modules/overrungl.core/src/main/java/overrungl/Pointer.java +++ /dev/null @@ -1,79 +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; - -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; - -/** - * A {@link MemorySegment} wrapper with a segment allocator. - * - * @author squid233 - * @since 0.1.0 - */ -@Deprecated(since = "0.1.0") -public class Pointer implements Addressable { - /** - * The pointer address. - */ - protected final MemorySegment address; - /** - * The managed native segment that is not zero-length. - *

- * This field is not modified with {@code final} since the layout might be null in construction. - */ - protected MemorySegment managedSegment; - - /** - * Create the pointer instance. - * - * @param address the address. - */ - public Pointer(MemorySegment address) { - this.address = address; - } - - @Override - public MemorySegment address() { - return address; - } - - /** - * Gets the native segment of this pointer, or creates a new one if the segment of this pointer is zero-length. - * - * @param byteSize the byte size of the segment. - * @return the memory segment. - * @see #segment(MemoryLayout) - */ - public MemorySegment segment(long byteSize) { - if (managedSegment == null) { - managedSegment = address().reinterpret(byteSize); - } - return managedSegment; - } - - /** - * Gets the native segment of this pointer, or creates a new one if the segment of this pointer is zero-length. - * - * @param layout the memory layout of the segment. - * @return the memory segment. - * @see #segment(long) - */ - public MemorySegment segment(MemoryLayout layout) { - return segment(layout.byteSize()); - } -} diff --git a/modules/overrungl.core/src/main/java/overrungl/Struct.java b/modules/overrungl.core/src/main/java/overrungl/Struct.java deleted file mode 100644 index b7f1a27d..00000000 --- a/modules/overrungl.core/src/main/java/overrungl/Struct.java +++ /dev/null @@ -1,81 +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; - -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; - -/** - * The C struct wrapper. - * - * @author squid233 - * @since 0.1.0 - */ -@Deprecated(since = "0.1.0") -public class Struct extends Pointer { - /** - * The memory layout of this struct. - *

- * The memory layout can be modified in subclasses to load lazily. - */ - protected MemoryLayout layout; - - /** - * Creates a struct instance with the given memory layout. - * - * @param address the address. - * @param layout the memory layout of this struct. - */ - public Struct(MemorySegment address, MemoryLayout layout) { - super(address); - this.layout = layout; - segment(layout); - } - - /** - * Creates a struct instance. - * - * @param address the address. - */ - public Struct(MemorySegment address) { - super(address); - } - - /** - * Gets as a native segment. - * - * @return the memory segment. - * @see #segment(long) - */ - public MemorySegment segment() { - return segment(layout()); - } - - /** - * {@return the layout of this struct} - */ - public MemoryLayout layout() { - return layout; - } - - /** - * {@return the elements size of this struct in bytes} - */ - public long sizeofThis() { - return layout() != null ? layout().byteSize() : 0; - } -} diff --git a/modules/overrungl.core/src/main/java/overrungl/internal/Exceptions.java b/modules/overrungl.core/src/main/java/overrungl/internal/Exceptions.java deleted file mode 100644 index 09bc87fe..00000000 --- a/modules/overrungl.core/src/main/java/overrungl/internal/Exceptions.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2023-2024 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 - */ -@Deprecated(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()); - - 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 44af12e9..6f2f404e 100644 --- a/modules/overrungl.core/src/main/java/overrungl/internal/RuntimeHelper.java +++ b/modules/overrungl.core/src/main/java/overrungl/internal/RuntimeHelper.java @@ -18,25 +18,18 @@ import io.github.overrun.platform.Architecture; import io.github.overrun.platform.Platform; -import org.jetbrains.annotations.Nullable; import overrungl.Configurations; -import overrungl.FunctionDescriptors; -import overrungl.NativeType; import overrungl.OverrunGL; -import overrungl.util.MemoryUtil; import java.io.IOException; -import java.lang.foreign.*; -import java.lang.invoke.MethodHandle; +import java.lang.foreign.Arena; +import java.lang.foreign.Linker; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.SymbolLookup; import java.nio.file.Files; import java.nio.file.Path; import java.util.Map; import java.util.Objects; -import java.util.Optional; -import java.util.function.Function; -import java.util.function.ToLongFunction; - -import static java.lang.foreign.ValueLayout.*; /** * The runtime helper, for internal use. @@ -48,16 +41,8 @@ public final class RuntimeHelper { /** * The native linker. */ - public static final Linker LINKER = Linker.nativeLinker(); + private static final Linker LINKER = Linker.nativeLinker(); private static final Path tmpdir = Path.of(System.getProperty("java.io.tmpdir")); - /** - * An unbounded address layout. - */ - public static final AddressLayout ADDRESS_UNBOUNDED = ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(Long.MAX_VALUE, JAVA_BYTE)); - /** - * @see Configurations#CHECKS - */ - public static final boolean CHECKS = Configurations.CHECKS.get(); private static final StackWalker STACK_WALKER = StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE); private static final Map CANONICAL_LAYOUTS = LINKER.canonicalLayouts(); /** @@ -74,24 +59,6 @@ private RuntimeHelper() { throw new IllegalStateException("Do not construct instance"); } - @Deprecated(since = "0.1.0") - private static MemorySegment reinterpreting(MemorySegment pointerToPointer, int index, ToLongFunction size) { - final MemorySegment seg = pointerToPointer.getAtIndex(ADDRESS, index); - return seg.reinterpret(size.applyAsLong(seg)); - } - - /** - * Gets a UTF-8 string from the given pointer of a string at the given index. - * - * @param segment the memory segment. - * @param index the index. - * @return the string. - */ - @Deprecated(since = "0.1.0") - public static String unboundPointerString(MemorySegment segment, int index) { - return reinterpreting(segment, index, str -> MemoryUtil.strlen(str) + 1).getString(0); - } - /** * Generates a string for unknown token. * @@ -166,206 +133,4 @@ public static SymbolLookup load(String module, String basename, String version) // Load the library by the path with the global arena return SymbolLookup.libraryLookup(uri, Arena.global()); } - - /** - * {@return {@code true} if {@code segment} is a null pointer} - * - * @param segment the segment. - */ - @Deprecated(since = "0.1.0") - public static boolean isNullptr(@Nullable MemorySegment segment) { - return segment == null || segment.equals(MemorySegment.NULL); - } - - /** - * Creates a downcall handle or {@code null}. - * - * @param symbol the address of the target function. - * @param function the function descriptor of the target function. - * @param options the linker options associated with this linkage request. - * @return a downcall method handle. or {@code null} if the symbol {@link MemorySegment#NULL} - */ - @Nullable - @Deprecated(since = "0.1.0") - public static MethodHandle downcallSafe(@Nullable MemorySegment symbol, FunctionDescriptor function, Linker.Option... options) { - return isNullptr(symbol) ? null : LINKER.downcallHandle(symbol, function, options); - } - - /** - * Creates a downcall handle or throws exception. - * - * @param optional the optional contained the address of the target function. - * @param function the function descriptor of the target function. - * @param options the linker options associated with this linkage request. - * @return a downcall method handle. - */ - @Deprecated(since = "0.1.0") - public static MethodHandle downcallThrow(Optional optional, FunctionDescriptor function, Linker.Option... options) { - return LINKER.downcallHandle(optional.orElseThrow(), function, options); - } - - /** - * Creates a downcall handle or {@code null}. - * - * @param symbol the address of the target function. - * @param function the function descriptor of the target function. - * @param options the linker options associated with this linkage request. - * @return a downcall method handle. or {@code null} if the symbol {@link MemorySegment#NULL} - */ - @Nullable - @Deprecated(since = "0.1.0") - public static MethodHandle downcallSafe(@Nullable MemorySegment symbol, FunctionDescriptors function, Linker.Option... options) { - return downcallSafe(symbol, function.descriptor(), options); - } - - /** - * Creates a downcall handle or throws exception. - * - * @param optional the optional contained the address of the target function. - * @param function the function descriptor of the target function. - * @param options the linker options associated with this linkage request. - * @return a downcall method handle. - */ - @Deprecated(since = "0.1.0") - public static MethodHandle downcallThrow(Optional optional, FunctionDescriptors function, Linker.Option... options) { - return downcallThrow(optional, function.descriptor(), options); - } - - /** - * Gets the objects from an address array. - * - * @param the array type - * @param seg the memory segment contained objects. native type: {@code void**} - * @param arr the array to hold the result - * @param generator the generator, from a zero-length address to the array type - * @return arr - */ - @Deprecated(since = "0.1.0") - public static T[] toArray(MemorySegment seg, T[] arr, - Function generator) { - for (int i = 0; i < arr.length; i++) { - arr[i] = generator.apply(seg.getAtIndex(ADDRESS, i)); - } - return arr; - } - - /** - * Gets the addresses from an address array. - * - * @param seg the memory segment contained addresses. native type: {@code void**} - * @param arr the array to hold the result - * @return an array of the zero-length addresses. - */ - @Deprecated(since = "0.1.0") - public static MemorySegment[] toArray(MemorySegment seg, MemorySegment[] arr) { - return toArray(seg, arr, Function.identity()); - } - - /** - * Gets the strings from an unbounded address array. - * - * @param seg the memory segment contained strings - * @param arr the array to hold the result - * @return arr - */ - @Deprecated(since = "0.1.0") - public static String[] toUnboundedArray(@NativeType("char**") MemorySegment seg, String[] arr) { - for (int i = 0; i < arr.length; i++) { - arr[i] = unboundPointerString(seg, i); - } - return arr; - } - - /** - * Gets the booleans from a boolean array. - * - * @param seg the memory segment contained booleans. native type: {@code boolean*} - * @param arr the array to hold the result - * @return arr - */ - @Deprecated(since = "0.1.0") - public static boolean[] toArray(MemorySegment seg, boolean[] arr) { - for (int i = 0; i < arr.length; i++) { - arr[i] = seg.get(JAVA_BOOLEAN, i); - } - return arr; - } - - /** - * Gets the bytes from a byte array. - * - * @param seg the memory segment contained bytes. native type: {@code byte*} - * @param arr the array to hold the result - * @return arr - */ - @Deprecated(since = "0.1.0") - public static byte[] toArray(MemorySegment seg, byte[] arr) { - MemorySegment.copy(seg, JAVA_BYTE, 0, arr, 0, arr.length); - return arr; - } - - /** - * Gets the shorts from a short array. - * - * @param seg the memory segment contained shorts. native type: {@code short*} - * @param arr the array to hold the result - * @return arr - */ - @Deprecated(since = "0.1.0") - public static short[] toArray(MemorySegment seg, short[] arr) { - MemorySegment.copy(seg, JAVA_SHORT, 0, arr, 0, arr.length); - return arr; - } - - /** - * Gets the ints from an int array. - * - * @param seg the memory segment contained ints. native type: {@code int*} - * @param arr the array to hold the result - * @return arr - */ - @Deprecated(since = "0.1.0") - public static int[] toArray(MemorySegment seg, int[] arr) { - MemorySegment.copy(seg, JAVA_INT, 0, arr, 0, arr.length); - return arr; - } - - /** - * Gets the longs from a long array. - * - * @param seg the memory segment contained longs. native type: {@code long*} - * @param arr the array to hold the result - * @return arr - */ - @Deprecated(since = "0.1.0") - public static long[] toArray(MemorySegment seg, long[] arr) { - MemorySegment.copy(seg, JAVA_LONG, 0, arr, 0, arr.length); - return arr; - } - - /** - * Gets the floats from a float array. - * - * @param seg the memory segment contained floats. native type: {@code float*} - * @param arr the array to hold the result - * @return arr - */ - @Deprecated(since = "0.1.0") - public static float[] toArray(MemorySegment seg, float[] arr) { - MemorySegment.copy(seg, JAVA_FLOAT, 0, arr, 0, arr.length); - return arr; - } - - /** - * Gets the doubles from a double array. - * - * @param seg the memory segment contained doubles. native type: {@code double*} - * @param arr the array to hold the result - * @return arr - */ - @Deprecated(since = "0.1.0") - public static double[] toArray(MemorySegment seg, double[] arr) { - MemorySegment.copy(seg, JAVA_DOUBLE, 0, arr, 0, arr.length); - return arr; - } } diff --git a/modules/overrungl.core/src/main/java/overrungl/util/MemoryStack.java b/modules/overrungl.core/src/main/java/overrungl/util/MemoryStack.java deleted file mode 100644 index 7d4a40fc..00000000 --- a/modules/overrungl.core/src/main/java/overrungl/util/MemoryStack.java +++ /dev/null @@ -1,997 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2022-2024 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.util; - -import overrungl.Configurations; -import overrungl.OverrunGL; -import overrungl.Pointer; -import overrungl.internal.RuntimeHelper; - -import java.lang.foreign.*; -import java.util.Arrays; - -import static java.lang.foreign.ValueLayout.*; - -/** - * An off-heap memory stack. - * - *

This class should be used in a thread-local manner for stack allocations.

- * - * @author Spasi - * @author lwjgl3 - * @author squid233 - * @see Configurations#STACK_SIZE - * @see Configurations#STACK_FRAMES - * @see Configurations#DEBUG_STACK - * @since 0.1.0 - */ -@Deprecated(since = "0.1.0") -public sealed class MemoryStack extends Pointer implements Arena { - private static final boolean DEBUG = Configurations.DEBUG.get(); - private static final boolean DEBUG_STACK = Configurations.DEBUG_STACK.get(); - private static final long DEFAULT_STACK_SIZE = Configurations.STACK_SIZE.get() * 1024; - private static final int DEFAULT_STACK_FRAMES = Configurations.STACK_FRAMES.get(); - private static final ThreadLocal TLS = ThreadLocal.withInitial(MemoryStack::create); - - static { - CheckUtil.check(DEFAULT_STACK_SIZE > 0, "Invalid stack size."); - CheckUtil.check(DEFAULT_STACK_FRAMES > 0, "Invalid stack frames."); - } - - private final long size; - - private long pointer; - - private long[] frames; - protected int frameIndex; - - /** - * 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 - */ - protected MemoryStack(MemorySegment address, long size) { - super(address); - - this.size = size; - this.pointer = size; - - frames = new long[DEFAULT_STACK_FRAMES]; - } - - /** - * Creates a new {@code MemoryStack} with the default size. - * - *

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

- */ - public static MemoryStack create() { - return create(DEFAULT_STACK_SIZE); - } - - /** - * Creates a new {@code MemoryStack} with the specified size. - * - *

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

- * - * @param capacity the maximum number of bytes that may be allocated on the stack - */ - public static MemoryStack create(long capacity) { - return create(capacity, Arena.ofAuto()); - } - - /** - * Creates a new {@code MemoryStack} with the specified size and arena. - * - *

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

- * - * @param capacity the maximum number of bytes that may be allocated on the stack - * @param arena the arena for allocating buffer - */ - public static MemoryStack create(long capacity, Arena arena) { - return create(arena.allocate(capacity), capacity); - } - - /** - * Creates a new {@code MemoryStack} backed by the specified memory buffer. - * - *

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

- * - * @param buffer the backing memory buffer - * @param size the memory buffer size - */ - public static MemoryStack create(MemorySegment buffer, long size) { - return DEBUG_STACK - ? new DebugMemoryStack(buffer, size) - : new MemoryStack(buffer, size); - } - - /** - * Stores the current stack pointer and pushes a new frame to the stack. - * - *

This method should be called when entering a method, before doing any stack allocations. When exiting a method, call the {@link #pop} method to - * restore the previous stack frame.

- * - *

Pairs of push/pop calls may be nested. Care must be taken to:

- *
    - *
  • match every push with a pop
  • - *
  • not call pop before push has been called at least once
  • - *
  • not nest push calls to more than the maximum supported depth
  • - *
- * - * @return this stack - */ - public MemoryStack push() { - if (frameIndex == frames.length) { - frameOverflow(); - } - - frames[frameIndex++] = pointer; - return this; - } - - private void frameOverflow() { - if (DEBUG) { - OverrunGL.apiLog(STR."[WARNING] Out of frame stack space (\{frames.length}) in thread: \{Thread.currentThread()}"); - } - frames = Arrays.copyOf(frames, frames.length * 3 / 2); - } - - /** - * Pops the current stack frame and moves the stack pointer to the end of the previous stack frame. - * - * @return this stack - */ - public MemoryStack pop() { - pointer = frames[--frameIndex]; - return this; - } - - @Override - public MemorySegment.Scope scope() { - return address().scope(); - } - - /** - * Calls {@link #pop} on this {@code MemoryStack}. - * - *

This method should not be used directly. It is called automatically when the {@code MemoryStack} is used as a resource in a try-with-resources - * statement.

- */ - @Override - public void close() { - this.pop(); - } - - /** - * Stores the method that pushed a frame and checks if it is the same method when the frame is popped. - * - * @since 0.1.0 - */ - private static final class DebugMemoryStack extends MemoryStack { - private Object[] debugFrames; - - DebugMemoryStack(MemorySegment address, long size) { - super(address, size); - debugFrames = new Object[DEFAULT_STACK_FRAMES]; - } - - @Override - public MemoryStack push() { - if (frameIndex == debugFrames.length) { - frameOverflow(); - } - - debugFrames[frameIndex] = StackWalkUtil.stackWalkGetMethod(MemoryStack.class); - - return super.push(); - } - - private void frameOverflow() { - debugFrames = Arrays.copyOf(debugFrames, debugFrames.length * 3 / 2); - } - - @Override - public MemoryStack pop() { - Object pushed = debugFrames[frameIndex - 1]; - Object popped = StackWalkUtil.stackWalkCheckPop(MemoryStack.class, pushed); - if (popped != null) { - reportAsymmetricPop(pushed, popped); - } - - debugFrames[frameIndex - 1] = null; - return super.pop(); - } - - // No need to check pop in try-with-resources - @Override - public void close() { - debugFrames[frameIndex - 1] = null; - super.pop(); - } - - private static void reportAsymmetricPop(Object pushed, Object popped) { - OverrunGL.apiLog(String.format( - "[OverrunGL] Asymmetric pop detected:\n\tPUSHED: %s\n\tPOPPED: %s\n\tTHREAD: %s\n", - pushed, - popped, - Thread.currentThread() - )); - } - } - - /** - * {@return the address of the backing off-heap memory} - * - *

The stack grows "downwards", so the bottom of the stack is at {@code address + size}, while the top is at {@code address}.

- */ - @Override - public MemorySegment address() { - return super.address(); - } - - /** - * {@return the size of the backing off-heap memory} - * - *

This is the maximum number of bytes that may be allocated on the stack.

- */ - public long getSize() { - return size; - } - - /** - * {@return the current frame index} - * - *

This is the current number of nested {@link #push} calls.

- */ - public int getFrameIndex() { - return frameIndex; - } - - /** - * {@return the memory address at the current stack pointer} - */ - public MemorySegment getPointerAddress() { - return address().asSlice(pointer); - } - - /** - * {@return the current stack pointer} - * - *

The stack grows "downwards", so when the stack is empty {@code pointer} is equal to {@code size}. On every allocation {@code pointer} is reduced by - * the allocated size (after alignment) and {@code address + pointer} points to the first byte of the last allocation.

- * - *

Effectively, this methods returns how many more bytes may be allocated on the stack.

- */ - public long getPointer() { - return pointer; - } - - /** - * Sets the current stack pointer. - * - *

This method directly manipulates the stack pointer. Using it irresponsibly may break the internal state of the stack. It should only be used in rare - * cases or in auto-generated code.

- */ - public void setPointer(long pointer) { - if (RuntimeHelper.CHECKS) { - checkPointer(pointer); - } - - this.pointer = pointer; - } - - private void checkPointer(long pointer) { - if (pointer < 0 || size < pointer) { - throw new IndexOutOfBoundsException("Invalid stack pointer"); - } - } - - /** - * Allocates a block of {@code size} bytes of memory on the stack. The content of the newly allocated block of memory is not initialized, remaining with - * indeterminate values. - * - * @param alignment the required alignment - * @param size the allocation size - * @return the memory address on the stack for the requested allocation - */ - 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; - - pointer = address - rawLong; - if (RuntimeHelper.CHECKS && pointer < 0) { - throw new OutOfMemoryError("Out of stack space."); - } - - return address().asSlice(pointer, size); - } - - /** - * Allocates a block of memory on the stack for an array of {@code num} elements, each of them {@code size} bytes long, and initializes all its bits to - * zero. - * - * @param alignment the required element alignment - * @param num the number of elements to allocate - * @param size the size of each element - * @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 = malloc(alignment, bytes); - address.fill((byte) 0); - return address; - } - - // ------------------------------------------------- - - /** - * Calloc version of {@link #malloc(long, long)}. - */ - public MemorySegment calloc(long alignment, long size) { - return ncalloc(alignment, 1, size); - } - - /** - * Allocates a {@link MemorySegment} on the stack with {@code alignment} equal to {@link ValueLayout#byteSize() POINTER_SIZE}. - * - * @param size the allocation size - * @return the memory address on the stack for the requested allocation - */ - public MemorySegment malloc(long 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.byteAlignment(), layout.byteSize()); - } - - /** - * Calloc version of {@link #malloc(long)}. - */ - public MemorySegment calloc(long size) { - return ncalloc(ADDRESS.byteAlignment(), 1, size); - } - - public MemorySegment calloc(MemoryLayout layout, long num) { - 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); - MemoryUtil.checkAlignment(byteAlignment); - return calloc(byteAlignment, byteSize); - } - - /** - * Single value version of {@link #malloc}. - */ - public MemorySegment bytes(byte x) { - MemorySegment segment = malloc(JAVA_BYTE.byteAlignment(), 1); - segment.set(JAVA_BYTE, 0, x); - return segment; - } - - /** - * Two value version of {@link #malloc}. - */ - public MemorySegment bytes(byte x, byte y) { - MemorySegment segment = malloc(JAVA_BYTE.byteAlignment(), 2); - segment.set(JAVA_BYTE, 0, x); - segment.set(JAVA_BYTE, 1, y); - return segment; - } - - /** - * Three value version of {@link #malloc}. - */ - public MemorySegment bytes(byte x, byte y, byte z) { - MemorySegment segment = malloc(JAVA_BYTE.byteAlignment(), 3); - segment.set(JAVA_BYTE, 0, x); - segment.set(JAVA_BYTE, 1, y); - segment.set(JAVA_BYTE, 2, z); - return segment; - } - - /** - * Four value version of {@link #malloc}. - */ - public MemorySegment bytes(byte x, byte y, byte z, byte w) { - MemorySegment segment = malloc(JAVA_BYTE.byteAlignment(), 4); - segment.set(JAVA_BYTE, 0, x); - segment.set(JAVA_BYTE, 1, y); - segment.set(JAVA_BYTE, 2, z); - segment.set(JAVA_BYTE, 3, w); - return segment; - } - - /** - * Vararg version of {@link #malloc}. - */ - public MemorySegment bytes(byte... values) { - MemorySegment segment = malloc(JAVA_BYTE.byteAlignment(), values.length); - MemorySegment.copy(values, 0, segment, JAVA_BYTE, 0, values.length); - return segment; - } - - // ------------------------------------------------- - - /** - * Single value version of {@link #malloc}. - */ - public MemorySegment shorts(short x) { - MemorySegment segment = malloc(JAVA_SHORT.byteAlignment(), 2); - segment.set(JAVA_SHORT, 0, x); - return segment; - } - - /** - * Two value version of {@link #malloc}. - */ - public MemorySegment shorts(short x, short y) { - MemorySegment segment = malloc(JAVA_SHORT.byteAlignment(), 4); - segment.set(JAVA_SHORT, 0, x); - segment.set(JAVA_SHORT, 2, y); - return segment; - } - - /** - * Three value version of {@link #malloc}. - */ - public MemorySegment shorts(short x, short y, short z) { - MemorySegment segment = malloc(JAVA_SHORT.byteAlignment(), 6); - segment.set(JAVA_SHORT, 0, x); - segment.set(JAVA_SHORT, 2, y); - segment.set(JAVA_SHORT, 4, z); - return segment; - } - - /** - * Four value version of {@link #malloc}. - */ - public MemorySegment shorts(short x, short y, short z, short w) { - MemorySegment segment = malloc(JAVA_SHORT.byteAlignment(), 8); - segment.set(JAVA_SHORT, 0, x); - segment.set(JAVA_SHORT, 2, y); - segment.set(JAVA_SHORT, 4, z); - segment.set(JAVA_SHORT, 6, w); - return segment; - } - - /** - * Vararg version of {@link #malloc}. - */ - public MemorySegment shorts(short... values) { - MemorySegment segment = malloc(JAVA_SHORT.byteAlignment(), (long) values.length << 1); - MemorySegment.copy(values, 0, segment, JAVA_SHORT, 0, values.length); - return segment; - } - - // ------------------------------------------------- - - /** - * Single value version of {@link #malloc}. - */ - public MemorySegment ints(int x) { - MemorySegment segment = malloc(JAVA_INT.byteAlignment(), 4); - segment.set(JAVA_INT, 0, x); - return segment; - } - - /** - * Two value version of {@link #malloc}. - */ - public MemorySegment ints(int x, int y) { - MemorySegment segment = malloc(JAVA_INT.byteAlignment(), 8); - segment.set(JAVA_INT, 0, x); - segment.set(JAVA_INT, 4, y); - return segment; - } - - /** - * Three value version of {@link #malloc}. - */ - public MemorySegment ints(int x, int y, int z) { - MemorySegment segment = malloc(JAVA_INT.byteAlignment(), 12); - segment.set(JAVA_INT, 0, x); - segment.set(JAVA_INT, 4, y); - segment.set(JAVA_INT, 8, z); - return segment; - } - - /** - * Four value version of {@link #malloc}. - */ - public MemorySegment ints(int x, int y, int z, int w) { - MemorySegment segment = malloc(JAVA_INT.byteAlignment(), 16); - segment.set(JAVA_INT, 0, x); - segment.set(JAVA_INT, 4, y); - segment.set(JAVA_INT, 8, z); - segment.set(JAVA_INT, 12, w); - return segment; - } - - /** - * Vararg version of {@link #malloc}. - */ - public MemorySegment ints(int... values) { - MemorySegment segment = malloc(JAVA_INT.byteAlignment(), (long) values.length << 2); - MemorySegment.copy(values, 0, segment, JAVA_INT, 0, values.length); - return segment; - } - - // ------------------------------------------------- - - /** - * Single value version of {@link #malloc}. - */ - public MemorySegment longs(long x) { - MemorySegment segment = malloc(JAVA_LONG.byteAlignment(), 8); - segment.set(JAVA_LONG, 0, x); - return segment; - } - - /** - * Two value version of {@link #malloc}. - */ - public MemorySegment longs(long x, long y) { - MemorySegment segment = malloc(JAVA_LONG.byteAlignment(), 16); - segment.set(JAVA_LONG, 0, x); - segment.set(JAVA_LONG, 8, y); - return segment; - } - - /** - * Three value version of {@link #malloc}. - */ - public MemorySegment longs(long x, long y, long z) { - MemorySegment segment = malloc(JAVA_LONG.byteAlignment(), 24); - segment.set(JAVA_LONG, 0, x); - segment.set(JAVA_LONG, 8, y); - segment.set(JAVA_LONG, 16, z); - return segment; - } - - /** - * Four value version of {@link #malloc}. - */ - public MemorySegment longs(long x, long y, long z, long w) { - MemorySegment segment = malloc(JAVA_LONG.byteAlignment(), 32); - segment.set(JAVA_LONG, 0, x); - segment.set(JAVA_LONG, 8, y); - segment.set(JAVA_LONG, 16, z); - segment.set(JAVA_LONG, 24, w); - return segment; - } - - /** - * Vararg version of {@link #malloc}. - */ - public MemorySegment longs(long... values) { - MemorySegment segment = malloc(JAVA_LONG.byteAlignment(), (long) values.length << 3); - MemorySegment.copy(values, 0, segment, JAVA_LONG, 0, values.length); - return segment; - } - - // ------------------------------------------------- - - /** - * Single value version of {@link #malloc}. - */ - public MemorySegment floats(float x) { - MemorySegment segment = malloc(JAVA_FLOAT.byteAlignment(), 4); - segment.set(JAVA_FLOAT, 0, x); - return segment; - } - - /** - * Two value version of {@link #malloc}. - */ - public MemorySegment floats(float x, float y) { - MemorySegment segment = malloc(JAVA_FLOAT.byteAlignment(), 8); - segment.set(JAVA_FLOAT, 0, x); - segment.set(JAVA_FLOAT, 4, y); - return segment; - } - - /** - * Three value version of {@link #malloc}. - */ - public MemorySegment floats(float x, float y, float z) { - MemorySegment segment = malloc(JAVA_FLOAT.byteAlignment(), 12); - segment.set(JAVA_FLOAT, 0, x); - segment.set(JAVA_FLOAT, 4, y); - segment.set(JAVA_FLOAT, 8, z); - return segment; - } - - /** - * Four value version of {@link #malloc}. - */ - public MemorySegment floats(float x, float y, float z, float w) { - MemorySegment segment = malloc(JAVA_FLOAT.byteAlignment(), 16); - segment.set(JAVA_FLOAT, 0, x); - segment.set(JAVA_FLOAT, 4, y); - segment.set(JAVA_FLOAT, 8, z); - segment.set(JAVA_FLOAT, 12, w); - return segment; - } - - /** - * Vararg version of {@link #malloc}. - */ - public MemorySegment floats(float... values) { - MemorySegment segment = malloc(JAVA_FLOAT.byteAlignment(), (long) values.length << 2); - MemorySegment.copy(values, 0, segment, JAVA_FLOAT, 0, values.length); - return segment; - } - - // ------------------------------------------------- - - /** - * Single value version of {@link #malloc}. - */ - public MemorySegment doubles(double x) { - MemorySegment segment = malloc(JAVA_DOUBLE.byteAlignment(), 8); - segment.set(JAVA_DOUBLE, 0, x); - return segment; - } - - /** - * Two value version of {@link #malloc}. - */ - public MemorySegment doubles(double x, double y) { - MemorySegment segment = malloc(JAVA_DOUBLE.byteAlignment(), 16); - segment.set(JAVA_DOUBLE, 0, x); - segment.set(JAVA_DOUBLE, 8, y); - return segment; - } - - /** - * Three value version of {@link #malloc}. - */ - public MemorySegment doubles(double x, double y, double z) { - MemorySegment segment = malloc(JAVA_DOUBLE.byteAlignment(), 24); - segment.set(JAVA_DOUBLE, 0, x); - segment.set(JAVA_DOUBLE, 8, y); - segment.set(JAVA_DOUBLE, 16, z); - return segment; - } - - /** - * Four value version of {@link #malloc}. - */ - public MemorySegment doubles(double x, double y, double z, double w) { - MemorySegment segment = malloc(JAVA_DOUBLE.byteAlignment(), 32); - segment.set(JAVA_DOUBLE, 0, x); - segment.set(JAVA_DOUBLE, 8, y); - segment.set(JAVA_DOUBLE, 16, z); - segment.set(JAVA_DOUBLE, 24, w); - return segment; - } - - /** - * Vararg version of {@link #malloc}. - */ - public MemorySegment doubles(double... values) { - MemorySegment segment = malloc(JAVA_DOUBLE.byteAlignment(), (long) values.length << 3); - MemorySegment.copy(values, 0, segment, JAVA_DOUBLE, 0, values.length); - return segment; - } - - // ------------------------------------------------- - - /** - * Single value version of {@link #malloc}. - */ - public MemorySegment pointers(MemorySegment x) { - MemorySegment segment = malloc(ADDRESS.byteAlignment(), ADDRESS.byteSize()); - segment.set(ADDRESS, 0, x); - return segment; - } - - /** - * Two value version of {@link #malloc}. - */ - public MemorySegment pointers(MemorySegment x, MemorySegment y) { - MemorySegment segment = malloc(ADDRESS.byteAlignment(), ADDRESS.byteSize() * 2); - segment.set(ADDRESS, 0, x); - segment.setAtIndex(ADDRESS, 1, y); - return segment; - } - - /** - * Three value version of {@link #malloc}. - */ - public MemorySegment pointers(MemorySegment x, MemorySegment y, MemorySegment z) { - MemorySegment segment = malloc(ADDRESS.byteAlignment(), ADDRESS.byteSize() * 3); - segment.set(ADDRESS, 0, x); - segment.setAtIndex(ADDRESS, 1, y); - segment.setAtIndex(ADDRESS, 2, z); - return segment; - } - - /** - * Four value version of {@link #malloc}. - */ - public MemorySegment pointers(MemorySegment x, MemorySegment y, MemorySegment z, MemorySegment w) { - MemorySegment segment = malloc(ADDRESS.byteAlignment(), ADDRESS.byteSize() * 4); - segment.set(ADDRESS, 0, x); - segment.setAtIndex(ADDRESS, 1, y); - segment.setAtIndex(ADDRESS, 2, z); - segment.setAtIndex(ADDRESS, 3, w); - return segment; - } - - /** - * Vararg version of {@link #malloc}. - */ - public MemorySegment pointers(MemorySegment... values) { - MemorySegment segment = malloc(ADDRESS.byteAlignment(), ADDRESS.byteSize() * values.length); - for (int i = 0; i < values.length; i++) { - segment.setAtIndex(ADDRESS, i, values[i]); - } - return segment; - } - - // ----------------------------------------------------- - // ----------------------------------------------------- - // ----------------------------------------------------- - - /** - * {@return the stack of the current thread} - */ - public static MemoryStack stackGet() { - return TLS.get(); - } - - /** - * Calls {@link #push} on the stack of the current thread. - * - * @return the stack of the current thread. - */ - public static MemoryStack stackPush() { - return stackGet().push(); - } - - /** - * Calls {@link #pop} on the stack of the current thread. - * - * @return the stack of the current thread. - */ - public static MemoryStack stackPop() { - return stackGet().pop(); - } - - /** - * Thread-local version of {@link #malloc(long, long)}. - */ - public static MemorySegment stackMalloc(long alignment, long size) { - return stackGet().malloc(alignment, size); - } - - /** - * Thread-local version of {@link #ncalloc}. - */ - public static MemorySegment nstackCalloc(long alignment, long num, long size) { - return stackGet().ncalloc(alignment, num, size); - } - - // ------------------------------------------------- - - /** - * Thread-local version of {@link #malloc(long) malloc}. - */ - public static MemorySegment stackMalloc(long size) { - return stackGet().malloc(size); - } - - /** - * Thread-local version of {@link #calloc(long) calloc}. - */ - public static MemorySegment stackCalloc(long size) { - return stackGet().calloc(size); - } -} 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 1085bfda..1ee83066 100644 --- a/modules/overrungl.core/src/main/java/overrungl/util/MemoryUtil.java +++ b/modules/overrungl.core/src/main/java/overrungl/util/MemoryUtil.java @@ -34,7 +34,8 @@ * @since 0.1.0 */ public final class MemoryUtil { - private static final SymbolLookup LOOKUP = RuntimeHelper.LINKER.defaultLookup(); + private static final Linker LINKER = Linker.nativeLinker(); + private static final SymbolLookup LOOKUP = LINKER.defaultLookup(); private static final MethodHandle m_malloc = downcall("malloc", of(ADDRESS, RuntimeHelper.SIZE_T)), m_calloc = downcall("calloc", of(ADDRESS, RuntimeHelper.SIZE_T, RuntimeHelper.SIZE_T)), @@ -51,7 +52,7 @@ public final class MemoryUtil { public static final long NULL = 0x0L; private static MethodHandle downcall(String name, FunctionDescriptor function) { - return RuntimeHelper.downcallThrow(LOOKUP.find(name), function); + return LINKER.downcallHandle(LOOKUP.find(name).orElseThrow(), function); } private MemoryUtil() { @@ -64,7 +65,7 @@ private MemoryUtil() { * @param segment the segment. */ public static boolean isNullptr(@Nullable MemorySegment segment) { - return RuntimeHelper.isNullptr(segment); + return segment == null || segment.equals(MemorySegment.NULL); } /** diff --git a/modules/overrungl.core/src/main/java/overrungl/util/StackWalkUtil.java b/modules/overrungl.core/src/main/java/overrungl/util/StackWalkUtil.java index 9f3407ce..bfd0626d 100644 --- a/modules/overrungl.core/src/main/java/overrungl/util/StackWalkUtil.java +++ b/modules/overrungl.core/src/main/java/overrungl/util/StackWalkUtil.java @@ -16,8 +16,6 @@ package overrungl.util; -import org.jetbrains.annotations.Nullable; - import java.util.Arrays; /** @@ -26,8 +24,6 @@ * @since 0.1.0 */ final class StackWalkUtil { - private static final StackWalker STACKWALKER = StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE); - private StackWalkUtil() { } @@ -37,72 +33,6 @@ static StackTraceElement[] stackWalkArray(Object[] a) { .toArray(StackTraceElement[]::new); } - static Object stackWalkGetMethod(Class after) { - return STACKWALKER.walk(s -> { - var iter = s.iterator(); - iter.next(); // skip this method - iter.next(); // skip MemoryStack::pop - - StackWalker.StackFrame frame; - do { - frame = iter.next(); - } while (frame.getDeclaringClass() == after && iter.hasNext()); - - return frame; - }); - } - - private static boolean isSameMethod(StackWalker.StackFrame a, StackWalker.StackFrame b) { - return isSameMethod(a, b, b.getMethodName()); - } - - private static boolean isSameMethod(StackWalker.StackFrame a, StackWalker.StackFrame b, String methodName) { - return a.getDeclaringClass() == b.getDeclaringClass() && - a.getMethodName().equals(methodName); - } - - private static boolean isAutoCloseable(StackWalker.StackFrame element, StackWalker.StackFrame pushed) { - // Java 9 try-with-resources: synthetic $closeResource - if (isSameMethod(element, pushed, "$closeResource")) { - return true; - } - - // Kotlin T.use: kotlin.AutoCloseable::closeFinally - return "kotlin.jdk7.AutoCloseableKt".equals(element.getClassName()) && "closeFinally".equals(element.getMethodName()); - } - - @Nullable - static Object stackWalkCheckPop(Class after, Object pushedObj) { - StackWalker.StackFrame pushed = (StackWalker.StackFrame) pushedObj; - - return StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE).walk(s -> { - var iter = s.iterator(); - iter.next(); - iter.next(); - - StackWalker.StackFrame element; - do { - element = iter.next(); - } while (element.getDeclaringClass() == after && iter.hasNext()); - - if (isSameMethod(element, pushed)) { - return null; - } - - if (iter.hasNext() && isAutoCloseable(element, pushed)) { - // Some runtimes use a separate method to call AutoCloseable::close in try-with-resources blocks. - // That method suppresses any exceptions thrown by close if necessary. - // When that happens, the pop is 1 level deeper than expected. - element = iter.next(); - if (isSameMethod(element, pushed)) { - return null; - } - } - - return element; - }); - } - static Object[] stackWalkGetTrace() { return StackWalker.getInstance() .walk(s -> s diff --git a/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWDropFun.java b/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWDropFun.java index 2b13bc8c..79a742c8 100644 --- a/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWDropFun.java +++ b/modules/overrungl.glfw/src/main/java/overrungl/glfw/GLFWDropFun.java @@ -16,11 +16,12 @@ package overrungl.glfw; +import overrun.marshal.Unmarshal; import overrun.marshal.Upcall; -import overrungl.internal.RuntimeHelper; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; +import java.lang.foreign.ValueLayout; /** * This is the function pointer type for path drop callbacks. A path drop @@ -59,7 +60,7 @@ public interface GLFWDropFun extends Upcall { */ @Stub default void ninvoke(MemorySegment window, int pathCount, MemorySegment paths) { - invoke(window, RuntimeHelper.toUnboundedArray(paths, new String[pathCount])); + invoke(window, Unmarshal.unmarshalAsStringArray(paths.reinterpret(ValueLayout.ADDRESS.scale(0L, pathCount)))); } @Override 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 20a2e3f4..f1745d71 100644 --- a/modules/overrungl.glfw/src/main/java/overrungl/glfw/Handles.java +++ b/modules/overrungl.glfw/src/main/java/overrungl/glfw/Handles.java @@ -17,19 +17,12 @@ package overrungl.glfw; import overrungl.Configurations; -import overrungl.FunctionDescriptors; import overrungl.OverrunGL; import overrungl.internal.RuntimeHelper; -import java.lang.foreign.FunctionDescriptor; -import java.lang.foreign.Linker; import java.lang.foreign.SymbolLookup; -import java.lang.invoke.MethodHandle; import java.util.function.Supplier; -import static java.lang.foreign.ValueLayout.ADDRESS; -import static overrungl.FunctionDescriptors.*; - /** * The GLFW method handles. * @@ -45,141 +38,7 @@ final class Handles { lookup = function != null ? function.apply(lib) : lib.get(); } - static final MethodHandle - glfwInit = downcall("glfwInit", I), - glfwTerminate = downcall("glfwTerminate", V), - glfwInitHint = downcall("glfwInitHint", IIV), - glfwGetVersion = downcallTrivial("glfwGetVersion", PPPV), - glfwGetVersionString = downcallTrivial("glfwGetVersionString", p), - glfwGetError = downcallTrivial("glfwGetError", fd_PI), - glfwSetErrorCallback = downcall("glfwSetErrorCallback", 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 = 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 = 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), - glfwSetWindowSizeCallback = downcall("glfwSetWindowSizeCallback", PPP), - glfwSetWindowCloseCallback = downcall("glfwSetWindowCloseCallback", PPP), - glfwSetWindowRefreshCallback = downcall("glfwSetWindowRefreshCallback", PPP), - glfwSetWindowFocusCallback = downcall("glfwSetWindowFocusCallback", PPP), - glfwSetWindowIconifyCallback = downcall("glfwSetWindowIconifyCallback", PPP), - glfwSetWindowMaximizeCallback = downcall("glfwSetWindowMaximizeCallback", PPP), - glfwSetFramebufferSizeCallback = downcall("glfwSetFramebufferSizeCallback", PPP), - glfwSetWindowContentScaleCallback = downcall("glfwSetWindowContentScaleCallback", PPP), - glfwPollEvents = downcall("glfwPollEvents", V), - glfwWaitEvents = downcall("glfwWaitEvents", V), - glfwWaitEventsTimeout = downcall("glfwWaitEventsTimeout", DV), - glfwPostEmptyEvent = downcallTrivial("glfwPostEmptyEvent", V), - glfwGetInputMode = downcall("glfwGetInputMode", PII), - glfwSetInputMode = downcall("glfwSetInputMode", PIIV), - glfwRawMouseMotionSupported = downcall("glfwRawMouseMotionSupported", I), - glfwGetKeyName = downcall("glfwGetKeyName", IIp), - glfwGetKeyScancode = downcallTrivial("glfwGetKeyScancode", II), - 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), - glfwSetCursorPosCallback = downcall("glfwSetCursorPosCallback", PPP), - glfwSetCursorEnterCallback = downcall("glfwSetCursorEnterCallback", PPP), - glfwSetScrollCallback = downcall("glfwSetScrollCallback", PPP), - glfwSetDropCallback = downcall("glfwSetDropCallback", PPP), - 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 = downcall("glfwJoystickIsGamepad", II), - glfwSetJoystickCallback = downcall("glfwSetJoystickCallback", PP), - glfwUpdateGamepadMappings = downcall("glfwUpdateGamepadMappings", fd_PI), - 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), - glfwGetTimerFrequency = downcallTrivial("glfwGetTimerFrequency", J), - glfwMakeContextCurrent = downcall("glfwMakeContextCurrent", PV), - glfwGetCurrentContext = downcallTrivial("glfwGetCurrentContext", P), - glfwSwapBuffers = downcall("glfwSwapBuffers", PV), - glfwSwapInterval = downcall("glfwSwapInterval", IV), - glfwExtensionSupported = downcall("glfwExtensionSupported", fd_PI), - glfwGetProcAddress = downcall("glfwGetProcAddress", PP), - glfwVulkanSupported = downcall("glfwVulkanSupported", I), - glfwGetRequiredInstanceExtensions = downcall("glfwGetRequiredInstanceExtensions", Pp); - private Handles() { //no instance } - - private static MethodHandle downcall(String name, - FunctionDescriptor function, - Linker.Option... options) { - return RuntimeHelper.downcallThrow(lookup.find(name), function, options); - } - - private static MethodHandle downcall(String name, - FunctionDescriptors function, - Linker.Option... options) { - return RuntimeHelper.downcallThrow(lookup.find(name), function, options); - } - - private static MethodHandle downcallTrivial(String name, - FunctionDescriptors function) { - return downcall(name, function, Linker.Option.critical(false)); - } } diff --git a/modules/overrungl.joml/src/main/java/overrungl/joml/Matrixn.java b/modules/overrungl.joml/src/main/java/overrungl/joml/Matrixn.java index e3223f02..55cab3ec 100644 --- a/modules/overrungl.joml/src/main/java/overrungl/joml/Matrixn.java +++ b/modules/overrungl.joml/src/main/java/overrungl/joml/Matrixn.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2022-2023 Overrun Organization + * Copyright (c) 2022-2024 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 @@ -17,7 +17,7 @@ package overrungl.joml; import org.joml.*; -import overrungl.util.MemoryStack; +import overrun.marshal.MemoryStack; import overrungl.util.MemoryUtil; import java.lang.foreign.MemoryLayout; diff --git a/modules/overrungl.joml/src/main/java/overrungl/joml/Vectorn.java b/modules/overrungl.joml/src/main/java/overrungl/joml/Vectorn.java index d0406bfc..da229136 100644 --- a/modules/overrungl.joml/src/main/java/overrungl/joml/Vectorn.java +++ b/modules/overrungl.joml/src/main/java/overrungl/joml/Vectorn.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2022-2023 Overrun Organization + * Copyright (c) 2022-2024 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 @@ -17,7 +17,7 @@ package overrungl.joml; import org.joml.*; -import overrungl.util.MemoryStack; +import overrun.marshal.MemoryStack; import overrungl.util.MemoryUtil; import java.lang.foreign.MemoryLayout; diff --git a/modules/overrungl.opengl/src/generator/kotlin/overrungl/opengl/GLAMD.kt b/modules/overrungl.opengl/src/generator/kotlin/overrungl/opengl/GLAMD.kt index fde48d9b..eda50cc5 100644 --- a/modules/overrungl.opengl/src/generator/kotlin/overrungl/opengl/GLAMD.kt +++ b/modules/overrungl.opengl/src/generator/kotlin/overrungl/opengl/GLAMD.kt @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2023 Overrun Organization + * Copyright (c) 2023-2024 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 @@ -62,7 +62,7 @@ fun amd() { ("glDebugMessageCallbackAMD"(void, address("callback", "GLDEBUGPROCAMD"), address("userParam", "void *"))) { "glDebugMessageCallbackAMD"( void, - "glDebugMessageCallbackAMD(callback.address(arena), userParam);", + "glDebugMessageCallbackAMD(callback.stub(arena), userParam);", arena("arena"), Type("GLDebugProcAMD", null)("callback"), address("userParam", "void *") diff --git a/modules/overrungl.opengl/src/generator/kotlin/overrungl/opengl/GLARB.kt b/modules/overrungl.opengl/src/generator/kotlin/overrungl/opengl/GLARB.kt index 36c8f6ce..c0107089 100644 --- a/modules/overrungl.opengl/src/generator/kotlin/overrungl/opengl/GLARB.kt +++ b/modules/overrungl.opengl/src/generator/kotlin/overrungl/opengl/GLARB.kt @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2023 Overrun Organization + * Copyright (c) 2023-2024 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 @@ -153,9 +153,9 @@ fun arb() { )) { "glDebugMessageCallbackARB"( void, - "glDebugMessageCallbackARB(callback.address(arena), userParam);", + "glDebugMessageCallbackARB(callback.stub(arena), userParam);", arena("arena"), - Type("GLDebugProc", null)("callback"), + Type("overrungl.opengl.GLDebugProc", null)("callback"), address("userParam", "const void *") ) } diff --git a/modules/overrungl.opengl/src/generator/kotlin/overrungl/opengl/OpenGLGenerator.kt b/modules/overrungl.opengl/src/generator/kotlin/overrungl/opengl/OpenGLGenerator.kt index 874187e4..6a46b37b 100644 --- a/modules/overrungl.opengl/src/generator/kotlin/overrungl/opengl/OpenGLGenerator.kt +++ b/modules/overrungl.opengl/src/generator/kotlin/overrungl/opengl/OpenGLGenerator.kt @@ -186,46 +186,32 @@ class OpenGLFile( """ ${fileHeader.prependIndent("|")} |package overrungl.opengl${ext.packageName}; - - |import overrungl.*; + |import overrungl.NativeType; |import overrungl.opengl.*; |import java.lang.foreign.*; - |import static java.lang.foreign.FunctionDescriptor.*; - |import static java.lang.foreign.ValueLayout.*; - |import static overrungl.opengl.GLLoader.*; |/** | * {@code $extName} | */ - |public final class GL${ext.extName}$name { + |public interface GL${ext.extName}$name { """.trimMargin() ) // constants constants.forEach { (name, value) -> - appendLine(" public static final int $name = $value;") + appendLine(" int $name = $value;") } if (functions.isNotEmpty()) { - // loader - appendLine(" public static void load(GLExtCaps ext, GLLoadFunc load) {") - appendLine(" if (!ext.$extName) return;") - functions.forEach { f -> - append(" ext.${f.name} = load.invoke(\"${f.name}\", ${if (f.returnType == void) "ofVoid" else "of"}(") - if (f.returnType != void) - append(f.returnType.layout) - f.params.forEachIndexed { index, it -> - if (index != 0 || f.returnType != void) append(", ") - append(it.type.layout) - } - appendLine("));") - } - appendLine(" }") appendLine() // functions - fun appendFuncHeader(f: Function) { - append(" public static ") + fun appendFuncHeader(f: Function, overload: Boolean) { + append(" ") + if (overload) { + appendLine("@overrun.marshal.gen.Skip") + append(" ") + } if (f.nativeType != null) append("@NativeType(\"${f.nativeType}\") ") - append("${f.returnType} ${f.name}(") + append("default ${f.returnType} ${f.name}(") f.params.forEachIndexed { index, it -> if (index != 0) append(", ") if (it.nativeType != null) @@ -235,30 +221,18 @@ class OpenGLFile( appendLine(") {") } functions.forEach { f -> - appendFuncHeader(f) - appendLine(" final var ext = getExtCapabilities();") - appendLine(" try {") - if (f.returnType != void) - appendLine(" return (${f.returnType})") - append(" check(ext.${f.name}).invokeExact(") - f.params.forEachIndexed { index, it -> - if (index != 0) append(", ") - append(it.name) - } - appendLine( - """); - | } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - | } - """.trimMargin() - ) + appendFuncHeader(f, false) + appendLine(" throw new ContextException();") + appendLine(" }") appendLine() // overloads if (f.overloads.isNotEmpty()) { f.overloads.forEach { overload -> - appendFuncHeader(overload) + appendFuncHeader(overload, true) appendLine(overload.content!!.prependIndent(" ")) - appendLine(" }\n") + appendLine(" }") + appendLine() } } } @@ -2529,7 +2503,39 @@ fun win() { ) } -fun glExtCaps() { +fun glExtension() { + Files.writeString(Path("ext/GLExtension.java"), buildString { + appendLine(""" + ${fileHeader.prependIndent("|")} + |package overrungl.opengl.ext; + |import overrungl.opengl.ext.arb.*; + |import overrungl.opengl.ext.khr.*; + |import overrungl.opengl.ext.oes.*; + |import overrungl.opengl.ext.amd.*; + |import overrungl.opengl.ext.apple.*; + |import overrungl.opengl.ext.ati.*; + |import overrungl.opengl.ext.ext.*; + |import overrungl.opengl.ext.ibm.*; + |import overrungl.opengl.ext.intel.*; + |import overrungl.opengl.ext.mesa.*; + |import overrungl.opengl.ext.nv.*; + |import overrungl.opengl.ext.sgi.*; + |import overrungl.opengl.ext.sun.*; + | + |/** + | * The OpenGL extension functions. + | * + | * @since 0.1.0 + | */ + |public interface GLExtension extends + """.trimMargin()) + generatedExtClasses.joinTo(this, ",\n") { " GL${it.ext.extName}${it.name}" } + appendLine(" {") + appendLine("}") + }) +} + +fun glFlags() { val caps = arrayOf( "GL_ARB_ES2_compatibility", "GL_ARB_ES3_1_compatibility", @@ -3151,91 +3157,65 @@ fun glExtCaps() { "GL_WIN_phong_shading", "GL_WIN_specular_fog" ) - Files.writeString(Path("GLExtCaps.java"), buildString { - append( - """ + Files.writeString( + Path("GLFlags.java"), + """ ${fileHeader.prependIndent("|")} |package overrungl.opengl; | - |import overrungl.opengl.ext.*; - |import overrungl.opengl.ext.arb.*; - |import overrungl.opengl.ext.khr.*; - |import overrungl.opengl.ext.oes.*; - |import overrungl.opengl.ext.amd.*; - |import overrungl.opengl.ext.apple.*; - |import overrungl.opengl.ext.ati.*; - |import overrungl.opengl.ext.ext.*; - |import overrungl.opengl.ext.ibm.*; - |import overrungl.opengl.ext.intel.*; - |import overrungl.opengl.ext.mesa.*; - |import overrungl.opengl.ext.nv.*; - |import overrungl.opengl.ext.sgi.*; - |import overrungl.opengl.ext.sun.*; - | - |import java.lang.foreign.MemorySegment; - |import java.lang.foreign.SegmentAllocator; - |import java.lang.invoke.MethodHandle; - | - |import static java.lang.foreign.ValueLayout.*; - |import static overrungl.opengl.GLExtFinder.*; - | |/** - | * The OpenGL extension capabilities. + | * The OpenGL flags. | * | * @since 0.1.0 | */ - |public final class GLExtCaps { + |public final class GLFlags { + | final GLLoadFunc load; + | final boolean foundExtension; + | /** The OpenGL core flags. */ + | public final boolean GL10, GL11, GL12, GL13, GL14, GL15, + | GL20, GL21, + | GL30, GL31, GL32, GL33, + | GL40, GL41, GL42, GL43, GL44, GL45, GL46; | /** The OpenGL extension flags. */ - | public boolean ${caps.joinToString()}; - | - | /** GLCapabilities */ - | public final GLCapabilities caps; + | public final boolean ${caps.joinToString()}; | | /** - | * Construct incomplete OpenGL extension capabilities. + | * Construct OpenGL flags. | * - | * @param caps The parent capabilities. + | * @param load the function where to find OpenGL functions. | */ - | public GLExtCaps(GLCapabilities caps) { - | this.caps = caps; + | GLFlags(GLLoadFunc load) { + | this.load = load; + | var core = GLFinder.findCoreGL(load); + | int major = core.x(); + | int minor = core.y(); + | this.GL10 = (major == 1 && minor >= 0) || major > 1; + | this.GL11 = (major == 1 && minor >= 1) || major > 1; + | this.GL12 = (major == 1 && minor >= 2) || major > 1; + | this.GL13 = (major == 1 && minor >= 3) || major > 1; + | this.GL14 = (major == 1 && minor >= 4) || major > 1; + | this.GL15 = (major == 1 && minor >= 5) || major > 1; + | this.GL20 = (major == 2 && minor >= 0) || major > 2; + | this.GL21 = (major == 2 && minor >= 1) || major > 2; + | this.GL30 = (major == 3 && minor >= 0) || major > 3; + | this.GL31 = (major == 3 && minor >= 1) || major > 3; + | this.GL32 = (major == 3 && minor >= 2) || major > 3; + | this.GL33 = (major == 3 && minor >= 3) || major > 3; + | this.GL40 = (major == 4 && minor >= 0) || major > 4; + | this.GL41 = (major == 4 && minor >= 1) || major > 4; + | this.GL42 = (major == 4 && minor >= 2) || major > 4; + | this.GL43 = (major == 4 && minor >= 3) || major > 4; + | this.GL44 = (major == 4 && minor >= 4) || major > 4; + | this.GL45 = (major == 4 && minor >= 5) || major > 4; + | this.GL46 = (major == 4 && minor >= 6) || major > 4; + | var list = new java.util.ArrayList(700); + | this.foundExtension = GLFinder.getExtensions(load, major, list); + | ${caps.joinToString("\n| ") { "this.$it = this.foundExtension && list.contains(\"$it\");" }} | } + |} | - | /** Method handles. */ - | public MethodHandle - """.trimMargin() - ) - generatedExtFunctions.forEachIndexed { index, function -> - if (index.rem(16) == 0) { - if (index == 0) append("\n ") - else append(",\n ") - } else append(", ") - append(function.name) - } - appendLine(";\n\n void load(GLLoadFunc load) {") - generatedExtClasses.forEach { - if (it.hasFunction) appendLine(" GL${it.ext.extName}${it.name}.load(this, load);") - } - appendLine(" }\n") - appendLine( - """ - | boolean findExtensionsGL(int version, SegmentAllocator allocator) { - | var pExts = allocator.allocate(ADDRESS); - | var pNumExtsI = allocator.allocate(JAVA_INT); - | var pExtsI = new MemorySegment[1]; - | if (!getExtensions(allocator, version, pExts, pNumExtsI, pExtsI, caps)) return false; - | - | String exts = pExts.getString(0); - | int numExtsI = pNumExtsI.get(JAVA_INT, 0); - | var extsI = pExtsI[0]; - | - | ${caps.joinToString(separator = "\n| ") { "this.$it = hasExtension(version, exts, numExtsI, extsI, \"$it\");" }} - | - | return true; - | } """.trimMargin() - ) - appendLine("}") - }) + ) } /** @@ -3266,5 +3246,6 @@ fun main() { sgi() sun() win() - glExtCaps() + glExtension() + glFlags() } diff --git a/modules/overrungl.core/src/main/java/overrungl/ArrayPointer.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ContextException.java similarity index 56% rename from modules/overrungl.core/src/main/java/overrungl/ArrayPointer.java rename to modules/overrungl.opengl/src/main/java/overrungl/opengl/ContextException.java index c51606f2..bc6263af 100644 --- a/modules/overrungl.core/src/main/java/overrungl/ArrayPointer.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ContextException.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2023 Overrun Organization + * Copyright (c) 2024 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 @@ -14,26 +14,19 @@ * copies or substantial portions of the Software. */ -package overrungl; - -import java.lang.foreign.SequenceLayout; +package overrungl.opengl; /** - * An array pointer. + * Signals that an OpenGL function has been invoked without its context, or it doesn't exist. * * @author squid233 * @since 0.1.0 */ -@Deprecated(since = "0.1.0") -public interface ArrayPointer extends Addressable { +public class ContextException extends RuntimeException { /** - * {@return the count of the elements in this array} + * Constructs a {@code ContextException}. */ - default long elementCount() { - if (this instanceof Struct struct && - struct.layout() instanceof SequenceLayout sequenceLayout) { - return sequenceLayout.elementCount(); - } - throw new UnsupportedOperationException(); + public ContextException() { + super("Couldn't find OpenGL function"); } } 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 0bf287e4..a86f77c9 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/DrawArraysIndirectCommand.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/DrawArraysIndirectCommand.java @@ -16,28 +16,26 @@ package overrungl.opengl; -import overrungl.ArrayPointer; -import overrungl.Struct; +import overrun.marshal.struct.Struct; +import overrun.marshal.struct.StructHandle; import java.lang.foreign.*; -import java.lang.foreign.MemoryLayout.PathElement; -import java.lang.invoke.VarHandle; /** * The OpenGL 4.2 draw arrays indirect command. *

Layout

*

  * struct DrawArraysIndirectCommand {
- *     unsigned int {@link #count() count};
- *     unsigned int {@link #primCount() primCount};
- *     unsigned int {@link #first() first};
- *     unsigned int {@link #baseInstance() baseInstance};
+ *     unsigned int {@link #count};
+ *     unsigned int {@link #primCount};
+ *     unsigned int {@link #first};
+ *     unsigned int {@link #baseInstance};
  * }
* * @author squid233 * @since 0.1.0 */ -public sealed class DrawArraysIndirectCommand extends Struct { +public final class DrawArraysIndirectCommand extends Struct { /** * The struct layout. */ @@ -47,280 +45,58 @@ public sealed class DrawArraysIndirectCommand extends Struct { ValueLayout.JAVA_INT.withName("first"), ValueLayout.JAVA_INT.withName("baseInstance") ); - private static final VarHandle - pCount = LAYOUT.varHandle(PathElement.groupElement("count")), - pPrimCount = LAYOUT.varHandle(PathElement.groupElement("primCount")), - pFirst = LAYOUT.varHandle(PathElement.groupElement("first")), - pBaseInstance = LAYOUT.varHandle(PathElement.groupElement("baseInstance")); - /** - * Create the pointer instance. - * - * @param address the address. + * the count */ - public DrawArraysIndirectCommand(MemorySegment address) { - super(address, LAYOUT); - } - + public final StructHandle.Int count = StructHandle.ofInt(this, "count"); /** - * Creates a struct instance with the given memory layout. - * - * @param address the address. - * @param layout the memory layout of this struct. + * the primCount */ - protected DrawArraysIndirectCommand(MemorySegment address, MemoryLayout layout) { - super(address, layout); - } - + public final StructHandle.Int primCount = StructHandle.ofInt(this, "primCount"); /** - * {@return the elements size of this struct in bytes} + * the first */ - public static long sizeof() { - return LAYOUT.byteSize(); - } - + public final StructHandle.Int first = StructHandle.ofInt(this, "first"); /** - * Creates a command instance with the given allocator. - * - * @param allocator the allocator - * @return the instance + * the baseInstance */ - public static DrawArraysIndirectCommand create(SegmentAllocator allocator) { - return new DrawArraysIndirectCommand(allocator.allocate(LAYOUT)); - } + public final StructHandle.Int baseInstance = StructHandle.ofInt(this, "baseInstance"); /** - * Creates a command instance with the given allocator and count. + * Creates a struct with the given layout. * - * @param allocator the allocator - * @param count the count - * @return the instance + * @param segment the segment + * @param elementCount the element count */ - public static Buffer create(SegmentAllocator allocator, long count) { - return new Buffer(allocator.allocate(LAYOUT, count), count); + public DrawArraysIndirectCommand(MemorySegment segment, long elementCount) { + super(segment, elementCount, LAYOUT); } /** - * Sets the count. + * Allocates a struct with the given layout. * - * @param count the count - * @return this + * @param allocator the allocator + * @param elementCount the element count */ - public DrawArraysIndirectCommand count(int count) { - pCount.set(segment(), count); - return this; + public DrawArraysIndirectCommand(SegmentAllocator allocator, long elementCount) { + super(allocator, elementCount, LAYOUT); } /** - * Sets the primitive count. + * Creates a struct with the given layout. * - * @param primCount the primitive count - * @return this + * @param segment the segment */ - public DrawArraysIndirectCommand primCount(int primCount) { - pPrimCount.set(segment(), primCount); - return this; + public DrawArraysIndirectCommand(MemorySegment segment) { + super(segment, LAYOUT); } /** - * Sets the first. + * Allocates a struct with the given layout. * - * @param first the first - * @return this - */ - public DrawArraysIndirectCommand first(int first) { - pFirst.set(segment(), first); - return this; - } - - /** - * Sets the base instance. - * - * @param baseInstance the base instance - * @return this - */ - public DrawArraysIndirectCommand baseInstance(int baseInstance) { - pBaseInstance.set(segment(), baseInstance); - return this; - } - - /** - * {@return the count} - */ - public int count() { - return (int) pCount.get(segment()); - } - - /** - * {@return the primitive count} - */ - public int primCount() { - return (int) pPrimCount.get(segment()); - } - - /** - * {@return the first} - */ - public int first() { - return (int) pFirst.get(segment()); - } - - /** - * {@return the base instance} - */ - public int baseInstance() { - return (int) pBaseInstance.get(segment()); - } - - /** - * The OpenGL 4.2 draw arrays indirect commands. - * - * @author squid233 - * @since 0.1.0 + * @param allocator the allocator */ - public static final class Buffer extends DrawArraysIndirectCommand implements ArrayPointer { - private final VarHandle pCount, pPrimCount, pFirst, pBaseInstance; - - /** - * Create the pointer instance. - * - * @param address the address. - * @param elementCount the element count - */ - public Buffer(MemorySegment address, long elementCount) { - super(address, MemoryLayout.sequenceLayout(elementCount, LAYOUT)); - pCount = layout().varHandle(PathElement.sequenceElement(), PathElement.groupElement("count")); - pPrimCount = layout().varHandle(PathElement.sequenceElement(), PathElement.groupElement("primCount")); - pFirst = layout().varHandle(PathElement.sequenceElement(), PathElement.groupElement("first")); - pBaseInstance = layout().varHandle(PathElement.sequenceElement(), PathElement.groupElement("baseInstance")); - } - - /** - * Sets the count at the given index. - * - * @param index the index - * @param count the count - * @return this - */ - public Buffer count(long index, int count) { - pCount.set(segment(), index, count); - return this; - } - - /** - * Sets the primitive count at the given index. - * - * @param index the index - * @param primCount the primitive count - * @return this - */ - public Buffer primCount(long index, int primCount) { - pPrimCount.set(segment(), index, primCount); - return this; - } - - /** - * Sets the first at the given index. - * - * @param index the index - * @param first the first - * @return this - */ - public Buffer first(long index, int first) { - pFirst.set(segment(), index, first); - return this; - } - - /** - * Sets the base instance at the given index. - * - * @param index the index - * @param baseInstance the base instance - * @return this - */ - public Buffer baseInstance(long index, int baseInstance) { - pBaseInstance.set(segment(), index, baseInstance); - return this; - } - - @Override - public Buffer count(int count) { - return count(0, count); - } - - @Override - public Buffer primCount(int primCount) { - return primCount(0, primCount); - } - - @Override - public Buffer first(int first) { - return first(0, first); - } - - @Override - public Buffer baseInstance(int baseInstance) { - return baseInstance(0, baseInstance); - } - - /** - * Gets the count at the given index. - * - * @param index the index - * @return the count - */ - public int countAt(long index) { - return (int) pCount.get(segment(), index); - } - - /** - * Gets the primitive count at the given index. - * - * @param index the index - * @return the primitive count - */ - public int primCountAt(long index) { - return (int) pPrimCount.get(segment(), index); - } - - /** - * Gets the first at the given index. - * - * @param index the index - * @return the first - */ - public int firstAt(long index) { - return (int) pFirst.get(segment(), index); - } - - /** - * Gets the base instance at the given index. - * - * @param index the index - * @return the base instance - */ - public int baseInstanceAt(long index) { - return (int) pBaseInstance.get(segment(), index); - } - - @Override - public int count() { - return countAt(0); - } - - @Override - public int primCount() { - return primCountAt(0); - } - - @Override - public int first() { - return firstAt(0); - } - - @Override - public int baseInstance() { - return baseInstanceAt(0); - } + public DrawArraysIndirectCommand(SegmentAllocator allocator) { + super(allocator, LAYOUT); } } 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 0dd1bdfd..ec08d704 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/DrawElementsIndirectCommand.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/DrawElementsIndirectCommand.java @@ -16,29 +16,27 @@ package overrungl.opengl; -import overrungl.ArrayPointer; -import overrungl.Struct; +import overrun.marshal.struct.Struct; +import overrun.marshal.struct.StructHandle; import java.lang.foreign.*; -import java.lang.foreign.MemoryLayout.PathElement; -import java.lang.invoke.VarHandle; /** * The OpenGL 4.2 draw elements indirect command. *

Layout

*

  * struct DrawElementsIndirectCommand {
- *     unsigned int {@link #count() count};
- *     unsigned int {@link #primCount() primCount};
- *     unsigned int {@link #firstIndex() firstIndex};
- *     unsigned int {@link #baseVertex() baseVertex};
- *     unsigned int {@link #baseInstance() baseInstance};
+ *     unsigned int {@link #count};
+ *     unsigned int {@link #primCount};
+ *     unsigned int {@link #firstIndex};
+ *     unsigned int {@link #baseVertex};
+ *     unsigned int {@link #baseInstance};
  * }
* * @author squid233 * @since 0.1.0 */ -public sealed class DrawElementsIndirectCommand extends Struct { +public final class DrawElementsIndirectCommand extends Struct { /** * The struct layout. */ @@ -49,332 +47,62 @@ public sealed class DrawElementsIndirectCommand extends Struct { ValueLayout.JAVA_INT.withName("baseVertex"), ValueLayout.JAVA_INT.withName("baseInstance") ); - private static final VarHandle - pCount = LAYOUT.varHandle(PathElement.groupElement("count")), - pPrimCount = LAYOUT.varHandle(PathElement.groupElement("primCount")), - pFirstIndex = LAYOUT.varHandle(PathElement.groupElement("firstIndex")), - pBaseVertex = LAYOUT.varHandle(PathElement.groupElement("baseVertex")), - pBaseInstance = LAYOUT.varHandle(PathElement.groupElement("baseInstance")); - /** - * Create the pointer instance. - * - * @param address the address. + * the count */ - public DrawElementsIndirectCommand(MemorySegment address) { - super(address, LAYOUT); - } - - /** - * Creates a struct instance with the given memory layout. - * - * @param address the address. - * @param layout the memory layout of this struct. - */ - protected DrawElementsIndirectCommand(MemorySegment address, MemoryLayout layout) { - super(address, layout); - } - + public final StructHandle.Int count = StructHandle.ofInt(this, "count"); /** - * {@return the elements size of this struct in bytes} + * the primCount */ - public static long sizeof() { - return LAYOUT.byteSize(); - } - - /** - * Creates a command instance with the given allocator. - * - * @param allocator the allocator - * @return the instance - */ - public static DrawElementsIndirectCommand create(SegmentAllocator allocator) { - return new DrawElementsIndirectCommand(allocator.allocate(LAYOUT)); - } - + public final StructHandle.Int primCount = StructHandle.ofInt(this, "primCount"); /** - * Creates a command instance with the given allocator and count. - * - * @param allocator the allocator - * @param count the count - * @return the instance + * the firstIndex */ - public static Buffer create(SegmentAllocator allocator, long count) { - return new Buffer(allocator.allocate(LAYOUT, count), count); - } - + public final StructHandle.Int firstIndex = StructHandle.ofInt(this, "firstIndex"); /** - * Sets the count. - * - * @param count the count - * @return this + * the baseVertex */ - public DrawElementsIndirectCommand count(int count) { - pCount.set(segment(), count); - return this; - } - + public final StructHandle.Int baseVertex = StructHandle.ofInt(this, "baseVertex"); /** - * Sets the primitive count. - * - * @param primCount the primitive count - * @return this + * the baseInstance */ - public DrawElementsIndirectCommand primCount(int primCount) { - pPrimCount.set(segment(), primCount); - return this; - } + public final StructHandle.Int baseInstance = StructHandle.ofInt(this, "baseInstance"); /** - * Sets the first index. + * Creates a struct with the given layout. * - * @param firstIndex the first index - * @return this + * @param segment the segment + * @param elementCount the element count */ - public DrawElementsIndirectCommand firstIndex(int firstIndex) { - pFirstIndex.set(segment(), firstIndex); - return this; + public DrawElementsIndirectCommand(MemorySegment segment, long elementCount) { + super(segment, elementCount, LAYOUT); } /** - * Sets the base vertex. + * Allocates a struct with the given layout. * - * @param baseVertex the base vertex - * @return this + * @param allocator the allocator + * @param elementCount the element count */ - public DrawElementsIndirectCommand baseVertex(int baseVertex) { - pBaseVertex.set(segment(), baseVertex); - return this; + public DrawElementsIndirectCommand(SegmentAllocator allocator, long elementCount) { + super(allocator, elementCount, LAYOUT); } /** - * Sets the base instance. + * Creates a struct with the given layout. * - * @param baseInstance the base instance - * @return this - */ - public DrawElementsIndirectCommand baseInstance(int baseInstance) { - pBaseInstance.set(segment(), baseInstance); - return this; - } - - /** - * {@return the count} - */ - public int count() { - return (int) pCount.get(segment()); - } - - /** - * {@return the primitive count} + * @param segment the segment */ - public int primCount() { - return (int) pPrimCount.get(segment()); + public DrawElementsIndirectCommand(MemorySegment segment) { + super(segment, LAYOUT); } /** - * {@return the first index} - */ - public int firstIndex() { - return (int) pFirstIndex.get(segment()); - } - - /** - * {@return the base vertex} - */ - public int baseVertex() { - return (int) pBaseVertex.get(segment()); - } - - /** - * {@return the base instance} - */ - public int baseInstance() { - return (int) pBaseInstance.get(segment()); - } - - /** - * The OpenGL 4.2 draw elements indirect commands. + * Allocates a struct with the given layout. * - * @author squid233 - * @since 0.1.0 + * @param allocator the allocator */ - public static final class Buffer extends DrawElementsIndirectCommand implements ArrayPointer { - private final VarHandle pCount, pPrimCount, pFirstIndex, pBaseVertex, pBaseInstance; - - /** - * Create the pointer instance. - * - * @param address the address. - * @param elementCount the element count - */ - public Buffer(MemorySegment address, long elementCount) { - super(address, MemoryLayout.sequenceLayout(elementCount, LAYOUT)); - pCount = layout().varHandle(PathElement.sequenceElement(), PathElement.groupElement("count")); - pPrimCount = layout().varHandle(PathElement.sequenceElement(), PathElement.groupElement("primCount")); - pFirstIndex = layout().varHandle(PathElement.sequenceElement(), PathElement.groupElement("firstIndex")); - pBaseVertex = layout().varHandle(PathElement.sequenceElement(), PathElement.groupElement("baseVertex")); - pBaseInstance = layout().varHandle(PathElement.sequenceElement(), PathElement.groupElement("baseInstance")); - } - - /** - * Sets the count at the given index. - * - * @param index the index - * @param count the count - * @return this - */ - public Buffer count(long index, int count) { - pCount.set(segment(), index, count); - return this; - } - - /** - * Sets the primitive count at the given index. - * - * @param index the index - * @param primCount the primitive count - * @return this - */ - public Buffer primCount(long index, int primCount) { - pPrimCount.set(segment(), index, primCount); - return this; - } - - /** - * Sets the first index at the given index. - * - * @param index the index - * @param firstIndex the first index - * @return this - */ - public Buffer firstIndex(long index, int firstIndex) { - pFirstIndex.set(segment(), index, firstIndex); - return this; - } - - /** - * Sets the base vertex at the given index. - * - * @param index the index - * @param baseVertex the base vertex - * @return this - */ - public Buffer baseVertex(long index, int baseVertex) { - pBaseVertex.set(segment(), index, baseVertex); - return this; - } - - /** - * Sets the base instance at the given index. - * - * @param index the index - * @param baseInstance the base instance - * @return this - */ - public Buffer baseInstance(long index, int baseInstance) { - pBaseInstance.set(segment(), index, baseInstance); - return this; - } - - @Override - public Buffer count(int count) { - return count(0, count); - } - - @Override - public Buffer primCount(int primCount) { - return primCount(0, primCount); - } - - @Override - public Buffer firstIndex(int firstIndex) { - return firstIndex(0, firstIndex); - } - - @Override - public Buffer baseVertex(int baseVertex) { - return baseVertex(0, baseVertex); - } - - @Override - public Buffer baseInstance(int baseInstance) { - return baseInstance(0, baseInstance); - } - - /** - * Gets the count at the given index. - * - * @param index the index - * @return the count - */ - public int countAt(long index) { - return (int) pCount.get(segment(), index); - } - - /** - * Gets the primitive count at the given index. - * - * @param index the index - * @return the primitive count - */ - public int primCountAt(long index) { - return (int) pPrimCount.get(segment(), index); - } - - /** - * Gets the first index at the given index. - * - * @param index the index - * @return the first index - */ - public int firstIndexAt(long index) { - return (int) pFirstIndex.get(segment(), index); - } - - /** - * Gets the base vertex at the given index. - * - * @param index the index - * @return the base vertex - */ - public int baseVertexAt(long index) { - return (int) pBaseVertex.get(segment(), index); - } - - /** - * Gets the base instance at the given index. - * - * @param index the index - * @return the base instance - */ - public int baseInstanceAt(long index) { - return (int) pBaseInstance.get(segment(), index); - } - - @Override - public int count() { - return countAt(0); - } - - @Override - public int primCount() { - return primCountAt(0); - } - - @Override - public int firstIndex() { - return firstIndexAt(0); - } - - @Override - public int baseVertex() { - return baseVertexAt(0); - } - - @Override - public int baseInstance() { - return baseInstanceAt(0); - } + public DrawElementsIndirectCommand(SegmentAllocator allocator) { + super(allocator, LAYOUT); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL.java index eebf21a2..716fc27f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2022-2023 Overrun Organization + * Copyright (c) 2022-2024 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 @@ -22,8 +22,5 @@ * @author squid233 * @since 0.1.0 */ -public final class GL extends GL46C { - private GL() { - //no instance - } +public non-sealed interface GL extends GL46C { } 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 4a7aec96..ff72c7d6 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL10.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL10.java @@ -16,16 +16,17 @@ package overrungl.opengl; -import overrungl.internal.RuntimeHelper; -import overrungl.util.MemoryStack; +import overrun.marshal.Marshal; +import overrun.marshal.MemoryStack; +import overrun.marshal.Unmarshal; +import overrun.marshal.gen.Entrypoint; +import overrun.marshal.gen.Ref; +import overrun.marshal.gen.Skip; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; import static java.lang.foreign.ValueLayout.*; -import static overrungl.FunctionDescriptors.*; -import static overrungl.opengl.GLLoader.check; -import static overrungl.opengl.GLLoader.getCapabilities; /** * The OpenGL 1.0 functions. @@ -33,3221 +34,1975 @@ * @author squid233 * @since 0.1.0 */ -public final class GL10 extends GL10C { - static void load(GLCapabilities caps, GLLoadFunc load) { - if (!caps.Ver10) return; - caps.glAccum = load.invoke("glAccum", IFV); - caps.glAlphaFunc = load.invoke("glAlphaFunc", IFV); - caps.glBegin = load.invoke("glBegin", IV); - caps.glBitmap = load.invoke("glBitmap", IIFFFFPV); - caps.glCallList = load.invoke("glCallList", IV); - caps.glCallLists = load.invoke("glCallLists", IIPV); - caps.glClearAccum = load.invoke("glClearAccum", FFFFV); - caps.glClearIndex = load.invoke("glClearIndex", FV); - caps.glClipPlane = load.invoke("glClipPlane", IPV); - caps.glColor3b = load.invoke("glColor3b", BBBV); - caps.glColor3bv = load.invoke("glColor3bv", PV); - caps.glColor3d = load.invoke("glColor3d", DDDV); - caps.glColor3dv = load.invoke("glColor3dv", PV); - caps.glColor3f = load.invoke("glColor3f", FFFV); - caps.glColor3fv = load.invoke("glColor3fv", PV); - caps.glColor3i = load.invoke("glColor3i", IIIV); - caps.glColor3iv = load.invoke("glColor3iv", PV); - caps.glColor3s = load.invoke("glColor3s", SSSV); - caps.glColor3sv = load.invoke("glColor3sv", PV); - caps.glColor3ub = load.invoke("glColor3ub", BBBV); - caps.glColor3ubv = load.invoke("glColor3ubv", PV); - caps.glColor3ui = load.invoke("glColor3ui", IIIV); - caps.glColor3uiv = load.invoke("glColor3uiv", PV); - caps.glColor3us = load.invoke("glColor3us", SSSV); - caps.glColor3usv = load.invoke("glColor3usv", PV); - caps.glColor4b = load.invoke("glColor4b", BBBBV); - caps.glColor4bv = load.invoke("glColor4bv", PV); - caps.glColor4d = load.invoke("glColor4d", DDDDV); - caps.glColor4dv = load.invoke("glColor4dv", PV); - caps.glColor4f = load.invoke("glColor4f", FFFFV); - caps.glColor4fv = load.invoke("glColor4fv", PV); - caps.glColor4i = load.invoke("glColor4i", IIIIV); - caps.glColor4iv = load.invoke("glColor4iv", PV); - caps.glColor4s = load.invoke("glColor4s", SSSSV); - caps.glColor4sv = load.invoke("glColor4sv", PV); - caps.glColor4ub = load.invoke("glColor4ub", BBBBV); - caps.glColor4ubv = load.invoke("glColor4ubv", PV); - caps.glColor4ui = load.invoke("glColor4ui", IIIIV); - caps.glColor4uiv = load.invoke("glColor4uiv", PV); - caps.glColor4us = load.invoke("glColor4us", SSSSV); - caps.glColor4usv = load.invoke("glColor4usv", PV); - caps.glColorMaterial = load.invoke("glColorMaterial", IIV); - caps.glCopyPixels = load.invoke("glCopyPixels", IIIIIV); - caps.glDeleteLists = load.invoke("glDeleteLists", IIV); - caps.glDrawPixels = load.invoke("glDrawPixels", IIIIPV); - caps.glEdgeFlag = load.invoke("glEdgeFlag", ZV); - caps.glEdgeFlagv = load.invoke("glEdgeFlagv", PV); - caps.glEnd = load.invoke("glEnd", V); - caps.glEndList = load.invoke("glEndList", V); - caps.glEvalCoord1d = load.invoke("glEvalCoord1d", DV); - caps.glEvalCoord1dv = load.invoke("glEvalCoord1dv", PV); - caps.glEvalCoord1f = load.invoke("glEvalCoord1f", FV); - caps.glEvalCoord1fv = load.invoke("glEvalCoord1fv", PV); - caps.glEvalCoord2d = load.invoke("glEvalCoord2d", DDV); - caps.glEvalCoord2dv = load.invoke("glEvalCoord2dv", PV); - caps.glEvalCoord2f = load.invoke("glEvalCoord2f", FFV); - caps.glEvalCoord2fv = load.invoke("glEvalCoord2fv", PV); - caps.glEvalMesh1 = load.invoke("glEvalMesh1", IIIV); - caps.glEvalMesh2 = load.invoke("glEvalMesh2", IIIIIV); - caps.glEvalPoint1 = load.invoke("glEvalPoint1", IV); - caps.glEvalPoint2 = load.invoke("glEvalPoint2", IIV); - caps.glFeedbackBuffer = load.invoke("glFeedbackBuffer", IIPV); - caps.glFogf = load.invoke("glFogf", IFV); - caps.glFogfv = load.invoke("glFogfv", IPV); - caps.glFogi = load.invoke("glFogi", IIV); - caps.glFogiv = load.invoke("glFogiv", IPV); - caps.glFrustum = load.invoke("glFrustum", DDDDDDV); - caps.glGenLists = load.invoke("glGenLists", II); - caps.glGetClipPlane = load.invoke("glGetClipPlane", IPV); - caps.glGetLightfv = load.invoke("glGetLightfv", IIPV); - caps.glGetLightiv = load.invoke("glGetLightiv", IIPV); - caps.glGetMapdv = load.invoke("glGetMapdv", IIPV); - caps.glGetMapfv = load.invoke("glGetMapfv", IIPV); - caps.glGetMapiv = load.invoke("glGetMapiv", IIPV); - caps.glGetMaterialfv = load.invoke("glGetMaterialfv", IIPV); - caps.glGetMaterialiv = load.invoke("glGetMaterialiv", IIPV); - caps.glGetPixelMapfv = load.invoke("glGetPixelMapfv", IPV); - caps.glGetPixelMapuiv = load.invoke("glGetPixelMapuiv", IPV); - caps.glGetPixelMapusv = load.invoke("glGetPixelMapusv", IPV); - caps.glGetPolygonStipple = load.invoke("glGetPolygonStipple", PV); - caps.glGetTexEnvfv = load.invoke("glGetTexEnvfv", IIPV); - caps.glGetTexEnviv = load.invoke("glGetTexEnviv", IIPV); - caps.glGetTexGendv = load.invoke("glGetTexGendv", IIPV); - caps.glGetTexGenfv = load.invoke("glGetTexGenfv", IIPV); - caps.glGetTexGeniv = load.invoke("glGetTexGeniv", IIPV); - caps.glIndexMask = load.invoke("glIndexMask", IV); - caps.glIndexd = load.invoke("glIndexd", DV); - caps.glIndexdv = load.invoke("glIndexdv", PV); - caps.glIndexf = load.invoke("glIndexf", FV); - caps.glIndexfv = load.invoke("glIndexfv", PV); - caps.glIndexi = load.invoke("glIndexi", IV); - caps.glIndexiv = load.invoke("glIndexiv", PV); - caps.glIndexs = load.invoke("glIndexs", SV); - caps.glIndexsv = load.invoke("glIndexsv", PV); - caps.glInitNames = load.invoke("glInitNames", V); - caps.glIsList = load.invoke("glIsList", IZ); - caps.glLightModelf = load.invoke("glLightModelf", IFV); - caps.glLightModelfv = load.invoke("glLightModelfv", IPV); - caps.glLightModeli = load.invoke("glLightModeli", IIV); - caps.glLightModeliv = load.invoke("glLightModeliv", IPV); - caps.glLightf = load.invoke("glLightf", IIFV); - caps.glLightfv = load.invoke("glLightfv", IIPV); - caps.glLighti = load.invoke("glLighti", IIIV); - caps.glLightiv = load.invoke("glLightiv", IIPV); - caps.glLineStipple = load.invoke("glLineStipple", ISV); - caps.glListBase = load.invoke("glListBase", IV); - caps.glLoadIdentity = load.invoke("glLoadIdentity", V); - caps.glLoadMatrixd = load.invoke("glLoadMatrixd", PV); - caps.glLoadMatrixf = load.invoke("glLoadMatrixf", PV); - caps.glLoadName = load.invoke("glLoadName", IV); - caps.glMap1d = load.invoke("glMap1d", IDDIIPV); - caps.glMap1f = load.invoke("glMap1f", IFFIIPV); - caps.glMap2d = load.invoke("glMap2d", IDDIIDDIIPV); - caps.glMap2f = load.invoke("glMap2f", IFFIIFFIIPV); - caps.glMapGrid1d = load.invoke("glMapGrid1d", IDDV); - caps.glMapGrid1f = load.invoke("glMapGrid1f", IFFV); - caps.glMapGrid2d = load.invoke("glMapGrid2d", IDDIDDV); - caps.glMapGrid2f = load.invoke("glMapGrid2f", IFFIFFV); - caps.glMaterialf = load.invoke("glMaterialf", IIFV); - caps.glMaterialfv = load.invoke("glMaterialfv", IIPV); - caps.glMateriali = load.invoke("glMateriali", IIIV); - caps.glMaterialiv = load.invoke("glMaterialiv", IIPV); - caps.glMatrixMode = load.invoke("glMatrixMode", IV); - caps.glMultMatrixd = load.invoke("glMultMatrixd", PV); - caps.glMultMatrixf = load.invoke("glMultMatrixf", PV); - caps.glNewList = load.invoke("glNewList", IIV); - caps.glNormal3b = load.invoke("glNormal3b", BBBV); - caps.glNormal3bv = load.invoke("glNormal3bv", PV); - caps.glNormal3d = load.invoke("glNormal3d", DDDV); - caps.glNormal3dv = load.invoke("glNormal3dv", PV); - caps.glNormal3f = load.invoke("glNormal3f", FFFV); - caps.glNormal3fv = load.invoke("glNormal3fv", PV); - caps.glNormal3i = load.invoke("glNormal3i", IIIV); - caps.glNormal3iv = load.invoke("glNormal3iv", PV); - caps.glNormal3s = load.invoke("glNormal3s", SSSV); - caps.glNormal3sv = load.invoke("glNormal3sv", PV); - caps.glOrtho = load.invoke("glOrtho", DDDDDDV); - caps.glPassThrough = load.invoke("glPassThrough", FV); - caps.glPixelMapfv = load.invoke("glPixelMapfv", IIPV); - caps.glPixelMapuiv = load.invoke("glPixelMapuiv", IIPV); - caps.glPixelMapusv = load.invoke("glPixelMapusv", IIPV); - caps.glPixelTransferf = load.invoke("glPixelTransferf", IFV); - caps.glPixelTransferi = load.invoke("glPixelTransferi", IIV); - caps.glPixelZoom = load.invoke("glPixelZoom", FFV); - caps.glPolygonStipple = load.invoke("glPolygonStipple", PV); - caps.glPopAttrib = load.invoke("glPopAttrib", V); - caps.glPopMatrix = load.invoke("glPopMatrix", V); - caps.glPopName = load.invoke("glPopName", V); - caps.glPushAttrib = load.invoke("glPushAttrib", IV); - caps.glPushMatrix = load.invoke("glPushMatrix", V); - caps.glPushName = load.invoke("glPushName", IV); - caps.glRasterPos2d = load.invoke("glRasterPos2d", DDV); - caps.glRasterPos2dv = load.invoke("glRasterPos2dv", PV); - caps.glRasterPos2f = load.invoke("glRasterPos2f", FFV); - caps.glRasterPos2fv = load.invoke("glRasterPos2fv", PV); - caps.glRasterPos2i = load.invoke("glRasterPos2i", IIV); - caps.glRasterPos2iv = load.invoke("glRasterPos2iv", PV); - caps.glRasterPos2s = load.invoke("glRasterPos2s", SSV); - caps.glRasterPos2sv = load.invoke("glRasterPos2sv", PV); - caps.glRasterPos3d = load.invoke("glRasterPos3d", DDDV); - caps.glRasterPos3dv = load.invoke("glRasterPos3dv", PV); - caps.glRasterPos3f = load.invoke("glRasterPos3f", FFFV); - caps.glRasterPos3fv = load.invoke("glRasterPos3fv", PV); - caps.glRasterPos3i = load.invoke("glRasterPos3i", IIIV); - caps.glRasterPos3iv = load.invoke("glRasterPos3iv", PV); - caps.glRasterPos3s = load.invoke("glRasterPos3s", SSSV); - caps.glRasterPos3sv = load.invoke("glRasterPos3sv", PV); - caps.glRasterPos4d = load.invoke("glRasterPos4d", DDDDV); - caps.glRasterPos4dv = load.invoke("glRasterPos4dv", PV); - caps.glRasterPos4f = load.invoke("glRasterPos4f", FFFFV); - caps.glRasterPos4fv = load.invoke("glRasterPos4fv", PV); - caps.glRasterPos4i = load.invoke("glRasterPos4i", IIIIV); - caps.glRasterPos4iv = load.invoke("glRasterPos4iv", PV); - caps.glRasterPos4s = load.invoke("glRasterPos4s", SSSSV); - caps.glRasterPos4sv = load.invoke("glRasterPos4sv", PV); - caps.glRectd = load.invoke("glRectd", DDDDV); - caps.glRectdv = load.invoke("glRectdv", PPV); - caps.glRectf = load.invoke("glRectf", FFFFV); - caps.glRectfv = load.invoke("glRectfv", PPV); - caps.glRecti = load.invoke("glRecti", IIIIV); - caps.glRectiv = load.invoke("glRectiv", PPV); - caps.glRects = load.invoke("glRects", SSSSV); - caps.glRectsv = load.invoke("glRectsv", PPV); - caps.glRenderMode = load.invoke("glRenderMode", II); - caps.glRotated = load.invoke("glRotated", DDDDV); - caps.glRotatef = load.invoke("glRotatef", FFFFV); - caps.glScaled = load.invoke("glScaled", DDDV); - caps.glScalef = load.invoke("glScalef", FFFV); - caps.glSelectBuffer = load.invoke("glSelectBuffer", IPV); - caps.glShadeModel = load.invoke("glShadeModel", IV); - caps.glTexCoord1d = load.invoke("glTexCoord1d", DV); - caps.glTexCoord1dv = load.invoke("glTexCoord1dv", PV); - caps.glTexCoord1f = load.invoke("glTexCoord1f", FV); - caps.glTexCoord1fv = load.invoke("glTexCoord1fv", PV); - caps.glTexCoord1i = load.invoke("glTexCoord1i", IV); - caps.glTexCoord1iv = load.invoke("glTexCoord1iv", PV); - caps.glTexCoord1s = load.invoke("glTexCoord1s", SV); - caps.glTexCoord1sv = load.invoke("glTexCoord1sv", PV); - caps.glTexCoord2d = load.invoke("glTexCoord2d", DDV); - caps.glTexCoord2dv = load.invoke("glTexCoord2dv", PV); - caps.glTexCoord2f = load.invoke("glTexCoord2f", FFV); - caps.glTexCoord2fv = load.invoke("glTexCoord2fv", PV); - caps.glTexCoord2i = load.invoke("glTexCoord2i", IIV); - caps.glTexCoord2iv = load.invoke("glTexCoord2iv", PV); - caps.glTexCoord2s = load.invoke("glTexCoord2s", SSV); - caps.glTexCoord2sv = load.invoke("glTexCoord2sv", PV); - caps.glTexCoord3d = load.invoke("glTexCoord3d", DDDV); - caps.glTexCoord3dv = load.invoke("glTexCoord3dv", PV); - caps.glTexCoord3f = load.invoke("glTexCoord3f", FFFV); - caps.glTexCoord3fv = load.invoke("glTexCoord3fv", PV); - caps.glTexCoord3i = load.invoke("glTexCoord3i", IIIV); - caps.glTexCoord3iv = load.invoke("glTexCoord3iv", PV); - caps.glTexCoord3s = load.invoke("glTexCoord3s", SSSV); - caps.glTexCoord3sv = load.invoke("glTexCoord3sv", PV); - caps.glTexCoord4d = load.invoke("glTexCoord4d", DDDDV); - caps.glTexCoord4dv = load.invoke("glTexCoord4dv", PV); - caps.glTexCoord4f = load.invoke("glTexCoord4f", FFFFV); - caps.glTexCoord4fv = load.invoke("glTexCoord4fv", PV); - caps.glTexCoord4i = load.invoke("glTexCoord4i", IIIIV); - caps.glTexCoord4iv = load.invoke("glTexCoord4iv", PV); - caps.glTexCoord4s = load.invoke("glTexCoord4s", SSSSV); - caps.glTexCoord4sv = load.invoke("glTexCoord4sv", PV); - caps.glTexEnvf = load.invoke("glTexEnvf", IIFV); - caps.glTexEnvfv = load.invoke("glTexEnvfv", IIPV); - caps.glTexEnvi = load.invoke("glTexEnvi", IIIV); - caps.glTexEnviv = load.invoke("glTexEnviv", IIPV); - caps.glTexGend = load.invoke("glTexGend", IIDV); - caps.glTexGendv = load.invoke("glTexGendv", IIPV); - caps.glTexGenf = load.invoke("glTexGenf", IIFV); - caps.glTexGenfv = load.invoke("glTexGenfv", IIPV); - caps.glTexGeni = load.invoke("glTexGeni", IIIV); - caps.glTexGeniv = load.invoke("glTexGeniv", IIPV); - caps.glTranslated = load.invoke("glTranslated", DDDV); - caps.glTranslatef = load.invoke("glTranslatef", FFFV); - caps.glVertex2d = load.invoke("glVertex2d", DDV); - caps.glVertex2dv = load.invoke("glVertex2dv", PV); - caps.glVertex2f = load.invoke("glVertex2f", FFV); - caps.glVertex2fv = load.invoke("glVertex2fv", PV); - caps.glVertex2i = load.invoke("glVertex2i", IIV); - caps.glVertex2iv = load.invoke("glVertex2iv", PV); - caps.glVertex2s = load.invoke("glVertex2s", SSV); - caps.glVertex2sv = load.invoke("glVertex2sv", PV); - caps.glVertex3d = load.invoke("glVertex3d", DDDV); - caps.glVertex3dv = load.invoke("glVertex3dv", PV); - caps.glVertex3f = load.invoke("glVertex3f", FFFV); - caps.glVertex3fv = load.invoke("glVertex3fv", PV); - caps.glVertex3i = load.invoke("glVertex3i", IIIV); - caps.glVertex3iv = load.invoke("glVertex3iv", PV); - caps.glVertex3s = load.invoke("glVertex3s", SSSV); - caps.glVertex3sv = load.invoke("glVertex3sv", PV); - caps.glVertex4d = load.invoke("glVertex4d", DDDDV); - caps.glVertex4dv = load.invoke("glVertex4dv", PV); - caps.glVertex4f = load.invoke("glVertex4f", FFFFV); - caps.glVertex4fv = load.invoke("glVertex4fv", PV); - caps.glVertex4i = load.invoke("glVertex4i", IIIIV); - caps.glVertex4iv = load.invoke("glVertex4iv", PV); - caps.glVertex4s = load.invoke("glVertex4s", SSSSV); - caps.glVertex4sv = load.invoke("glVertex4sv", PV); - } - - public static void accum(int op, float value) { - var caps = getCapabilities(); - try { - check(caps.glAccum).invokeExact(op, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } +public sealed interface GL10 extends GL10C permits GLLegacy { + @Entrypoint("glAccum") + default void accum(int op, float value) { + throw new ContextException(); } - public static void alphaFunc(int func, float ref) { - var caps = getCapabilities(); - try { - check(caps.glAlphaFunc).invokeExact(func, ref); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glAlphaFunc") + default void alphaFunc(int func, float ref) { + throw new ContextException(); } - public static void begin(int mode) { - var caps = getCapabilities(); - try { - check(caps.glBegin).invokeExact(mode); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glBegin") + default void begin(int mode) { + throw new ContextException(); } - public static void bitmap(int width, int height, float xorig, float yorig, float xmove, float ymove, MemorySegment bitmap) { - var caps = getCapabilities(); - try { - check(caps.glBitmap).invokeExact(width, height, xorig, yorig, xmove, ymove, bitmap); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glBitmap") + default void bitmap(int width, int height, float xorig, float yorig, float xmove, float ymove, MemorySegment bitmap) { + throw new ContextException(); } - public static void callList(int list) { - var caps = getCapabilities(); - try { - check(caps.glCallList).invokeExact(list); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCallList") + default void callList(int list) { + throw new ContextException(); } - public static void callLists(int n, int type, MemorySegment lists) { - var caps = getCapabilities(); - try { - check(caps.glCallLists).invokeExact(n, type, lists); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCallLists") + default void callLists(int n, int type, MemorySegment lists) { + throw new ContextException(); } - public static void clearAccum(float red, float green, float blue, float alpha) { - var caps = getCapabilities(); - try { - check(caps.glClearAccum).invokeExact(red, green, blue, alpha); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glClearAccum") + default void clearAccum(float red, float green, float blue, float alpha) { + throw new ContextException(); } - public static void clearIndex(float c) { - var caps = getCapabilities(); - try { - check(caps.glClearIndex).invokeExact(c); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glClearIndex") + default void clearIndex(float c) { + throw new ContextException(); } - public static void clipPlane(int plane, MemorySegment equation) { - var caps = getCapabilities(); - try { - check(caps.glClipPlane).invokeExact(plane, equation); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glClipPlane") + default void clipPlane(int plane, MemorySegment equation) { + throw new ContextException(); } - public static void clipPlane(SegmentAllocator allocator, int plane, double[] equation) { - clipPlane(plane, allocator.allocateFrom(JAVA_DOUBLE, equation)); + @Entrypoint("glClipPlane") + default void clipPlane(SegmentAllocator allocator, int plane, double[] equation) { + throw new ContextException(); } - - public static void color3b(byte red, byte green, byte blue) { - var caps = getCapabilities(); - try { - check(caps.glColor3b).invokeExact(red, green, blue); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor3b") + default void color3b(byte red, byte green, byte blue) { + throw new ContextException(); } - public static void color3bv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glColor3bv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor3bv") + default void color3bv(MemorySegment v) { + throw new ContextException(); } - public static void color3bv(SegmentAllocator allocator, byte[] v) { - color3bv(allocator.allocateFrom(JAVA_BYTE, v)); + @Entrypoint("glColor3bv") + default void color3bv(SegmentAllocator allocator, byte[] v) { + throw new ContextException(); } - public static void color3d(double red, double green, double blue) { - var caps = getCapabilities(); - try { - check(caps.glColor3d).invokeExact(red, green, blue); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor3d") + default void color3d(double red, double green, double blue) { + throw new ContextException(); } - public static void color3dv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glColor3dv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor3dv") + default void color3dv(MemorySegment v) { + throw new ContextException(); } - public static void color3dv(SegmentAllocator allocator, double[] v) { - color3dv(allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glColor3dv") + default void color3dv(SegmentAllocator allocator, double[] v) { + throw new ContextException(); } - public static void color3f(float red, float green, float blue) { - var caps = getCapabilities(); - try { - check(caps.glColor3f).invokeExact(red, green, blue); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor3f") + default void color3f(float red, float green, float blue) { + throw new ContextException(); } - public static void color3fv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glColor3fv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor3fv") + default void color3fv(MemorySegment v) { + throw new ContextException(); } - public static void color3fv(SegmentAllocator allocator, float[] v) { - color3fv(allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glColor3fv") + default void color3fv(SegmentAllocator allocator, float[] v) { + throw new ContextException(); } - public static void color3i(int red, int green, int blue) { - var caps = getCapabilities(); - try { - check(caps.glColor3i).invokeExact(red, green, blue); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor3i") + default void color3i(int red, int green, int blue) { + throw new ContextException(); } - public static void color3iv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glColor3iv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor3iv") + default void color3iv(MemorySegment v) { + throw new ContextException(); } - public static void color3iv(SegmentAllocator allocator, int[] v) { - color3iv(allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glColor3iv") + default void color3iv(SegmentAllocator allocator, int[] v) { + throw new ContextException(); } - public static void color3s(short red, short green, short blue) { - var caps = getCapabilities(); - try { - check(caps.glColor3s).invokeExact(red, green, blue); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor3s") + default void color3s(short red, short green, short blue) { + throw new ContextException(); } - public static void color3sv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glColor3sv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor3sv") + default void color3sv(MemorySegment v) { + throw new ContextException(); } - public static void color3sv(SegmentAllocator allocator, short[] v) { - color3sv(allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glColor3sv") + default void color3sv(SegmentAllocator allocator, short[] v) { + throw new ContextException(); } - public static void color3ub(byte red, byte green, byte blue) { - var caps = getCapabilities(); - try { - check(caps.glColor3ub).invokeExact(red, green, blue); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor3ub") + default void color3ub(byte red, byte green, byte blue) { + throw new ContextException(); } - public static void color3ubv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glColor3ubv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor3ubv") + default void color3ubv(MemorySegment v) { + throw new ContextException(); } - public static void color3ubv(SegmentAllocator allocator, byte[] v) { - color3ubv(allocator.allocateFrom(JAVA_BYTE, v)); + @Entrypoint("glColor3ubv") + default void color3ubv(SegmentAllocator allocator, byte[] v) { + throw new ContextException(); } - public static void color3ui(int red, int green, int blue) { - var caps = getCapabilities(); - try { - check(caps.glColor3ui).invokeExact(red, green, blue); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor3ui") + default void color3ui(int red, int green, int blue) { + throw new ContextException(); } - public static void color3uiv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glColor3uiv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor3uiv") + default void color3uiv(MemorySegment v) { + throw new ContextException(); } - public static void color3uiv(SegmentAllocator allocator, int[] v) { - color3uiv(allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glColor3uiv") + default void color3uiv(SegmentAllocator allocator, int[] v) { + throw new ContextException(); } - public static void color3us(short red, short green, short blue) { - var caps = getCapabilities(); - try { - check(caps.glColor3us).invokeExact(red, green, blue); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor3us") + default void color3us(short red, short green, short blue) { + throw new ContextException(); } - public static void color3usv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glColor3usv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor3usv") + default void color3usv(MemorySegment v) { + throw new ContextException(); } - public static void color3usv(SegmentAllocator allocator, short[] v) { - color3usv(allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glColor3usv") + default void color3usv(SegmentAllocator allocator, short[] v) { + throw new ContextException(); } - public static void color4b(byte red, byte green, byte blue, byte alpha) { - var caps = getCapabilities(); - try { - check(caps.glColor4b).invokeExact(red, green, blue, alpha); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor4b") + default void color4b(byte red, byte green, byte blue, byte alpha) { + throw new ContextException(); } - public static void color4bv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glColor4bv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor4bv") + default void color4bv(MemorySegment v) { + throw new ContextException(); } - public static void color4bv(SegmentAllocator allocator, byte[] v) { - color4bv(allocator.allocateFrom(JAVA_BYTE, v)); + @Entrypoint("glColor4bv") + default void color4bv(SegmentAllocator allocator, byte[] v) { + throw new ContextException(); } - public static void color4d(double red, double green, double blue, double alpha) { - var caps = getCapabilities(); - try { - check(caps.glColor4d).invokeExact(red, green, blue, alpha); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor4d") + default void color4d(double red, double green, double blue, double alpha) { + throw new ContextException(); } - public static void color4dv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glColor4dv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor4dv") + default void color4dv(MemorySegment v) { + throw new ContextException(); } - public static void color4dv(SegmentAllocator allocator, double[] v) { - color4dv(allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glColor4dv") + default void color4dv(SegmentAllocator allocator, double[] v) { + throw new ContextException(); } - public static void color4f(float red, float green, float blue, float alpha) { - var caps = getCapabilities(); - try { - check(caps.glColor4f).invokeExact(red, green, blue, alpha); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor4f") + default void color4f(float red, float green, float blue, float alpha) { + throw new ContextException(); } - public static void color4fv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glColor4fv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor4fv") + default void color4fv(MemorySegment v) { + throw new ContextException(); } - public static void color4fv(SegmentAllocator allocator, float[] v) { - color4fv(allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glColor4fv") + default void color4fv(SegmentAllocator allocator, float[] v) { + throw new ContextException(); } - public static void color4i(int red, int green, int blue, int alpha) { - var caps = getCapabilities(); - try { - check(caps.glColor4i).invokeExact(red, green, blue, alpha); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor4i") + default void color4i(int red, int green, int blue, int alpha) { + throw new ContextException(); } - public static void color4iv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glColor4iv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor4iv") + default void color4iv(MemorySegment v) { + throw new ContextException(); } - public static void color4iv(SegmentAllocator allocator, int[] v) { - color4iv(allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glColor4iv") + default void color4iv(SegmentAllocator allocator, int[] v) { + throw new ContextException(); } - public static void color4s(short red, short green, short blue, short alpha) { - var caps = getCapabilities(); - try { - check(caps.glColor4s).invokeExact(red, green, blue, alpha); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor4s") + default void color4s(short red, short green, short blue, short alpha) { + throw new ContextException(); } - public static void color4sv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glColor4sv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor4sv") + default void color4sv(MemorySegment v) { + throw new ContextException(); } - public static void color4sv(SegmentAllocator allocator, short[] v) { - color4sv(allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glColor4sv") + default void color4sv(SegmentAllocator allocator, short[] v) { + throw new ContextException(); } - public static void color4ub(byte red, byte green, byte blue, byte alpha) { - var caps = getCapabilities(); - try { - check(caps.glColor4ub).invokeExact(red, green, blue, alpha); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor4ub") + default void color4ub(byte red, byte green, byte blue, byte alpha) { + throw new ContextException(); } - public static void color4ubv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glColor4ubv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor4ubv") + default void color4ubv(MemorySegment v) { + throw new ContextException(); } - public static void color4ubv(SegmentAllocator allocator, byte[] v) { - color4ubv(allocator.allocateFrom(JAVA_BYTE, v)); + @Entrypoint("glColor4ubv") + default void color4ubv(SegmentAllocator allocator, byte[] v) { + throw new ContextException(); } - public static void color4ui(int red, int green, int blue, int alpha) { - var caps = getCapabilities(); - try { - check(caps.glColor4ui).invokeExact(red, green, blue, alpha); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor4ui") + default void color4ui(int red, int green, int blue, int alpha) { + throw new ContextException(); } - public static void color4uiv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glColor4uiv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor4uiv") + default void color4uiv(MemorySegment v) { + throw new ContextException(); } - public static void color4uiv(SegmentAllocator allocator, int[] v) { - color4uiv(allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glColor4uiv") + default void color4uiv(SegmentAllocator allocator, int[] v) { + throw new ContextException(); } - public static void color4us(short red, short green, short blue, short alpha) { - var caps = getCapabilities(); - try { - check(caps.glColor4us).invokeExact(red, green, blue, alpha); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor4us") + default void color4us(short red, short green, short blue, short alpha) { + throw new ContextException(); } - public static void color4usv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glColor4usv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColor4usv") + default void color4usv(MemorySegment v) { + throw new ContextException(); } - public static void color4usv(SegmentAllocator allocator, short[] v) { - color4usv(allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glColor4usv") + default void color4usv(SegmentAllocator allocator, short[] v) { + throw new ContextException(); } - public static void colorMaterial(int face, int mode) { - var caps = getCapabilities(); - try { - check(caps.glColorMaterial).invokeExact(face, mode); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColorMaterial") + default void colorMaterial(int face, int mode) { + throw new ContextException(); } - public static void copyPixels(int x, int y, int width, int height, int type) { - var caps = getCapabilities(); - try { - check(caps.glCopyPixels).invokeExact(x, y, width, height, type); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCopyPixels") + default void copyPixels(int x, int y, int width, int height, int type) { + throw new ContextException(); } - public static void deleteLists(int list, int range) { - var caps = getCapabilities(); - try { - check(caps.glDeleteLists).invokeExact(list, range); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDeleteLists") + default void deleteLists(int list, int range) { + throw new ContextException(); } - public static void drawPixels(int width, int height, int format, int type, MemorySegment pixels) { - var caps = getCapabilities(); - try { - check(caps.glDrawPixels).invokeExact(width, height, format, type, pixels); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDrawPixels") + default void drawPixels(int width, int height, int format, int type, MemorySegment pixels) { + throw new ContextException(); } - public static void edgeFlag(boolean flag) { - var caps = getCapabilities(); - try { - check(caps.glEdgeFlag).invokeExact(flag); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEdgeFlag") + default void edgeFlag(boolean flag) { + throw new ContextException(); } - public static void edgeFlagv(MemorySegment flag) { - var caps = getCapabilities(); - try { - check(caps.glEdgeFlagv).invokeExact(flag); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEdgeFlagv") + default void edgeFlagv(MemorySegment flag) { + throw new ContextException(); } - public static void edgeFlagv(SegmentAllocator allocator, boolean[] flag) { - var pFlag = allocator.allocate(JAVA_BOOLEAN, flag.length); - for (int i = 0; i < flag.length; i++) { - pFlag.set(JAVA_BOOLEAN, i, flag[i]); - } - edgeFlagv(pFlag); + @Entrypoint("glEdgeFlagv") + default void edgeFlagv(SegmentAllocator allocator, boolean[] flag) { + throw new ContextException(); } - public static void end() { - var caps = getCapabilities(); - try { - check(caps.glEnd).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEnd") + default void end() { + throw new ContextException(); } - public static void endList() { - var caps = getCapabilities(); - try { - check(caps.glEndList).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEndList") + default void endList() { + throw new ContextException(); } - public static void evalCoord1d(double u) { - var caps = getCapabilities(); - try { - check(caps.glEvalCoord1d).invokeExact(u); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEvalCoord1d") + default void evalCoord1d(double u) { + throw new ContextException(); } - public static void evalCoord1dv(MemorySegment u) { - var caps = getCapabilities(); - try { - check(caps.glEvalCoord1dv).invokeExact(u); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEvalCoord1dv") + default void evalCoord1dv(MemorySegment u) { + throw new ContextException(); } - public static void evalCoord1dv(SegmentAllocator allocator, double[] u) { - evalCoord1dv(allocator.allocateFrom(JAVA_DOUBLE, u)); + @Entrypoint("glEvalCoord1dv") + default void evalCoord1dv(SegmentAllocator allocator, double[] u) { + throw new ContextException(); } - public static void evalCoord1f(float u) { - var caps = getCapabilities(); - try { - check(caps.glEvalCoord1f).invokeExact(u); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEvalCoord1f") + default void evalCoord1f(float u) { + throw new ContextException(); } - public static void evalCoord1fv(MemorySegment u) { - var caps = getCapabilities(); - try { - check(caps.glEvalCoord1fv).invokeExact(u); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEvalCoord1fv") + default void evalCoord1fv(MemorySegment u) { + throw new ContextException(); } - public static void evalCoord1fv(SegmentAllocator allocator, float[] u) { - evalCoord1fv(allocator.allocateFrom(JAVA_FLOAT, u)); + @Entrypoint("glEvalCoord1fv") + default void evalCoord1fv(SegmentAllocator allocator, float[] u) { + throw new ContextException(); } - public static void evalCoord2d(double u, double v) { - var caps = getCapabilities(); - try { - check(caps.glEvalCoord2d).invokeExact(u, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEvalCoord2d") + default void evalCoord2d(double u, double v) { + throw new ContextException(); } - public static void evalCoord2dv(MemorySegment u) { - var caps = getCapabilities(); - try { - check(caps.glEvalCoord2dv).invokeExact(u); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEvalCoord2dv") + default void evalCoord2dv(MemorySegment u) { + throw new ContextException(); } - public static void evalCoord2dv(SegmentAllocator allocator, double[] u) { - evalCoord2dv(allocator.allocateFrom(JAVA_DOUBLE, u)); + @Entrypoint("glEvalCoord2dv") + default void evalCoord2dv(SegmentAllocator allocator, double[] u) { + throw new ContextException(); } - public static void evalCoord2f(float u, float v) { - var caps = getCapabilities(); - try { - check(caps.glEvalCoord2f).invokeExact(u, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEvalCoord2f") + default void evalCoord2f(float u, float v) { + throw new ContextException(); } - public static void evalCoord2fv(MemorySegment u) { - var caps = getCapabilities(); - try { - check(caps.glEvalCoord2fv).invokeExact(u); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEvalCoord2fv") + default void evalCoord2fv(MemorySegment u) { + throw new ContextException(); } - public static void evalCoord2fv(SegmentAllocator allocator, float[] u) { - evalCoord2fv(allocator.allocateFrom(JAVA_FLOAT, u)); + @Entrypoint("glEvalCoord2fv") + default void evalCoord2fv(SegmentAllocator allocator, float[] u) { + throw new ContextException(); } - public static void evalMesh1(int mode, int i1, int i2) { - var caps = getCapabilities(); - try { - check(caps.glEvalMesh1).invokeExact(mode, i1, i2); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEvalMesh1") + default void evalMesh1(int mode, int i1, int i2) { + throw new ContextException(); } - public static void evalMesh2(int mode, int i1, int i2, int j1, int j2) { - var caps = getCapabilities(); - try { - check(caps.glEvalMesh2).invokeExact(mode, i1, i2, j1, j2); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEvalMesh2") + default void evalMesh2(int mode, int i1, int i2, int j1, int j2) { + throw new ContextException(); } - public static void evalPoint1(int mode, int i) { - var caps = getCapabilities(); - try { - check(caps.glEvalPoint1).invokeExact(mode, i); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEvalPoint1") + default void evalPoint1(int mode, int i) { + throw new ContextException(); } - public static void evalPoint2(int mode, int i, int j) { - var caps = getCapabilities(); - try { - check(caps.glEvalPoint2).invokeExact(mode, i, j); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEvalPoint2") + default void evalPoint2(int mode, int i, int j) { + throw new ContextException(); } - public static void feedbackBuffer(int size, int type, MemorySegment buffer) { - var caps = getCapabilities(); - try { - check(caps.glFeedbackBuffer).invokeExact(size, type, buffer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glFeedbackBuffer") + default void feedbackBuffer(int size, int type, MemorySegment buffer) { + throw new ContextException(); } - public static void feedbackBuffer(SegmentAllocator allocator, int type, float[] buffer) { - var pBuffer = allocator.allocateFrom(JAVA_FLOAT, buffer); - feedbackBuffer(buffer.length, type, pBuffer); - RuntimeHelper.toArray(pBuffer, buffer); + @Entrypoint("glFeedbackBuffer") + default void feedbackBuffer(SegmentAllocator allocator, int type, @Ref float[] buffer) { + throw new ContextException(); } - public static void fogf(int pname, float param) { - var caps = getCapabilities(); - try { - check(caps.glFogf).invokeExact(pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glFogf") + default void fogf(int pname, float param) { + throw new ContextException(); } - public static void fogfv(int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glFogfv).invokeExact(pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glFogfv") + default void fogfv(int pname, MemorySegment params) { + throw new ContextException(); } - public static void fogfv(SegmentAllocator allocator, int pname, float[] params) { - fogfv(pname, allocator.allocateFrom(JAVA_FLOAT, params)); + @Entrypoint("glFogfv") + default void fogfv(SegmentAllocator allocator, int pname, float[] params) { + throw new ContextException(); } - public static void fogi(int pname, int param) { - var caps = getCapabilities(); - try { - check(caps.glFogi).invokeExact(pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glFogi") + default void fogi(int pname, int param) { + throw new ContextException(); } - public static void fogiv(int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glFogiv).invokeExact(pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glFogiv") + default void fogiv(int pname, MemorySegment params) { + throw new ContextException(); } - public static void fogiv(SegmentAllocator allocator, int pname, int[] params) { - fogiv(pname, allocator.allocateFrom(JAVA_INT, params)); + @Entrypoint("glFogiv") + default void fogiv(SegmentAllocator allocator, int pname, int[] params) { + throw new ContextException(); } - public static void frustum(double left, double right, double bottom, double top, double zNear, double zFar) { - var caps = getCapabilities(); - try { - check(caps.glFrustum).invokeExact(left, right, bottom, top, zNear, zFar); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glFrustum") + default void frustum(double left, double right, double bottom, double top, double zNear, double zFar) { + throw new ContextException(); } - public static int genLists(int range) { - var caps = getCapabilities(); - try { - return (int) check(caps.glGenLists).invokeExact(range); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGenLists") + default int genLists(int range) { + throw new ContextException(); } - public static void getClipPlane(int plane, MemorySegment equation) { - var caps = getCapabilities(); - try { - check(caps.glGetClipPlane).invokeExact(plane, equation); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetClipPlane") + default void getClipPlane(int plane, MemorySegment equation) { + throw new ContextException(); } - public static double[] getClipPlane(int plane) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pEq = stack.callocDouble(4); + @Skip + default double[] getClipPlane(int plane) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pEq = stack.allocate(JAVA_DOUBLE, 4); getClipPlane(plane, pEq); - return RuntimeHelper.toArray(pEq, new double[4]); - } finally { - stack.setPointer(stackPointer); + return Unmarshal.unmarshalAsDoubleArray(pEq); } } - public static void getLightfv(int light, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetLightfv).invokeExact(light, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetLightfv") + default void getLightfv(int light, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getLightfv(SegmentAllocator allocator, int light, int pname, float[] params) { - var pParams = allocator.allocateFrom(JAVA_FLOAT, params); - getLightfv(light, pname, pParams); - RuntimeHelper.toArray(pParams, params); + @Entrypoint("glGetLightfv") + default void getLightfv(SegmentAllocator allocator, int light, int pname, @Ref float[] params) { + throw new ContextException(); } - public static float getLightf(int light, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pParams = stack.callocFloat(); + @Skip + default float getLightfv(int light, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pParams = stack.floats(0F); getLightfv(light, pname, pParams); return pParams.get(JAVA_FLOAT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getLightiv(int light, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetLightiv).invokeExact(light, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetLightiv") + default void getLightiv(int light, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getLightiv(SegmentAllocator allocator, int light, int pname, int[] params) { - var pParams = allocator.allocateFrom(JAVA_INT, params); - getLightiv(light, pname, pParams); - RuntimeHelper.toArray(pParams, params); + @Entrypoint("glGetLightiv") + default void getLightiv(SegmentAllocator allocator, int light, int pname, @Ref int[] params) { + throw new ContextException(); } - public static int getLighti(int light, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pParams = stack.callocInt(); + @Skip + default int getLightiv(int light, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pParams = stack.ints(0); getLightiv(light, pname, pParams); return pParams.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getMapdv(int target, int query, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glGetMapdv).invokeExact(target, query, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetMapdv") + default void getMapdv(int target, int query, MemorySegment v) { + throw new ContextException(); } - public static void getMapdv(SegmentAllocator allocator, int target, int query, double[] v) { - var pv = allocator.allocateFrom(JAVA_DOUBLE, v); - getMapdv(target, query, pv); - RuntimeHelper.toArray(pv, v); + @Entrypoint("glGetMapdv") + default void getMapdv(SegmentAllocator allocator, int target, int query, @Ref double[] v) { + throw new ContextException(); } - public static double getMapd(int target, int query) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pv = stack.callocDouble(); + @Skip + default double getMapdv(int target, int query) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pv = stack.doubles(0D); getMapdv(target, query, pv); return pv.get(JAVA_DOUBLE, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getMapfv(int target, int query, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glGetMapfv).invokeExact(target, query, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetMapfv") + default void getMapfv(int target, int query, MemorySegment v) { + throw new ContextException(); } - public static void getMapfv(SegmentAllocator allocator, int target, int query, float[] v) { - var pv = allocator.allocateFrom(JAVA_FLOAT, v); - getMapfv(target, query, pv); - RuntimeHelper.toArray(pv, v); + @Entrypoint("glGetMapfv") + default void getMapfv(SegmentAllocator allocator, int target, int query, @Ref float[] v) { + throw new ContextException(); } - public static float getMapf(int target, int query) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pv = stack.callocFloat(); + @Skip + default float getMapfv(int target, int query) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pv = stack.floats(0F); getMapfv(target, query, pv); return pv.get(JAVA_FLOAT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getMapiv(int target, int query, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glGetMapiv).invokeExact(target, query, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetMapiv") + default void getMapiv(int target, int query, MemorySegment v) { + throw new ContextException(); } - public static void getMapiv(SegmentAllocator allocator, int target, int query, int[] v) { - var pv = allocator.allocateFrom(JAVA_INT, v); - getMapiv(target, query, pv); - RuntimeHelper.toArray(pv, v); + @Entrypoint("glGetMapiv") + default void getMapiv(SegmentAllocator allocator, int target, int query, @Ref int[] v) { + throw new ContextException(); } - public static int getMapi(int target, int query) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pv = stack.callocInt(); + @Skip + default int getMapiv(int target, int query) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pv = stack.ints(0); getMapiv(target, query, pv); return pv.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getMaterialfv(int face, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetMaterialfv).invokeExact(face, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetMaterialfv") + default void getMaterialfv(int face, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getMaterialfv(SegmentAllocator allocator, int face, int pname, float[] params) { - var pParams = allocator.allocateFrom(JAVA_FLOAT, params); - getMaterialfv(face, pname, pParams); - RuntimeHelper.toArray(pParams, params); + @Entrypoint("glGetMaterialfv") + default void getMaterialfv(SegmentAllocator allocator, int face, int pname, @Ref float[] params) { + throw new ContextException(); } - public static float getMaterialf(int face, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pParams = stack.callocFloat(); + @Skip + default float getMaterialfv(int face, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pParams = stack.floats(0F); getMaterialfv(face, pname, pParams); return pParams.get(JAVA_FLOAT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getMaterialiv(int face, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetMaterialiv).invokeExact(face, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetMaterialiv") + default void getMaterialiv(int face, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getMaterialiv(SegmentAllocator allocator, int face, int pname, int[] params) { - var pParams = allocator.allocateFrom(JAVA_INT, params); - getMaterialiv(face, pname, pParams); - RuntimeHelper.toArray(pParams, params); + @Entrypoint("glGetMaterialiv") + default void getMaterialiv(SegmentAllocator allocator, int face, int pname, @Ref int[] params) { + throw new ContextException(); } - public static int getMateriali(int face, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pParams = stack.callocInt(); + @Skip + default int getMaterialiv(int face, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pParams = stack.ints(0); getMaterialiv(face, pname, pParams); return pParams.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getPixelMapfv(int map, MemorySegment values) { - var caps = getCapabilities(); - try { - check(caps.glGetPixelMapfv).invokeExact(map, values); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetPixelMapfv") + default void getPixelMapfv(int map, MemorySegment values) { + throw new ContextException(); } - public static void getPixelMapfv(SegmentAllocator allocator, int map, float[] values) { - var pValues = allocator.allocateFrom(JAVA_FLOAT, values); - getPixelMapfv(map, pValues); - RuntimeHelper.toArray(pValues, values); + @Entrypoint("glGetPixelMapfv") + default void getPixelMapfv(SegmentAllocator allocator, int map, @Ref float[] values) { + throw new ContextException(); } - public static void getPixelMapuiv(int map, MemorySegment values) { - var caps = getCapabilities(); - try { - check(caps.glGetPixelMapuiv).invokeExact(map, values); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetPixelMapuiv") + default void getPixelMapuiv(int map, MemorySegment values) { + throw new ContextException(); } - public static void getPixelMapuiv(SegmentAllocator allocator, int map, int[] values) { - var pValues = allocator.allocateFrom(JAVA_INT, values); - getPixelMapuiv(map, pValues); - RuntimeHelper.toArray(pValues, values); + @Entrypoint("glGetPixelMapuiv") + default void getPixelMapuiv(SegmentAllocator allocator, int map, @Ref int[] values) { + throw new ContextException(); } - public static void getPixelMapusv(int map, MemorySegment values) { - var caps = getCapabilities(); - try { - check(caps.glGetPixelMapusv).invokeExact(map, values); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetPixelMapusv") + default void getPixelMapusv(int map, MemorySegment values) { + throw new ContextException(); } - public static void getPixelMapusv(SegmentAllocator allocator, int map, short[] values) { - var pValues = allocator.allocateFrom(JAVA_SHORT, values); - getPixelMapusv(map, pValues); - RuntimeHelper.toArray(pValues, values); + @Entrypoint("glGetPixelMapusv") + default void getPixelMapusv(SegmentAllocator allocator, int map, @Ref short[] values) { + throw new ContextException(); } - public static void getPolygonStipple(MemorySegment mask) { - var caps = getCapabilities(); - try { - check(caps.glGetPolygonStipple).invokeExact(mask); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetPolygonStipple") + default void getPolygonStipple(MemorySegment mask) { + throw new ContextException(); } - public static void getPolygonStipple(SegmentAllocator allocator, byte[] mask) { - var pMask = allocator.allocateFrom(JAVA_BYTE, mask); - getPolygonStipple(pMask); - RuntimeHelper.toArray(pMask, mask); + @Entrypoint("glGetPolygonStipple") + default void getPolygonStipple(SegmentAllocator allocator, @Ref byte[] mask) { + throw new ContextException(); } - public static void getTexEnvfv(int target, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetTexEnvfv).invokeExact(target, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTexEnvfv") + default void getTexEnvfv(int target, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getTexEnvfv(SegmentAllocator allocator, int target, int pname, float[] params) { - var pParams = allocator.allocateFrom(JAVA_FLOAT, params); - getTexEnvfv(target, pname, pParams); - RuntimeHelper.toArray(pParams, params); + @Entrypoint("glGetTexEnvfv") + default void getTexEnvfv(SegmentAllocator allocator, int target, int pname, @Ref float[] params) { + throw new ContextException(); } - public static float getTexEnvf(int target, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pParams = stack.callocFloat(); + @Skip + default float getTexEnvfv(int target, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pParams = stack.floats(0F); getTexEnvfv(target, pname, pParams); return pParams.get(JAVA_FLOAT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getTexEnviv(int target, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetTexEnviv).invokeExact(target, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTexEnviv") + default void getTexEnviv(int target, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getTexEnviv(SegmentAllocator allocator, int target, int pname, int[] params) { - var pParams = allocator.allocateFrom(JAVA_INT, params); - getTexEnviv(target, pname, pParams); - RuntimeHelper.toArray(pParams, params); + @Entrypoint("glGetTexEnviv") + default void getTexEnviv(SegmentAllocator allocator, int target, int pname, @Ref int[] params) { + throw new ContextException(); } - public static int getTexEnvi(int target, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pParams = stack.callocInt(); + @Skip + default int getTexEnviv(int target, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pParams = stack.ints(0); getTexEnviv(target, pname, pParams); return pParams.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getTexGendv(int coord, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetTexGendv).invokeExact(coord, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTexGendv") + default void getTexGendv(int coord, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getTexGendv(SegmentAllocator allocator, int coord, int pname, double[] params) { - var pParams = allocator.allocateFrom(JAVA_DOUBLE, params); - getTexGendv(coord, pname, pParams); - RuntimeHelper.toArray(pParams, params); + @Entrypoint("glGetTexGendv") + default void getTexGendv(SegmentAllocator allocator, int coord, int pname, @Ref double[] params) { + throw new ContextException(); } - public static void getTexGenfv(int coord, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetTexGenfv).invokeExact(coord, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTexGenfv") + default void getTexGenfv(int coord, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getTexGenfv(SegmentAllocator allocator, int coord, int pname, float[] params) { - var pParams = allocator.allocateFrom(JAVA_FLOAT, params); - getTexGenfv(coord, pname, pParams); - RuntimeHelper.toArray(pParams, params); + @Entrypoint("glGetTexGenfv") + default void getTexGenfv(SegmentAllocator allocator, int coord, int pname, @Ref float[] params) { + throw new ContextException(); } - public static void getTexGeniv(int coord, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetTexGeniv).invokeExact(coord, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTexGeniv") + default void getTexGeniv(int coord, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getTexGeniv(SegmentAllocator allocator, int coord, int pname, int[] params) { - var pParams = allocator.allocateFrom(JAVA_INT, params); - getTexGeniv(coord, pname, pParams); - RuntimeHelper.toArray(pParams, params); + @Entrypoint("glGetTexGeniv") + default void getTexGeniv(SegmentAllocator allocator, int coord, int pname, @Ref int[] params) { + throw new ContextException(); } - public static void indexMask(int mask) { - var caps = getCapabilities(); - try { - check(caps.glIndexMask).invokeExact(mask); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIndexMask") + default void indexMask(int mask) { + throw new ContextException(); } - public static void indexd(double c) { - var caps = getCapabilities(); - try { - check(caps.glIndexd).invokeExact(c); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIndexd") + default void indexd(double c) { + throw new ContextException(); } - public static void indexdv(MemorySegment c) { - var caps = getCapabilities(); - try { - check(caps.glIndexdv).invokeExact(c); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIndexdv") + default void indexdv(MemorySegment c) { + throw new ContextException(); } - public static void indexdv(SegmentAllocator allocator, double[] c) { - indexdv(allocator.allocateFrom(JAVA_DOUBLE, c)); + @Entrypoint("glIndexdv") + default void indexdv(SegmentAllocator allocator, double[] c) { + throw new ContextException(); } - public static void indexf(float c) { - var caps = getCapabilities(); - try { - check(caps.glIndexf).invokeExact(c); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIndexf") + default void indexf(float c) { + throw new ContextException(); } - public static void indexfv(MemorySegment c) { - var caps = getCapabilities(); - try { - check(caps.glIndexfv).invokeExact(c); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIndexfv") + default void indexfv(MemorySegment c) { + throw new ContextException(); } - public static void indexfv(SegmentAllocator allocator, float[] c) { - indexfv(allocator.allocateFrom(JAVA_FLOAT, c)); + @Entrypoint("glIndexfv") + default void indexfv(SegmentAllocator allocator, float[] c) { + throw new ContextException(); } - public static void indexi(int c) { - var caps = getCapabilities(); - try { - check(caps.glIndexi).invokeExact(c); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIndexi") + default void indexi(int c) { + throw new ContextException(); } - public static void indexiv(MemorySegment c) { - var caps = getCapabilities(); - try { - check(caps.glIndexiv).invokeExact(c); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIndexiv") + default void indexiv(MemorySegment c) { + throw new ContextException(); } - public static void indexiv(SegmentAllocator allocator, int[] c) { - indexiv(allocator.allocateFrom(JAVA_INT, c)); + @Entrypoint("glIndexiv") + default void indexiv(SegmentAllocator allocator, int[] c) { + throw new ContextException(); } - public static void indexs(short c) { - var caps = getCapabilities(); - try { - check(caps.glIndexs).invokeExact(c); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIndexs") + default void indexs(short c) { + throw new ContextException(); } - public static void indexsv(MemorySegment c) { - var caps = getCapabilities(); - try { - check(caps.glIndexsv).invokeExact(c); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIndexsv") + default void indexsv(MemorySegment c) { + throw new ContextException(); } - public static void indexsv(SegmentAllocator allocator, short[] c) { - indexsv(allocator.allocateFrom(JAVA_SHORT, c)); + @Entrypoint("glIndexsv") + default void indexsv(SegmentAllocator allocator, short[] c) { + throw new ContextException(); } - public static void initNames() { - var caps = getCapabilities(); - try { - check(caps.glInitNames).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glInitNames") + default void initNames() { + throw new ContextException(); } - public static boolean isList(int list) { - var caps = getCapabilities(); - try { - return (boolean) check(caps.glIsList).invokeExact(list); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIsList") + default boolean isList(int list) { + throw new ContextException(); } - public static void lightModelf(int pname, float param) { - var caps = getCapabilities(); - try { - check(caps.glLightModelf).invokeExact(pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glLightModelf") + default void lightModelf(int pname, float param) { + throw new ContextException(); } - public static void lightModelfv(int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glLightModelfv).invokeExact(pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glLightModelfv") + default void lightModelfv(int pname, MemorySegment params) { + throw new ContextException(); } - public static void lightModelfv(SegmentAllocator allocator, int pname, float[] params) { - lightModelfv(pname, allocator.allocateFrom(JAVA_FLOAT, params)); + @Entrypoint("glLightModelfv") + default void lightModelfv(SegmentAllocator allocator, int pname, float[] params) { + throw new ContextException(); } - public static void lightModeli(int pname, int param) { - var caps = getCapabilities(); - try { - check(caps.glLightModeli).invokeExact(pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glLightModeli") + default void lightModeli(int pname, int param) { + throw new ContextException(); } - public static void lightModeliv(int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glLightModeliv).invokeExact(pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glLightModeliv") + default void lightModeliv(int pname, MemorySegment params) { + throw new ContextException(); } - public static void lightModeliv(SegmentAllocator allocator, int pname, int[] params) { - lightModeliv(pname, allocator.allocateFrom(JAVA_INT, params)); + @Entrypoint("glLightModeliv") + default void lightModeliv(SegmentAllocator allocator, int pname, int[] params) { + throw new ContextException(); } - public static void lightf(int light, int pname, float param) { - var caps = getCapabilities(); - try { - check(caps.glLightf).invokeExact(light, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glLightf") + default void lightf(int light, int pname, float param) { + throw new ContextException(); } - public static void lightfv(int light, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glLightfv).invokeExact(light, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glLightfv") + default void lightfv(int light, int pname, MemorySegment params) { + throw new ContextException(); } - public static void lightfv(SegmentAllocator allocator, int light, int pname, float[] params) { - lightfv(light, pname, allocator.allocateFrom(JAVA_FLOAT, params)); + @Entrypoint("glLightfv") + default void lightfv(SegmentAllocator allocator, int light, int pname, float[] params) { + throw new ContextException(); } - public static void lighti(int light, int pname, int param) { - var caps = getCapabilities(); - try { - check(caps.glLighti).invokeExact(light, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glLighti") + default void lighti(int light, int pname, int param) { + throw new ContextException(); } - public static void lightiv(int light, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glLightiv).invokeExact(light, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glLightiv") + default void lightiv(int light, int pname, MemorySegment params) { + throw new ContextException(); } - public static void lightiv(SegmentAllocator allocator, int light, int pname, int[] params) { - lightiv(light, pname, allocator.allocateFrom(JAVA_INT, params)); + @Entrypoint("glLightiv") + default void lightiv(SegmentAllocator allocator, int light, int pname, int[] params) { + throw new ContextException(); } - public static void lineStipple(int factor, short pattern) { - var caps = getCapabilities(); - try { - check(caps.glLineStipple).invokeExact(factor, pattern); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glLineStipple") + default void lineStipple(int factor, short pattern) { + throw new ContextException(); } - public static void listBase(int base) { - var caps = getCapabilities(); - try { - check(caps.glListBase).invokeExact(base); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glListBase") + default void listBase(int base) { + throw new ContextException(); } - public static void loadIdentity() { - var caps = getCapabilities(); - try { - check(caps.glLoadIdentity).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glLoadIdentity") + default void loadIdentity() { + throw new ContextException(); } - public static void loadMatrixd(MemorySegment m) { - var caps = getCapabilities(); - try { - check(caps.glLoadMatrixd).invokeExact(m); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glLoadMatrixd") + default void loadMatrixd(MemorySegment m) { + throw new ContextException(); } - public static void loadMatrixd(SegmentAllocator allocator, double[] m) { - loadMatrixd(allocator.allocateFrom(JAVA_DOUBLE, m)); + @Entrypoint("glLoadMatrixd") + default void loadMatrixd(SegmentAllocator allocator, double[] m) { + throw new ContextException(); } - public static void loadMatrixf(MemorySegment m) { - var caps = getCapabilities(); - try { - check(caps.glLoadMatrixf).invokeExact(m); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glLoadMatrixf") + default void loadMatrixf(MemorySegment m) { + throw new ContextException(); } - public static void loadMatrixf(SegmentAllocator allocator, float[] m) { - loadMatrixf(allocator.allocateFrom(JAVA_FLOAT, m)); + @Entrypoint("glLoadMatrixf") + default void loadMatrixf(SegmentAllocator allocator, float[] m) { + throw new ContextException(); } - public static void loadName(int name) { - var caps = getCapabilities(); - try { - check(caps.glLoadName).invokeExact(name); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glLoadName") + default void loadName(int name) { + throw new ContextException(); } - public static void map1d(int target, double u1, double u2, int stride, int order, MemorySegment points) { - var caps = getCapabilities(); - try { - check(caps.glMap1d).invokeExact(target, u1, u2, stride, order, points); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMap1d") + default void map1d(int target, double u1, double u2, int stride, int order, MemorySegment points) { + throw new ContextException(); } - public static void map1d(SegmentAllocator allocator, int target, double u1, double u2, int stride, int order, double[] points) { - map1d(target, u1, u2, stride, order, allocator.allocateFrom(JAVA_DOUBLE, points)); + @Entrypoint("glMap1d") + default void map1d(SegmentAllocator allocator, int target, double u1, double u2, int stride, int order, double[] points) { + throw new ContextException(); } - public static void map1f(int target, float u1, float u2, int stride, int order, MemorySegment points) { - var caps = getCapabilities(); - try { - check(caps.glMap1f).invokeExact(target, u1, u2, stride, order, points); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMap1f") + default void map1f(int target, float u1, float u2, int stride, int order, MemorySegment points) { + throw new ContextException(); } - public static void map1f(SegmentAllocator allocator, int target, float u1, float u2, int stride, int order, float[] points) { - map1f(target, u1, u2, stride, order, allocator.allocateFrom(JAVA_FLOAT, points)); + @Entrypoint("glMap1f") + default void map1f(SegmentAllocator allocator, int target, float u1, float u2, int stride, int order, float[] points) { + throw new ContextException(); } - public static void map2d(int target, double u1, double u2, int ustride, int uorder, double v1, double v2, int vstride, int vorder, MemorySegment points) { - var caps = getCapabilities(); - try { - check(caps.glMap2d).invokeExact(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMap2d") + default void map2d(int target, double u1, double u2, int ustride, int uorder, double v1, double v2, int vstride, int vorder, MemorySegment points) { + throw new ContextException(); } - public static void map2d(SegmentAllocator allocator, int target, double u1, double u2, int ustride, int uorder, double v1, double v2, int vstride, int vorder, double[] points) { - map2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, allocator.allocateFrom(JAVA_DOUBLE, points)); + + @Entrypoint("glMap2d") + default void map2d(SegmentAllocator allocator, int target, double u1, double u2, int ustride, int uorder, double v1, double v2, int vstride, int vorder, double[] points) { + throw new ContextException(); } - public static void map2f(int target, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, MemorySegment points) { - var caps = getCapabilities(); - try { - check(caps.glMap2f).invokeExact(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMap2f") + default void map2f(int target, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, MemorySegment points) { + throw new ContextException(); } - public static void map2f(SegmentAllocator allocator, int target, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, float[] points) { - map2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, allocator.allocateFrom(JAVA_FLOAT, points)); + @Entrypoint("glMap2f") + default void map2f(SegmentAllocator allocator, int target, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, float[] points) { + throw new ContextException(); } - public static void mapGrid1d(int un, double u1, double u2) { - var caps = getCapabilities(); - try { - check(caps.glMapGrid1d).invokeExact(un, u1, u2); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMapGrid1d") + default void mapGrid1d(int un, double u1, double u2) { + throw new ContextException(); } - public static void mapGrid1f(int un, float u1, float u2) { - var caps = getCapabilities(); - try { - check(caps.glMapGrid1f).invokeExact(un, u1, u2); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMapGrid1f") + default void mapGrid1f(int un, float u1, float u2) { + throw new ContextException(); } - public static void mapGrid2d(int un, double u1, double u2, int vn, double v1, double v2) { - var caps = getCapabilities(); - try { - check(caps.glMapGrid2d).invokeExact(un, u1, u2, vn, v1, v2); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMapGrid2d") + default void mapGrid2d(int un, double u1, double u2, int vn, double v1, double v2) { + throw new ContextException(); } - public static void mapGrid2f(int un, float u1, float u2, int vn, float v1, float v2) { - var caps = getCapabilities(); - try { - check(caps.glMapGrid2f).invokeExact(un, u1, u2, vn, v1, v2); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMapGrid2f") + default void mapGrid2f(int un, float u1, float u2, int vn, float v1, float v2) { + throw new ContextException(); } - public static void materialf(int face, int pname, float param) { - var caps = getCapabilities(); - try { - check(caps.glMaterialf).invokeExact(face, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMaterialf") + default void materialf(int face, int pname, float param) { + throw new ContextException(); } - public static void materialfv(int face, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glMaterialfv).invokeExact(face, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMaterialfv") + default void materialfv(int face, int pname, MemorySegment params) { + throw new ContextException(); } - public static void materialfv(SegmentAllocator allocator, int face, int pname, float[] params) { - materialfv(face, pname, allocator.allocateFrom(JAVA_FLOAT, params)); + @Entrypoint("glMaterialfv") + default void materialfv(SegmentAllocator allocator, int face, int pname, float[] params) { + throw new ContextException(); } - public static void materiali(int face, int pname, int param) { - var caps = getCapabilities(); - try { - check(caps.glMateriali).invokeExact(face, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMateriali") + default void materiali(int face, int pname, int param) { + throw new ContextException(); } - public static void materialiv(int face, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glMaterialiv).invokeExact(face, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMaterialiv") + default void materialiv(int face, int pname, MemorySegment params) { + throw new ContextException(); } - public static void materialiv(SegmentAllocator allocator, int face, int pname, int[] params) { - materialiv(face, pname, allocator.allocateFrom(JAVA_INT, params)); + @Entrypoint("glMaterialiv") + default void materialiv(SegmentAllocator allocator, int face, int pname, int[] params) { + throw new ContextException(); } - public static void matrixMode(int mode) { - var caps = getCapabilities(); - try { - check(caps.glMatrixMode).invokeExact(mode); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMatrixMode") + default void matrixMode(int mode) { + throw new ContextException(); } - public static void multMatrixd(MemorySegment m) { - var caps = getCapabilities(); - try { - check(caps.glMultMatrixd).invokeExact(m); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultMatrixd") + default void multMatrixd(MemorySegment m) { + throw new ContextException(); } - public static void multMatrixd(SegmentAllocator allocator, double[] m) { - multMatrixd(allocator.allocateFrom(JAVA_DOUBLE, m)); + @Entrypoint("glMultMatrixd") + default void multMatrixd(SegmentAllocator allocator, double[] m) { + throw new ContextException(); } - public static void multMatrixf(MemorySegment m) { - var caps = getCapabilities(); - try { - check(caps.glMultMatrixf).invokeExact(m); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultMatrixf") + default void multMatrixf(MemorySegment m) { + throw new ContextException(); } - public static void multMatrixf(SegmentAllocator allocator, float[] m) { - multMatrixf(allocator.allocateFrom(JAVA_FLOAT, m)); + @Entrypoint("glMultMatrixf") + default void multMatrixf(SegmentAllocator allocator, float[] m) { + throw new ContextException(); } - public static void newList(int list, int mode) { - var caps = getCapabilities(); - try { - check(caps.glNewList).invokeExact(list, mode); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNewList") + default void newList(int list, int mode) { + throw new ContextException(); } - public static void normal3b(byte nx, byte ny, byte nz) { - var caps = getCapabilities(); - try { - check(caps.glNormal3b).invokeExact(nx, ny, nz); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNormal3b") + default void normal3b(byte nx, byte ny, byte nz) { + throw new ContextException(); } - public static void normal3bv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glNormal3bv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNormal3bv") + default void normal3bv(MemorySegment v) { + throw new ContextException(); } - public static void normal3bv(SegmentAllocator allocator, byte[] v) { - normal3bv(allocator.allocateFrom(JAVA_BYTE, v)); + @Entrypoint("glNormal3bv") + default void normal3bv(SegmentAllocator allocator, byte[] v) { + throw new ContextException(); } - public static void normal3d(double nx, double ny, double nz) { - var caps = getCapabilities(); - try { - check(caps.glNormal3d).invokeExact(nx, ny, nz); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNormal3d") + default void normal3d(double nx, double ny, double nz) { + throw new ContextException(); } - public static void normal3dv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glNormal3dv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNormal3dv") + default void normal3dv(MemorySegment v) { + throw new ContextException(); } - public static void normal3dv(SegmentAllocator allocator, double[] v) { - normal3dv(allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glNormal3dv") + default void normal3dv(SegmentAllocator allocator, double[] v) { + throw new ContextException(); } - public static void normal3f(float nx, float ny, float nz) { - var caps = getCapabilities(); - try { - check(caps.glNormal3f).invokeExact(nx, ny, nz); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNormal3f") + default void normal3f(float nx, float ny, float nz) { + throw new ContextException(); } - public static void normal3fv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glNormal3fv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNormal3fv") + default void normal3fv(MemorySegment v) { + throw new ContextException(); } - public static void normal3fv(SegmentAllocator allocator, float[] v) { - normal3fv(allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glNormal3fv") + default void normal3fv(SegmentAllocator allocator, float[] v) { + throw new ContextException(); } - public static void normal3i(int nx, int ny, int nz) { - var caps = getCapabilities(); - try { - check(caps.glNormal3i).invokeExact(nx, ny, nz); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNormal3i") + default void normal3i(int nx, int ny, int nz) { + throw new ContextException(); } - public static void normal3iv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glNormal3iv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNormal3iv") + default void normal3iv(MemorySegment v) { + throw new ContextException(); } - public static void normal3iv(SegmentAllocator allocator, int[] v) { - normal3iv(allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glNormal3iv") + default void normal3iv(SegmentAllocator allocator, int[] v) { + throw new ContextException(); } - public static void normal3s(short nx, short ny, short nz) { - var caps = getCapabilities(); - try { - check(caps.glNormal3s).invokeExact(nx, ny, nz); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNormal3s") + default void normal3s(short nx, short ny, short nz) { + throw new ContextException(); } - public static void normal3sv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glNormal3sv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNormal3sv") + default void normal3sv(MemorySegment v) { + throw new ContextException(); } - public static void normal3sv(SegmentAllocator allocator, short[] v) { - normal3sv(allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glNormal3sv") + default void normal3sv(SegmentAllocator allocator, short[] v) { + throw new ContextException(); } - public static void ortho(double left, double right, double bottom, double top, double zNear, double zFar) { - var caps = getCapabilities(); - try { - check(caps.glOrtho).invokeExact(left, right, bottom, top, zNear, zFar); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glOrtho") + default void ortho(double left, double right, double bottom, double top, double zNear, double zFar) { + throw new ContextException(); } - public static void passThrough(float token) { - var caps = getCapabilities(); - try { - check(caps.glPassThrough).invokeExact(token); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPassThrough") + default void passThrough(float token) { + throw new ContextException(); } - public static void pixelMapfv(int map, int mapSize, MemorySegment values) { - var caps = getCapabilities(); - try { - check(caps.glPixelMapfv).invokeExact(map, mapSize, values); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPixelMapfv") + default void pixelMapfv(int map, int mapSize, MemorySegment values) { + throw new ContextException(); } - public static void pixelMapfv(SegmentAllocator allocator, int map, float[] values) { - pixelMapfv(map, values.length, allocator.allocateFrom(JAVA_FLOAT, values)); + @Skip + default void pixelMapfv(SegmentAllocator allocator, int map, float[] values) { + pixelMapfv(map, values.length, Marshal.marshal(allocator, values)); } - public static void pixelMapuiv(int map, int mapSize, MemorySegment values) { - var caps = getCapabilities(); - try { - check(caps.glPixelMapuiv).invokeExact(map, mapSize, values); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPixelMapuiv") + default void pixelMapuiv(int map, int mapSize, MemorySegment values) { + throw new ContextException(); } - public static void pixelMapuiv(SegmentAllocator allocator, int map, int[] values) { - pixelMapuiv(map, values.length, allocator.allocateFrom(JAVA_INT, values)); + @Skip + default void pixelMapuiv(SegmentAllocator allocator, int map, int[] values) { + pixelMapuiv(map, values.length, Marshal.marshal(allocator, values)); } - public static void pixelMapusv(int map, int mapSize, MemorySegment values) { - var caps = getCapabilities(); - try { - check(caps.glPixelMapusv).invokeExact(map, mapSize, values); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPixelMapusv") + default void pixelMapusv(int map, int mapSize, MemorySegment values) { + throw new ContextException(); } - public static void pixelMapusv(SegmentAllocator allocator, int map, short[] values) { - pixelMapusv(map, values.length, allocator.allocateFrom(JAVA_SHORT, values)); + @Skip + default void pixelMapusv(SegmentAllocator allocator, int map, short[] values) { + pixelMapusv(map, values.length, Marshal.marshal(allocator, values)); } - public static void pixelTransferf(int pname, float param) { - var caps = getCapabilities(); - try { - check(caps.glPixelTransferf).invokeExact(pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPixelTransferf") + default void pixelTransferf(int pname, float param) { + throw new ContextException(); } - public static void pixelTransferi(int pname, int param) { - var caps = getCapabilities(); - try { - check(caps.glPixelTransferi).invokeExact(pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPixelTransferi") + default void pixelTransferi(int pname, int param) { + throw new ContextException(); } - public static void pixelZoom(float xfactor, float yfactor) { - var caps = getCapabilities(); - try { - check(caps.glPixelZoom).invokeExact(xfactor, yfactor); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPixelZoom") + default void pixelZoom(float xfactor, float yfactor) { + throw new ContextException(); } - public static void polygonStipple(MemorySegment mask) { - var caps = getCapabilities(); - try { - check(caps.glPolygonStipple).invokeExact(mask); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPolygonStipple") + default void polygonStipple(MemorySegment mask) { + throw new ContextException(); } - public static void polygonStipple(SegmentAllocator allocator, byte[] mask) { - polygonStipple(allocator.allocateFrom(JAVA_BYTE, mask)); + @Entrypoint("glPolygonStipple") + default void polygonStipple(SegmentAllocator allocator, byte[] mask) { + throw new ContextException(); } - public static void popAttrib() { - var caps = getCapabilities(); - try { - check(caps.glPopAttrib).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPopAttrib") + default void popAttrib() { + throw new ContextException(); } - public static void popMatrix() { - var caps = getCapabilities(); - try { - check(caps.glPopMatrix).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPopMatrix") + default void popMatrix() { + throw new ContextException(); } - public static void popName() { - var caps = getCapabilities(); - try { - check(caps.glPopName).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPopName") + default void popName() { + throw new ContextException(); } - public static void pushAttrib(int mask) { - var caps = getCapabilities(); - try { - check(caps.glPushAttrib).invokeExact(mask); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPushAttrib") + default void pushAttrib(int mask) { + throw new ContextException(); } - public static void pushMatrix() { - var caps = getCapabilities(); - try { - check(caps.glPushMatrix).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPushMatrix") + default void pushMatrix() { + throw new ContextException(); } - public static void pushName(int name) { - var caps = getCapabilities(); - try { - check(caps.glPushName).invokeExact(name); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPushName") + default void pushName(int name) { + throw new ContextException(); } - public static void rasterPos2d(double x, double y) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos2d).invokeExact(x, y); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos2d") + default void rasterPos2d(double x, double y) { + throw new ContextException(); } - public static void rasterPos2dv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos2dv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos2dv") + default void rasterPos2dv(MemorySegment v) { + throw new ContextException(); } - public static void rasterPos2dv(SegmentAllocator allocator, double[] v) { - rasterPos2dv(allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glRasterPos2dv") + default void rasterPos2dv(SegmentAllocator allocator, double[] v) { + throw new ContextException(); } - public static void rasterPos2f(float x, float y) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos2f).invokeExact(x, y); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos2f") + default void rasterPos2f(float x, float y) { + throw new ContextException(); } - public static void rasterPos2fv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos2fv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos2fv") + default void rasterPos2fv(MemorySegment v) { + throw new ContextException(); } - public static void rasterPos2fv(SegmentAllocator allocator, float[] v) { - rasterPos2fv(allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glRasterPos2fv") + default void rasterPos2fv(SegmentAllocator allocator, float[] v) { + throw new ContextException(); } - public static void rasterPos2i(int x, int y) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos2i).invokeExact(x, y); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos2i") + default void rasterPos2i(int x, int y) { + throw new ContextException(); } - public static void rasterPos2iv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos2iv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos2iv") + default void rasterPos2iv(MemorySegment v) { + throw new ContextException(); } - public static void rasterPos2iv(SegmentAllocator allocator, int[] v) { - rasterPos2iv(allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glRasterPos2iv") + default void rasterPos2iv(SegmentAllocator allocator, int[] v) { + throw new ContextException(); } - public static void rasterPos2s(short x, short y) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos2s).invokeExact(x, y); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos2s") + default void rasterPos2s(short x, short y) { + throw new ContextException(); } - public static void rasterPos2sv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos2sv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos2sv") + default void rasterPos2sv(MemorySegment v) { + throw new ContextException(); } - public static void rasterPos2sv(SegmentAllocator allocator, short[] v) { - rasterPos2sv(allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glRasterPos2sv") + default void rasterPos2sv(SegmentAllocator allocator, short[] v) { + throw new ContextException(); } - public static void rasterPos3d(double x, double y, double z) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos3d).invokeExact(x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos3d") + default void rasterPos3d(double x, double y, double z) { + throw new ContextException(); } - public static void rasterPos3dv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos3dv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos3dv") + default void rasterPos3dv(MemorySegment v) { + throw new ContextException(); } - public static void rasterPos3dv(SegmentAllocator allocator, double[] v) { - rasterPos3dv(allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glRasterPos3dv") + default void rasterPos3dv(SegmentAllocator allocator, double[] v) { + throw new ContextException(); } - public static void rasterPos3f(float x, float y, float z) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos3f).invokeExact(x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos3f") + default void rasterPos3f(float x, float y, float z) { + throw new ContextException(); } - public static void rasterPos3fv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos3fv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos3fv") + default void rasterPos3fv(MemorySegment v) { + throw new ContextException(); } - public static void rasterPos3fv(SegmentAllocator allocator, float[] v) { - rasterPos3fv(allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glRasterPos3fv") + default void rasterPos3fv(SegmentAllocator allocator, float[] v) { + throw new ContextException(); } - public static void rasterPos3i(int x, int y, int z) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos3i).invokeExact(x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos3i") + default void rasterPos3i(int x, int y, int z) { + throw new ContextException(); } - public static void rasterPos3iv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos3iv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos3iv") + default void rasterPos3iv(MemorySegment v) { + throw new ContextException(); } - public static void rasterPos3iv(SegmentAllocator allocator, int[] v) { - rasterPos3iv(allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glRasterPos3iv") + default void rasterPos3iv(SegmentAllocator allocator, int[] v) { + throw new ContextException(); } - public static void rasterPos3s(short x, short y, short z) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos3s).invokeExact(x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos3s") + default void rasterPos3s(short x, short y, short z) { + throw new ContextException(); } - public static void rasterPos3sv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos3sv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos3sv") + default void rasterPos3sv(MemorySegment v) { + throw new ContextException(); } - public static void rasterPos3sv(SegmentAllocator allocator, short[] v) { - rasterPos3sv(allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glRasterPos3sv") + default void rasterPos3sv(SegmentAllocator allocator, short[] v) { + throw new ContextException(); } - public static void rasterPos4d(double x, double y, double z, double w) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos4d).invokeExact(x, y, z, w); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos4d") + default void rasterPos4d(double x, double y, double z, double w) { + throw new ContextException(); } - public static void rasterPos4dv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos4dv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos4dv") + default void rasterPos4dv(MemorySegment v) { + throw new ContextException(); } - public static void rasterPos4dv(SegmentAllocator allocator, double[] v) { - rasterPos4dv(allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glRasterPos4dv") + default void rasterPos4dv(SegmentAllocator allocator, double[] v) { + throw new ContextException(); } - public static void rasterPos4f(float x, float y, float z, float w) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos4f).invokeExact(x, y, z, w); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos4f") + default void rasterPos4f(float x, float y, float z, float w) { + throw new ContextException(); } - public static void rasterPos4fv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos4fv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos4fv") + default void rasterPos4fv(MemorySegment v) { + throw new ContextException(); } - public static void rasterPos4fv(SegmentAllocator allocator, float[] v) { - rasterPos4fv(allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glRasterPos4fv") + default void rasterPos4fv(SegmentAllocator allocator, float[] v) { + throw new ContextException(); } - public static void rasterPos4i(int x, int y, int z, int w) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos4i).invokeExact(x, y, z, w); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos4i") + default void rasterPos4i(int x, int y, int z, int w) { + throw new ContextException(); } - public static void rasterPos4iv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos4iv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos4iv") + default void rasterPos4iv(MemorySegment v) { + throw new ContextException(); } - public static void rasterPos4iv(SegmentAllocator allocator, int[] v) { - rasterPos4iv(allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glRasterPos4iv") + default void rasterPos4iv(SegmentAllocator allocator, int[] v) { + throw new ContextException(); } - public static void rasterPos4s(short x, short y, short z, short w) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos4s).invokeExact(x, y, z, w); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos4s") + default void rasterPos4s(short x, short y, short z, short w) { + throw new ContextException(); } - public static void rasterPos4sv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glRasterPos4sv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRasterPos4sv") + default void rasterPos4sv(MemorySegment v) { + throw new ContextException(); } - public static void rasterPos4sv(SegmentAllocator allocator, short[] v) { - rasterPos4sv(allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glRasterPos4sv") + default void rasterPos4sv(SegmentAllocator allocator, short[] v) { + throw new ContextException(); } - public static void rectd(double x1, double y1, double x2, double y2) { - var caps = getCapabilities(); - try { - check(caps.glRectd).invokeExact(x1, y1, x2, y2); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRectd") + default void rectd(double x1, double y1, double x2, double y2) { + throw new ContextException(); } - public static void rectdv(MemorySegment v1, MemorySegment v2) { - var caps = getCapabilities(); - try { - check(caps.glRectdv).invokeExact(v1, v2); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRectdv") + default void rectdv(MemorySegment v1, MemorySegment v2) { + throw new ContextException(); } - public static void rectdv(SegmentAllocator allocator, double[] v1, double[] v2) { - rectdv(allocator.allocateFrom(JAVA_DOUBLE, v1), allocator.allocateFrom(JAVA_DOUBLE, v2)); + @Entrypoint("glRectdv") + default void rectdv(SegmentAllocator allocator, double[] v1, double[] v2) { + throw new ContextException(); } - public static void rectf(float x1, float y1, float x2, float y2) { - var caps = getCapabilities(); - try { - check(caps.glRectf).invokeExact(x1, y1, x2, y2); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRectf") + default void rectf(float x1, float y1, float x2, float y2) { + throw new ContextException(); } - public static void rectfv(MemorySegment v1, MemorySegment v2) { - var caps = getCapabilities(); - try { - check(caps.glRectfv).invokeExact(v1, v2); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRectfv") + default void rectfv(MemorySegment v1, MemorySegment v2) { + throw new ContextException(); } - public static void rectfv(SegmentAllocator allocator, float[] v1, float[] v2) { - rectfv(allocator.allocateFrom(JAVA_FLOAT, v1), allocator.allocateFrom(JAVA_FLOAT, v2)); + @Entrypoint("glRectfv") + default void rectfv(SegmentAllocator allocator, float[] v1, float[] v2) { + throw new ContextException(); } - public static void recti(int x1, int y1, int x2, int y2) { - var caps = getCapabilities(); - try { - check(caps.glRecti).invokeExact(x1, y1, x2, y2); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRecti") + default void recti(int x1, int y1, int x2, int y2) { + throw new ContextException(); } - public static void rectiv(MemorySegment v1, MemorySegment v2) { - var caps = getCapabilities(); - try { - check(caps.glRectiv).invokeExact(v1, v2); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRectiv") + default void rectiv(MemorySegment v1, MemorySegment v2) { + throw new ContextException(); } - public static void rectiv(SegmentAllocator allocator, int[] v1, int[] v2) { - rectiv(allocator.allocateFrom(JAVA_INT, v1), allocator.allocateFrom(JAVA_INT, v2)); + @Entrypoint("glRectiv") + default void rectiv(SegmentAllocator allocator, int[] v1, int[] v2) { + throw new ContextException(); } - public static void rects(short x1, short y1, short x2, short y2) { - var caps = getCapabilities(); - try { - check(caps.glRects).invokeExact(x1, y1, x2, y2); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRects") + default void rects(short x1, short y1, short x2, short y2) { + throw new ContextException(); } - public static void rectsv(MemorySegment v1, MemorySegment v2) { - var caps = getCapabilities(); - try { - check(caps.glRectsv).invokeExact(v1, v2); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRectsv") + default void rectsv(MemorySegment v1, MemorySegment v2) { + throw new ContextException(); } - public static void rectsv(SegmentAllocator allocator, short[] v1, short[] v2) { - rectsv(allocator.allocateFrom(JAVA_SHORT, v1), allocator.allocateFrom(JAVA_SHORT, v2)); + @Entrypoint("glRectsv") + default void rectsv(SegmentAllocator allocator, short[] v1, short[] v2) { + throw new ContextException(); } - public static int renderMode(int mode) { - var caps = getCapabilities(); - try { - return (int) check(caps.glRenderMode).invokeExact(mode); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRenderMode") + default int renderMode(int mode) { + throw new ContextException(); } - public static void rotated(double angle, double x, double y, double z) { - var caps = getCapabilities(); - try { - check(caps.glRotated).invokeExact(angle, x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRotated") + default void rotated(double angle, double x, double y, double z) { + throw new ContextException(); } - public static void rotatef(float angle, float x, float y, float z) { - var caps = getCapabilities(); - try { - check(caps.glRotatef).invokeExact(angle, x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRotatef") + default void rotatef(float angle, float x, float y, float z) { + throw new ContextException(); } - public static void scaled(double x, double y, double z) { - var caps = getCapabilities(); - try { - check(caps.glScaled).invokeExact(x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glScaled") + default void scaled(double x, double y, double z) { + throw new ContextException(); } - public static void scalef(float x, float y, float z) { - var caps = getCapabilities(); - try { - check(caps.glScalef).invokeExact(x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glScalef") + default void scalef(float x, float y, float z) { + throw new ContextException(); } - public static void selectBuffer(int size, MemorySegment buffer) { - var caps = getCapabilities(); - try { - check(caps.glSelectBuffer).invokeExact(size, buffer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSelectBuffer") + default void selectBuffer(int size, MemorySegment buffer) { + throw new ContextException(); } - public static void selectBuffer(SegmentAllocator allocator, int[] buffer) { - var seg = allocator.allocateFrom(JAVA_INT, buffer); - selectBuffer(buffer.length, seg); - RuntimeHelper.toArray(seg, buffer); + @Entrypoint("glSelectBuffer") + default void selectBuffer(SegmentAllocator allocator, @Ref int[] buffer) { + throw new ContextException(); } - public static void shadeModel(int mode) { - var caps = getCapabilities(); - try { - check(caps.glShadeModel).invokeExact(mode); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glShadeModel") + default void shadeModel(int mode) { + throw new ContextException(); } - public static void texCoord1d(double s) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord1d).invokeExact(s); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord1d") + default void texCoord1d(double s) { + throw new ContextException(); } - public static void texCoord1dv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord1dv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord1dv") + default void texCoord1dv(MemorySegment v) { + throw new ContextException(); } - public static void texCoord1dv(SegmentAllocator allocator, double[] v) { - texCoord1dv(allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glTexCoord1dv") + default void texCoord1dv(SegmentAllocator allocator, double[] v) { + throw new ContextException(); } - public static void texCoord1f(float s) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord1f).invokeExact(s); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord1f") + default void texCoord1f(float s) { + throw new ContextException(); } - public static void texCoord1fv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord1fv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord1fv") + default void texCoord1fv(MemorySegment v) { + throw new ContextException(); } - public static void texCoord1fv(SegmentAllocator allocator, float[] v) { - texCoord1fv(allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glTexCoord1fv") + default void texCoord1fv(SegmentAllocator allocator, float[] v) { + throw new ContextException(); } - public static void texCoord1i(int s) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord1i).invokeExact(s); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord1i") + default void texCoord1i(int s) { + throw new ContextException(); } - public static void texCoord1iv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord1iv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord1iv") + default void texCoord1iv(MemorySegment v) { + throw new ContextException(); } - public static void texCoord1iv(SegmentAllocator allocator, int[] v) { - texCoord1iv(allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glTexCoord1iv") + default void texCoord1iv(SegmentAllocator allocator, int[] v) { + throw new ContextException(); } - public static void texCoord1s(short s) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord1s).invokeExact(s); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord1s") + default void texCoord1s(short s) { + throw new ContextException(); } - public static void texCoord1sv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord1sv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord1sv") + default void texCoord1sv(MemorySegment v) { + throw new ContextException(); } - public static void texCoord1sv(SegmentAllocator allocator, short[] v) { - texCoord1sv(allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glTexCoord1sv") + default void texCoord1sv(SegmentAllocator allocator, short[] v) { + throw new ContextException(); } - public static void texCoord2d(double s, double t) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord2d).invokeExact(s, t); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord2d") + default void texCoord2d(double s, double t) { + throw new ContextException(); } - public static void texCoord2dv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord2dv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord2dv") + default void texCoord2dv(MemorySegment v) { + throw new ContextException(); } - public static void texCoord2dv(SegmentAllocator allocator, double[] v) { - texCoord2dv(allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glTexCoord2dv") + default void texCoord2dv(SegmentAllocator allocator, double[] v) { + throw new ContextException(); } - public static void texCoord2f(float s, float t) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord2f).invokeExact(s, t); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord2f") + default void texCoord2f(float s, float t) { + throw new ContextException(); } - public static void texCoord2fv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord2fv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord2fv") + default void texCoord2fv(MemorySegment v) { + throw new ContextException(); } - public static void texCoord2fv(SegmentAllocator allocator, float[] v) { - texCoord2fv(allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glTexCoord2fv") + default void texCoord2fv(SegmentAllocator allocator, float[] v) { + throw new ContextException(); } - public static void texCoord2i(int s, int t) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord2i).invokeExact(s, t); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord2i") + default void texCoord2i(int s, int t) { + throw new ContextException(); } - public static void texCoord2iv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord2iv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord2iv") + default void texCoord2iv(MemorySegment v) { + throw new ContextException(); } - public static void texCoord2iv(SegmentAllocator allocator, int[] v) { - texCoord2iv(allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glTexCoord2iv") + default void texCoord2iv(SegmentAllocator allocator, int[] v) { + throw new ContextException(); } - public static void texCoord2s(short s, short t) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord2s).invokeExact(s, t); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord2s") + default void texCoord2s(short s, short t) { + throw new ContextException(); } - public static void texCoord2sv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord2sv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord2sv") + default void texCoord2sv(MemorySegment v) { + throw new ContextException(); } - public static void texCoord2sv(SegmentAllocator allocator, short[] v) { - texCoord2sv(allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glTexCoord2sv") + default void texCoord2sv(SegmentAllocator allocator, short[] v) { + throw new ContextException(); } - public static void texCoord3d(double s, double t, double r) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord3d).invokeExact(s, t, r); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord3d") + default void texCoord3d(double s, double t, double r) { + throw new ContextException(); } - public static void texCoord3dv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord3dv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord3dv") + default void texCoord3dv(MemorySegment v) { + throw new ContextException(); } - public static void texCoord3dv(SegmentAllocator allocator, double[] v) { - texCoord3dv(allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glTexCoord3dv") + default void texCoord3dv(SegmentAllocator allocator, double[] v) { + throw new ContextException(); } - public static void texCoord3f(float s, float t, float r) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord3f).invokeExact(s, t, r); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord3f") + default void texCoord3f(float s, float t, float r) { + throw new ContextException(); } - public static void texCoord3fv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord3fv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord3fv") + default void texCoord3fv(MemorySegment v) { + throw new ContextException(); } - public static void texCoord3fv(SegmentAllocator allocator, float[] v) { - texCoord3fv(allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glTexCoord3fv") + default void texCoord3fv(SegmentAllocator allocator, float[] v) { + throw new ContextException(); } - public static void texCoord3i(int s, int t, int r) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord3i).invokeExact(s, t, r); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord3i") + default void texCoord3i(int s, int t, int r) { + throw new ContextException(); } - public static void texCoord3iv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord3iv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord3iv") + default void texCoord3iv(MemorySegment v) { + throw new ContextException(); } - public static void texCoord3iv(SegmentAllocator allocator, int[] v) { - texCoord3iv(allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glTexCoord3iv") + default void texCoord3iv(SegmentAllocator allocator, int[] v) { + throw new ContextException(); } - public static void texCoord3s(short s, short t, short r) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord3s).invokeExact(s, t, r); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord3s") + default void texCoord3s(short s, short t, short r) { + throw new ContextException(); } - public static void texCoord3sv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord3sv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord3sv") + default void texCoord3sv(MemorySegment v) { + throw new ContextException(); } - public static void texCoord3sv(SegmentAllocator allocator, short[] v) { - texCoord3sv(allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glTexCoord3sv") + default void texCoord3sv(SegmentAllocator allocator, short[] v) { + throw new ContextException(); } - public static void texCoord4d(double s, double t, double r, double q) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord4d).invokeExact(s, t, r, q); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord4d") + default void texCoord4d(double s, double t, double r, double q) { + throw new ContextException(); } - public static void texCoord4dv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord4dv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord4dv") + default void texCoord4dv(MemorySegment v) { + throw new ContextException(); } - public static void texCoord4dv(SegmentAllocator allocator, double[] v) { - texCoord4dv(allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glTexCoord4dv") + default void texCoord4dv(SegmentAllocator allocator, double[] v) { + throw new ContextException(); } - public static void texCoord4f(float s, float t, float r, float q) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord4f).invokeExact(s, t, r, q); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord4f") + default void texCoord4f(float s, float t, float r, float q) { + throw new ContextException(); } - public static void texCoord4fv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord4fv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord4fv") + default void texCoord4fv(MemorySegment v) { + throw new ContextException(); } - public static void texCoord4fv(SegmentAllocator allocator, float[] v) { - texCoord4fv(allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glTexCoord4fv") + default void texCoord4fv(SegmentAllocator allocator, float[] v) { + throw new ContextException(); } - public static void texCoord4i(int s, int t, int r, int q) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord4i).invokeExact(s, t, r, q); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord4i") + default void texCoord4i(int s, int t, int r, int q) { + throw new ContextException(); } - public static void texCoord4iv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord4iv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord4iv") + default void texCoord4iv(MemorySegment v) { + throw new ContextException(); } - public static void texCoord4iv(SegmentAllocator allocator, int[] v) { - texCoord4iv(allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glTexCoord4iv") + default void texCoord4iv(SegmentAllocator allocator, int[] v) { + throw new ContextException(); } - public static void texCoord4s(short s, short t, short r, short q) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord4s).invokeExact(s, t, r, q); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord4s") + default void texCoord4s(short s, short t, short r, short q) { + throw new ContextException(); } - public static void texCoord4sv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glTexCoord4sv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoord4sv") + default void texCoord4sv(MemorySegment v) { + throw new ContextException(); } - public static void texCoord4sv(SegmentAllocator allocator, short[] v) { - texCoord4sv(allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glTexCoord4sv") + default void texCoord4sv(SegmentAllocator allocator, short[] v) { + throw new ContextException(); } - public static void texEnvf(int target, int pname, float param) { - var caps = getCapabilities(); - try { - check(caps.glTexEnvf).invokeExact(target, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexEnvf") + default void texEnvf(int target, int pname, float param) { + throw new ContextException(); } - public static void texEnvfv(int target, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glTexEnvfv).invokeExact(target, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexEnvfv") + default void texEnvfv(int target, int pname, MemorySegment params) { + throw new ContextException(); } - public static void texEnvfv(SegmentAllocator allocator, int target, int pname, float[] params) { - texEnvfv(target, pname, allocator.allocateFrom(JAVA_FLOAT, params)); + @Entrypoint("glTexEnvfv") + default void texEnvfv(SegmentAllocator allocator, int target, int pname, float[] params) { + throw new ContextException(); } - public static void texEnvi(int target, int pname, int param) { - var caps = getCapabilities(); - try { - check(caps.glTexEnvi).invokeExact(target, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexEnvi") + default void texEnvi(int target, int pname, int param) { + throw new ContextException(); } - public static void texEnviv(int target, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glTexEnviv).invokeExact(target, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexEnviv") + default void texEnviv(int target, int pname, MemorySegment params) { + throw new ContextException(); } - public static void texEnviv(SegmentAllocator allocator, int target, int pname, int[] params) { - texEnviv(target, pname, allocator.allocateFrom(JAVA_INT, params)); + @Entrypoint("glTexEnviv") + default void texEnviv(SegmentAllocator allocator, int target, int pname, int[] params) { + throw new ContextException(); } - public static void texGend(int coord, int pname, double param) { - var caps = getCapabilities(); - try { - check(caps.glTexGend).invokeExact(coord, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexGend") + default void texGend(int coord, int pname, double param) { + throw new ContextException(); } - public static void texGendv(int coord, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glTexGendv).invokeExact(coord, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexGendv") + default void texGendv(int coord, int pname, MemorySegment params) { + throw new ContextException(); } - public static void texGendv(SegmentAllocator allocator, int coord, int pname, double[] params) { - texGendv(coord, pname, allocator.allocateFrom(JAVA_DOUBLE, params)); + @Entrypoint("glTexGendv") + default void texGendv(SegmentAllocator allocator, int coord, int pname, double[] params) { + throw new ContextException(); } - public static void texGenf(int coord, int pname, float param) { - var caps = getCapabilities(); - try { - check(caps.glTexGenf).invokeExact(coord, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexGenf") + default void texGenf(int coord, int pname, float param) { + throw new ContextException(); } - public static void texGenfv(int coord, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glTexGenfv).invokeExact(coord, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexGenfv") + default void texGenfv(int coord, int pname, MemorySegment params) { + throw new ContextException(); } - public static void texGenfv(SegmentAllocator allocator, int coord, int pname, float[] params) { - texGenfv(coord, pname, allocator.allocateFrom(JAVA_FLOAT, params)); + @Entrypoint("glTexGenfv") + default void texGenfv(SegmentAllocator allocator, int coord, int pname, float[] params) { + throw new ContextException(); } - public static void texGeni(int coord, int pname, int param) { - var caps = getCapabilities(); - try { - check(caps.glTexGeni).invokeExact(coord, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexGeni") + default void texGeni(int coord, int pname, int param) { + throw new ContextException(); } - public static void texGeniv(int coord, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glTexGeniv).invokeExact(coord, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexGeniv") + default void texGeniv(int coord, int pname, MemorySegment params) { + throw new ContextException(); } - public static void texGeniv(SegmentAllocator allocator, int coord, int pname, int[] params) { - texGeniv(coord, pname, allocator.allocateFrom(JAVA_INT, params)); + @Entrypoint("glTexGeniv") + default void texGeniv(SegmentAllocator allocator, int coord, int pname, int[] params) { + throw new ContextException(); } - public static void translated(double x, double y, double z) { - var caps = getCapabilities(); - try { - check(caps.glTranslated).invokeExact(x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTranslated") + default void translated(double x, double y, double z) { + throw new ContextException(); } - public static void translatef(float x, float y, float z) { - var caps = getCapabilities(); - try { - check(caps.glTranslatef).invokeExact(x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTranslatef") + default void translatef(float x, float y, float z) { + throw new ContextException(); } - public static void vertex2d(double x, double y) { - var caps = getCapabilities(); - try { - check(caps.glVertex2d).invokeExact(x, y); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex2d") + default void vertex2d(double x, double y) { + throw new ContextException(); } - public static void vertex2dv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertex2dv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex2dv") + default void vertex2dv(MemorySegment v) { + throw new ContextException(); } - public static void vertex2dv(SegmentAllocator allocator, double[] v) { - vertex2dv(allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glVertex2dv") + default void vertex2dv(SegmentAllocator allocator, double[] v) { + throw new ContextException(); } - public static void vertex2f(float x, float y) { - var caps = getCapabilities(); - try { - check(caps.glVertex2f).invokeExact(x, y); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex2f") + default void vertex2f(float x, float y) { + throw new ContextException(); } - public static void vertex2fv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertex2fv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex2fv") + default void vertex2fv(MemorySegment v) { + throw new ContextException(); } - public static void vertex2fv(SegmentAllocator allocator, float[] v) { - vertex2fv(allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glVertex2fv") + default void vertex2fv(SegmentAllocator allocator, float[] v) { + throw new ContextException(); } - public static void vertex2i(int x, int y) { - var caps = getCapabilities(); - try { - check(caps.glVertex2i).invokeExact(x, y); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex2i") + default void vertex2i(int x, int y) { + throw new ContextException(); } - public static void vertex2iv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertex2iv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex2iv") + default void vertex2iv(MemorySegment v) { + throw new ContextException(); } - public static void vertex2iv(SegmentAllocator allocator, int[] v) { - vertex2iv(allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glVertex2iv") + default void vertex2iv(SegmentAllocator allocator, int[] v) { + throw new ContextException(); } - public static void vertex2s(short x, short y) { - var caps = getCapabilities(); - try { - check(caps.glVertex2s).invokeExact(x, y); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex2s") + default void vertex2s(short x, short y) { + throw new ContextException(); } - public static void vertex2sv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertex2sv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex2sv") + default void vertex2sv(MemorySegment v) { + throw new ContextException(); } - public static void vertex2sv(SegmentAllocator allocator, short[] v) { - vertex2sv(allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glVertex2sv") + default void vertex2sv(SegmentAllocator allocator, short[] v) { + throw new ContextException(); } - public static void vertex3d(double x, double y, double z) { - var caps = getCapabilities(); - try { - check(caps.glVertex3d).invokeExact(x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex3d") + default void vertex3d(double x, double y, double z) { + throw new ContextException(); } - public static void vertex3dv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertex3dv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex3dv") + default void vertex3dv(MemorySegment v) { + throw new ContextException(); } - public static void vertex3dv(SegmentAllocator allocator, double[] v) { - vertex3dv(allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glVertex3dv") + default void vertex3dv(SegmentAllocator allocator, double[] v) { + throw new ContextException(); } - public static void vertex3f(float x, float y, float z) { - var caps = getCapabilities(); - try { - check(caps.glVertex3f).invokeExact(x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex3f") + default void vertex3f(float x, float y, float z) { + throw new ContextException(); } - public static void vertex3fv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertex3fv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex3fv") + default void vertex3fv(MemorySegment v) { + throw new ContextException(); } - public static void vertex3fv(SegmentAllocator allocator, float[] v) { - vertex3fv(allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glVertex3fv") + default void vertex3fv(SegmentAllocator allocator, float[] v) { + throw new ContextException(); } - public static void vertex3i(int x, int y, int z) { - var caps = getCapabilities(); - try { - check(caps.glVertex3i).invokeExact(x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex3i") + default void vertex3i(int x, int y, int z) { + throw new ContextException(); } - public static void vertex3iv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertex3iv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex3iv") + default void vertex3iv(MemorySegment v) { + throw new ContextException(); } - public static void vertex3iv(SegmentAllocator allocator, int[] v) { - vertex3iv(allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glVertex3iv") + default void vertex3iv(SegmentAllocator allocator, int[] v) { + throw new ContextException(); } - public static void vertex3s(short x, short y, short z) { - var caps = getCapabilities(); - try { - check(caps.glVertex3s).invokeExact(x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex3s") + default void vertex3s(short x, short y, short z) { + throw new ContextException(); } - public static void vertex3sv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertex3sv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex3sv") + default void vertex3sv(MemorySegment v) { + throw new ContextException(); } - public static void vertex3sv(SegmentAllocator allocator, short[] v) { - vertex3sv(allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glVertex3sv") + default void vertex3sv(SegmentAllocator allocator, short[] v) { + throw new ContextException(); } - public static void vertex4d(double x, double y, double z, double w) { - var caps = getCapabilities(); - try { - check(caps.glVertex4d).invokeExact(x, y, z, w); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex4d") + default void vertex4d(double x, double y, double z, double w) { + throw new ContextException(); } - public static void vertex4dv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertex4dv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex4dv") + default void vertex4dv(MemorySegment v) { + throw new ContextException(); } - public static void vertex4dv(SegmentAllocator allocator, double[] v) { - vertex4dv(allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glVertex4dv") + default void vertex4dv(SegmentAllocator allocator, double[] v) { + throw new ContextException(); } - public static void vertex4f(float x, float y, float z, float w) { - var caps = getCapabilities(); - try { - check(caps.glVertex4f).invokeExact(x, y, z, w); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex4f") + default void vertex4f(float x, float y, float z, float w) { + throw new ContextException(); } - public static void vertex4fv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertex4fv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex4fv") + default void vertex4fv(MemorySegment v) { + throw new ContextException(); } - public static void vertex4fv(SegmentAllocator allocator, float[] v) { - vertex4fv(allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glVertex4fv") + default void vertex4fv(SegmentAllocator allocator, float[] v) { + throw new ContextException(); } - public static void vertex4i(int x, int y, int z, int w) { - var caps = getCapabilities(); - try { - check(caps.glVertex4i).invokeExact(x, y, z, w); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex4i") + default void vertex4i(int x, int y, int z, int w) { + throw new ContextException(); } - public static void vertex4iv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertex4iv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex4iv") + default void vertex4iv(MemorySegment v) { + throw new ContextException(); } - public static void vertex4iv(SegmentAllocator allocator, int[] v) { - vertex4iv(allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glVertex4iv") + default void vertex4iv(SegmentAllocator allocator, int[] v) { + throw new ContextException(); } - public static void vertex4s(short x, short y, short z, short w) { - var caps = getCapabilities(); - try { - check(caps.glVertex4s).invokeExact(x, y, z, w); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex4s") + default void vertex4s(short x, short y, short z, short w) { + throw new ContextException(); } - public static void vertex4sv(MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertex4sv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertex4sv") + default void vertex4sv(MemorySegment v) { + throw new ContextException(); } - public static void vertex4sv(SegmentAllocator allocator, short[] v) { - vertex4sv(allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glVertex4sv") + default void vertex4sv(SegmentAllocator allocator, short[] v) { + throw new ContextException(); } } 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 0e53af2c..4e3245f8 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL10C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL10C.java @@ -17,15 +17,17 @@ package overrungl.opengl; import org.jetbrains.annotations.Nullable; -import overrungl.internal.RuntimeHelper; -import overrungl.util.MemoryStack; +import overrun.marshal.MemoryStack; +import overrun.marshal.Unmarshal; +import overrun.marshal.gen.Entrypoint; +import overrun.marshal.gen.Ref; +import overrun.marshal.gen.SizedSeg; +import overrun.marshal.gen.Skip; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; import static java.lang.foreign.ValueLayout.*; -import static overrungl.FunctionDescriptors.*; -import static overrungl.opengl.GLLoader.*; /** * The OpenGL 1.0 forward compatible functions. @@ -33,890 +35,607 @@ * @author squid233 * @since 0.1.0 */ -public sealed class GL10C permits GL10, GL11C { - public static final int DEPTH_BUFFER_BIT = 0x00000100; - public static final int STENCIL_BUFFER_BIT = 0x00000400; - public static final int COLOR_BUFFER_BIT = 0x00004000; - public static final int FALSE = 0; - public static final int TRUE = 1; - public static final int POINTS = 0x0000; - public static final int LINES = 0x0001; - public static final int LINE_LOOP = 0x0002; - public static final int LINE_STRIP = 0x0003; - public static final int TRIANGLES = 0x0004; - public static final int TRIANGLE_STRIP = 0x0005; - public static final int TRIANGLE_FAN = 0x0006; - public static final int QUADS = 0x0007; - public static final int NEVER = 0x0200; - public static final int LESS = 0x0201; - public static final int EQUAL = 0x0202; - public static final int LEQUAL = 0x0203; - public static final int GREATER = 0x0204; - public static final int NOTEQUAL = 0x0205; - public static final int GEQUAL = 0x0206; - public static final int ALWAYS = 0x0207; - public static final int ZERO = 0; - public static final int ONE = 1; - public static final int SRC_COLOR = 0x0300; - public static final int ONE_MINUS_SRC_COLOR = 0x0301; - public static final int SRC_ALPHA = 0x0302; - public static final int ONE_MINUS_SRC_ALPHA = 0x0303; - public static final int DST_ALPHA = 0x0304; - public static final int ONE_MINUS_DST_ALPHA = 0x0305; - public static final int DST_COLOR = 0x0306; - public static final int ONE_MINUS_DST_COLOR = 0x0307; - public static final int SRC_ALPHA_SATURATE = 0x0308; - public static final int NONE = 0; - public static final int FRONT_LEFT = 0x0400; - public static final int FRONT_RIGHT = 0x0401; - public static final int BACK_LEFT = 0x0402; - public static final int BACK_RIGHT = 0x0403; - public static final int FRONT = 0x0404; - public static final int BACK = 0x0405; - public static final int LEFT = 0x0406; - public static final int RIGHT = 0x0407; - public static final int FRONT_AND_BACK = 0x0408; - public static final int NO_ERROR = 0; - public static final int INVALID_ENUM = 0x0500; - public static final int INVALID_VALUE = 0x0501; - public static final int INVALID_OPERATION = 0x0502; - public static final int OUT_OF_MEMORY = 0x0505; - public static final int CW = 0x0900; - public static final int CCW = 0x0901; - public static final int POINT_SIZE = 0x0B11; - public static final int POINT_SIZE_RANGE = 0x0B12; - public static final int POINT_SIZE_GRANULARITY = 0x0B13; - public static final int LINE_SMOOTH = 0x0B20; - public static final int LINE_WIDTH = 0x0B21; - public static final int LINE_WIDTH_RANGE = 0x0B22; - public static final int LINE_WIDTH_GRANULARITY = 0x0B23; - public static final int POLYGON_MODE = 0x0B40; - public static final int POLYGON_SMOOTH = 0x0B41; - public static final int CULL_FACE = 0x0B44; - public static final int CULL_FACE_MODE = 0x0B45; - public static final int FRONT_FACE = 0x0B46; - public static final int DEPTH_RANGE = 0x0B70; - public static final int DEPTH_TEST = 0x0B71; - public static final int DEPTH_WRITEMASK = 0x0B72; - public static final int DEPTH_CLEAR_VALUE = 0x0B73; - public static final int DEPTH_FUNC = 0x0B74; - public static final int STENCIL_TEST = 0x0B90; - public static final int STENCIL_CLEAR_VALUE = 0x0B91; - public static final int STENCIL_FUNC = 0x0B92; - public static final int STENCIL_VALUE_MASK = 0x0B93; - public static final int STENCIL_FAIL = 0x0B94; - public static final int STENCIL_PASS_DEPTH_FAIL = 0x0B95; - public static final int STENCIL_PASS_DEPTH_PASS = 0x0B96; - public static final int STENCIL_REF = 0x0B97; - public static final int STENCIL_WRITEMASK = 0x0B98; - public static final int VIEWPORT = 0x0BA2; - public static final int DITHER = 0x0BD0; - public static final int BLEND_DST = 0x0BE0; - public static final int BLEND_SRC = 0x0BE1; - public static final int BLEND = 0x0BE2; - public static final int LOGIC_OP_MODE = 0x0BF0; - public static final int DRAW_BUFFER = 0x0C01; - public static final int READ_BUFFER = 0x0C02; - public static final int SCISSOR_BOX = 0x0C10; - public static final int SCISSOR_TEST = 0x0C11; - public static final int COLOR_CLEAR_VALUE = 0x0C22; - public static final int COLOR_WRITEMASK = 0x0C23; - public static final int DOUBLEBUFFER = 0x0C32; - public static final int STEREO = 0x0C33; - public static final int LINE_SMOOTH_HINT = 0x0C52; - public static final int POLYGON_SMOOTH_HINT = 0x0C53; - public static final int UNPACK_SWAP_BYTES = 0x0CF0; - public static final int UNPACK_LSB_FIRST = 0x0CF1; - public static final int UNPACK_ROW_LENGTH = 0x0CF2; - public static final int UNPACK_SKIP_ROWS = 0x0CF3; - public static final int UNPACK_SKIP_PIXELS = 0x0CF4; - public static final int UNPACK_ALIGNMENT = 0x0CF5; - public static final int PACK_SWAP_BYTES = 0x0D00; - public static final int PACK_LSB_FIRST = 0x0D01; - public static final int PACK_ROW_LENGTH = 0x0D02; - public static final int PACK_SKIP_ROWS = 0x0D03; - public static final int PACK_SKIP_PIXELS = 0x0D04; - public static final int PACK_ALIGNMENT = 0x0D05; - public static final int MAX_TEXTURE_SIZE = 0x0D33; - public static final int MAX_VIEWPORT_DIMS = 0x0D3A; - public static final int SUBPIXEL_BITS = 0x0D50; - public static final int TEXTURE_1D = 0x0DE0; - public static final int TEXTURE_2D = 0x0DE1; - public static final int TEXTURE_WIDTH = 0x1000; - public static final int TEXTURE_HEIGHT = 0x1001; - public static final int TEXTURE_BORDER_COLOR = 0x1004; - public static final int DONT_CARE = 0x1100; - public static final int FASTEST = 0x1101; - public static final int NICEST = 0x1102; - public static final int BYTE = 0x1400; - public static final int UNSIGNED_BYTE = 0x1401; - public static final int SHORT = 0x1402; - public static final int UNSIGNED_SHORT = 0x1403; - public static final int INT = 0x1404; - public static final int UNSIGNED_INT = 0x1405; - public static final int FLOAT = 0x1406; - public static final int STACK_OVERFLOW = 0x0503; - public static final int STACK_UNDERFLOW = 0x0504; - public static final int CLEAR = 0x1500; - public static final int AND = 0x1501; - public static final int AND_REVERSE = 0x1502; - public static final int COPY = 0x1503; - public static final int AND_INVERTED = 0x1504; - public static final int NOOP = 0x1505; - public static final int XOR = 0x1506; - public static final int OR = 0x1507; - public static final int NOR = 0x1508; - public static final int EQUIV = 0x1509; - public static final int INVERT = 0x150A; - public static final int OR_REVERSE = 0x150B; - public static final int COPY_INVERTED = 0x150C; - public static final int OR_INVERTED = 0x150D; - public static final int NAND = 0x150E; - public static final int SET = 0x150F; - public static final int TEXTURE = 0x1702; - public static final int COLOR = 0x1800; - public static final int DEPTH = 0x1801; - public static final int STENCIL = 0x1802; - public static final int STENCIL_INDEX = 0x1901; - public static final int DEPTH_COMPONENT = 0x1902; - public static final int RED = 0x1903; - public static final int GREEN = 0x1904; - public static final int BLUE = 0x1905; - public static final int ALPHA = 0x1906; - public static final int RGB = 0x1907; - public static final int RGBA = 0x1908; - public static final int POINT = 0x1B00; - public static final int LINE = 0x1B01; - public static final int FILL = 0x1B02; - public static final int KEEP = 0x1E00; - public static final int REPLACE = 0x1E01; - public static final int INCR = 0x1E02; - public static final int DECR = 0x1E03; - public static final int VENDOR = 0x1F00; - public static final int RENDERER = 0x1F01; - public static final int VERSION = 0x1F02; - public static final int EXTENSIONS = 0x1F03; - public static final int NEAREST = 0x2600; - public static final int LINEAR = 0x2601; - public static final int NEAREST_MIPMAP_NEAREST = 0x2700; - public static final int LINEAR_MIPMAP_NEAREST = 0x2701; - public static final int NEAREST_MIPMAP_LINEAR = 0x2702; - public static final int LINEAR_MIPMAP_LINEAR = 0x2703; - public static final int TEXTURE_MAG_FILTER = 0x2800; - public static final int TEXTURE_MIN_FILTER = 0x2801; - public static final int TEXTURE_WRAP_S = 0x2802; - public static final int TEXTURE_WRAP_T = 0x2803; - public static final int REPEAT = 0x2901; - - protected GL10C() { - throw new IllegalStateException("Do not construct instance"); - } - - static boolean isSupported(GLCapabilities caps) { - return checkAll(caps.glBlendFunc, caps.glClear, caps.glClearColor, caps.glClearDepth, caps.glClearStencil, caps.glColorMask, - caps.glCullFace, caps.glDepthFunc, caps.glDepthMask, caps.glDepthRange, caps.glDisable, caps.glDrawBuffer, - caps.glEnable, caps.glFinish, caps.glFlush, caps.glFrontFace, caps.glGetBooleanv, caps.glGetDoublev, - caps.glGetError, caps.glGetFloatv, caps.glGetIntegerv, caps.glGetString, caps.glGetTexImage, caps.glGetTexLevelParameterfv, - caps.glGetTexLevelParameteriv, caps.glGetTexParameterfv, caps.glGetTexParameteriv, caps.glHint, caps.glIsEnabled, caps.glLineWidth, - caps.glLogicOp, caps.glPixelStoref, caps.glPixelStorei, caps.glPointSize, caps.glPolygonMode, caps.glReadBuffer, - caps.glReadPixels, caps.glScissor, caps.glStencilFunc, caps.glStencilMask, caps.glStencilOp, caps.glTexImage1D, - caps.glTexImage2D, caps.glTexParameterf, caps.glTexParameterfv, caps.glTexParameteri, caps.glTexParameteriv, caps.glViewport); - } - - static void load(GLCapabilities caps, GLLoadFunc load) { - caps.glBlendFunc = load.invoke("glBlendFunc", IIV); - caps.glClear = load.invoke("glClear", 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.invoke("glEnable", IV); - caps.glFinish = load.invoke("glFinish", V); - caps.glFlush = load.invoke("glFlush", V); - 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.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.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.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) { - var caps = getCapabilities(); - try { - check(caps.glBlendFunc).invokeExact(sfactor, dfactor); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void clear(int mask) { - var caps = getCapabilities(); - try { - check(caps.glClear).invokeExact(mask); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void clearColor(float red, float green, float blue, float alpha) { - var caps = getCapabilities(); - try { - check(caps.glClearColor).invokeExact(red, green, blue, alpha); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void clearDepth(double depth) { - var caps = getCapabilities(); - try { - check(caps.glClearDepth).invokeExact(depth); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void clearStencil(int s) { - var caps = getCapabilities(); - try { - check(caps.glClearStencil).invokeExact(s); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void colorMask(boolean red, boolean green, boolean blue, boolean alpha) { - var caps = getCapabilities(); - try { - check(caps.glColorMask).invokeExact(red, green, blue, alpha); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } +public sealed interface GL10C permits GL10, GL11C { + int DEPTH_BUFFER_BIT = 0x00000100; + int STENCIL_BUFFER_BIT = 0x00000400; + int COLOR_BUFFER_BIT = 0x00004000; + int FALSE = 0; + int TRUE = 1; + int POINTS = 0x0000; + int LINES = 0x0001; + int LINE_LOOP = 0x0002; + int LINE_STRIP = 0x0003; + int TRIANGLES = 0x0004; + int TRIANGLE_STRIP = 0x0005; + int TRIANGLE_FAN = 0x0006; + int QUADS = 0x0007; + int NEVER = 0x0200; + int LESS = 0x0201; + int EQUAL = 0x0202; + int LEQUAL = 0x0203; + int GREATER = 0x0204; + int NOTEQUAL = 0x0205; + int GEQUAL = 0x0206; + int ALWAYS = 0x0207; + int ZERO = 0; + int ONE = 1; + int SRC_COLOR = 0x0300; + int ONE_MINUS_SRC_COLOR = 0x0301; + int SRC_ALPHA = 0x0302; + int ONE_MINUS_SRC_ALPHA = 0x0303; + int DST_ALPHA = 0x0304; + int ONE_MINUS_DST_ALPHA = 0x0305; + int DST_COLOR = 0x0306; + int ONE_MINUS_DST_COLOR = 0x0307; + int SRC_ALPHA_SATURATE = 0x0308; + int NONE = 0; + int FRONT_LEFT = 0x0400; + int FRONT_RIGHT = 0x0401; + int BACK_LEFT = 0x0402; + int BACK_RIGHT = 0x0403; + int FRONT = 0x0404; + int BACK = 0x0405; + int LEFT = 0x0406; + int RIGHT = 0x0407; + int FRONT_AND_BACK = 0x0408; + int NO_ERROR = 0; + int INVALID_ENUM = 0x0500; + int INVALID_VALUE = 0x0501; + int INVALID_OPERATION = 0x0502; + int OUT_OF_MEMORY = 0x0505; + int CW = 0x0900; + int CCW = 0x0901; + int POINT_SIZE = 0x0B11; + int POINT_SIZE_RANGE = 0x0B12; + int POINT_SIZE_GRANULARITY = 0x0B13; + int LINE_SMOOTH = 0x0B20; + int LINE_WIDTH = 0x0B21; + int LINE_WIDTH_RANGE = 0x0B22; + int LINE_WIDTH_GRANULARITY = 0x0B23; + int POLYGON_MODE = 0x0B40; + int POLYGON_SMOOTH = 0x0B41; + int CULL_FACE = 0x0B44; + int CULL_FACE_MODE = 0x0B45; + int FRONT_FACE = 0x0B46; + int DEPTH_RANGE = 0x0B70; + int DEPTH_TEST = 0x0B71; + int DEPTH_WRITEMASK = 0x0B72; + int DEPTH_CLEAR_VALUE = 0x0B73; + int DEPTH_FUNC = 0x0B74; + int STENCIL_TEST = 0x0B90; + int STENCIL_CLEAR_VALUE = 0x0B91; + int STENCIL_FUNC = 0x0B92; + int STENCIL_VALUE_MASK = 0x0B93; + int STENCIL_FAIL = 0x0B94; + int STENCIL_PASS_DEPTH_FAIL = 0x0B95; + int STENCIL_PASS_DEPTH_PASS = 0x0B96; + int STENCIL_REF = 0x0B97; + int STENCIL_WRITEMASK = 0x0B98; + int VIEWPORT = 0x0BA2; + int DITHER = 0x0BD0; + int BLEND_DST = 0x0BE0; + int BLEND_SRC = 0x0BE1; + int BLEND = 0x0BE2; + int LOGIC_OP_MODE = 0x0BF0; + int DRAW_BUFFER = 0x0C01; + int READ_BUFFER = 0x0C02; + int SCISSOR_BOX = 0x0C10; + int SCISSOR_TEST = 0x0C11; + int COLOR_CLEAR_VALUE = 0x0C22; + int COLOR_WRITEMASK = 0x0C23; + int DOUBLEBUFFER = 0x0C32; + int STEREO = 0x0C33; + int LINE_SMOOTH_HINT = 0x0C52; + int POLYGON_SMOOTH_HINT = 0x0C53; + int UNPACK_SWAP_BYTES = 0x0CF0; + int UNPACK_LSB_FIRST = 0x0CF1; + int UNPACK_ROW_LENGTH = 0x0CF2; + int UNPACK_SKIP_ROWS = 0x0CF3; + int UNPACK_SKIP_PIXELS = 0x0CF4; + int UNPACK_ALIGNMENT = 0x0CF5; + int PACK_SWAP_BYTES = 0x0D00; + int PACK_LSB_FIRST = 0x0D01; + int PACK_ROW_LENGTH = 0x0D02; + int PACK_SKIP_ROWS = 0x0D03; + int PACK_SKIP_PIXELS = 0x0D04; + int PACK_ALIGNMENT = 0x0D05; + int MAX_TEXTURE_SIZE = 0x0D33; + int MAX_VIEWPORT_DIMS = 0x0D3A; + int SUBPIXEL_BITS = 0x0D50; + int TEXTURE_1D = 0x0DE0; + int TEXTURE_2D = 0x0DE1; + int TEXTURE_WIDTH = 0x1000; + int TEXTURE_HEIGHT = 0x1001; + int TEXTURE_BORDER_COLOR = 0x1004; + int DONT_CARE = 0x1100; + int FASTEST = 0x1101; + int NICEST = 0x1102; + int BYTE = 0x1400; + int UNSIGNED_BYTE = 0x1401; + int SHORT = 0x1402; + int UNSIGNED_SHORT = 0x1403; + int INT = 0x1404; + int UNSIGNED_INT = 0x1405; + int FLOAT = 0x1406; + int STACK_OVERFLOW = 0x0503; + int STACK_UNDERFLOW = 0x0504; + int CLEAR = 0x1500; + int AND = 0x1501; + int AND_REVERSE = 0x1502; + int COPY = 0x1503; + int AND_INVERTED = 0x1504; + int NOOP = 0x1505; + int XOR = 0x1506; + int OR = 0x1507; + int NOR = 0x1508; + int EQUIV = 0x1509; + int INVERT = 0x150A; + int OR_REVERSE = 0x150B; + int COPY_INVERTED = 0x150C; + int OR_INVERTED = 0x150D; + int NAND = 0x150E; + int SET = 0x150F; + int TEXTURE = 0x1702; + int COLOR = 0x1800; + int DEPTH = 0x1801; + int STENCIL = 0x1802; + int STENCIL_INDEX = 0x1901; + int DEPTH_COMPONENT = 0x1902; + int RED = 0x1903; + int GREEN = 0x1904; + int BLUE = 0x1905; + int ALPHA = 0x1906; + int RGB = 0x1907; + int RGBA = 0x1908; + int POINT = 0x1B00; + int LINE = 0x1B01; + int FILL = 0x1B02; + int KEEP = 0x1E00; + int REPLACE = 0x1E01; + int INCR = 0x1E02; + int DECR = 0x1E03; + int VENDOR = 0x1F00; + int RENDERER = 0x1F01; + int VERSION = 0x1F02; + int EXTENSIONS = 0x1F03; + int NEAREST = 0x2600; + int LINEAR = 0x2601; + int NEAREST_MIPMAP_NEAREST = 0x2700; + int LINEAR_MIPMAP_NEAREST = 0x2701; + int NEAREST_MIPMAP_LINEAR = 0x2702; + int LINEAR_MIPMAP_LINEAR = 0x2703; + int TEXTURE_MAG_FILTER = 0x2800; + int TEXTURE_MIN_FILTER = 0x2801; + int TEXTURE_WRAP_S = 0x2802; + int TEXTURE_WRAP_T = 0x2803; + int REPEAT = 0x2901; + + @Entrypoint("glBlendFunc") + default void blendFunc(int sfactor, int dfactor) { + throw new ContextException(); + } + + @Entrypoint("glClear") + default void clear(int mask) { + throw new ContextException(); + } + + @Entrypoint("glClearColor") + default void clearColor(float red, float green, float blue, float alpha) { + throw new ContextException(); + } + + @Entrypoint("glClearDepth") + default void clearDepth(double depth) { + throw new ContextException(); + } + + @Entrypoint("glClearStencil") + default void clearStencil(int s) { + throw new ContextException(); + } + + @Entrypoint("glColorMask") + default void colorMask(boolean red, boolean green, boolean blue, boolean alpha) { + throw new ContextException(); + } + + @Entrypoint("glCullFace") + default void cullFace(int mode) { + throw new ContextException(); + } + + @Entrypoint("glDepthFunc") + default void depthFunc(int func) { + throw new ContextException(); + } + + @Entrypoint("glDepthMask") + default void depthMask(boolean flag) { + throw new ContextException(); } - public static void cullFace(int mode) { - var caps = getCapabilities(); - try { - check(caps.glCullFace).invokeExact(mode); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void depthFunc(int func) { - var caps = getCapabilities(); - try { - check(caps.glDepthFunc).invokeExact(func); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void depthMask(boolean flag) { - var caps = getCapabilities(); - try { - check(caps.glDepthMask).invokeExact(flag); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void depthRange(double n, double f) { - var caps = getCapabilities(); - try { - check(caps.glDepthRange).invokeExact(n, f); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDepthRange") + default void depthRange(double n, double f) { + throw new ContextException(); } - public static void disable(int cap) { - var caps = getCapabilities(); - try { - check(caps.glDisable).invokeExact(cap); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDisable") + default void disable(int cap) { + throw new ContextException(); } - public static void drawBuffer(int buf) { - var caps = getCapabilities(); - try { - check(caps.glDrawBuffer).invokeExact(buf); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDrawBuffer") + default void drawBuffer(int buf) { + throw new ContextException(); } - public static void enable(int cap) { - var caps = getCapabilities(); - try { - check(caps.glEnable).invokeExact(cap); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEnable") + default void enable(int cap) { + throw new ContextException(); } - public static void finish() { - var caps = getCapabilities(); - try { - check(caps.glFinish).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glFinish") + default void finish() { + throw new ContextException(); } - public static void flush() { - var caps = getCapabilities(); - try { - check(caps.glFlush).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glFlush") + default void flush() { + throw new ContextException(); } - public static void frontFace(int mode) { - var caps = getCapabilities(); - try { - check(caps.glFrontFace).invokeExact(mode); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glFrontFace") + default void frontFace(int mode) { + throw new ContextException(); } - public static void getBooleanv(int pname, MemorySegment data) { - var caps = getCapabilities(); - try { - check(caps.glGetBooleanv).invokeExact(pname, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetBooleanv") + default void getBooleanv(int pname, MemorySegment data) { + throw new ContextException(); } - public static void getBooleanv(SegmentAllocator allocator, int pname, boolean[] data) { - var pData = allocator.allocate(JAVA_BOOLEAN, data.length); - getBooleanv(pname, pData); - RuntimeHelper.toArray(pData, data); + @Entrypoint("glGetBooleanv") + default void getBooleanv(SegmentAllocator allocator, int pname, @Ref boolean[] data) { + throw new ContextException(); } - public static boolean getBoolean(int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pData = stack.calloc(JAVA_BOOLEAN); + @Skip + default boolean getBooleanv(int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pData = stack.allocate(JAVA_BOOLEAN); getBooleanv(pname, pData); return pData.get(JAVA_BOOLEAN, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getDoublev(int pname, MemorySegment data) { - var caps = getCapabilities(); - try { - check(caps.glGetDoublev).invokeExact(pname, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetDoublev") + default void getDoublev(int pname, MemorySegment data) { + throw new ContextException(); } - public static void getDoublev(SegmentAllocator allocator, int pname, double[] data) { - var pData = allocator.allocate(JAVA_DOUBLE, data.length); - getDoublev(pname, pData); - RuntimeHelper.toArray(pData, data); + @Entrypoint("glGetDoublev") + default void getDoublev(SegmentAllocator allocator, int pname, @Ref double[] data) { + throw new ContextException(); } - public static double getDouble(int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pData = stack.callocDouble(); + @Skip + default double getDoublev(int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pData = stack.doubles(0D); getDoublev(pname, pData); return pData.get(JAVA_DOUBLE, 0); - } finally { - stack.setPointer(stackPointer); } } - public static int getError() { - var caps = getCapabilities(); - try { - return (int) check(caps.glGetError).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetError") + default int getError() { + throw new ContextException(); } - public static void getFloatv(int pname, MemorySegment data) { - var caps = getCapabilities(); - try { - check(caps.glGetFloatv).invokeExact(pname, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetFloatv") + default void getFloatv(int pname, MemorySegment data) { + throw new ContextException(); } - public static void getFloatv(SegmentAllocator allocator, int pname, float[] data) { - var pData = allocator.allocate(JAVA_FLOAT, data.length); - getFloatv(pname, pData); - RuntimeHelper.toArray(pData, data); + @Entrypoint("glGetFloatv") + default void getFloatv(SegmentAllocator allocator, int pname, @Ref float[] data) { + throw new ContextException(); } - public static float getFloat(int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pData = stack.callocFloat(); + @Skip + default float getFloatv(int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pData = stack.floats(0F); getFloatv(pname, pData); return pData.get(JAVA_FLOAT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getIntegerv(int pname, MemorySegment data) { - var caps = getCapabilities(); - try { - check(caps.glGetIntegerv).invokeExact(pname, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetIntegerv") + default void getIntegerv(int pname, MemorySegment data) { + throw new ContextException(); } - public static void getIntegerv(SegmentAllocator allocator, int pname, int[] data) { - var pData = allocator.allocate(JAVA_INT, data.length); - getIntegerv(pname, pData); - RuntimeHelper.toArray(pData, data); + @Entrypoint("glGetIntegerv") + default void getIntegerv(SegmentAllocator allocator, int pname, @Ref int[] data) { + throw new ContextException(); } - public static int getInteger(int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pData = stack.callocInt(); + @Skip + default int getIntegerv(int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pData = stack.ints(0); getIntegerv(pname, pData); return pData.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static MemorySegment ngetString(int name) { - var caps = getCapabilities(); - try { - return (MemorySegment) check(caps.glGetString).invokeExact(name); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetString") + default MemorySegment ngetString(int name) { + throw new ContextException(); } + @Entrypoint("glGetString") @Nullable - public static String getString(int name) { - var pStr = ngetString(name); - return RuntimeHelper.isNullptr(pStr) ? null : pStr.getString(0); + @SizedSeg(Unmarshal.STR_SIZE) + default String getString(int name) { + throw new ContextException(); } - public static void getTexImage(int target, int level, int format, int type, MemorySegment pixels) { - var caps = getCapabilities(); - try { - check(caps.glGetTexImage).invokeExact(target, level, format, type, pixels); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTexImage") + default void getTexImage(int target, int level, int format, int type, MemorySegment pixels) { + throw new ContextException(); } - public static void getTexLevelParameterfv(int target, int level, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetTexLevelParameterfv).invokeExact(target, level, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTexLevelParameterfv") + default void getTexLevelParameterfv(int target, int level, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getTexLevelParameterfv(SegmentAllocator allocator, int target, int level, int pname, float[] params) { - var pParams = allocator.allocate(JAVA_FLOAT, params.length); - getTexLevelParameterfv(target, level, pname, pParams); - RuntimeHelper.toArray(pParams, params); + @Entrypoint("glGetTexLevelParameterfv") + default void getTexLevelParameterfv(SegmentAllocator allocator, int target, int level, int pname, @Ref float[] params) { + throw new ContextException(); } - public static float getTexLevelParameterf(int target, int level, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pParams = stack.callocFloat(); + @Skip + default float getTexLevelParameterfv(int target, int level, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pParams = stack.floats(0F); getTexLevelParameterfv(target, level, pname, pParams); return pParams.get(JAVA_FLOAT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getTexLevelParameteriv(int target, int level, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetTexLevelParameteriv).invokeExact(target, level, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTexLevelParameteriv") + default void getTexLevelParameteriv(int target, int level, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getTexLevelParameteriv(SegmentAllocator allocator, int target, int level, int pname, int[] params) { - var pParams = allocator.allocate(JAVA_INT, params.length); - getTexLevelParameteriv(target, level, pname, pParams); - RuntimeHelper.toArray(pParams, params); + @Entrypoint("glGetTexLevelParameteriv") + default void getTexLevelParameteriv(SegmentAllocator allocator, int target, int level, int pname, @Ref int[] params) { + throw new ContextException(); } - public static int getTexLevelParameteri(int target, int level, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pParams = stack.callocInt(); + @Skip + default int getTexLevelParameteriv(int target, int level, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pParams = stack.ints(0); getTexLevelParameteriv(target, level, pname, pParams); return pParams.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getTexParameterfv(int target, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetTexParameterfv).invokeExact(target, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTexParameterfv") + default void getTexParameterfv(int target, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getTexParameterfv(SegmentAllocator allocator, int target, int pname, float[] params) { - var pParams = allocator.allocate(JAVA_FLOAT, params.length); - getTexParameterfv(target, pname, pParams); - RuntimeHelper.toArray(pParams, params); + @Entrypoint("glGetTexParameterfv") + default void getTexParameterfv(SegmentAllocator allocator, int target, int pname, @Ref float[] params) { + throw new ContextException(); } - public static float getTexParameterf(int target, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pParams = stack.callocFloat(); + @Skip + default float getTexParameterfv(int target, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pParams = stack.floats(0F); getTexParameterfv(target, pname, pParams); return pParams.get(JAVA_FLOAT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getTexParameteriv(int target, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetTexParameteriv).invokeExact(target, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTexParameteriv") + default void getTexParameteriv(int target, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getTexParameteriv(SegmentAllocator allocator, int target, int pname, int[] params) { - var pParams = allocator.allocate(JAVA_INT, params.length); - getTexParameteriv(target, pname, pParams); - RuntimeHelper.toArray(pParams, params); + @Entrypoint("glGetTexParameteriv") + default void getTexParameteriv(SegmentAllocator allocator, int target, int pname, @Ref int[] params) { + throw new ContextException(); } - public static int getTexParameteri(int target, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pParams = stack.callocInt(); + @Skip + default int getTexParameteriv(int target, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pParams = stack.ints(0); getTexParameteriv(target, pname, pParams); return pParams.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void hint(int target, int mode) { - var caps = getCapabilities(); - try { - check(caps.glHint).invokeExact(target, mode); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glHint") + default void hint(int target, int mode) { + throw new ContextException(); } - public static boolean isEnabled(int cap) { - var caps = getCapabilities(); - try { - return (boolean) check(caps.glIsEnabled).invokeExact(cap); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIsEnabled") + default boolean isEnabled(int cap) { + throw new ContextException(); } - public static void lineWidth(float width) { - var caps = getCapabilities(); - try { - check(caps.glLineWidth).invokeExact(width); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glLineWidth") + default void lineWidth(float width) { + throw new ContextException(); } - public static void logicOp(int opcode) { - var caps = getCapabilities(); - try { - check(caps.glLogicOp).invokeExact(opcode); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glLogicOp") + default void logicOp(int opcode) { + throw new ContextException(); } - public static void pixelStoref(int pname, float param) { - var caps = getCapabilities(); - try { - check(caps.glPixelStoref).invokeExact(pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPixelStoref") + default void pixelStoref(int pname, float param) { + throw new ContextException(); } - public static void pixelStorei(int pname, int param) { - var caps = getCapabilities(); - try { - check(caps.glPixelStorei).invokeExact(pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPixelStorei") + default void pixelStorei(int pname, int param) { + throw new ContextException(); } - public static void pointSize(float size) { - var caps = getCapabilities(); - try { - check(caps.glPointSize).invokeExact(size); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPointSize") + default void pointSize(float size) { + throw new ContextException(); } - public static void polygonMode(int face, int mode) { - var caps = getCapabilities(); - try { - check(caps.glPolygonMode).invokeExact(face, mode); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPolygonMode") + default void polygonMode(int face, int mode) { + throw new ContextException(); } - public static void readBuffer(int src) { - var caps = getCapabilities(); - try { - check(caps.glReadBuffer).invokeExact(src); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glReadBuffer") + default void readBuffer(int src) { + throw new ContextException(); } - public static void readPixels(int x, int y, int width, int height, int format, int type, MemorySegment pixels) { - var caps = getCapabilities(); - try { - check(caps.glReadPixels).invokeExact(x, y, width, height, format, type, pixels); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glReadPixels") + default void readPixels(int x, int y, int width, int height, int format, int type, MemorySegment pixels) { + throw new ContextException(); } - public static void readPixels(SegmentAllocator allocator, int x, int y, int width, int height, int format, int type, byte[] pixels) { - var seg = allocator.allocate(JAVA_BYTE, pixels.length); - readPixels(x, y, width, height, format, type, seg); - RuntimeHelper.toArray(seg, pixels); + @Entrypoint("glReadPixels") + default void readPixels(SegmentAllocator allocator, int x, int y, int width, int height, int format, int type, @Ref byte[] pixels) { + throw new ContextException(); } - public static void readPixels(SegmentAllocator allocator, int x, int y, int width, int height, int format, int type, short[] pixels) { - var seg = allocator.allocate(JAVA_SHORT, pixels.length); - readPixels(x, y, width, height, format, type, seg); - RuntimeHelper.toArray(seg, pixels); + @Entrypoint("glReadPixels") + default void readPixels(SegmentAllocator allocator, int x, int y, int width, int height, int format, int type, @Ref short[] pixels) { + throw new ContextException(); } - public static void readPixels(SegmentAllocator allocator, int x, int y, int width, int height, int format, int type, int[] pixels) { - var seg = allocator.allocate(JAVA_INT, pixels.length); - readPixels(x, y, width, height, format, type, seg); - RuntimeHelper.toArray(seg, pixels); + @Entrypoint("glReadPixels") + default void readPixels(SegmentAllocator allocator, int x, int y, int width, int height, int format, int type, @Ref int[] pixels) { + throw new ContextException(); } - public static void readPixels(SegmentAllocator allocator, int x, int y, int width, int height, int format, int type, float[] pixels) { - var seg = allocator.allocate(JAVA_FLOAT, pixels.length); - readPixels(x, y, width, height, format, type, seg); - RuntimeHelper.toArray(seg, pixels); + @Entrypoint("glReadPixels") + default void readPixels(SegmentAllocator allocator, int x, int y, int width, int height, int format, int type, @Ref float[] pixels) { + throw new ContextException(); } - public static void scissor(int x, int y, int width, int height) { - var caps = getCapabilities(); - try { - check(caps.glScissor).invokeExact(x, y, width, height); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glScissor") + default void scissor(int x, int y, int width, int height) { + throw new ContextException(); } - public static void stencilFunc(int func, int ref, int mask) { - var caps = getCapabilities(); - try { - check(caps.glStencilFunc).invokeExact(func, ref, mask); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glStencilFunc") + default void stencilFunc(int func, int ref, int mask) { + throw new ContextException(); } - public static void stencilMask(int mask) { - var caps = getCapabilities(); - try { - check(caps.glStencilMask).invokeExact(mask); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glStencilMask") + default void stencilMask(int mask) { + throw new ContextException(); } - public static void stencilOp(int fail, int zfail, int zpass) { - var caps = getCapabilities(); - try { - check(caps.glStencilOp).invokeExact(fail, zfail, zpass); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glStencilOp") + default void stencilOp(int fail, int zfail, int zpass) { + throw new ContextException(); } - public static void texImage1D(int target, int level, int internalFormat, int width, int border, int format, int type, MemorySegment pixels) { - var caps = getCapabilities(); - try { - check(caps.glTexImage1D).invokeExact(target, level, internalFormat, width, border, format, type, pixels); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexImage1D") + default void texImage1D(int target, int level, int internalFormat, int width, int border, int format, int type, MemorySegment pixels) { + throw new ContextException(); } - public static void texImage1D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int border, int format, int type, byte[] pixels) { - texImage1D(target, level, internalFormat, width, border, format, type, allocator.allocateFrom(JAVA_BYTE, pixels)); + @Entrypoint("glTexImage1D") + default void texImage1D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int border, int format, int type, byte[] pixels) { + throw new ContextException(); } - public static void texImage1D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int border, int format, int type, short[] pixels) { - texImage1D(target, level, internalFormat, width, border, format, type, allocator.allocateFrom(JAVA_SHORT, pixels)); + @Entrypoint("glTexImage1D") + default void texImage1D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int border, int format, int type, short[] pixels) { + throw new ContextException(); } - public static void texImage1D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int border, int format, int type, int[] pixels) { - texImage1D(target, level, internalFormat, width, border, format, type, allocator.allocateFrom(JAVA_INT, pixels)); + @Entrypoint("glTexImage1D") + default void texImage1D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int border, int format, int type, int[] pixels) { + throw new ContextException(); } - public static void texImage1D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int border, int format, int type, float[] pixels) { - texImage1D(target, level, internalFormat, width, border, format, type, allocator.allocateFrom(JAVA_FLOAT, pixels)); + @Entrypoint("glTexImage1D") + default void texImage1D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int border, int format, int type, float[] pixels) { + throw new ContextException(); } - public static void texImage2D(int target, int level, int internalFormat, int width, int height, int border, int format, int type, MemorySegment pixels) { - var caps = getCapabilities(); - try { - check(caps.glTexImage2D).invokeExact(target, level, internalFormat, width, height, border, format, type, pixels); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexImage2D") + default void texImage2D(int target, int level, int internalFormat, int width, int height, int border, int format, int type, MemorySegment pixels) { + throw new ContextException(); } - public static void texImage2D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int height, int border, int format, int type, byte[] pixels) { - texImage2D(target, level, internalFormat, width, height, border, format, type, allocator.allocateFrom(JAVA_BYTE, pixels)); + @Entrypoint("glTexImage2D") + default void texImage2D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int height, int border, int format, int type, byte[] pixels) { + throw new ContextException(); } - public static void texImage2D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int height, int border, int format, int type, short[] pixels) { - texImage2D(target, level, internalFormat, width, height, border, format, type, allocator.allocateFrom(JAVA_SHORT, pixels)); + @Entrypoint("glTexImage2D") + default void texImage2D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int height, int border, int format, int type, short[] pixels) { + throw new ContextException(); } - public static void texImage2D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int height, int border, int format, int type, int[] pixels) { - texImage2D(target, level, internalFormat, width, height, border, format, type, allocator.allocateFrom(JAVA_INT, pixels)); + @Entrypoint("glTexImage2D") + default void texImage2D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int height, int border, int format, int type, int[] pixels) { + throw new ContextException(); } - public static void texImage2D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int height, int border, int format, int type, float[] pixels) { - texImage2D(target, level, internalFormat, width, height, border, format, type, allocator.allocateFrom(JAVA_FLOAT, pixels)); + @Entrypoint("glTexImage2D") + default void texImage2D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int height, int border, int format, int type, float[] pixels) { + throw new ContextException(); } - public static void texParameterf(int target, int pname, float param) { - var caps = getCapabilities(); - try { - check(caps.glTexParameterf).invokeExact(target, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexParameterf") + default void texParameterf(int target, int pname, float param) { + throw new ContextException(); } - public static void texParameterfv(int target, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glTexParameterfv).invokeExact(target, pname, params); - } catch (Throwable e) { - throw new RuntimeException(e); - } + @Entrypoint("glTexParameterfv") + default void texParameterfv(int target, int pname, MemorySegment params) { + throw new ContextException(); } - public static void texParameterfv(SegmentAllocator allocator, int target, int pname, float[] params) { - texParameterfv(target, pname, allocator.allocateFrom(JAVA_FLOAT, params)); + @Entrypoint("glTexParameterfv") + default void texParameterfv(SegmentAllocator allocator, int target, int pname, float[] params) { + throw new ContextException(); } - public static void texParameteri(int target, int pname, int param) { - var caps = getCapabilities(); - try { - check(caps.glTexParameteri).invokeExact(target, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexParameteri") + default void texParameteri(int target, int pname, int param) { + throw new ContextException(); } - public static void texParameteriv(int target, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glTexParameteriv).invokeExact(target, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexParameteriv") + default void texParameteriv(int target, int pname, MemorySegment params) { + throw new ContextException(); } - public static void texParameteriv(SegmentAllocator allocator, int target, int pname, int[] params) { - texParameteriv(target, pname, allocator.allocateFrom(JAVA_INT, params)); + @Entrypoint("glTexParameteriv") + default void texParameteriv(SegmentAllocator allocator, int target, int pname, int[] params) { + throw new ContextException(); } - public static void viewport(int x, int y, int width, int height) { - var caps = getCapabilities(); - try { - check(caps.glViewport).invokeExact(x, y, width, height); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glViewport") + default void viewport(int x, int y, int width, int height) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL11.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL11.java index 3fae162b..d4638d95 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL11.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL11.java @@ -16,22 +16,23 @@ package overrungl.opengl; +import overrun.marshal.Marshal; +import overrun.marshal.Unmarshal; +import overrun.marshal.gen.Entrypoint; +import overrun.marshal.gen.Ref; +import overrun.marshal.gen.Skip; + import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.FunctionDescriptors.*; -import static overrungl.opengl.GLLoader.check; -import static overrungl.opengl.GLLoader.getCapabilities; - /** * The OpenGL 1.1 functions. * * @author squid233 * @since 0.1.0 */ -public final class GL11 extends GL11C { - public static final int CURRENT_BIT = 0x00000001, +public sealed interface GL11 extends GL11C permits GLLegacy { + int CURRENT_BIT = 0x00000001, POINT_BIT = 0x00000002, LINE_BIT = 0x00000004, POLYGON_BIT = 0x00000008, @@ -52,26 +53,26 @@ public final class GL11 extends GL11C { CLIENT_PIXEL_STORE_BIT = 0x00000001, CLIENT_VERTEX_ARRAY_BIT = 0x00000002, CLIENT_ALL_ATTRIB_BITS = 0xFFFFFFFF; - public static final int QUAD_STRIP = 0x0008, + int QUAD_STRIP = 0x0008, QUADS = 0x0007, POLYGON = 0x0009; - public static final int ACCUM = 0x0100, + int ACCUM = 0x0100, LOAD = 0x0101, RETURN = 0x0102, MULT = 0x0103, ADD = 0x0104; - public static final int STACK_OVERFLOW = 0x0503, + int STACK_OVERFLOW = 0x0503, STACK_UNDERFLOW = 0x0504; - public static final int AUX0 = 0x0409, + int AUX0 = 0x0409, AUX1 = 0x040A, AUX2 = 0x040B, AUX3 = 0x040C; - public static final int GL_2D = 0x0600, + int GL_2D = 0x0600, GL_3D = 0x0601, GL_3D_COLOR = 0x0602, GL_3D_COLOR_TEXTURE = 0x0603, GL_4D_COLOR_TEXTURE = 0x0604; - public static final int PASS_THROUGH_TOKEN = 0x0700, + int PASS_THROUGH_TOKEN = 0x0700, POINT_TOKEN = 0x0701, LINE_TOKEN = 0x0702, POLYGON_TOKEN = 0x0703, @@ -79,12 +80,12 @@ public final class GL11 extends GL11C { DRAW_PIXEL_TOKEN = 0x0705, COPY_PIXEL_TOKEN = 0x0706, LINE_RESET_TOKEN = 0x0707; - public static final int EXP = 0x0800, + int EXP = 0x0800, EXP2 = 0x0801; - public static final int COEFF = 0x0A00, + int COEFF = 0x0A00, ORDER = 0x0A01, DOMAIN = 0x0A02; - public static final int PIXEL_MAP_I_TO_I = 0x0C70, + int PIXEL_MAP_I_TO_I = 0x0C70, PIXEL_MAP_S_TO_S = 0x0C71, PIXEL_MAP_I_TO_R = 0x0C72, PIXEL_MAP_I_TO_G = 0x0C73, @@ -94,15 +95,15 @@ public final class GL11 extends GL11C { PIXEL_MAP_G_TO_G = 0x0C77, PIXEL_MAP_B_TO_B = 0x0C78, PIXEL_MAP_A_TO_A = 0x0C79; - public static final int VERTEX_ARRAY_POINTER = 0x808E, + int VERTEX_ARRAY_POINTER = 0x808E, NORMAL_ARRAY_POINTER = 0x808F, COLOR_ARRAY_POINTER = 0x8090, INDEX_ARRAY_POINTER = 0x8091, TEXTURE_COORD_ARRAY_POINTER = 0x8092, EDGE_FLAG_ARRAY_POINTER = 0x8093; - public static final int FEEDBACK_BUFFER_POINTER = 0x0DF0; - public static final int SELECTION_BUFFER_POINTER = 0x0DF3; - public static final int CURRENT_COLOR = 0x0B00, + int FEEDBACK_BUFFER_POINTER = 0x0DF0; + int SELECTION_BUFFER_POINTER = 0x0DF3; + int CURRENT_COLOR = 0x0B00, CURRENT_INDEX = 0x0B01, CURRENT_NORMAL = 0x0B02, CURRENT_TEXTURE_COORDS = 0x0B03, @@ -113,16 +114,16 @@ public final class GL11 extends GL11C { CURRENT_RASTER_POSITION_VALID = 0x0B08, CURRENT_RASTER_DISTANCE = 0x0B09, POINT_SMOOTH = 0x0B10; - public static final int LINE_STIPPLE = 0x0B24, + int LINE_STIPPLE = 0x0B24, LINE_STIPPLE_PATTERN = 0x0B25, LINE_STIPPLE_REPEAT = 0x0B26; - public static final int LIST_MODE = 0x0B30, + int LIST_MODE = 0x0B30, MAX_LIST_NESTING = 0x0B31, LIST_BASE = 0x0B32, LIST_INDEX = 0x0B33; - public static final int POLYGON_STIPPLE = 0x0B42, + int POLYGON_STIPPLE = 0x0B42, EDGE_FLAG = 0x0B43; - public static final int LIGHTING = 0x0B50, + int LIGHTING = 0x0B50, LIGHT_MODEL_LOCAL_VIEWER = 0x0B51, LIGHT_MODEL_TWO_SIDE = 0x0B52, LIGHT_MODEL_AMBIENT = 0x0B53, @@ -130,15 +131,15 @@ public final class GL11 extends GL11C { COLOR_MATERIAL_FACE = 0x0B55, COLOR_MATERIAL_PARAMETER = 0x0B56, COLOR_MATERIAL = 0x0B57; - public static final int FOG = 0x0B60, + int FOG = 0x0B60, FOG_INDEX = 0x0B61, FOG_DENSITY = 0x0B62, FOG_START = 0x0B63, FOG_END = 0x0B64, FOG_MODE = 0x0B65, FOG_COLOR = 0x0B66; - public static final int ACCUM_CLEAR_VALUE = 0x0B80; - public static final int MATRIX_MODE = 0x0BA0, + int ACCUM_CLEAR_VALUE = 0x0B80; + int MATRIX_MODE = 0x0BA0, NORMALIZE = 0x0BA1, MODELVIEW_STACK_DEPTH = 0x0BA3, PROJECTION_STACK_DEPTH = 0x0BA4, @@ -146,27 +147,27 @@ public final class GL11 extends GL11C { MODELVIEW_MATRIX = 0x0BA6, PROJECTION_MATRIX = 0x0BA7, TEXTURE_MATRIX = 0x0BA8; - public static final int ATTRIB_STACK_DEPTH = 0x0BB0, + int ATTRIB_STACK_DEPTH = 0x0BB0, CLIENT_ATTRIB_STACK_DEPTH = 0x0BB1; - public static final int ALPHA_TEST = 0x0BC0, + int ALPHA_TEST = 0x0BC0, ALPHA_TEST_FUNC = 0x0BC1, ALPHA_TEST_REF = 0x0BC2; - public static final int INDEX_LOGIC_OP = 0x0BF1; - public static final int LOGIC_OP = 0x0BF1; - public static final int AUX_BUFFERS = 0x0C00; - public static final int INDEX_CLEAR_VALUE = 0x0C20; - public static final int INDEX_WRITEMASK = 0x0C21; - public static final int INDEX_MODE = 0x0C30; - public static final int RGBA_MODE = 0x0C31; - public static final int RENDER_MODE = 0x0C40; - public static final int PERSPECTIVE_CORRECTION_HINT = 0x0C50, + int INDEX_LOGIC_OP = 0x0BF1; + int LOGIC_OP = 0x0BF1; + int AUX_BUFFERS = 0x0C00; + int INDEX_CLEAR_VALUE = 0x0C20; + int INDEX_WRITEMASK = 0x0C21; + int INDEX_MODE = 0x0C30; + int RGBA_MODE = 0x0C31; + int RENDER_MODE = 0x0C40; + int PERSPECTIVE_CORRECTION_HINT = 0x0C50, POINT_SMOOTH_HINT = 0x0C51, FOG_HINT = 0x0C54; - public static final int TEXTURE_GEN_S = 0x0C60, + int TEXTURE_GEN_S = 0x0C60, TEXTURE_GEN_T = 0x0C61, TEXTURE_GEN_R = 0x0C62, TEXTURE_GEN_Q = 0x0C63; - public static final int PIXEL_MAP_I_TO_I_SIZE = 0x0CB0, + int PIXEL_MAP_I_TO_I_SIZE = 0x0CB0, PIXEL_MAP_S_TO_S_SIZE = 0x0CB1, PIXEL_MAP_I_TO_R_SIZE = 0x0CB2, PIXEL_MAP_I_TO_G_SIZE = 0x0CB3, @@ -176,7 +177,7 @@ public final class GL11 extends GL11C { PIXEL_MAP_G_TO_G_SIZE = 0x0CB7, PIXEL_MAP_B_TO_B_SIZE = 0x0CB8, PIXEL_MAP_A_TO_A_SIZE = 0x0CB9; - public static final int MAP_COLOR = 0x0D10, + int MAP_COLOR = 0x0D10, MAP_STENCIL = 0x0D11, INDEX_SHIFT = 0x0D12, INDEX_OFFSET = 0x0D13, @@ -192,7 +193,7 @@ public final class GL11 extends GL11C { ALPHA_BIAS = 0x0D1D, DEPTH_SCALE = 0x0D1E, DEPTH_BIAS = 0x0D1F; - public static final int MAX_EVAL_ORDER = 0x0D30, + int MAX_EVAL_ORDER = 0x0D30, MAX_LIGHTS = 0x0D31, MAX_CLIP_PLANES = 0x0D32, MAX_PIXEL_MAP_TABLE = 0x0D34, @@ -202,7 +203,7 @@ public final class GL11 extends GL11C { MAX_PROJECTION_STACK_DEPTH = 0x0D38, MAX_TEXTURE_STACK_DEPTH = 0x0D39, MAX_CLIENT_ATTRIB_STACK_DEPTH = 0x0D3B; - public static final int INDEX_BITS = 0x0D51, + int INDEX_BITS = 0x0D51, RED_BITS = 0x0D52, GREEN_BITS = 0x0D53, BLUE_BITS = 0x0D54, @@ -213,7 +214,7 @@ public final class GL11 extends GL11C { ACCUM_GREEN_BITS = 0x0D59, ACCUM_BLUE_BITS = 0x0D5A, ACCUM_ALPHA_BITS = 0x0D5B; - public static final int NAME_STACK_DEPTH = 0x0D70, + int NAME_STACK_DEPTH = 0x0D70, AUTO_NORMAL = 0x0D80, MAP1_COLOR_4 = 0x0D90, MAP1_INDEX = 0x0D91, @@ -224,7 +225,7 @@ public final class GL11 extends GL11C { MAP1_TEXTURE_COORD_4 = 0x0D96, MAP1_VERTEX_3 = 0x0D97, MAP1_VERTEX_4 = 0x0D98; - public static final int MAP2_COLOR_4 = 0x0DB0, + int MAP2_COLOR_4 = 0x0DB0, MAP2_INDEX = 0x0DB1, MAP2_NORMAL = 0x0DB2, MAP2_TEXTURE_COORD_1 = 0x0DB3, @@ -233,14 +234,14 @@ public final class GL11 extends GL11C { MAP2_TEXTURE_COORD_4 = 0x0DB6, MAP2_VERTEX_3 = 0x0DB7, MAP2_VERTEX_4 = 0x0DB8; - public static final int MAP1_GRID_DOMAIN = 0x0DD0, + int MAP1_GRID_DOMAIN = 0x0DD0, MAP1_GRID_SEGMENTS = 0x0DD1, MAP2_GRID_DOMAIN = 0x0DD2, MAP2_GRID_SEGMENTS = 0x0DD3; - public static final int FEEDBACK_BUFFER_SIZE = 0x0DF1, + int FEEDBACK_BUFFER_SIZE = 0x0DF1, FEEDBACK_BUFFER_TYPE = 0x0DF2, SELECTION_BUFFER_SIZE = 0x0DF4; - public static final int VERTEX_ARRAY = 0x8074, + int VERTEX_ARRAY = 0x8074, NORMAL_ARRAY = 0x8075, COLOR_ARRAY = 0x8076, INDEX_ARRAY = 0x8077, @@ -260,13 +261,13 @@ public final class GL11 extends GL11C { TEXTURE_COORD_ARRAY_TYPE = 0x8089, TEXTURE_COORD_ARRAY_STRIDE = 0x808A, EDGE_FLAG_ARRAY_STRIDE = 0x808C; - public static final int TEXTURE_COMPONENTS = 0x1003, + int TEXTURE_COMPONENTS = 0x1003, TEXTURE_BORDER = 0x1005; - public static final int TEXTURE_LUMINANCE_SIZE = 0x8060, + int TEXTURE_LUMINANCE_SIZE = 0x8060, TEXTURE_INTENSITY_SIZE = 0x8061, TEXTURE_PRIORITY = 0x8066, TEXTURE_RESIDENT = 0x8067; - public static final int AMBIENT = 0x1200, + int AMBIENT = 0x1200, DIFFUSE = 0x1201, SPECULAR = 0x1202, POSITION = 0x1203, @@ -276,47 +277,47 @@ public final class GL11 extends GL11C { CONSTANT_ATTENUATION = 0x1207, LINEAR_ATTENUATION = 0x1208, QUADRATIC_ATTENUATION = 0x1209; - public static final int COMPILE = 0x1300, + int COMPILE = 0x1300, COMPILE_AND_EXECUTE = 0x1301; - public static final int GL_2_BYTES = 0x1407, + int GL_2_BYTES = 0x1407, GL_3_BYTES = 0x1408, GL_4_BYTES = 0x1409; - public static final int EMISSION = 0x1600, + int EMISSION = 0x1600, SHININESS = 0x1601, AMBIENT_AND_DIFFUSE = 0x1602, COLOR_INDEXES = 0x1603; - public static final int MODELVIEW = 0x1700, + int MODELVIEW = 0x1700, PROJECTION = 0x1701; - public static final int COLOR_INDEX = 0x1900, + int COLOR_INDEX = 0x1900, LUMINANCE = 0x1909, LUMINANCE_ALPHA = 0x190A; - public static final int BITMAP = 0x1A00; - public static final int RENDER = 0x1C00, + int BITMAP = 0x1A00; + int RENDER = 0x1C00, FEEDBACK = 0x1C01, SELECT = 0x1C02; - public static final int FLAT = 0x1D00, + int FLAT = 0x1D00, SMOOTH = 0x1D01; - public static final int S = 0x2000, + int S = 0x2000, T = 0x2001, R = 0x2003, Q = 0x2002; - public static final int MODULATE = 0x2100, + int MODULATE = 0x2100, DECAL = 0x2101; - public static final int TEXTURE_ENV_MODE = 0x2200, + int TEXTURE_ENV_MODE = 0x2200, TEXTURE_ENV_COLOR = 0x2201; - public static final int TEXTURE_ENV = 0x2300; - public static final int EYE_LINEAR = 0x2400, + int TEXTURE_ENV = 0x2300; + int EYE_LINEAR = 0x2400, OBJECT_LINEAR = 0x2401, SPHERE_MAP = 0x2402; - public static final int TEXTURE_GEN_MODE = 0x2500, + int TEXTURE_GEN_MODE = 0x2500, OBJECT_PLANE = 0x2501, EYE_PLANE = 0x2502; - public static final int CLAMP = 0x2900; - public static final int ALPHA4 = 0x803B, + int CLAMP = 0x2900; + int ALPHA4 = 0x803B, ALPHA8 = 0x803C, ALPHA12 = 0x803D, ALPHA16 = 0x803E; - public static final int LUMINANCE4 = 0x803F, + int LUMINANCE4 = 0x803F, LUMINANCE8 = 0x8040, LUMINANCE12 = 0x8041, LUMINANCE16 = 0x8042, @@ -326,12 +327,12 @@ public final class GL11 extends GL11C { LUMINANCE12_ALPHA4 = 0x8046, LUMINANCE12_ALPHA12 = 0x8047, LUMINANCE16_ALPHA16 = 0x8048; - public static final int INTENSITY = 0x8049, + int INTENSITY = 0x8049, INTENSITY4 = 0x804A, INTENSITY8 = 0x804B, INTENSITY12 = 0x804C, INTENSITY16 = 0x804D; - public static final int V2F = 0x2A20, + int V2F = 0x2A20, V3F = 0x2A21, C4UB_V2F = 0x2A22, C4UB_V3F = 0x2A23, @@ -345,13 +346,13 @@ public final class GL11 extends GL11C { T2F_N3F_V3F = 0x2A2B, T2F_C4F_N3F_V3F = 0x2A2C, T4F_C4F_N3F_V4F = 0x2A2D; - public static final int CLIP_PLANE0 = 0x3000, + int CLIP_PLANE0 = 0x3000, CLIP_PLANE1 = 0x3001, CLIP_PLANE2 = 0x3002, CLIP_PLANE3 = 0x3003, CLIP_PLANE4 = 0x3004, CLIP_PLANE5 = 0x3005; - public static final int LIGHT0 = 0x4000, + int LIGHT0 = 0x4000, LIGHT1 = 0x4001, LIGHT2 = 0x4002, LIGHT3 = 0x4003, @@ -360,292 +361,221 @@ public final class GL11 extends GL11C { LIGHT6 = 0x4006, LIGHT7 = 0x4007; - static void load(GLCapabilities caps, GLLoadFunc load) { - if (!caps.Ver11) return; - caps.glAreTexturesResident = load.invoke("glAreTexturesResident", IPPZ); - caps.glArrayElement = load.invoke("glArrayElement", IV); - caps.glColorPointer = load.invoke("glColorPointer", IIIPV); - caps.glDisableClientState = load.invoke("glDisableClientState", IV); - caps.glEdgeFlagPointer = load.invoke("glEdgeFlagPointer", IPV); - caps.glEnableClientState = load.invoke("glEnableClientState", IV); - caps.glIndexPointer = load.invoke("glIndexPointer", IIPV); - caps.glIndexub = load.invoke("glIndexub", BV); - caps.glIndexubv = load.invoke("glIndexubv", PV); - caps.glInterleavedArrays = load.invoke("glInterleavedArrays", IIPV); - caps.glNormalPointer = load.invoke("glNormalPointer", IIPV); - caps.glPopClientAttrib = load.invoke("glPopClientAttrib", V); - caps.glPrioritizeTextures = load.invoke("glPrioritizeTextures", IPPV); - caps.glPushClientAttrib = load.invoke("glPushClientAttrib", IV); - caps.glTexCoordPointer = load.invoke("glTexCoordPointer", IIIPV); - caps.glVertexPointer = load.invoke("glVertexPointer", IIIPV); - } - - public static boolean areTexturesResident(int n, MemorySegment textures, MemorySegment residences) { - var caps = getCapabilities(); - try { - return (boolean) check(caps.glAreTexturesResident).invokeExact(n, textures, residences); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static boolean areTexturesResident(SegmentAllocator allocator, int[] textures, boolean[] residences) { - final int n = textures.length; - var pTex = allocator.allocate(JAVA_INT, n); - var pRes = allocator.allocate(JAVA_BOOLEAN, n); - boolean b = areTexturesResident(n, pTex, pRes); - for (int i = 0; i < n; i++) { - textures[i] = pTex.getAtIndex(JAVA_INT, i); - residences[i] = pTex.get(JAVA_BOOLEAN, i); - } + @Entrypoint("glAreTexturesResident") + default boolean areTexturesResident(int n, MemorySegment textures, MemorySegment residences) { + throw new ContextException(); + } + + @Skip + default boolean areTexturesResident(SegmentAllocator allocator, int[] textures, @Ref boolean[] residences) { + var pRes = Marshal.marshal(allocator, residences); + boolean b = areTexturesResident(textures.length, Marshal.marshal(allocator, textures), pRes); + Unmarshal.copy(pRes, residences); return b; } - public static void arrayElement(int i) { - var caps = getCapabilities(); - try { - check(caps.glArrayElement).invokeExact(i); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glArrayElement") + default void arrayElement(int i) { + throw new ContextException(); } - public static void colorPointer(int size, int type, int stride, MemorySegment pointer) { - var caps = getCapabilities(); - try { - check(caps.glColorPointer).invokeExact(size, type, stride, pointer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColorPointer") + default void colorPointer(int size, int type, int stride, MemorySegment pointer) { + throw new ContextException(); } - public static void colorPointer(SegmentAllocator allocator, int size, int type, int stride, byte[] pointer) { - colorPointer(size, type, stride, allocator.allocateFrom(JAVA_BYTE, pointer)); + @Entrypoint("glColorPointer") + default void colorPointer(SegmentAllocator allocator, int size, int type, int stride, byte[] pointer) { + throw new ContextException(); } - public static void colorPointer(SegmentAllocator allocator, int size, int type, int stride, short[] pointer) { - colorPointer(size, type, stride, allocator.allocateFrom(JAVA_SHORT, pointer)); + @Entrypoint("glColorPointer") + default void colorPointer(SegmentAllocator allocator, int size, int type, int stride, short[] pointer) { + throw new ContextException(); } - public static void colorPointer(SegmentAllocator allocator, int size, int type, int stride, int[] pointer) { - colorPointer(size, type, stride, allocator.allocateFrom(JAVA_INT, pointer)); + @Entrypoint("glColorPointer") + default void colorPointer(SegmentAllocator allocator, int size, int type, int stride, int[] pointer) { + throw new ContextException(); } - public static void colorPointer(SegmentAllocator allocator, int size, int type, int stride, float[] pointer) { - colorPointer(size, type, stride, allocator.allocateFrom(JAVA_FLOAT, pointer)); + @Entrypoint("glColorPointer") + default void colorPointer(SegmentAllocator allocator, int size, int type, int stride, float[] pointer) { + throw new ContextException(); } - public static void colorPointer(SegmentAllocator allocator, int size, int type, int stride, double[] pointer) { - colorPointer(size, type, stride, allocator.allocateFrom(JAVA_DOUBLE, pointer)); + @Entrypoint("glColorPointer") + default void colorPointer(SegmentAllocator allocator, int size, int type, int stride, double[] pointer) { + throw new ContextException(); } - public static void disableClientState(int array) { - var caps = getCapabilities(); - try { - check(caps.glDisableClientState).invokeExact(array); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDisableClientState") + default void disableClientState(int array) { + throw new ContextException(); } - public static void edgeFlagPointer(int stride, MemorySegment pointer) { - var caps = getCapabilities(); - try { - check(caps.glEdgeFlagPointer).invokeExact(stride, pointer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEdgeFlagPointer") + default void edgeFlagPointer(int stride, MemorySegment pointer) { + throw new ContextException(); } - public static void enableClientState(int array) { - var caps = getCapabilities(); - try { - check(caps.glEnableClientState).invokeExact(array); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEnableClientState") + default void enableClientState(int array) { + throw new ContextException(); } - public static void indexPointer(int type, int stride, MemorySegment pointer) { - var caps = getCapabilities(); - try { - check(caps.glIndexPointer).invokeExact(type, stride, pointer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIndexPointer") + default void indexPointer(int type, int stride, MemorySegment pointer) { + throw new ContextException(); } - public static void indexPointer(SegmentAllocator allocator, int type, int stride, byte[] pointer) { - indexPointer(type, stride, allocator.allocateFrom(JAVA_BYTE, pointer)); + @Entrypoint("glIndexPointer") + default void indexPointer(SegmentAllocator allocator, int type, int stride, byte[] pointer) { + throw new ContextException(); } - public static void indexPointer(SegmentAllocator allocator, int type, int stride, short[] pointer) { - indexPointer(type, stride, allocator.allocateFrom(JAVA_SHORT, pointer)); + @Entrypoint("glIndexPointer") + default void indexPointer(SegmentAllocator allocator, int type, int stride, short[] pointer) { + throw new ContextException(); } - public static void indexPointer(SegmentAllocator allocator, int type, int stride, int[] pointer) { - indexPointer(type, stride, allocator.allocateFrom(JAVA_INT, pointer)); + @Entrypoint("glIndexPointer") + default void indexPointer(SegmentAllocator allocator, int type, int stride, int[] pointer) { + throw new ContextException(); } - public static void indexPointer(SegmentAllocator allocator, int type, int stride, float[] pointer) { - indexPointer(type, stride, allocator.allocateFrom(JAVA_FLOAT, pointer)); + @Entrypoint("glIndexPointer") + default void indexPointer(SegmentAllocator allocator, int type, int stride, float[] pointer) { + throw new ContextException(); } - public static void indexPointer(SegmentAllocator allocator, int type, int stride, double[] pointer) { - indexPointer(type, stride, allocator.allocateFrom(JAVA_DOUBLE, pointer)); + @Entrypoint("glIndexPointer") + default void indexPointer(SegmentAllocator allocator, int type, int stride, double[] pointer) { + throw new ContextException(); } - public static void indexub(byte c) { - var caps = getCapabilities(); - try { - check(caps.glIndexub).invokeExact(c); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIndexub") + default void indexub(byte c) { + throw new ContextException(); } - public static void indexubv(MemorySegment c) { - var caps = getCapabilities(); - try { - check(caps.glIndexubv).invokeExact(c); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIndexubv") + default void indexubv(MemorySegment c) { + throw new ContextException(); } - public static void indexubv(SegmentAllocator allocator, byte[] c) { - var pc = allocator.allocateFrom(JAVA_BYTE, c); - indexubv(pc); + @Entrypoint("glIndexubv") + default void indexubv(SegmentAllocator allocator, byte[] c) { + throw new ContextException(); } - public static void interleavedArrays(int format, int stride, MemorySegment pointer) { - var caps = getCapabilities(); - try { - check(caps.glInterleavedArrays).invokeExact(format, stride, pointer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glInterleavedArrays") + default void interleavedArrays(int format, int stride, MemorySegment pointer) { + throw new ContextException(); } - public static void interleavedArrays(SegmentAllocator allocator, int format, int stride, float[] pointer) { - var pp = allocator.allocateFrom(JAVA_FLOAT, pointer); - interleavedArrays(format, stride, pp); + @Entrypoint("glInterleavedArrays") + default void interleavedArrays(SegmentAllocator allocator, int format, int stride, float[] pointer) { + throw new ContextException(); } - public static void normalPointer(int type, int stride, MemorySegment pointer) { - var caps = getCapabilities(); - try { - check(caps.glNormalPointer).invokeExact(type, stride, pointer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNormalPointer") + default void normalPointer(int type, int stride, MemorySegment pointer) { + throw new ContextException(); } - public static void normalPointer(SegmentAllocator allocator, int type, int stride, byte[] pointer) { - normalPointer(type, stride, allocator.allocateFrom(JAVA_BYTE, pointer)); + @Entrypoint("glNormalPointer") + default void normalPointer(SegmentAllocator allocator, int type, int stride, byte[] pointer) { + throw new ContextException(); } - public static void normalPointer(SegmentAllocator allocator, int type, int stride, short[] pointer) { - normalPointer(type, stride, allocator.allocateFrom(JAVA_SHORT, pointer)); + @Entrypoint("glNormalPointer") + default void normalPointer(SegmentAllocator allocator, int type, int stride, short[] pointer) { + throw new ContextException(); } - public static void normalPointer(SegmentAllocator allocator, int type, int stride, int[] pointer) { - normalPointer(type, stride, allocator.allocateFrom(JAVA_INT, pointer)); + @Entrypoint("glNormalPointer") + default void normalPointer(SegmentAllocator allocator, int type, int stride, int[] pointer) { + throw new ContextException(); } - public static void normalPointer(SegmentAllocator allocator, int type, int stride, float[] pointer) { - normalPointer(type, stride, allocator.allocateFrom(JAVA_FLOAT, pointer)); + @Entrypoint("glNormalPointer") + default void normalPointer(SegmentAllocator allocator, int type, int stride, float[] pointer) { + throw new ContextException(); } - public static void normalPointer(SegmentAllocator allocator, int type, int stride, double[] pointer) { - normalPointer(type, stride, allocator.allocateFrom(JAVA_DOUBLE, pointer)); + @Entrypoint("glNormalPointer") + default void normalPointer(SegmentAllocator allocator, int type, int stride, double[] pointer) { + throw new ContextException(); } - public static void popClientAttrib() { - var caps = getCapabilities(); - try { - check(caps.glPopClientAttrib).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPopClientAttrib") + default void popClientAttrib() { + throw new ContextException(); } - public static void prioritizeTextures(int n, MemorySegment textures, MemorySegment priorities) { - var caps = getCapabilities(); - try { - check(caps.glPrioritizeTextures).invokeExact(n, textures, priorities); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPrioritizeTextures") + default void prioritizeTextures(int n, MemorySegment textures, MemorySegment priorities) { + throw new ContextException(); } - public static void prioritizeTextures(SegmentAllocator allocator, int[] textures, float[] priorities) { - final int n = textures.length; - var pTex = allocator.allocate(JAVA_INT, n); - var pPri = allocator.allocate(JAVA_FLOAT, n); - for (int i = 0; i < n; i++) { - pTex.setAtIndex(JAVA_INT, i, textures[i]); - pPri.setAtIndex(JAVA_FLOAT, i, priorities[i]); - } - prioritizeTextures(n, pTex, pPri); + @Skip + default void prioritizeTextures(SegmentAllocator allocator, int[] textures, float[] priorities) { + prioritizeTextures(textures.length, Marshal.marshal(allocator, textures), Marshal.marshal(allocator, priorities)); } - public static void pushClientAttrib(int mask) { - var caps = getCapabilities(); - try { - check(caps.glPushClientAttrib).invokeExact(mask); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPushClientAttrib") + default void pushClientAttrib(int mask) { + throw new ContextException(); } - public static void texCoordPointer(int size, int type, int stride, MemorySegment pointer) { - var caps = getCapabilities(); - try { - check(caps.glTexCoordPointer).invokeExact(size, type, stride, pointer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexCoordPointer") + default void texCoordPointer(int size, int type, int stride, MemorySegment pointer) { + throw new ContextException(); } - public static void texCoordPointer(SegmentAllocator allocator, int size, int type, int stride, short[] pointer) { - texCoordPointer(size, type, stride, allocator.allocateFrom(JAVA_SHORT, pointer)); + @Entrypoint("glTexCoordPointer") + default void texCoordPointer(SegmentAllocator allocator, int size, int type, int stride, short[] pointer) { + throw new ContextException(); } - public static void texCoordPointer(SegmentAllocator allocator, int size, int type, int stride, int[] pointer) { - texCoordPointer(size, type, stride, allocator.allocateFrom(JAVA_INT, pointer)); + @Entrypoint("glTexCoordPointer") + default void texCoordPointer(SegmentAllocator allocator, int size, int type, int stride, int[] pointer) { + throw new ContextException(); } - public static void texCoordPointer(SegmentAllocator allocator, int size, int type, int stride, float[] pointer) { - texCoordPointer(size, type, stride, allocator.allocateFrom(JAVA_FLOAT, pointer)); + @Entrypoint("glTexCoordPointer") + default void texCoordPointer(SegmentAllocator allocator, int size, int type, int stride, float[] pointer) { + throw new ContextException(); } - public static void texCoordPointer(SegmentAllocator allocator, int size, int type, int stride, double[] pointer) { - texCoordPointer(size, type, stride, allocator.allocateFrom(JAVA_DOUBLE, pointer)); + @Entrypoint("glTexCoordPointer") + default void texCoordPointer(SegmentAllocator allocator, int size, int type, int stride, double[] pointer) { + throw new ContextException(); } - public static void vertexPointer(int size, int type, int stride, MemorySegment pointer) { - var caps = getCapabilities(); - try { - check(caps.glVertexPointer).invokeExact(size, type, stride, pointer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexPointer") + default void vertexPointer(int size, int type, int stride, MemorySegment pointer) { + throw new ContextException(); } - public static void vertexPointer(SegmentAllocator allocator, int size, int type, int stride, short[] pointer) { - vertexPointer(size, type, stride, allocator.allocateFrom(JAVA_SHORT, pointer)); + @Entrypoint("glVertexPointer") + default void vertexPointer(SegmentAllocator allocator, int size, int type, int stride, short[] pointer) { + throw new ContextException(); } - public static void vertexPointer(SegmentAllocator allocator, int size, int type, int stride, int[] pointer) { - vertexPointer(size, type, stride, allocator.allocateFrom(JAVA_INT, pointer)); + @Entrypoint("glVertexPointer") + default void vertexPointer(SegmentAllocator allocator, int size, int type, int stride, int[] pointer) { + throw new ContextException(); } - public static void vertexPointer(SegmentAllocator allocator, int size, int type, int stride, float[] pointer) { - vertexPointer(size, type, stride, allocator.allocateFrom(JAVA_FLOAT, pointer)); + @Entrypoint("glVertexPointer") + default void vertexPointer(SegmentAllocator allocator, int size, int type, int stride, float[] pointer) { + throw new ContextException(); } - public static void vertexPointer(SegmentAllocator allocator, int size, int type, int stride, double[] pointer) { - vertexPointer(size, type, stride, allocator.allocateFrom(JAVA_DOUBLE, pointer)); + @Entrypoint("glVertexPointer") + default void vertexPointer(SegmentAllocator allocator, int size, int type, int stride, double[] pointer) { + throw new ContextException(); } } 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 0145d20c..edbc0a3b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL11C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL11C.java @@ -16,15 +16,16 @@ package overrungl.opengl; -import overrungl.internal.RuntimeHelper; -import overrungl.util.MemoryStack; +import overrun.marshal.Marshal; +import overrun.marshal.MemoryStack; +import overrun.marshal.Unmarshal; +import overrun.marshal.gen.Entrypoint; +import overrun.marshal.gen.Ref; +import overrun.marshal.gen.Skip; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; - -import static java.lang.foreign.ValueLayout.*; -import static overrungl.FunctionDescriptors.*; -import static overrungl.opengl.GLLoader.*; +import java.lang.foreign.ValueLayout; /** * The OpenGL 1.1 forward compatible functions. @@ -32,277 +33,193 @@ * @author squid233 * @since 0.1.0 */ -public sealed class GL11C extends GL10C permits GL11, GL12C { - public static final int COLOR_LOGIC_OP = 0x0BF2; - public static final int POLYGON_OFFSET_UNITS = 0x2A00; - public static final int POLYGON_OFFSET_POINT = 0x2A01; - public static final int POLYGON_OFFSET_LINE = 0x2A02; - public static final int POLYGON_OFFSET_FILL = 0x8037; - public static final int POLYGON_OFFSET_FACTOR = 0x8038; - public static final int TEXTURE_BINDING_1D = 0x8068; - public static final int TEXTURE_BINDING_2D = 0x8069; - public static final int TEXTURE_INTERNAL_FORMAT = 0x1003; - public static final int TEXTURE_RED_SIZE = 0x805C; - public static final int TEXTURE_GREEN_SIZE = 0x805D; - public static final int TEXTURE_BLUE_SIZE = 0x805E; - public static final int TEXTURE_ALPHA_SIZE = 0x805F; - public static final int DOUBLE = 0x140A; - public static final int PROXY_TEXTURE_1D = 0x8063; - public static final int PROXY_TEXTURE_2D = 0x8064; - public static final int R3_G3_B2 = 0x2A10; - public static final int RGB4 = 0x804F; - public static final int RGB5 = 0x8050; - public static final int RGB8 = 0x8051; - public static final int RGB10 = 0x8052; - public static final int RGB12 = 0x8053; - public static final int RGB16 = 0x8054; - public static final int RGBA2 = 0x8055; - public static final int RGBA4 = 0x8056; - public static final int RGB5_A1 = 0x8057; - public static final int RGBA8 = 0x8058; - public static final int RGB10_A2 = 0x8059; - public static final int RGBA12 = 0x805A; - public static final int RGBA16 = 0x805B; - public static final int VERTEX_ARRAY = 0x8074; - - static boolean isSupported(GLCapabilities caps) { - return checkAll(caps.glBindTexture, caps.glCopyTexImage1D, caps.glCopyTexImage2D, caps.glCopyTexSubImage1D, caps.glCopyTexSubImage2D, caps.glDeleteTextures, - caps.glDrawArrays, caps.glDrawElements, caps.glGenTextures, caps.glGetPointerv, caps.glIsTexture, caps.glPolygonOffset, - caps.glTexSubImage1D, caps.glTexSubImage2D); - } - - static void load(GLCapabilities caps, GLLoadFunc load) { - caps.glBindTexture = load.invoke("glBindTexture", IIV); - caps.glCopyTexImage1D = load.invoke("glCopyTexImage1D", IIIIIIIV); - caps.glCopyTexImage2D = load.invoke("glCopyTexImage2D", IIIIIIIIV); - caps.glCopyTexSubImage1D = load.invoke("glCopyTexSubImage1D", IIIIIIV); - caps.glCopyTexSubImage2D = load.invoke("glCopyTexSubImage2D", IIIIIIIIV); - caps.glDeleteTextures = load.invoke("glDeleteTextures", IPV); - caps.glDrawArrays = load.invoke("glDrawArrays", IIIV); - caps.glDrawElements = load.invoke("glDrawElements", IIIPV); - 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); - } - - public static void bindTexture(int target, int texture) { - var caps = getCapabilities(); - try { - check(caps.glBindTexture).invokeExact(target, texture); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } +public sealed interface GL11C extends GL10C permits GL11, GL12C { + int COLOR_LOGIC_OP = 0x0BF2; + int POLYGON_OFFSET_UNITS = 0x2A00; + int POLYGON_OFFSET_POINT = 0x2A01; + int POLYGON_OFFSET_LINE = 0x2A02; + int POLYGON_OFFSET_FILL = 0x8037; + int POLYGON_OFFSET_FACTOR = 0x8038; + int TEXTURE_BINDING_1D = 0x8068; + int TEXTURE_BINDING_2D = 0x8069; + int TEXTURE_INTERNAL_FORMAT = 0x1003; + int TEXTURE_RED_SIZE = 0x805C; + int TEXTURE_GREEN_SIZE = 0x805D; + int TEXTURE_BLUE_SIZE = 0x805E; + int TEXTURE_ALPHA_SIZE = 0x805F; + int DOUBLE = 0x140A; + int PROXY_TEXTURE_1D = 0x8063; + int PROXY_TEXTURE_2D = 0x8064; + int R3_G3_B2 = 0x2A10; + int RGB4 = 0x804F; + int RGB5 = 0x8050; + int RGB8 = 0x8051; + int RGB10 = 0x8052; + int RGB12 = 0x8053; + int RGB16 = 0x8054; + int RGBA2 = 0x8055; + int RGBA4 = 0x8056; + int RGB5_A1 = 0x8057; + int RGBA8 = 0x8058; + int RGB10_A2 = 0x8059; + int RGBA12 = 0x805A; + int RGBA16 = 0x805B; + int VERTEX_ARRAY = 0x8074; - public static void copyTexImage1D(int target, int level, int internalFormat, int x, int y, int width, int border) { - var caps = getCapabilities(); - try { - check(caps.glCopyTexImage1D).invokeExact(target, level, internalFormat, x, y, width, border); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glBindTexture") + default void bindTexture(int target, int texture) { + throw new ContextException(); } - public static void copyTexImage2D(int target, int level, int internalFormat, int x, int y, int width, int height, int border) { - var caps = getCapabilities(); - try { - check(caps.glCopyTexImage2D).invokeExact(target, level, internalFormat, x, y, width, height, border); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCopyTexImage1D") + default void copyTexImage1D(int target, int level, int internalFormat, int x, int y, int width, int border) { + throw new ContextException(); } - public static void copyTexSubImage1D(int target, int level, int xoffset, int x, int y, int width) { - var caps = getCapabilities(); - try { - check(caps.glCopyTexSubImage1D).invokeExact(target, level, xoffset, x, y, width); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCopyTexImage2D") + default void copyTexImage2D(int target, int level, int internalFormat, int x, int y, int width, int height, int border) { + throw new ContextException(); } - public static void copyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x, int y, int width, int height) { - var caps = getCapabilities(); - try { - check(caps.glCopyTexSubImage2D).invokeExact(target, level, xoffset, yoffset, x, y, width, height); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCopyTexSubImage1D") + default void copyTexSubImage1D(int target, int level, int xoffset, int x, int y, int width) { + throw new ContextException(); } - public static void deleteTextures(int n, MemorySegment textures) { - var caps = getCapabilities(); - try { - check(caps.glDeleteTextures).invokeExact(n, textures); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCopyTexSubImage2D") + default void copyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x, int y, int width, int height) { + throw new ContextException(); } - public static void deleteTextures(SegmentAllocator allocator, int[] textures) { - deleteTextures(textures.length, allocator.allocateFrom(JAVA_INT, textures)); + @Entrypoint("glDeleteTextures") + default void deleteTextures(int n, MemorySegment textures) { + throw new ContextException(); } - public static void deleteTexture(int texture) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - deleteTextures(1, stack.ints(texture)); - } finally { - stack.setPointer(stackPointer); + @Skip + default void deleteTextures(int... textures) { + try (MemoryStack stack = MemoryStack.stackPush()) { + deleteTextures(textures.length, Marshal.marshal(stack, textures)); } } - public static void drawArrays(int mode, int first, int count) { - var caps = getCapabilities(); - try { - check(caps.glDrawArrays).invokeExact(mode, first, count); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDrawArrays") + default void drawArrays(int mode, int first, int count) { + throw new ContextException(); } - public static void drawElements(int mode, int count, int type, MemorySegment indices) { - var caps = getCapabilities(); - try { - check(caps.glDrawElements).invokeExact(mode, count, type, indices); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDrawElements") + default void drawElements(int mode, int count, int type, MemorySegment indices) { + throw new ContextException(); } - public static void drawElements(SegmentAllocator allocator, int mode, int count, int type, byte[] indices) { - var seg = allocator.allocateFrom(JAVA_BYTE, indices); - drawElements(mode, count, type, seg); + @Entrypoint("glDrawElements") + default void drawElements(SegmentAllocator allocator, int mode, int count, int type, byte[] indices) { + throw new ContextException(); } - public static void drawElements(SegmentAllocator allocator, int mode, int count, int type, short[] indices) { - var seg = allocator.allocateFrom(JAVA_SHORT, indices); - drawElements(mode, count, type, seg); + @Entrypoint("glDrawElements") + default void drawElements(SegmentAllocator allocator, int mode, int count, int type, short[] indices) { + throw new ContextException(); } - public static void drawElements(SegmentAllocator allocator, int mode, int count, int type, int[] indices) { - var seg = allocator.allocateFrom(JAVA_INT, indices); - drawElements(mode, count, type, seg); + @Entrypoint("glDrawElements") + default void drawElements(SegmentAllocator allocator, int mode, int count, int type, int[] indices) { + throw new ContextException(); } - public static void genTextures(int n, MemorySegment textures) { - var caps = getCapabilities(); - try { - check(caps.glGenTextures).invokeExact(n, textures); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGenTextures") + default void genTextures(int n, MemorySegment textures) { + throw new ContextException(); } - public static void genTextures(SegmentAllocator allocator, int[] textures) { - final int n = textures.length; - var pTex = allocator.allocate(JAVA_INT, n); - genTextures(n, pTex); - RuntimeHelper.toArray(pTex, textures); + @Skip + default void genTextures(SegmentAllocator allocator, @Ref int[] textures) { + var pTex = Marshal.marshal(allocator, textures); + genTextures(textures.length, pTex); + Unmarshal.copy(pTex, textures); } - public static int genTexture() { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pTex = stack.callocInt(); + @Skip + default int genTextures() { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pTex = stack.ints(0); genTextures(1, pTex); - return pTex.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); + return pTex.get(ValueLayout.JAVA_INT, 0); } } - public static void getPointerv(int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetPointerv).invokeExact(pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetPointerv") + default void getPointerv(int pname, MemorySegment params) { + throw new ContextException(); } - public static MemorySegment getPointer(int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pParams = stack.callocPointer(); + @Skip + default MemorySegment getPointer(int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pParams = stack.segments(MemorySegment.NULL); getPointerv(pname, pParams); - return pParams.get(RuntimeHelper.ADDRESS_UNBOUNDED, 0); - } finally { - stack.setPointer(stackPointer); + return pParams.get(ValueLayout.ADDRESS, 0); } } - public static boolean isTexture(int texture) { - var caps = getCapabilities(); - try { - return (boolean) check(caps.glIsTexture).invokeExact(texture); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIsTexture") + default boolean isTexture(int texture) { + throw new ContextException(); } - public static void polygonOffset(float factor, float units) { - var caps = getCapabilities(); - try { - check(caps.glPolygonOffset).invokeExact(factor, units); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPolygonOffset") + default void polygonOffset(float factor, float units) { + throw new ContextException(); } - public static void texSubImage1D(int target, int level, int xoffset, int width, int format, int type, MemorySegment pixels) { - var caps = getCapabilities(); - try { - check(caps.glTexSubImage1D).invokeExact(target, level, xoffset, width, format, type, pixels); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexSubImage1D") + default void texSubImage1D(int target, int level, int xoffset, int width, int format, int type, MemorySegment pixels) { + throw new ContextException(); } - public static void texSubImage1D(SegmentAllocator allocator, int target, int level, int xoffset, int width, int format, int type, byte[] pixels) { - texSubImage1D(target, level, xoffset, width, format, type, allocator.allocateFrom(JAVA_BYTE, pixels)); + @Entrypoint("glTexSubImage1D") + default void texSubImage1D(SegmentAllocator allocator, int target, int level, int xoffset, int width, int format, int type, byte[] pixels) { + throw new ContextException(); } - public static void texSubImage1D(SegmentAllocator allocator, int target, int level, int xoffset, int width, int format, int type, short[] pixels) { - texSubImage1D(target, level, xoffset, width, format, type, allocator.allocateFrom(JAVA_SHORT, pixels)); + @Entrypoint("glTexSubImage1D") + default void texSubImage1D(SegmentAllocator allocator, int target, int level, int xoffset, int width, int format, int type, short[] pixels) { + throw new ContextException(); } - public static void texSubImage1D(SegmentAllocator allocator, int target, int level, int xoffset, int width, int format, int type, int[] pixels) { - texSubImage1D(target, level, xoffset, width, format, type, allocator.allocateFrom(JAVA_INT, pixels)); + @Entrypoint("glTexSubImage1D") + default void texSubImage1D(SegmentAllocator allocator, int target, int level, int xoffset, int width, int format, int type, int[] pixels) { + throw new ContextException(); } - public static void texSubImage1D(SegmentAllocator allocator, int target, int level, int xoffset, int width, int format, int type, float[] pixels) { - texSubImage1D(target, level, xoffset, width, format, type, allocator.allocateFrom(JAVA_FLOAT, pixels)); + @Entrypoint("glTexSubImage1D") + default void texSubImage1D(SegmentAllocator allocator, int target, int level, int xoffset, int width, int format, int type, float[] pixels) { + throw new ContextException(); } - public static void texSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, MemorySegment pixels) { - var caps = getCapabilities(); - try { - check(caps.glTexSubImage2D).invokeExact(target, level, xoffset, yoffset, width, height, format, type, pixels); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexSubImage2D") + default void texSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, MemorySegment pixels) { + throw new ContextException(); } - public static void texSubImage2D(SegmentAllocator allocator, int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, byte[] pixels) { - texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, allocator.allocateFrom(JAVA_BYTE, pixels)); + @Entrypoint("glTexSubImage2D") + default void texSubImage2D(SegmentAllocator allocator, int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, byte[] pixels) { + throw new ContextException(); } - public static void texSubImage2D(SegmentAllocator allocator, int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, short[] pixels) { - texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, allocator.allocateFrom(JAVA_SHORT, pixels)); + @Entrypoint("glTexSubImage2D") + default void texSubImage2D(SegmentAllocator allocator, int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, short[] pixels) { + throw new ContextException(); } - public static void texSubImage2D(SegmentAllocator allocator, int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, int[] pixels) { - texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, allocator.allocateFrom(JAVA_INT, pixels)); + @Entrypoint("glTexSubImage2D") + default void texSubImage2D(SegmentAllocator allocator, int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, int[] pixels) { + throw new ContextException(); } - public static void texSubImage2D(SegmentAllocator allocator, int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, float[] pixels) { - texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, allocator.allocateFrom(JAVA_FLOAT, pixels)); + @Entrypoint("glTexSubImage2D") + default void texSubImage2D(SegmentAllocator allocator, int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, float[] pixels) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL12.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL12.java index ac36dcb3..fe1e25a6 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL12.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL12.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2023 Overrun Organization + * Copyright (c) 2023-2024 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 @@ -22,10 +22,10 @@ * @author squid233 * @since 0.1.0 */ -public final class GL12 extends GL12C { - public static final int RESCALE_NORMAL = 0x803A; - public static final int LIGHT_MODEL_COLOR_CONTROL = 0x81F8, +public sealed interface GL12 extends GL12C permits GLLegacy { + int RESCALE_NORMAL = 0x803A; + int LIGHT_MODEL_COLOR_CONTROL = 0x81F8, SINGLE_COLOR = 0x81F9, SEPARATE_SPECULAR_COLOR = 0x81FA; - public static final int ALIASED_POINT_SIZE_RANGE = 0x846D; + int ALIASED_POINT_SIZE_RANGE = 0x846D; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL12C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL12C.java index 6aaf560b..ea487872 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL12C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL12C.java @@ -16,144 +16,127 @@ package overrungl.opengl; +import overrun.marshal.gen.Entrypoint; + import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.FunctionDescriptors.*; - /** * The OpenGL 1.2 forward compatible functions. * * @author squid233 * @since 0.1.0 */ -public sealed class GL12C extends GL11C permits GL12, GL13C { - public static final int UNSIGNED_BYTE_3_3_2 = 0x8032; - public static final int UNSIGNED_SHORT_4_4_4_4 = 0x8033; - public static final int UNSIGNED_SHORT_5_5_5_1 = 0x8034; - public static final int UNSIGNED_INT_8_8_8_8 = 0x8035; - public static final int UNSIGNED_INT_10_10_10_2 = 0x8036; - public static final int TEXTURE_BINDING_3D = 0x806A; - public static final int PACK_SKIP_IMAGES = 0x806B; - public static final int PACK_IMAGE_HEIGHT = 0x806C; - public static final int UNPACK_SKIP_IMAGES = 0x806D; - public static final int UNPACK_IMAGE_HEIGHT = 0x806E; - public static final int TEXTURE_3D = 0x806F; - public static final int PROXY_TEXTURE_3D = 0x8070; - public static final int TEXTURE_DEPTH = 0x8071; - public static final int TEXTURE_WRAP_R = 0x8072; - public static final int MAX_3D_TEXTURE_SIZE = 0x8073; - public static final int UNSIGNED_BYTE_2_3_3_REV = 0x8362; - public static final int UNSIGNED_SHORT_5_6_5 = 0x8363; - public static final int UNSIGNED_SHORT_5_6_5_REV = 0x8364; - public static final int UNSIGNED_SHORT_4_4_4_4_REV = 0x8365; - public static final int UNSIGNED_SHORT_1_5_5_5_REV = 0x8366; - public static final int UNSIGNED_INT_8_8_8_8_REV = 0x8367; - public static final int UNSIGNED_INT_2_10_10_10_REV = 0x8368; - public static final int BGR = 0x80E0; - public static final int BGRA = 0x80E1; - public static final int MAX_ELEMENTS_VERTICES = 0x80E8; - public static final int MAX_ELEMENTS_INDICES = 0x80E9; - public static final int CLAMP_TO_EDGE = 0x812F; - public static final int TEXTURE_MIN_LOD = 0x813A; - public static final int TEXTURE_MAX_LOD = 0x813B; - public static final int TEXTURE_BASE_LEVEL = 0x813C; - public static final int TEXTURE_MAX_LEVEL = 0x813D; - public static final int SMOOTH_POINT_SIZE_RANGE = 0x0B12; - public static final int SMOOTH_POINT_SIZE_GRANULARITY = 0x0B13; - public static final int SMOOTH_LINE_WIDTH_RANGE = 0x0B22; - public static final int SMOOTH_LINE_WIDTH_GRANULARITY = 0x0B23; - public static final int ALIASED_LINE_WIDTH_RANGE = 0x846E; - - static boolean isSupported(GLCapabilities caps) { - return GLLoader.checkAll(caps.glCopyTexSubImage3D, caps.glDrawRangeElements, caps.glTexImage3D, caps.glTexSubImage3D); - } - - static void load(GLCapabilities caps, GLLoadFunc load) { - caps.glCopyTexSubImage3D = load.invoke("glCopyTexSubImage3D", IIIIIIIIIV); - caps.glDrawRangeElements = load.invoke("glDrawRangeElements", IIIIIPV); - caps.glTexImage3D = load.invoke("glTexImage3D", IIIIIIIIIPV); - caps.glTexSubImage3D = load.invoke("glTexSubImage3D", IIIIIIIIIIPV); - } +public sealed interface GL12C extends GL11C permits GL12, GL13C { + int UNSIGNED_BYTE_3_3_2 = 0x8032; + int UNSIGNED_SHORT_4_4_4_4 = 0x8033; + int UNSIGNED_SHORT_5_5_5_1 = 0x8034; + int UNSIGNED_INT_8_8_8_8 = 0x8035; + int UNSIGNED_INT_10_10_10_2 = 0x8036; + int TEXTURE_BINDING_3D = 0x806A; + int PACK_SKIP_IMAGES = 0x806B; + int PACK_IMAGE_HEIGHT = 0x806C; + int UNPACK_SKIP_IMAGES = 0x806D; + int UNPACK_IMAGE_HEIGHT = 0x806E; + int TEXTURE_3D = 0x806F; + int PROXY_TEXTURE_3D = 0x8070; + int TEXTURE_DEPTH = 0x8071; + int TEXTURE_WRAP_R = 0x8072; + int MAX_3D_TEXTURE_SIZE = 0x8073; + int UNSIGNED_BYTE_2_3_3_REV = 0x8362; + int UNSIGNED_SHORT_5_6_5 = 0x8363; + int UNSIGNED_SHORT_5_6_5_REV = 0x8364; + int UNSIGNED_SHORT_4_4_4_4_REV = 0x8365; + int UNSIGNED_SHORT_1_5_5_5_REV = 0x8366; + int UNSIGNED_INT_8_8_8_8_REV = 0x8367; + int UNSIGNED_INT_2_10_10_10_REV = 0x8368; + int BGR = 0x80E0; + int BGRA = 0x80E1; + int MAX_ELEMENTS_VERTICES = 0x80E8; + int MAX_ELEMENTS_INDICES = 0x80E9; + int CLAMP_TO_EDGE = 0x812F; + int TEXTURE_MIN_LOD = 0x813A; + int TEXTURE_MAX_LOD = 0x813B; + int TEXTURE_BASE_LEVEL = 0x813C; + int TEXTURE_MAX_LEVEL = 0x813D; + int SMOOTH_POINT_SIZE_RANGE = 0x0B12; + int SMOOTH_POINT_SIZE_GRANULARITY = 0x0B13; + int SMOOTH_LINE_WIDTH_RANGE = 0x0B22; + int SMOOTH_LINE_WIDTH_GRANULARITY = 0x0B23; + int ALIASED_LINE_WIDTH_RANGE = 0x846E; - public static void copyTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glCopyTexSubImage3D).invokeExact(target, level, xoffset, yoffset, zoffset, x, y, width, height); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCopyTexSubImage3D") + default void copyTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height) { + throw new ContextException(); } - public static void drawRangeElements(int mode, int start, int end, int count, int type, MemorySegment indices) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glDrawRangeElements).invokeExact(mode, start, end, count, type, indices); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDrawRangeElements") + default void drawRangeElements(int mode, int start, int end, int count, int type, MemorySegment indices) { + throw new ContextException(); } - public static void drawRangeElements(SegmentAllocator allocator, int mode, int start, int end, int count, int type, byte[] indices) { - drawRangeElements(mode, start, end, count, type, allocator.allocateFrom(JAVA_BYTE, indices)); + @Entrypoint("glDrawRangeElements") + default void drawRangeElements(SegmentAllocator allocator, int mode, int start, int end, int count, int type, byte[] indices) { + throw new ContextException(); } - public static void drawRangeElements(SegmentAllocator allocator, int mode, int start, int end, int count, int type, short[] indices) { - drawRangeElements(mode, start, end, count, type, allocator.allocateFrom(JAVA_SHORT, indices)); + @Entrypoint("glDrawRangeElements") + default void drawRangeElements(SegmentAllocator allocator, int mode, int start, int end, int count, int type, short[] indices) { + throw new ContextException(); } - public static void drawRangeElements(SegmentAllocator allocator, int mode, int start, int end, int count, int type, int[] indices) { - drawRangeElements(mode, start, end, count, type, allocator.allocateFrom(JAVA_INT, indices)); + @Entrypoint("glDrawRangeElements") + default void drawRangeElements(SegmentAllocator allocator, int mode, int start, int end, int count, int type, int[] indices) { + throw new ContextException(); } - public static void texImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, MemorySegment pixels) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTexImage3D).invokeExact(target, level, internalFormat, width, height, depth, border, format, type, pixels); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexImage3D") + default void texImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, MemorySegment pixels) { + throw new ContextException(); } - public static void texImage3D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, byte[] pixels) { - texImage3D(target, level, internalFormat, width, height, depth, border, format, type, allocator.allocateFrom(JAVA_BYTE, pixels)); + @Entrypoint("glTexImage3D") + default void texImage3D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, byte[] pixels) { + throw new ContextException(); } - public static void texImage3D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, short[] pixels) { - texImage3D(target, level, internalFormat, width, height, depth, border, format, type, allocator.allocateFrom(JAVA_SHORT, pixels)); + @Entrypoint("glTexImage3D") + default void texImage3D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, short[] pixels) { + throw new ContextException(); } - public static void texImage3D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, int[] pixels) { - texImage3D(target, level, internalFormat, width, height, depth, border, format, type, allocator.allocateFrom(JAVA_INT, pixels)); + @Entrypoint("glTexImage3D") + default void texImage3D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, int[] pixels) { + throw new ContextException(); } - public static void texImage3D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, float[] pixels) { - texImage3D(target, level, internalFormat, width, height, depth, border, format, type, allocator.allocateFrom(JAVA_FLOAT, pixels)); + @Entrypoint("glTexImage3D") + default void texImage3D(SegmentAllocator allocator, int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, float[] pixels) { + throw new ContextException(); } - public static void texSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, MemorySegment pixels) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTexSubImage3D).invokeExact(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexSubImage3D") + default void texSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, MemorySegment pixels) { + throw new ContextException(); } - public static void texSubImage3D(SegmentAllocator allocator, int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, byte[] pixels) { - texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, allocator.allocateFrom(JAVA_BYTE, pixels)); + @Entrypoint("glTexSubImage3D") + default void texSubImage3D(SegmentAllocator allocator, int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, byte[] pixels) { + throw new ContextException(); } - public static void texSubImage3D(SegmentAllocator allocator, int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, short[] pixels) { - texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, allocator.allocateFrom(JAVA_SHORT, pixels)); + @Entrypoint("glTexSubImage3D") + default void texSubImage3D(SegmentAllocator allocator, int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, short[] pixels) { + throw new ContextException(); } - public static void texSubImage3D(SegmentAllocator allocator, int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, int[] pixels) { - texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, allocator.allocateFrom(JAVA_INT, pixels)); + @Entrypoint("glTexSubImage3D") + default void texSubImage3D(SegmentAllocator allocator, int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, int[] pixels) { + throw new ContextException(); } - public static void texSubImage3D(SegmentAllocator allocator, int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, float[] pixels) { - texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, allocator.allocateFrom(JAVA_FLOAT, pixels)); + @Entrypoint("glTexSubImage3D") + default void texSubImage3D(SegmentAllocator allocator, int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, float[] pixels) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL13.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL13.java index f3e2b76f..aba8a7eb 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL13.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL13.java @@ -16,16 +16,12 @@ package overrungl.opengl; +import overrun.marshal.gen.Entrypoint; import overrungl.opengl.ext.arb.GLARBTransposeMatrix; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.FunctionDescriptors.*; -import static overrungl.opengl.GLLoader.check; -import static overrungl.opengl.GLLoader.getCapabilities; - /** * The OpenGL 1.3 functions. *

@@ -37,496 +33,327 @@ * @author squid233 * @since 0.1.0 */ -public final class GL13 extends GL13C { - public static final int CLIENT_ACTIVE_TEXTURE = 0x84E1; - public static final int MAX_TEXTURE_UNITS = 0x84E2; - public static final int TRANSPOSE_MODELVIEW_MATRIX = 0x84E3; - public static final int TRANSPOSE_PROJECTION_MATRIX = 0x84E4; - public static final int TRANSPOSE_TEXTURE_MATRIX = 0x84E5; - public static final int TRANSPOSE_COLOR_MATRIX = 0x84E6; - public static final int MULTISAMPLE_BIT = 0x20000000; - public static final int NORMAL_MAP = 0x8511; - public static final int REFLECTION_MAP = 0x8512; - public static final int COMPRESSED_ALPHA = 0x84E9; - public static final int COMPRESSED_LUMINANCE = 0x84EA; - public static final int COMPRESSED_LUMINANCE_ALPHA = 0x84EB; - public static final int COMPRESSED_INTENSITY = 0x84EC; - public static final int COMBINE = 0x8570; - public static final int COMBINE_RGB = 0x8571; - public static final int COMBINE_ALPHA = 0x8572; - public static final int SOURCE0_RGB = 0x8580; - public static final int SOURCE1_RGB = 0x8581; - public static final int SOURCE2_RGB = 0x8582; - public static final int SOURCE0_ALPHA = 0x8588; - public static final int SOURCE1_ALPHA = 0x8589; - public static final int SOURCE2_ALPHA = 0x858A; - public static final int OPERAND0_RGB = 0x8590; - public static final int OPERAND1_RGB = 0x8591; - public static final int OPERAND2_RGB = 0x8592; - public static final int OPERAND0_ALPHA = 0x8598; - public static final int OPERAND1_ALPHA = 0x8599; - public static final int OPERAND2_ALPHA = 0x859A; - public static final int RGB_SCALE = 0x8573; - public static final int ADD_SIGNED = 0x8574; - public static final int INTERPOLATE = 0x8575; - public static final int SUBTRACT = 0x84E7; - public static final int CONSTANT = 0x8576; - public static final int PRIMARY_COLOR = 0x8577; - public static final int PREVIOUS = 0x8578; - public static final int DOT3_RGB = 0x86AE; - public static final int DOT3_RGBA = 0x86AF; - - static void load(GLCapabilities caps, GLLoadFunc load) { - if (!caps.Ver13) return; - caps.glClientActiveTexture = load.invoke("glClientActiveTexture", IV); - caps.glLoadTransposeMatrixd = load.invoke("glLoadTransposeMatrixd", PV); - caps.glLoadTransposeMatrixf = load.invoke("glLoadTransposeMatrixf", PV); - caps.glMultTransposeMatrixd = load.invoke("glMultTransposeMatrixd", PV); - caps.glMultTransposeMatrixf = load.invoke("glMultTransposeMatrixf", PV); - caps.glMultiTexCoord1d = load.invoke("glMultiTexCoord1d", IDV); - caps.glMultiTexCoord1dv = load.invoke("glMultiTexCoord1dv", IPV); - caps.glMultiTexCoord1f = load.invoke("glMultiTexCoord1f", IFV); - caps.glMultiTexCoord1fv = load.invoke("glMultiTexCoord1fv", IPV); - caps.glMultiTexCoord1i = load.invoke("glMultiTexCoord1i", IIV); - caps.glMultiTexCoord1iv = load.invoke("glMultiTexCoord1iv", IPV); - caps.glMultiTexCoord1s = load.invoke("glMultiTexCoord1s", ISV); - caps.glMultiTexCoord1sv = load.invoke("glMultiTexCoord1sv", IPV); - caps.glMultiTexCoord2d = load.invoke("glMultiTexCoord2d", IDDV); - caps.glMultiTexCoord2dv = load.invoke("glMultiTexCoord2dv", IPV); - caps.glMultiTexCoord2f = load.invoke("glMultiTexCoord2f", IFFV); - caps.glMultiTexCoord2fv = load.invoke("glMultiTexCoord2fv", IPV); - caps.glMultiTexCoord2i = load.invoke("glMultiTexCoord2i", IIIV); - caps.glMultiTexCoord2iv = load.invoke("glMultiTexCoord2iv", IPV); - caps.glMultiTexCoord2s = load.invoke("glMultiTexCoord2s", ISSV); - caps.glMultiTexCoord2sv = load.invoke("glMultiTexCoord2sv", IPV); - caps.glMultiTexCoord3d = load.invoke("glMultiTexCoord3d", IDDDV); - caps.glMultiTexCoord3dv = load.invoke("glMultiTexCoord3dv", IPV); - caps.glMultiTexCoord3f = load.invoke("glMultiTexCoord3f", IFFFV); - caps.glMultiTexCoord3fv = load.invoke("glMultiTexCoord3fv", IPV); - caps.glMultiTexCoord3i = load.invoke("glMultiTexCoord3i", IIIIV); - caps.glMultiTexCoord3iv = load.invoke("glMultiTexCoord3iv", IPV); - caps.glMultiTexCoord3s = load.invoke("glMultiTexCoord3s", ISSSV); - caps.glMultiTexCoord3sv = load.invoke("glMultiTexCoord3sv", IPV); - caps.glMultiTexCoord4d = load.invoke("glMultiTexCoord4d", IDDDDV); - caps.glMultiTexCoord4dv = load.invoke("glMultiTexCoord4dv", IPV); - caps.glMultiTexCoord4f = load.invoke("glMultiTexCoord4f", IFFFFV); - caps.glMultiTexCoord4fv = load.invoke("glMultiTexCoord4fv", IPV); - caps.glMultiTexCoord4i = load.invoke("glMultiTexCoord4i", IIIIIV); - caps.glMultiTexCoord4iv = load.invoke("glMultiTexCoord4iv", IPV); - caps.glMultiTexCoord4s = load.invoke("glMultiTexCoord4s", ISSSSV); - caps.glMultiTexCoord4sv = load.invoke("glMultiTexCoord4sv", IPV); - } - - public static void clientActiveTexture(int texture) { - var caps = getCapabilities(); - try { - check(caps.glClientActiveTexture).invokeExact(texture); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void loadTransposeMatrixd(MemorySegment m) { - var caps = getCapabilities(); - try { - check(caps.glLoadTransposeMatrixd).invokeExact(m); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void loadTransposeMatrixd(SegmentAllocator allocator, double[] m) { - loadTransposeMatrixd(allocator.allocateFrom(JAVA_DOUBLE, m)); - } - - public static void loadTransposeMatrixf(MemorySegment m) { - var caps = getCapabilities(); - try { - check(caps.glLoadTransposeMatrixf).invokeExact(m); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void loadTransposeMatrixf(SegmentAllocator allocator, float[] m) { - loadTransposeMatrixf(allocator.allocateFrom(JAVA_FLOAT, m)); - } - - public static void multTransposeMatrixd(MemorySegment m) { - var caps = getCapabilities(); - try { - check(caps.glMultTransposeMatrixd).invokeExact(m); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void multTransposeMatrixd(SegmentAllocator allocator, double[] m) { - multTransposeMatrixd(allocator.allocateFrom(JAVA_DOUBLE, m)); - } - - public static void multTransposeMatrixf(MemorySegment m) { - var caps = getCapabilities(); - try { - check(caps.glMultTransposeMatrixf).invokeExact(m); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void multTransposeMatrixf(SegmentAllocator allocator, float[] m) { - multTransposeMatrixf(allocator.allocateFrom(JAVA_FLOAT, m)); - } - - public static void multiTexCoord1d(int target, double s) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord1d).invokeExact(target, s); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void multiTexCoord1dv(int target, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord1dv).invokeExact(target, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } +public sealed interface GL13 extends GL13C permits GLLegacy { + int CLIENT_ACTIVE_TEXTURE = 0x84E1; + int MAX_TEXTURE_UNITS = 0x84E2; + int TRANSPOSE_MODELVIEW_MATRIX = 0x84E3; + int TRANSPOSE_PROJECTION_MATRIX = 0x84E4; + int TRANSPOSE_TEXTURE_MATRIX = 0x84E5; + int TRANSPOSE_COLOR_MATRIX = 0x84E6; + int MULTISAMPLE_BIT = 0x20000000; + int NORMAL_MAP = 0x8511; + int REFLECTION_MAP = 0x8512; + int COMPRESSED_ALPHA = 0x84E9; + int COMPRESSED_LUMINANCE = 0x84EA; + int COMPRESSED_LUMINANCE_ALPHA = 0x84EB; + int COMPRESSED_INTENSITY = 0x84EC; + int COMBINE = 0x8570; + int COMBINE_RGB = 0x8571; + int COMBINE_ALPHA = 0x8572; + int SOURCE0_RGB = 0x8580; + int SOURCE1_RGB = 0x8581; + int SOURCE2_RGB = 0x8582; + int SOURCE0_ALPHA = 0x8588; + int SOURCE1_ALPHA = 0x8589; + int SOURCE2_ALPHA = 0x858A; + int OPERAND0_RGB = 0x8590; + int OPERAND1_RGB = 0x8591; + int OPERAND2_RGB = 0x8592; + int OPERAND0_ALPHA = 0x8598; + int OPERAND1_ALPHA = 0x8599; + int OPERAND2_ALPHA = 0x859A; + int RGB_SCALE = 0x8573; + int ADD_SIGNED = 0x8574; + int INTERPOLATE = 0x8575; + int SUBTRACT = 0x84E7; + int CONSTANT = 0x8576; + int PRIMARY_COLOR = 0x8577; + int PREVIOUS = 0x8578; + int DOT3_RGB = 0x86AE; + int DOT3_RGBA = 0x86AF; + + @Entrypoint("glClientActiveTexture") + default void clientActiveTexture(int texture) { + throw new ContextException(); + } + + @Entrypoint("glLoadTransposeMatrixd") + default void loadTransposeMatrixd(MemorySegment m) { + throw new ContextException(); + } + + @Entrypoint("glLoadTransposeMatrixd") + default void loadTransposeMatrixd(SegmentAllocator allocator, double[] m) { + throw new ContextException(); + } + + @Entrypoint("glLoadTransposeMatrixf") + default void loadTransposeMatrixf(MemorySegment m) { + throw new ContextException(); + } + + @Entrypoint("glLoadTransposeMatrixf") + default void loadTransposeMatrixf(SegmentAllocator allocator, float[] m) { + throw new ContextException(); + } + + @Entrypoint("glMultTransposeMatrixd") + default void multTransposeMatrixd(MemorySegment m) { + throw new ContextException(); + } + + @Entrypoint("glMultTransposeMatrixd") + default void multTransposeMatrixd(SegmentAllocator allocator, double[] m) { + throw new ContextException(); + } + + @Entrypoint("glMultTransposeMatrixf") + default void multTransposeMatrixf(MemorySegment m) { + throw new ContextException(); + } + + @Entrypoint("glMultTransposeMatrixf") + default void multTransposeMatrixf(SegmentAllocator allocator, float[] m) { + throw new ContextException(); + } + + @Entrypoint("glMultiTexCoord1d") + default void multiTexCoord1d(int target, double s) { + throw new ContextException(); + } + + @Entrypoint("glMultiTexCoord1dv") + default void multiTexCoord1dv(int target, MemorySegment v) { + throw new ContextException(); } - public static void multiTexCoord1dv(SegmentAllocator allocator, int target, double[] v) { - multiTexCoord1dv(target, allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glMultiTexCoord1dv") + default void multiTexCoord1dv(SegmentAllocator allocator, int target, double[] v) { + throw new ContextException(); } - public static void multiTexCoord1f(int target, float s) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord1f).invokeExact(target, s); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord1f") + default void multiTexCoord1f(int target, float s) { + throw new ContextException(); } - public static void multiTexCoord1fv(int target, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord1fv).invokeExact(target, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord1fv") + default void multiTexCoord1fv(int target, MemorySegment v) { + throw new ContextException(); } - public static void multiTexCoord1fv(SegmentAllocator allocator, int target, float[] v) { - multiTexCoord1fv(target, allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glMultiTexCoord1fv") + default void multiTexCoord1fv(SegmentAllocator allocator, int target, float[] v) { + throw new ContextException(); } - public static void multiTexCoord1i(int target, int s) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord1i).invokeExact(target, s); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord1i") + default void multiTexCoord1i(int target, int s) { + throw new ContextException(); } - public static void multiTexCoord1iv(int target, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord1iv).invokeExact(target, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord1iv") + default void multiTexCoord1iv(int target, MemorySegment v) { + throw new ContextException(); } - public static void multiTexCoord1iv(SegmentAllocator allocator, int target, int[] v) { - multiTexCoord1iv(target, allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glMultiTexCoord1iv") + default void multiTexCoord1iv(SegmentAllocator allocator, int target, int[] v) { + throw new ContextException(); } - public static void multiTexCoord1s(int target, short s) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord1s).invokeExact(target, s); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord1s") + default void multiTexCoord1s(int target, short s) { + throw new ContextException(); } - public static void multiTexCoord1sv(int target, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord1sv).invokeExact(target, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord1sv") + default void multiTexCoord1sv(int target, MemorySegment v) { + throw new ContextException(); } - public static void multiTexCoord1sv(SegmentAllocator allocator, int target, short[] v) { - multiTexCoord1sv(target, allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glMultiTexCoord1sv") + default void multiTexCoord1sv(SegmentAllocator allocator, int target, short[] v) { + throw new ContextException(); } - public static void multiTexCoord2d(int target, double s, double t) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord2d).invokeExact(target, s, t); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord2d") + default void multiTexCoord2d(int target, double s, double t) { + throw new ContextException(); } - public static void multiTexCoord2dv(int target, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord2dv).invokeExact(target, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord2dv") + default void multiTexCoord2dv(int target, MemorySegment v) { + throw new ContextException(); } - public static void multiTexCoord2dv(SegmentAllocator allocator, int target, double[] v) { - multiTexCoord2dv(target, allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glMultiTexCoord2dv") + default void multiTexCoord2dv(SegmentAllocator allocator, int target, double[] v) { + throw new ContextException(); } - public static void multiTexCoord2f(int target, float s, float t) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord2f).invokeExact(target, s, t); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord2f") + default void multiTexCoord2f(int target, float s, float t) { + throw new ContextException(); } - public static void multiTexCoord2fv(int target, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord2fv).invokeExact(target, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord2fv") + default void multiTexCoord2fv(int target, MemorySegment v) { + throw new ContextException(); } - public static void multiTexCoord2fv(SegmentAllocator allocator, int target, float[] v) { - multiTexCoord2fv(target, allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glMultiTexCoord2fv") + default void multiTexCoord2fv(SegmentAllocator allocator, int target, float[] v) { + throw new ContextException(); } - public static void multiTexCoord2i(int target, int s, int t) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord2i).invokeExact(target, s, t); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord2i") + default void multiTexCoord2i(int target, int s, int t) { + throw new ContextException(); } - public static void multiTexCoord2iv(int target, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord2iv).invokeExact(target, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord2iv") + default void multiTexCoord2iv(int target, MemorySegment v) { + throw new ContextException(); } - public static void multiTexCoord2iv(SegmentAllocator allocator, int target, int[] v) { - multiTexCoord2iv(target, allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glMultiTexCoord2iv") + default void multiTexCoord2iv(SegmentAllocator allocator, int target, int[] v) { + throw new ContextException(); } - public static void multiTexCoord2s(int target, short s, short t) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord2s).invokeExact(target, s, t); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord2s") + default void multiTexCoord2s(int target, short s, short t) { + throw new ContextException(); } - public static void multiTexCoord2sv(int target, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord2sv).invokeExact(target, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord2sv") + default void multiTexCoord2sv(int target, MemorySegment v) { + throw new ContextException(); } - public static void multiTexCoord2sv(SegmentAllocator allocator, int target, short[] v) { - multiTexCoord2sv(target, allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glMultiTexCoord2sv") + default void multiTexCoord2sv(SegmentAllocator allocator, int target, short[] v) { + throw new ContextException(); } - public static void multiTexCoord3d(int target, double s, double t, double r) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord3d).invokeExact(target, s, t, r); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord3d") + default void multiTexCoord3d(int target, double s, double t, double r) { + throw new ContextException(); } - public static void multiTexCoord3dv(int target, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord3dv).invokeExact(target, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord3dv") + default void multiTexCoord3dv(int target, MemorySegment v) { + throw new ContextException(); } - public static void multiTexCoord3dv(SegmentAllocator allocator, int target, double[] v) { - multiTexCoord3dv(target, allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glMultiTexCoord3dv") + default void multiTexCoord3dv(SegmentAllocator allocator, int target, double[] v) { + throw new ContextException(); } - public static void multiTexCoord3f(int target, float s, float t, float r) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord3f).invokeExact(target, s, t, r); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord3f") + default void multiTexCoord3f(int target, float s, float t, float r) { + throw new ContextException(); } - public static void multiTexCoord3fv(int target, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord3fv).invokeExact(target, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord3fv") + default void multiTexCoord3fv(int target, MemorySegment v) { + throw new ContextException(); } - public static void multiTexCoord3fv(SegmentAllocator allocator, int target, float[] v) { - multiTexCoord3fv(target, allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glMultiTexCoord3fv") + default void multiTexCoord3fv(SegmentAllocator allocator, int target, float[] v) { + throw new ContextException(); } - public static void multiTexCoord3i(int target, int s, int t, int r) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord3i).invokeExact(target, s, t, r); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord3i") + default void multiTexCoord3i(int target, int s, int t, int r) { + throw new ContextException(); } - public static void multiTexCoord3iv(int target, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord3iv).invokeExact(target, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord3iv") + default void multiTexCoord3iv(int target, MemorySegment v) { + throw new ContextException(); } - public static void multiTexCoord3iv(SegmentAllocator allocator, int target, int[] v) { - multiTexCoord3iv(target, allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glMultiTexCoord3iv") + default void multiTexCoord3iv(SegmentAllocator allocator, int target, int[] v) { + throw new ContextException(); } - public static void multiTexCoord3s(int target, short s, short t, short r) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord3s).invokeExact(target, s, t, r); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord3s") + default void multiTexCoord3s(int target, short s, short t, short r) { + throw new ContextException(); } - public static void multiTexCoord3sv(int target, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord3sv).invokeExact(target, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord3sv") + default void multiTexCoord3sv(int target, MemorySegment v) { + throw new ContextException(); } - public static void multiTexCoord3sv(SegmentAllocator allocator, int target, short[] v) { - multiTexCoord3sv(target, allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glMultiTexCoord3sv") + default void multiTexCoord3sv(SegmentAllocator allocator, int target, short[] v) { + throw new ContextException(); } - public static void multiTexCoord4d(int target, double s, double t, double r, double q) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord4d).invokeExact(target, s, t, r, q); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord4d") + default void multiTexCoord4d(int target, double s, double t, double r, double q) { + throw new ContextException(); } - public static void multiTexCoord4dv(int target, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord4dv).invokeExact(target, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord4dv") + default void multiTexCoord4dv(int target, MemorySegment v) { + throw new ContextException(); } - public static void multiTexCoord4dv(SegmentAllocator allocator, int target, double[] v) { - multiTexCoord4dv(target, allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glMultiTexCoord4dv") + default void multiTexCoord4dv(SegmentAllocator allocator, int target, double[] v) { + throw new ContextException(); } - public static void multiTexCoord4f(int target, float s, float t, float r, float q) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord4f).invokeExact(target, s, t, r, q); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord4f") + default void multiTexCoord4f(int target, float s, float t, float r, float q) { + throw new ContextException(); } - public static void multiTexCoord4fv(int target, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord4fv).invokeExact(target, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord4fv") + default void multiTexCoord4fv(int target, MemorySegment v) { + throw new ContextException(); } - public static void multiTexCoord4fv(SegmentAllocator allocator, int target, float[] v) { - multiTexCoord4fv(target, allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glMultiTexCoord4fv") + default void multiTexCoord4fv(SegmentAllocator allocator, int target, float[] v) { + throw new ContextException(); } - public static void multiTexCoord4i(int target, int s, int t, int r, int q) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord4i).invokeExact(target, s, t, r, q); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord4i") + default void multiTexCoord4i(int target, int s, int t, int r, int q) { + throw new ContextException(); } - public static void multiTexCoord4iv(int target, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord4iv).invokeExact(target, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord4iv") + default void multiTexCoord4iv(int target, MemorySegment v) { + throw new ContextException(); } - public static void multiTexCoord4iv(SegmentAllocator allocator, int target, int[] v) { - multiTexCoord4iv(target, allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glMultiTexCoord4iv") + default void multiTexCoord4iv(SegmentAllocator allocator, int target, int[] v) { + throw new ContextException(); } - public static void multiTexCoord4s(int target, short s, short t, short r, short q) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord4s).invokeExact(target, s, t, r, q); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord4s") + default void multiTexCoord4s(int target, short s, short t, short r, short q) { + throw new ContextException(); } - public static void multiTexCoord4sv(int target, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glMultiTexCoord4sv).invokeExact(target, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiTexCoord4sv") + default void multiTexCoord4sv(int target, MemorySegment v) { + throw new ContextException(); } - public static void multiTexCoord4sv(SegmentAllocator allocator, int target, short[] v) { - multiTexCoord4sv(target, allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glMultiTexCoord4sv") + default void multiTexCoord4sv(SegmentAllocator allocator, int target, short[] v) { + throw new ContextException(); } } 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 7620ae15..74bd264a 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL13C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL13C.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2022-2023 Overrun Organization + * Copyright (c) 2022-2024 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 @@ -16,13 +16,11 @@ package overrungl.opengl; +import overrun.marshal.gen.Entrypoint; import overrungl.opengl.ext.arb.*; import java.lang.foreign.MemorySegment; -import static overrungl.FunctionDescriptors.*; -import static overrungl.opengl.GLLoader.*; - /** * The OpenGL 1.3 forward compatible functions. *

@@ -38,162 +36,109 @@ * @author squid233 * @since 0.1.0 */ -public sealed class GL13C extends GL12C permits GL13, GL14C { - public static final int TEXTURE0 = 0x84C0; - public static final int TEXTURE1 = 0x84C1; - public static final int TEXTURE2 = 0x84C2; - public static final int TEXTURE3 = 0x84C3; - public static final int TEXTURE4 = 0x84C4; - public static final int TEXTURE5 = 0x84C5; - public static final int TEXTURE6 = 0x84C6; - public static final int TEXTURE7 = 0x84C7; - public static final int TEXTURE8 = 0x84C8; - public static final int TEXTURE9 = 0x84C9; - public static final int TEXTURE10 = 0x84CA; - public static final int TEXTURE11 = 0x84CB; - public static final int TEXTURE12 = 0x84CC; - public static final int TEXTURE13 = 0x84CD; - public static final int TEXTURE14 = 0x84CE; - public static final int TEXTURE15 = 0x84CF; - public static final int TEXTURE16 = 0x84D0; - public static final int TEXTURE17 = 0x84D1; - public static final int TEXTURE18 = 0x84D2; - public static final int TEXTURE19 = 0x84D3; - public static final int TEXTURE20 = 0x84D4; - public static final int TEXTURE21 = 0x84D5; - public static final int TEXTURE22 = 0x84D6; - public static final int TEXTURE23 = 0x84D7; - public static final int TEXTURE24 = 0x84D8; - public static final int TEXTURE25 = 0x84D9; - public static final int TEXTURE26 = 0x84DA; - public static final int TEXTURE27 = 0x84DB; - public static final int TEXTURE28 = 0x84DC; - public static final int TEXTURE29 = 0x84DD; - public static final int TEXTURE30 = 0x84DE; - public static final int TEXTURE31 = 0x84DF; - public static final int ACTIVE_TEXTURE = 0x84E0; - public static final int MULTISAMPLE = 0x809D; - public static final int SAMPLE_ALPHA_TO_COVERAGE = 0x809E; - public static final int SAMPLE_ALPHA_TO_ONE = 0x809F; - public static final int SAMPLE_COVERAGE = 0x80A0; - public static final int SAMPLE_BUFFERS = 0x80A8; - public static final int SAMPLES = 0x80A9; - public static final int SAMPLE_COVERAGE_VALUE = 0x80AA; - public static final int SAMPLE_COVERAGE_INVERT = 0x80AB; - public static final int TEXTURE_CUBE_MAP = 0x8513; - public static final int TEXTURE_BINDING_CUBE_MAP = 0x8514; - public static final int TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515; - public static final int TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516; - public static final int TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517; - public static final int TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518; - public static final int TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519; - public static final int TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A; - public static final int PROXY_TEXTURE_CUBE_MAP = 0x851B; - public static final int MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C; - public static final int COMPRESSED_RGB = 0x84ED; - public static final int COMPRESSED_RGBA = 0x84EE; - public static final int TEXTURE_COMPRESSION_HINT = 0x84EF; - public static final int TEXTURE_COMPRESSED_IMAGE_SIZE = 0x86A0; - public static final int TEXTURE_COMPRESSED = 0x86A1; - public static final int NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2; - public static final int COMPRESSED_TEXTURE_FORMATS = 0x86A3; - public static final int CLAMP_TO_BORDER = 0x812D; - - static boolean isSupported(GLCapabilities caps) { - return checkAll(caps.glActiveTexture, caps.glCompressedTexImage1D, caps.glCompressedTexImage2D, caps.glCompressedTexImage3D, caps.glCompressedTexSubImage1D, caps.glCompressedTexSubImage2D, - caps.glCompressedTexSubImage3D, caps.glGetCompressedTexImage, caps.glSampleCoverage); - } - - static void load(GLCapabilities caps, GLLoadFunc load) { - caps.glActiveTexture = load.invoke("glActiveTexture", IV); - caps.glCompressedTexImage1D = load.invoke("glCompressedTexImage1D", IIIIIIPV); - caps.glCompressedTexImage2D = load.invoke("glCompressedTexImage2D", IIIIIIIPV); - caps.glCompressedTexImage3D = load.invoke("glCompressedTexImage3D", IIIIIIIIPV); - caps.glCompressedTexSubImage1D = load.invoke("glCompressedTexSubImage1D", IIIIIIPV); - caps.glCompressedTexSubImage2D = load.invoke("glCompressedTexSubImage2D", IIIIIIIIPV); - caps.glCompressedTexSubImage3D = load.invoke("glCompressedTexSubImage3D", IIIIIIIIIIPV); - caps.glGetCompressedTexImage = load.invoke("glGetCompressedTexImage", IIPV); - caps.glSampleCoverage = load.invoke("glSampleCoverage", FZV); - } - - public static void activeTexture(int texture) { - var caps = getCapabilities(); - try { - check(caps.glActiveTexture).invokeExact(texture); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } +public sealed interface GL13C extends GL12C permits GL13, GL14C { + int TEXTURE0 = 0x84C0; + int TEXTURE1 = 0x84C1; + int TEXTURE2 = 0x84C2; + int TEXTURE3 = 0x84C3; + int TEXTURE4 = 0x84C4; + int TEXTURE5 = 0x84C5; + int TEXTURE6 = 0x84C6; + int TEXTURE7 = 0x84C7; + int TEXTURE8 = 0x84C8; + int TEXTURE9 = 0x84C9; + int TEXTURE10 = 0x84CA; + int TEXTURE11 = 0x84CB; + int TEXTURE12 = 0x84CC; + int TEXTURE13 = 0x84CD; + int TEXTURE14 = 0x84CE; + int TEXTURE15 = 0x84CF; + int TEXTURE16 = 0x84D0; + int TEXTURE17 = 0x84D1; + int TEXTURE18 = 0x84D2; + int TEXTURE19 = 0x84D3; + int TEXTURE20 = 0x84D4; + int TEXTURE21 = 0x84D5; + int TEXTURE22 = 0x84D6; + int TEXTURE23 = 0x84D7; + int TEXTURE24 = 0x84D8; + int TEXTURE25 = 0x84D9; + int TEXTURE26 = 0x84DA; + int TEXTURE27 = 0x84DB; + int TEXTURE28 = 0x84DC; + int TEXTURE29 = 0x84DD; + int TEXTURE30 = 0x84DE; + int TEXTURE31 = 0x84DF; + int ACTIVE_TEXTURE = 0x84E0; + int MULTISAMPLE = 0x809D; + int SAMPLE_ALPHA_TO_COVERAGE = 0x809E; + int SAMPLE_ALPHA_TO_ONE = 0x809F; + int SAMPLE_COVERAGE = 0x80A0; + int SAMPLE_BUFFERS = 0x80A8; + int SAMPLES = 0x80A9; + int SAMPLE_COVERAGE_VALUE = 0x80AA; + int SAMPLE_COVERAGE_INVERT = 0x80AB; + int TEXTURE_CUBE_MAP = 0x8513; + int TEXTURE_BINDING_CUBE_MAP = 0x8514; + int TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515; + int TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516; + int TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517; + int TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518; + int TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519; + int TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A; + int PROXY_TEXTURE_CUBE_MAP = 0x851B; + int MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C; + int COMPRESSED_RGB = 0x84ED; + int COMPRESSED_RGBA = 0x84EE; + int TEXTURE_COMPRESSION_HINT = 0x84EF; + int TEXTURE_COMPRESSED_IMAGE_SIZE = 0x86A0; + int TEXTURE_COMPRESSED = 0x86A1; + int NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2; + int COMPRESSED_TEXTURE_FORMATS = 0x86A3; + int CLAMP_TO_BORDER = 0x812D; + + @Entrypoint("glActiveTexture") + default void activeTexture(int texture) { + throw new ContextException(); } - public static void compressedTexImage1D(int target, int level, int internalFormat, int width, int border, int imageSize, MemorySegment data) { - var caps = getCapabilities(); - try { - check(caps.glCompressedTexImage1D).invokeExact(target, level, internalFormat, width, border, imageSize, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCompressedTexImage1D") + default void compressedTexImage1D(int target, int level, int internalFormat, int width, int border, int imageSize, MemorySegment data) { + throw new ContextException(); } - public static void compressedTexImage2D(int target, int level, int internalFormat, int width, int height, int border, int imageSize, MemorySegment data) { - var caps = getCapabilities(); - try { - check(caps.glCompressedTexImage2D).invokeExact(target, level, internalFormat, width, height, border, imageSize, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCompressedTexImage2D") + default void compressedTexImage2D(int target, int level, int internalFormat, int width, int height, int border, int imageSize, MemorySegment data) { + throw new ContextException(); } - public static void compressedTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int imageSize, MemorySegment data) { - var caps = getCapabilities(); - try { - check(caps.glCompressedTexImage3D).invokeExact(target, level, internalFormat, width, height, depth, border, imageSize, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCompressedTexImage3D") + default void compressedTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int imageSize, MemorySegment data) { + throw new ContextException(); } - public static void compressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, MemorySegment data) { - var caps = getCapabilities(); - try { - check(caps.glCompressedTexSubImage1D).invokeExact(target, level, xoffset, width, format, imageSize, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCompressedTexSubImage1D") + default void compressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, MemorySegment data) { + throw new ContextException(); } - public static void compressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, MemorySegment data) { - var caps = getCapabilities(); - try { - check(caps.glCompressedTexSubImage2D).invokeExact(target, level, xoffset, yoffset, width, height, format, imageSize, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCompressedTexSubImage2D") + default void compressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, MemorySegment data) { + throw new ContextException(); } - public static void compressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, MemorySegment data) { - var caps = getCapabilities(); - try { - check(caps.glCompressedTexSubImage3D).invokeExact(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCompressedTexSubImage3D") + default void compressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, MemorySegment data) { + throw new ContextException(); } - public static void getCompressedTexImage(int target, int level, MemorySegment img) { - var caps = getCapabilities(); - try { - check(caps.glGetCompressedTexImage).invokeExact(target, level, img); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetCompressedTexImage") + default void getCompressedTexImage(int target, int level, MemorySegment img) { + throw new ContextException(); } - public static void sampleCoverage(float value, boolean invert) { - var caps = getCapabilities(); - try { - check(caps.glSampleCoverage).invokeExact(value, invert); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSampleCoverage") + default void sampleCoverage(float value, boolean invert) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL14.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL14.java index 6f7e53a3..e6b67b5e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL14.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL14.java @@ -16,14 +16,12 @@ package overrungl.opengl; +import overrun.marshal.gen.Entrypoint; import overrungl.opengl.ext.arb.GLARBWindowPos; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.FunctionDescriptors.*; - /** * The OpenGL 1.4 functions. *

@@ -35,488 +33,319 @@ * @author squid233 * @since 0.1.0 */ -public final class GL14 extends GL14C { - static void load(GLCapabilities caps, GLLoadFunc load) { - if (!caps.Ver14) return; - caps.glFogCoordPointer = load.invoke("glFogCoordPointer", IIPV); - caps.glFogCoordd = load.invoke("glFogCoordd", DV); - caps.glFogCoorddv = load.invoke("glFogCoorddv", PV); - caps.glFogCoordf = load.invoke("glFogCoordf", FV); - caps.glFogCoordfv = load.invoke("glFogCoordfv", PV); - caps.glSecondaryColor3b = load.invoke("glSecondaryColor3b", BBBV); - caps.glSecondaryColor3bv = load.invoke("glSecondaryColor3bv", PV); - caps.glSecondaryColor3d = load.invoke("glSecondaryColor3d", DDDV); - caps.glSecondaryColor3dv = load.invoke("glSecondaryColor3dv", PV); - caps.glSecondaryColor3f = load.invoke("glSecondaryColor3f", FFFV); - caps.glSecondaryColor3fv = load.invoke("glSecondaryColor3fv", PV); - caps.glSecondaryColor3i = load.invoke("glSecondaryColor3i", IIIV); - caps.glSecondaryColor3iv = load.invoke("glSecondaryColor3iv", PV); - caps.glSecondaryColor3s = load.invoke("glSecondaryColor3s", SSSV); - caps.glSecondaryColor3sv = load.invoke("glSecondaryColor3sv", PV); - caps.glSecondaryColor3ub = load.invoke("glSecondaryColor3ub", BBBV); - caps.glSecondaryColor3ubv = load.invoke("glSecondaryColor3ubv", PV); - caps.glSecondaryColor3ui = load.invoke("glSecondaryColor3ui", IIIV); - caps.glSecondaryColor3uiv = load.invoke("glSecondaryColor3uiv", PV); - caps.glSecondaryColor3us = load.invoke("glSecondaryColor3us", SSSV); - caps.glSecondaryColor3usv = load.invoke("glSecondaryColor3usv", PV); - caps.glSecondaryColorPointer = load.invoke("glSecondaryColorPointer", IIIPV); - caps.glWindowPos2d = load.invoke("glWindowPos2d", DDV); - caps.glWindowPos2dv = load.invoke("glWindowPos2dv", PV); - caps.glWindowPos2f = load.invoke("glWindowPos2f", FFV); - caps.glWindowPos2fv = load.invoke("glWindowPos2fv", PV); - caps.glWindowPos2i = load.invoke("glWindowPos2i", IIV); - caps.glWindowPos2iv = load.invoke("glWindowPos2iv", PV); - caps.glWindowPos2s = load.invoke("glWindowPos2s", SSV); - caps.glWindowPos2sv = load.invoke("glWindowPos2sv", PV); - caps.glWindowPos3d = load.invoke("glWindowPos3d", DDDV); - caps.glWindowPos3dv = load.invoke("glWindowPos3dv", PV); - caps.glWindowPos3f = load.invoke("glWindowPos3f", FFFV); - caps.glWindowPos3fv = load.invoke("glWindowPos3fv", PV); - caps.glWindowPos3i = load.invoke("glWindowPos3i", IIIV); - caps.glWindowPos3iv = load.invoke("glWindowPos3iv", PV); - caps.glWindowPos3s = load.invoke("glWindowPos3s", SSSV); - caps.glWindowPos3sv = load.invoke("glWindowPos3sv", PV); - } - - public static void fogCoordPointer(int type, int stride, MemorySegment pointer) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glFogCoordPointer).invokeExact(type, stride, pointer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void fogCoordPointer(SegmentAllocator allocator, int type, int stride, float[] pointer) { - fogCoordPointer(type, stride, allocator.allocateFrom(JAVA_FLOAT, pointer)); - } - - public static void fogCoordPointer(SegmentAllocator allocator, int type, int stride, double[] pointer) { - fogCoordPointer(type, stride, allocator.allocateFrom(JAVA_DOUBLE, pointer)); - } - - public static void fogCoordd(double coord) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glFogCoordd).invokeExact(coord); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void fogCoorddv(MemorySegment coord) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glFogCoorddv).invokeExact(coord); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void fogCoorddv(SegmentAllocator allocator, double[] coord) { - fogCoorddv(allocator.allocateFrom(JAVA_DOUBLE, coord)); - } - - public static void fogCoordf(float coord) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glFogCoordf).invokeExact(coord); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void fogCoordfv(MemorySegment coord) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glFogCoordfv).invokeExact(coord); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void fogCoordfv(SegmentAllocator allocator, float[] coord) { - fogCoordfv(allocator.allocateFrom(JAVA_FLOAT, coord)); - } - - public static void secondaryColor3b(byte red, byte green, byte blue) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glSecondaryColor3b).invokeExact(red, green, blue); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void secondaryColor3bv(MemorySegment v) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glSecondaryColor3bv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } +public sealed interface GL14 extends GL14C permits GLLegacy { + @Entrypoint("glFogCoordPointer") + default void fogCoordPointer(int type, int stride, MemorySegment pointer) { + throw new ContextException(); + } + + @Entrypoint("glFogCoordPointer") + default void fogCoordPointer(SegmentAllocator allocator, int type, int stride, float[] pointer) { + throw new ContextException(); + } + + @Entrypoint("glFogCoordPointer") + default void fogCoordPointer(SegmentAllocator allocator, int type, int stride, double[] pointer) { + throw new ContextException(); + } + + @Entrypoint("glFogCoordd") + default void fogCoordd(double coord) { + throw new ContextException(); + } + + @Entrypoint("glFogCoorddv") + default void fogCoorddv(MemorySegment coord) { + throw new ContextException(); + } + + @Entrypoint("glFogCoorddv") + default void fogCoorddv(SegmentAllocator allocator, double[] coord) { + throw new ContextException(); + } + + @Entrypoint("glFogCoordf") + default void fogCoordf(float coord) { + throw new ContextException(); + } + + @Entrypoint("glFogCoordfv") + default void fogCoordfv(MemorySegment coord) { + throw new ContextException(); + } + + @Entrypoint("glFogCoordfv") + default void fogCoordfv(SegmentAllocator allocator, float[] coord) { + throw new ContextException(); + } + + @Entrypoint("glSecondaryColor3b") + default void secondaryColor3b(byte red, byte green, byte blue) { + throw new ContextException(); + } + + @Entrypoint("glSecondaryColor3bv") + default void secondaryColor3bv(MemorySegment v) { + throw new ContextException(); } - public static void secondaryColor3bv(SegmentAllocator allocator, byte[] v) { - secondaryColor3bv(allocator.allocateFrom(JAVA_BYTE, v)); + @Entrypoint("glSecondaryColor3bv") + default void secondaryColor3bv(SegmentAllocator allocator, byte[] v) { + throw new ContextException(); } - public static void secondaryColor3d(double red, double green, double blue) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glSecondaryColor3d).invokeExact(red, green, blue); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSecondaryColor3d") + default void secondaryColor3d(double red, double green, double blue) { + throw new ContextException(); } - public static void secondaryColor3dv(MemorySegment v) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glSecondaryColor3dv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSecondaryColor3dv") + default void secondaryColor3dv(MemorySegment v) { + throw new ContextException(); } - public static void secondaryColor3dv(SegmentAllocator allocator, double[] v) { - secondaryColor3dv(allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glSecondaryColor3dv") + default void secondaryColor3dv(SegmentAllocator allocator, double[] v) { + throw new ContextException(); } - public static void secondaryColor3f(float red, float green, float blue) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glSecondaryColor3f).invokeExact(red, green, blue); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSecondaryColor3f") + default void secondaryColor3f(float red, float green, float blue) { + throw new ContextException(); } - public static void secondaryColor3fv(MemorySegment v) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glSecondaryColor3fv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSecondaryColor3fv") + default void secondaryColor3fv(MemorySegment v) { + throw new ContextException(); } - public static void secondaryColor3fv(SegmentAllocator allocator, float[] v) { - secondaryColor3fv(allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glSecondaryColor3fv") + default void secondaryColor3fv(SegmentAllocator allocator, float[] v) { + throw new ContextException(); } - public static void secondaryColor3i(int red, int green, int blue) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glSecondaryColor3i).invokeExact(red, green, blue); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSecondaryColor3i") + default void secondaryColor3i(int red, int green, int blue) { + throw new ContextException(); } - public static void secondaryColor3iv(MemorySegment v) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glSecondaryColor3iv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSecondaryColor3iv") + default void secondaryColor3iv(MemorySegment v) { + throw new ContextException(); } - public static void secondaryColor3iv(SegmentAllocator allocator, int[] v) { - secondaryColor3iv(allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glSecondaryColor3iv") + default void secondaryColor3iv(SegmentAllocator allocator, int[] v) { + throw new ContextException(); } - public static void secondaryColor3s(short red, short green, short blue) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glSecondaryColor3s).invokeExact(red, green, blue); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSecondaryColor3s") + default void secondaryColor3s(short red, short green, short blue) { + throw new ContextException(); } - public static void secondaryColor3sv(MemorySegment v) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glSecondaryColor3sv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSecondaryColor3sv") + default void secondaryColor3sv(MemorySegment v) { + throw new ContextException(); } - public static void secondaryColor3sv(SegmentAllocator allocator, short[] v) { - secondaryColor3sv(allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glSecondaryColor3sv") + default void secondaryColor3sv(SegmentAllocator allocator, short[] v) { + throw new ContextException(); } - public static void secondaryColor3ub(byte red, byte green, byte blue) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glSecondaryColor3ub).invokeExact(red, green, blue); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSecondaryColor3ub") + default void secondaryColor3ub(byte red, byte green, byte blue) { + throw new ContextException(); } - public static void secondaryColor3ubv(MemorySegment v) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glSecondaryColor3ubv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSecondaryColor3ubv") + default void secondaryColor3ubv(MemorySegment v) { + throw new ContextException(); } - public static void secondaryColor3ubv(SegmentAllocator allocator, byte[] v) { - secondaryColor3ubv(allocator.allocateFrom(JAVA_BYTE, v)); + @Entrypoint("glSecondaryColor3ubv") + default void secondaryColor3ubv(SegmentAllocator allocator, byte[] v) { + throw new ContextException(); } - public static void secondaryColor3ui(int red, int green, int blue) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glSecondaryColor3ui).invokeExact(red, green, blue); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSecondaryColor3ui") + default void secondaryColor3ui(int red, int green, int blue) { + throw new ContextException(); } - public static void secondaryColor3uiv(MemorySegment v) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glSecondaryColor3uiv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSecondaryColor3uiv") + default void secondaryColor3uiv(MemorySegment v) { + throw new ContextException(); } - public static void secondaryColor3uiv(SegmentAllocator allocator, int[] v) { - secondaryColor3uiv(allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glSecondaryColor3uiv") + default void secondaryColor3uiv(SegmentAllocator allocator, int[] v) { + throw new ContextException(); } - public static void secondaryColor3us(short red, short green, short blue) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glSecondaryColor3us).invokeExact(red, green, blue); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSecondaryColor3us") + default void secondaryColor3us(short red, short green, short blue) { + throw new ContextException(); } - public static void secondaryColor3usv(MemorySegment v) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glSecondaryColor3usv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSecondaryColor3usv") + default void secondaryColor3usv(MemorySegment v) { + throw new ContextException(); } - public static void secondaryColor3usv(SegmentAllocator allocator, short[] v) { - secondaryColor3usv(allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glSecondaryColor3usv") + default void secondaryColor3usv(SegmentAllocator allocator, short[] v) { + throw new ContextException(); } - public static void secondaryColorPointer(int size, int type, int stride, MemorySegment pointer) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glSecondaryColorPointer).invokeExact(size, type, stride, pointer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSecondaryColorPointer") + default void secondaryColorPointer(int size, int type, int stride, MemorySegment pointer) { + throw new ContextException(); } - public static void secondaryColorPointer(SegmentAllocator allocator, int size, int type, int stride, byte[] pointer) { - secondaryColorPointer(size, type, stride, allocator.allocateFrom(JAVA_BYTE, pointer)); + @Entrypoint("glSecondaryColorPointer") + default void secondaryColorPointer(SegmentAllocator allocator, int size, int type, int stride, byte[] pointer) { + throw new ContextException(); } - public static void secondaryColorPointer(SegmentAllocator allocator, int size, int type, int stride, short[] pointer) { - secondaryColorPointer(size, type, stride, allocator.allocateFrom(JAVA_SHORT, pointer)); + @Entrypoint("glSecondaryColorPointer") + default void secondaryColorPointer(SegmentAllocator allocator, int size, int type, int stride, short[] pointer) { + throw new ContextException(); } - public static void secondaryColorPointer(SegmentAllocator allocator, int size, int type, int stride, int[] pointer) { - secondaryColorPointer(size, type, stride, allocator.allocateFrom(JAVA_INT, pointer)); + @Entrypoint("glSecondaryColorPointer") + default void secondaryColorPointer(SegmentAllocator allocator, int size, int type, int stride, int[] pointer) { + throw new ContextException(); } - public static void secondaryColorPointer(SegmentAllocator allocator, int size, int type, int stride, float[] pointer) { - secondaryColorPointer(size, type, stride, allocator.allocateFrom(JAVA_FLOAT, pointer)); + @Entrypoint("glSecondaryColorPointer") + default void secondaryColorPointer(SegmentAllocator allocator, int size, int type, int stride, float[] pointer) { + throw new ContextException(); } - public static void secondaryColorPointer(SegmentAllocator allocator, int size, int type, int stride, double[] pointer) { - secondaryColorPointer(size, type, stride, allocator.allocateFrom(JAVA_DOUBLE, pointer)); + @Entrypoint("glSecondaryColorPointer") + default void secondaryColorPointer(SegmentAllocator allocator, int size, int type, int stride, double[] pointer) { + throw new ContextException(); } - public static void windowPos2d(double x, double y) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glWindowPos2d).invokeExact(x, y); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glWindowPos2d") + default void windowPos2d(double x, double y) { + throw new ContextException(); } - public static void windowPos2dv(MemorySegment v) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glWindowPos2dv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glWindowPos2dv") + default void windowPos2dv(MemorySegment v) { + throw new ContextException(); } - public static void windowPos2dv(SegmentAllocator allocator, double[] v) { - windowPos2dv(allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glWindowPos2dv") + default void windowPos2dv(SegmentAllocator allocator, double[] v) { + throw new ContextException(); } - public static void windowPos2f(float x, float y) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glWindowPos2f).invokeExact(x, y); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glWindowPos2f") + default void windowPos2f(float x, float y) { + throw new ContextException(); } - public static void windowPos2fv(MemorySegment v) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glWindowPos2fv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glWindowPos2fv") + default void windowPos2fv(MemorySegment v) { + throw new ContextException(); } - public static void windowPos2fv(SegmentAllocator allocator, float[] v) { - windowPos2fv(allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glWindowPos2fv") + default void windowPos2fv(SegmentAllocator allocator, float[] v) { + throw new ContextException(); } - public static void windowPos2i(int x, int y) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glWindowPos2i).invokeExact(x, y); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glWindowPos2i") + default void windowPos2i(int x, int y) { + throw new ContextException(); } - public static void windowPos2iv(MemorySegment v) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glWindowPos2iv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glWindowPos2iv") + default void windowPos2iv(MemorySegment v) { + throw new ContextException(); } - public static void windowPos2iv(SegmentAllocator allocator, int[] v) { - windowPos2iv(allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glWindowPos2iv") + default void windowPos2iv(SegmentAllocator allocator, int[] v) { + throw new ContextException(); } - public static void windowPos2s(short x, short y) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glWindowPos2s).invokeExact(x, y); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glWindowPos2s") + default void windowPos2s(short x, short y) { + throw new ContextException(); } - public static void windowPos2sv(MemorySegment v) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glWindowPos2sv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glWindowPos2sv") + default void windowPos2sv(MemorySegment v) { + throw new ContextException(); } - public static void windowPos2sv(SegmentAllocator allocator, short[] v) { - windowPos2sv(allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glWindowPos2sv") + default void windowPos2sv(SegmentAllocator allocator, short[] v) { + throw new ContextException(); } - public static void windowPos3d(double x, double y, double z) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glWindowPos3d).invokeExact(x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glWindowPos3d") + default void windowPos3d(double x, double y, double z) { + throw new ContextException(); } - public static void windowPos3dv(MemorySegment v) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glWindowPos3dv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glWindowPos3dv") + default void windowPos3dv(MemorySegment v) { + throw new ContextException(); } - public static void windowPos3dv(SegmentAllocator allocator, double[] v) { - windowPos3dv(allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glWindowPos3dv") + default void windowPos3dv(SegmentAllocator allocator, double[] v) { + throw new ContextException(); } - public static void windowPos3f(float x, float y, float z) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glWindowPos3f).invokeExact(x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glWindowPos3f") + default void windowPos3f(float x, float y, float z) { + throw new ContextException(); } - public static void windowPos3fv(MemorySegment v) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glWindowPos3fv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glWindowPos3fv") + default void windowPos3fv(MemorySegment v) { + throw new ContextException(); } - public static void windowPos3fv(SegmentAllocator allocator, float[] v) { - windowPos3fv(allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glWindowPos3fv") + default void windowPos3fv(SegmentAllocator allocator, float[] v) { + throw new ContextException(); } - public static void windowPos3i(int x, int y, int z) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glWindowPos3i).invokeExact(x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glWindowPos3i") + default void windowPos3i(int x, int y, int z) { + throw new ContextException(); } - public static void windowPos3iv(MemorySegment v) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glWindowPos3iv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glWindowPos3iv") + default void windowPos3iv(MemorySegment v) { + throw new ContextException(); } - public static void windowPos3iv(SegmentAllocator allocator, int[] v) { - windowPos3iv(allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glWindowPos3iv") + default void windowPos3iv(SegmentAllocator allocator, int[] v) { + throw new ContextException(); } - public static void windowPos3s(short x, short y, short z) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glWindowPos3s).invokeExact(x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glWindowPos3s") + default void windowPos3s(short x, short y, short z) { + throw new ContextException(); } - public static void windowPos3sv(MemorySegment v) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glWindowPos3sv).invokeExact(v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glWindowPos3sv") + default void windowPos3sv(MemorySegment v) { + throw new ContextException(); } - public static void windowPos3sv(SegmentAllocator allocator, short[] v) { - windowPos3sv(allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glWindowPos3sv") + default void windowPos3sv(SegmentAllocator allocator, short[] v) { + throw new ContextException(); } } 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 11d61147..057e63fb 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL14C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL14C.java @@ -16,6 +16,9 @@ package overrungl.opengl; +import overrun.marshal.Marshal; +import overrun.marshal.gen.Entrypoint; +import overrun.marshal.gen.Skip; import overrungl.opengl.ext.arb.GLARBPointParameters; import overrungl.opengl.ext.arb.GLARBShadow; import overrungl.opengl.ext.arb.GLARBTextureMirroredRepeat; @@ -23,9 +26,7 @@ import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.FunctionDescriptors.*; -import static overrungl.opengl.GLLoader.*; +import static java.lang.foreign.ValueLayout.ADDRESS; /** * The OpenGL 1.4 forward compatible functions. @@ -41,182 +42,119 @@ * @author squid233 * @since 0.1.0 */ -public sealed class GL14C extends GL13C permits GL14, GL15C { - public static final int BLEND_DST_RGB = 0x80C8; - public static final int BLEND_SRC_RGB = 0x80C9; - public static final int BLEND_DST_ALPHA = 0x80CA; - public static final int BLEND_SRC_ALPHA = 0x80CB; - public static final int POINT_FADE_THRESHOLD_SIZE = 0x8128; - public static final int DEPTH_COMPONENT16 = 0x81A5; - public static final int DEPTH_COMPONENT24 = 0x81A6; - public static final int DEPTH_COMPONENT32 = 0x81A7; - public static final int MIRRORED_REPEAT = 0x8370; - public static final int MAX_TEXTURE_LOD_BIAS = 0x84FD; - public static final int TEXTURE_LOD_BIAS = 0x8501; - public static final int INCR_WRAP = 0x8507; - public static final int DECR_WRAP = 0x8508; - public static final int TEXTURE_DEPTH_SIZE = 0x884A; - public static final int TEXTURE_COMPARE_MODE = 0x884C; - public static final int TEXTURE_COMPARE_FUNC = 0x884D; - public static final int BLEND_COLOR = 0x8005; - public static final int BLEND_EQUATION = 0x8009; - public static final int CONSTANT_COLOR = 0x8001; - public static final int ONE_MINUS_CONSTANT_COLOR = 0x8002; - public static final int CONSTANT_ALPHA = 0x8003; - public static final int ONE_MINUS_CONSTANT_ALPHA = 0x8004; - public static final int FUNC_ADD = 0x8006; - public static final int FUNC_REVERSE_SUBTRACT = 0x800B; - public static final int FUNC_SUBTRACT = 0x800A; - public static final int MIN = 0x8007; - public static final int MAX = 0x8008; - - static boolean isSupported(GLCapabilities caps) { - return checkAll(caps.glBlendColor, caps.glBlendEquation, caps.glBlendFuncSeparate, caps.glMultiDrawArrays, caps.glMultiDrawElements, caps.glPointParameterf, - caps.glPointParameterfv, caps.glPointParameteri, caps.glPointParameteriv); - } - - static void load(GLCapabilities caps, GLLoadFunc load) { - 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.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) { - var caps = getCapabilities(); - try { - check(caps.glBlendColor).invokeExact(red, green, blue, alpha); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void blendEquation(int mode) { - var caps = getCapabilities(); - try { - check(caps.glBlendEquation).invokeExact(mode); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void blendFuncSeparate(int sfactorRGB, int dfactorRGB, int sfactorAlpha, int dfactorAlpha) { - var caps = getCapabilities(); - try { - check(caps.glBlendFuncSeparate).invokeExact(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void multiDrawArrays(int mode, MemorySegment first, MemorySegment count, int drawCount) { - var caps = getCapabilities(); - try { - check(caps.glMultiDrawArrays).invokeExact(mode, first, count, drawCount); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void multiDrawArrays(SegmentAllocator allocator, int mode, int[] first, int[] count, int drawCount) { - multiDrawArrays(mode, allocator.allocateFrom(JAVA_INT, first), allocator.allocateFrom(JAVA_INT, count), drawCount); - } - - public static void multiDrawArrays(SegmentAllocator allocator, int mode, int[] first, int[] count) { - multiDrawArrays(allocator, mode, first, count, first.length); - } - - public static void multiDrawElements(int mode, MemorySegment count, int type, MemorySegment indices, int drawCount) { - var caps = getCapabilities(); - try { - check(caps.glMultiDrawElements).invokeExact(mode, count, type, indices, drawCount); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void multiDrawElements(SegmentAllocator allocator, int mode, int[] count, int type, byte[][] indices, int drawCount) { +public sealed interface GL14C extends GL13C permits GL14, GL15C { + int BLEND_DST_RGB = 0x80C8; + int BLEND_SRC_RGB = 0x80C9; + int BLEND_DST_ALPHA = 0x80CA; + int BLEND_SRC_ALPHA = 0x80CB; + int POINT_FADE_THRESHOLD_SIZE = 0x8128; + int DEPTH_COMPONENT16 = 0x81A5; + int DEPTH_COMPONENT24 = 0x81A6; + int DEPTH_COMPONENT32 = 0x81A7; + int MIRRORED_REPEAT = 0x8370; + int MAX_TEXTURE_LOD_BIAS = 0x84FD; + int TEXTURE_LOD_BIAS = 0x8501; + int INCR_WRAP = 0x8507; + int DECR_WRAP = 0x8508; + int TEXTURE_DEPTH_SIZE = 0x884A; + int TEXTURE_COMPARE_MODE = 0x884C; + int TEXTURE_COMPARE_FUNC = 0x884D; + int BLEND_COLOR = 0x8005; + int BLEND_EQUATION = 0x8009; + int CONSTANT_COLOR = 0x8001; + int ONE_MINUS_CONSTANT_COLOR = 0x8002; + int CONSTANT_ALPHA = 0x8003; + int ONE_MINUS_CONSTANT_ALPHA = 0x8004; + int FUNC_ADD = 0x8006; + int FUNC_REVERSE_SUBTRACT = 0x800B; + int FUNC_SUBTRACT = 0x800A; + int MIN = 0x8007; + int MAX = 0x8008; + + @Entrypoint("glBlendColor") + default void blendColor(float red, float green, float blue, float alpha) { + throw new ContextException(); + } + + @Entrypoint("glBlendEquation") + default void blendEquation(int mode) { + throw new ContextException(); + } + + @Entrypoint("glBlendFuncSeparate") + default void blendFuncSeparate(int sfactorRGB, int dfactorRGB, int sfactorAlpha, int dfactorAlpha) { + throw new ContextException(); + } + + @Entrypoint("glMultiDrawArrays") + default void multiDrawArrays(int mode, MemorySegment first, MemorySegment count, int drawCount) { + throw new ContextException(); + } + + @Entrypoint("glMultiDrawArrays") + default void multiDrawArrays(SegmentAllocator allocator, int mode, int[] first, int[] count, int drawCount) { + throw new ContextException(); + } + + @Entrypoint("glMultiDrawElements") + default void multiDrawElements(int mode, MemorySegment count, int type, MemorySegment indices, int drawCount) { + throw new ContextException(); + } + + @Skip + default void multiDrawElements(SegmentAllocator allocator, int mode, int[] count, int type, byte[][] indices, int drawCount) { var seg = allocator.allocate(ADDRESS, indices.length); for (int i = 0; i < indices.length; i++) { - seg.setAtIndex(ADDRESS, i, allocator.allocateFrom(JAVA_BYTE, indices[i])); + seg.setAtIndex(ADDRESS, i, Marshal.marshal(allocator, indices[i])); } - multiDrawElements(mode, allocator.allocateFrom(JAVA_INT, count), type, seg, drawCount); - } - - public static void multiDrawElements(SegmentAllocator allocator, int mode, int[] count, int type, byte[][] indices) { - multiDrawElements(allocator, mode, count, type, indices, count.length); + multiDrawElements(mode, Marshal.marshal(allocator, count), type, seg, drawCount); } - public static void multiDrawElements(SegmentAllocator allocator, int mode, int[] count, int type, short[][] indices, int drawCount) { + @Skip + default void multiDrawElements(SegmentAllocator allocator, int mode, int[] count, int type, short[][] indices, int drawCount) { var seg = allocator.allocate(ADDRESS, indices.length); for (int i = 0; i < indices.length; i++) { - seg.setAtIndex(ADDRESS, i, allocator.allocateFrom(JAVA_SHORT, indices[i])); + seg.setAtIndex(ADDRESS, i, Marshal.marshal(allocator, indices[i])); } - multiDrawElements(mode, allocator.allocateFrom(JAVA_INT, count), type, seg, drawCount); + multiDrawElements(mode, Marshal.marshal(allocator, count), type, seg, drawCount); } - public static void multiDrawElements(SegmentAllocator allocator, int mode, int[] count, int type, short[][] indices) { - multiDrawElements(allocator, mode, count, type, indices, count.length); - } - - public static void multiDrawElements(SegmentAllocator allocator, int mode, int[] count, int type, int[][] indices, int drawCount) { + @Skip + default void multiDrawElements(SegmentAllocator allocator, int mode, int[] count, int type, int[][] indices, int drawCount) { var seg = allocator.allocate(ADDRESS, indices.length); for (int i = 0; i < indices.length; i++) { - seg.setAtIndex(ADDRESS, i, allocator.allocateFrom(JAVA_INT, indices[i])); + seg.setAtIndex(ADDRESS, i, Marshal.marshal(allocator, indices[i])); } - multiDrawElements(mode, allocator.allocateFrom(JAVA_INT, count), type, seg, drawCount); - } - - public static void multiDrawElements(SegmentAllocator allocator, int mode, int[] count, int type, int[][] indices) { - multiDrawElements(allocator, mode, count, type, indices, count.length); + multiDrawElements(mode, Marshal.marshal(allocator, count), type, seg, drawCount); } - public static void pointParameterf(int pname, float param) { - var caps = getCapabilities(); - try { - check(caps.glPointParameterf).invokeExact(pname, param); - } catch (Throwable e) { - throw new RuntimeException(e); - } + @Entrypoint("glPointParameterf") + default void pointParameterf(int pname, float param) { + throw new ContextException(); } - public static void pointParameterfv(int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glPointParameterfv).invokeExact(pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPointParameterfv") + default void pointParameterfv(int pname, MemorySegment params) { + throw new ContextException(); } - public static void pointParameterfv(SegmentAllocator allocator, int pname, float[] params) { - pointParameterfv(pname, allocator.allocateFrom(JAVA_FLOAT, params)); + @Entrypoint("glPointParameterfv") + default void pointParameterfv(SegmentAllocator allocator, int pname, float[] params) { + throw new ContextException(); } - public static void pointParameteri(int pname, int param) { - var caps = getCapabilities(); - try { - check(caps.glPointParameteri).invokeExact(pname, param); - } catch (Throwable e) { - throw new RuntimeException(e); - } + @Entrypoint("glPointParameteri") + default void pointParameteri(int pname, int param) { + throw new ContextException(); } - public static void pointParameteriv(int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glPointParameteriv).invokeExact(pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPointParameteriv") + default void pointParameteriv(int pname, MemorySegment params) { + throw new ContextException(); } - public static void pointParameteriv(SegmentAllocator allocator, int pname, int[] params) { - pointParameteriv(pname, allocator.allocateFrom(JAVA_INT, params)); + @Entrypoint("glPointParameteriv") + default void pointParameteriv(SegmentAllocator allocator, int pname, int[] params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL15.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL15.java index f5838470..5c84f272 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL15.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL15.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2023 Overrun Organization + * Copyright (c) 2023-2024 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 @@ -22,27 +22,27 @@ * @author squid233 * @since 0.1.0 */ -public final class GL15 extends GL15C { - public static final int VERTEX_ARRAY_BUFFER_BINDING = 0x8896; - public static final int NORMAL_ARRAY_BUFFER_BINDING = 0x8897; - public static final int COLOR_ARRAY_BUFFER_BINDING = 0x8898; - public static final int INDEX_ARRAY_BUFFER_BINDING = 0x8899; - public static final int TEXTURE_COORD_ARRAY_BUFFER_BINDING = 0x889A; - public static final int EDGE_FLAG_ARRAY_BUFFER_BINDING = 0x889B; - public static final int SECONDARY_COLOR_ARRAY_BUFFER_BINDING = 0x889C; - public static final int FOG_COORDINATE_ARRAY_BUFFER_BINDING = 0x889D; - public static final int WEIGHT_ARRAY_BUFFER_BINDING = 0x889E; - public static final int FOG_COORD_SRC = 0x8450; - public static final int FOG_COORD = 0x8451; - public static final int CURRENT_FOG_COORD = 0x8453; - public static final int FOG_COORD_ARRAY_TYPE = 0x8454; - public static final int FOG_COORD_ARRAY_STRIDE = 0x8455; - public static final int FOG_COORD_ARRAY_POINTER = 0x8456; - public static final int FOG_COORD_ARRAY = 0x8457; - public static final int FOG_COORD_ARRAY_BUFFER_BINDING = 0x889D; - public static final int SRC0_RGB = 0x8580; - public static final int SRC1_RGB = 0x8581; - public static final int SRC2_RGB = 0x8582; - public static final int SRC0_ALPHA = 0x8588; - public static final int SRC2_ALPHA = 0x858A; +public sealed interface GL15 extends GL15C permits GLLegacy { + int VERTEX_ARRAY_BUFFER_BINDING = 0x8896; + int NORMAL_ARRAY_BUFFER_BINDING = 0x8897; + int COLOR_ARRAY_BUFFER_BINDING = 0x8898; + int INDEX_ARRAY_BUFFER_BINDING = 0x8899; + int TEXTURE_COORD_ARRAY_BUFFER_BINDING = 0x889A; + int EDGE_FLAG_ARRAY_BUFFER_BINDING = 0x889B; + int SECONDARY_COLOR_ARRAY_BUFFER_BINDING = 0x889C; + int FOG_COORDINATE_ARRAY_BUFFER_BINDING = 0x889D; + int WEIGHT_ARRAY_BUFFER_BINDING = 0x889E; + int FOG_COORD_SRC = 0x8450; + int FOG_COORD = 0x8451; + int CURRENT_FOG_COORD = 0x8453; + int FOG_COORD_ARRAY_TYPE = 0x8454; + int FOG_COORD_ARRAY_STRIDE = 0x8455; + int FOG_COORD_ARRAY_POINTER = 0x8456; + int FOG_COORD_ARRAY = 0x8457; + int FOG_COORD_ARRAY_BUFFER_BINDING = 0x889D; + int SRC0_RGB = 0x8580; + int SRC1_RGB = 0x8581; + int SRC2_RGB = 0x8582; + int SRC0_ALPHA = 0x8588; + int SRC2_ALPHA = 0x858A; } 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 97c79447..af019620 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL15C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL15C.java @@ -16,16 +16,19 @@ package overrungl.opengl; -import overrungl.internal.RuntimeHelper; +import overrun.marshal.Marshal; +import overrun.marshal.MemoryStack; +import overrun.marshal.Unmarshal; +import overrun.marshal.gen.Entrypoint; +import overrun.marshal.gen.Ref; +import overrun.marshal.gen.Skip; import overrungl.opengl.ext.arb.GLARBOcclusionQuery; import overrungl.opengl.ext.arb.GLARBVertexBufferObject; -import overrungl.util.MemoryStack; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; - -import static java.lang.foreign.ValueLayout.*; -import static overrungl.FunctionDescriptors.*; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; /** * The OpenGL 1.5 forward compatible functions. @@ -39,454 +42,364 @@ * @author squid233 * @since 0.1.0 */ -public sealed class GL15C extends GL14C permits GL15, GL20C { - public static final int BUFFER_SIZE = 0x8764; - public static final int BUFFER_USAGE = 0x8765; - public static final int QUERY_COUNTER_BITS = 0x8864; - public static final int CURRENT_QUERY = 0x8865; - public static final int QUERY_RESULT = 0x8866; - public static final int QUERY_RESULT_AVAILABLE = 0x8867; - public static final int ARRAY_BUFFER = 0x8892; - public static final int ELEMENT_ARRAY_BUFFER = 0x8893; - public static final int ARRAY_BUFFER_BINDING = 0x8894; - public static final int ELEMENT_ARRAY_BUFFER_BINDING = 0x8895; - public static final int VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F; - public static final int READ_ONLY = 0x88B8; - public static final int WRITE_ONLY = 0x88B9; - public static final int READ_WRITE = 0x88BA; - public static final int BUFFER_ACCESS = 0x88BB; - public static final int BUFFER_MAPPED = 0x88BC; - public static final int BUFFER_MAP_POINTER = 0x88BD; - public static final int STREAM_DRAW = 0x88E0; - public static final int STREAM_READ = 0x88E1; - public static final int STREAM_COPY = 0x88E2; - public static final int STATIC_DRAW = 0x88E4; - public static final int STATIC_READ = 0x88E5; - public static final int STATIC_COPY = 0x88E6; - public static final int DYNAMIC_DRAW = 0x88E8; - public static final int DYNAMIC_READ = 0x88E9; - public static final int DYNAMIC_COPY = 0x88EA; - public static final int SAMPLES_PASSED = 0x8914; - public static final int SRC1_ALPHA = 0x8589; - - static boolean isSupported(GLCapabilities caps) { - return GLLoader.checkAll(caps.glBeginQuery, caps.glBindBuffer, caps.glBufferData, caps.glBufferSubData, caps.glDeleteBuffers, caps.glDeleteQueries, - caps.glEndQuery, caps.glGenBuffers, caps.glGenQueries, caps.glGetBufferParameteriv, caps.glGetBufferPointerv, caps.glGetBufferSubData, - caps.glGetQueryObjectiv, caps.glGetQueryObjectuiv, caps.glGetQueryiv, caps.glIsBuffer, caps.glIsQuery, caps.glMapBuffer, - caps.glUnmapBuffer); - } - - static void load(GLCapabilities caps, GLLoadFunc load) { - caps.glBeginQuery = load.invoke("glBeginQuery", IIV); - caps.glBindBuffer = load.invoke("glBindBuffer", IIV); - caps.glBufferData = load.invoke("glBufferData", IJPIV); - caps.glBufferSubData = load.invoke("glBufferSubData", IJJPV); - caps.glDeleteBuffers = load.invoke("glDeleteBuffers", IPV); - caps.glDeleteQueries = load.invoke("glDeleteQueries", IPV); - caps.glEndQuery = load.invoke("glEndQuery", IV); - 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.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); - } - - public static void beginQuery(int target, int id) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glBeginQuery).invokeExact(target, id); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void bindBuffer(int target, int buffer) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glBindBuffer).invokeExact(target, buffer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void bufferData(int target, long size, MemorySegment data, int usage) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glBufferData).invokeExact(target, size, data, usage); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void bufferData(int target, MemorySegment data, int usage) { +public sealed interface GL15C extends GL14C permits GL15, GL20C { + int BUFFER_SIZE = 0x8764; + int BUFFER_USAGE = 0x8765; + int QUERY_COUNTER_BITS = 0x8864; + int CURRENT_QUERY = 0x8865; + int QUERY_RESULT = 0x8866; + int QUERY_RESULT_AVAILABLE = 0x8867; + int ARRAY_BUFFER = 0x8892; + int ELEMENT_ARRAY_BUFFER = 0x8893; + int ARRAY_BUFFER_BINDING = 0x8894; + int ELEMENT_ARRAY_BUFFER_BINDING = 0x8895; + int VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F; + int READ_ONLY = 0x88B8; + int WRITE_ONLY = 0x88B9; + int READ_WRITE = 0x88BA; + int BUFFER_ACCESS = 0x88BB; + int BUFFER_MAPPED = 0x88BC; + int BUFFER_MAP_POINTER = 0x88BD; + int STREAM_DRAW = 0x88E0; + int STREAM_READ = 0x88E1; + int STREAM_COPY = 0x88E2; + int STATIC_DRAW = 0x88E4; + int STATIC_READ = 0x88E5; + int STATIC_COPY = 0x88E6; + int DYNAMIC_DRAW = 0x88E8; + int DYNAMIC_READ = 0x88E9; + int DYNAMIC_COPY = 0x88EA; + int SAMPLES_PASSED = 0x8914; + int SRC1_ALPHA = 0x8589; + + @Entrypoint("glBeginQuery") + default void beginQuery(int target, int id) { + throw new ContextException(); + } + + @Entrypoint("glBindBuffer") + default void bindBuffer(int target, int buffer) { + throw new ContextException(); + } + + @Entrypoint("glBufferData") + default void bufferData(int target, long size, MemorySegment data, int usage) { + throw new ContextException(); + } + + @Skip + default void bufferData(int target, MemorySegment data, int usage) { bufferData(target, data.byteSize(), data, usage); } - public static void bufferData(int target, long size, int usage) { + @Skip + default void bufferData(int target, long size, int usage) { bufferData(target, size, MemorySegment.NULL, usage); } - public static void bufferData(SegmentAllocator allocator, int target, byte[] data, int usage) { - bufferData(target, Integer.toUnsignedLong(data.length), allocator.allocateFrom(JAVA_BYTE, data), usage); + @Skip + default void bufferData(SegmentAllocator allocator, int target, byte[] data, int usage) { + bufferData(target, Marshal.marshal(allocator, data), usage); } - public static void bufferData(SegmentAllocator allocator, int target, short[] data, int usage) { - bufferData(target, Integer.toUnsignedLong(data.length) << 1, allocator.allocateFrom(JAVA_SHORT, data), usage); + @Skip + default void bufferData(SegmentAllocator allocator, int target, short[] data, int usage) { + bufferData(target, Marshal.marshal(allocator, data), usage); } - public static void bufferData(SegmentAllocator allocator, int target, int[] data, int usage) { - bufferData(target, Integer.toUnsignedLong(data.length) << 2, allocator.allocateFrom(JAVA_INT, data), usage); + @Skip + default void bufferData(SegmentAllocator allocator, int target, int[] data, int usage) { + bufferData(target, Marshal.marshal(allocator, data), usage); } - public static void bufferData(SegmentAllocator allocator, int target, long[] data, int usage) { - bufferData(target, Integer.toUnsignedLong(data.length) << 3, allocator.allocateFrom(JAVA_LONG, data), usage); + @Skip + default void bufferData(SegmentAllocator allocator, int target, long[] data, int usage) { + bufferData(target, Marshal.marshal(allocator, data), usage); } - public static void bufferData(SegmentAllocator allocator, int target, float[] data, int usage) { - bufferData(target, Integer.toUnsignedLong(data.length) << 2, allocator.allocateFrom(JAVA_FLOAT, data), usage); + @Skip + default void bufferData(SegmentAllocator allocator, int target, float[] data, int usage) { + bufferData(target, Marshal.marshal(allocator, data), usage); } - public static void bufferData(SegmentAllocator allocator, int target, double[] data, int usage) { - bufferData(target, Integer.toUnsignedLong(data.length) << 3, allocator.allocateFrom(JAVA_DOUBLE, data), usage); + @Skip + default void bufferData(SegmentAllocator allocator, int target, double[] data, int usage) { + bufferData(target, Marshal.marshal(allocator, data), usage); } - public static void bufferSubData(int target, long offset, long size, MemorySegment data) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glBufferSubData).invokeExact(target, offset, size, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glBufferSubData") + default void bufferSubData(int target, long offset, long size, MemorySegment data) { + throw new ContextException(); } - public static void bufferSubData(int target, long offset, MemorySegment data) { + @Skip + default void bufferSubData(int target, long offset, MemorySegment data) { bufferSubData(target, offset, data.byteSize(), data); } - public static void bufferSubData(SegmentAllocator allocator, int target, long offset, byte[] data) { - bufferSubData(target, offset, Integer.toUnsignedLong(data.length), allocator.allocateFrom(JAVA_BYTE, data)); + @Skip + default void bufferSubData(SegmentAllocator allocator, int target, long offset, byte[] data) { + final MemorySegment segment = Marshal.marshal(allocator, data); + bufferSubData(target, offset, segment.byteSize(), segment); } - public static void bufferSubData(SegmentAllocator allocator, int target, long offset, short[] data) { - bufferSubData(target, offset, Integer.toUnsignedLong(data.length) << 1, allocator.allocateFrom(JAVA_SHORT, data)); + @Skip + default void bufferSubData(SegmentAllocator allocator, int target, long offset, short[] data) { + final MemorySegment segment = Marshal.marshal(allocator, data); + bufferSubData(target, offset, segment.byteSize(), segment); } - public static void bufferSubData(SegmentAllocator allocator, int target, long offset, int[] data) { - bufferSubData(target, offset, Integer.toUnsignedLong(data.length) << 2, allocator.allocateFrom(JAVA_INT, data)); + @Skip + default void bufferSubData(SegmentAllocator allocator, int target, long offset, int[] data) { + final MemorySegment segment = Marshal.marshal(allocator, data); + bufferSubData(target, offset, segment.byteSize(), segment); } - public static void bufferSubData(SegmentAllocator allocator, int target, long offset, long[] data) { - bufferSubData(target, offset, Integer.toUnsignedLong(data.length) << 3, allocator.allocateFrom(JAVA_LONG, data)); + @Skip + default void bufferSubData(SegmentAllocator allocator, int target, long offset, long[] data) { + final MemorySegment segment = Marshal.marshal(allocator, data); + bufferSubData(target, offset, segment.byteSize(), segment); } - public static void bufferSubData(SegmentAllocator allocator, int target, long offset, float[] data) { - bufferSubData(target, offset, Integer.toUnsignedLong(data.length) << 2, allocator.allocateFrom(JAVA_FLOAT, data)); + @Skip + default void bufferSubData(SegmentAllocator allocator, int target, long offset, float[] data) { + final MemorySegment segment = Marshal.marshal(allocator, data); + bufferSubData(target, offset, segment.byteSize(), segment); } - public static void bufferSubData(SegmentAllocator allocator, int target, long offset, double[] data) { - bufferSubData(target, offset, Integer.toUnsignedLong(data.length) << 3, allocator.allocateFrom(JAVA_DOUBLE, data)); + @Skip + default void bufferSubData(SegmentAllocator allocator, int target, long offset, double[] data) { + final MemorySegment segment = Marshal.marshal(allocator, data); + bufferSubData(target, offset, segment.byteSize(), segment); } - public static void deleteBuffers(int n, MemorySegment buffers) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glDeleteBuffers).invokeExact(n, buffers); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void deleteBuffers(SegmentAllocator allocator, int[] buffers) { - deleteBuffers(buffers.length, allocator.allocateFrom(JAVA_INT, buffers)); - } - - public static void deleteBuffer(int buffer) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - deleteBuffers(1, stack.ints(buffer)); - } finally { - stack.setPointer(stackPointer); - } + @Entrypoint("glDeleteBuffers") + default void deleteBuffers(int n, MemorySegment buffers) { + throw new ContextException(); } - public static void deleteQueries(int n, MemorySegment ids) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glDeleteQueries).invokeExact(n, ids); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); + @Skip + default void deleteBuffers(int... buffers) { + try (MemoryStack stack = MemoryStack.stackPush()) { + deleteBuffers(buffers.length, Marshal.marshal(stack, buffers)); } } - public static void deleteQueries(SegmentAllocator allocator, int[] ids) { - deleteQueries(ids.length, allocator.allocateFrom(JAVA_INT, ids)); + @Entrypoint("glDeleteQueries") + default void deleteQueries(int n, MemorySegment ids) { + throw new ContextException(); } - public static void deleteQuery(int id) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - deleteQueries(1, stack.ints(id)); - } finally { - stack.setPointer(stackPointer); + @Skip + default void deleteQueries(int... ids) { + try (MemoryStack stack = MemoryStack.stackPush()) { + deleteQueries(ids.length, Marshal.marshal(stack, ids)); } } - public static void endQuery(int target) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glEndQuery).invokeExact(target); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEndQuery") + default void endQuery(int target) { + throw new ContextException(); } - public static void genBuffers(int n, MemorySegment buffers) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGenBuffers).invokeExact(n, buffers); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGenBuffers") + default void genBuffers(int n, MemorySegment buffers) { + throw new ContextException(); } - public static void genBuffers(SegmentAllocator allocator, int[] buffers) { - var seg = allocator.allocateFrom(JAVA_INT, buffers.length); + @Skip + default void genBuffers(SegmentAllocator allocator, @Ref int[] buffers) { + var seg = Marshal.marshal(allocator, buffers); genBuffers(buffers.length, seg); - RuntimeHelper.toArray(seg, buffers); + Unmarshal.copy(seg, buffers); } - public static int genBuffer() { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int genBuffers() { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); genBuffers(1, seg); - return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); + return seg.get(ValueLayout.JAVA_INT, 0); } } - public static void genQueries(int n, MemorySegment ids) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGenQueries).invokeExact(n, ids); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGenQueries") + default void genQueries(int n, MemorySegment ids) { + throw new ContextException(); } - public static void genQueries(SegmentAllocator allocator, int[] ids) { - var seg = allocator.allocateFrom(JAVA_INT, ids.length); + @Skip + default void genQueries(SegmentAllocator allocator, @Ref int[] ids) { + var seg = Marshal.marshal(allocator, ids); genQueries(ids.length, seg); - RuntimeHelper.toArray(seg, ids); + Unmarshal.copy(seg, ids); } - public static int genQuery() { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int genQueries() { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); genQueries(1, seg); - return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); + return seg.get(ValueLayout.JAVA_INT, 0); } } - public static void getBufferParameteriv(int target, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetBufferParameteriv).invokeExact(target, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetBufferParameteriv") + default void getBufferParameteriv(int target, int pname, MemorySegment params) { + throw new ContextException(); } - public static int getBufferParameteri(int target, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getBufferParameteriv(int target, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getBufferParameteriv(target, pname, seg); - return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); + return seg.get(ValueLayout.JAVA_INT, 0); } } - public static void getBufferPointerv(int target, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetBufferPointerv).invokeExact(target, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetBufferPointerv") + default void getBufferPointerv(int target, int pname, MemorySegment params) { + throw new ContextException(); } - public static MemorySegment getBufferPointer(int target, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocPointer(); + @Skip + default MemorySegment getBufferPointerv(int target, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.segments(MemorySegment.NULL); getBufferPointerv(target, pname, seg); - return seg.get(RuntimeHelper.ADDRESS_UNBOUNDED, 0); - } finally { - stack.setPointer(stackPointer); + return seg.get(ValueLayout.ADDRESS, 0); } } - public static void getBufferSubData(int target, long offset, long size, MemorySegment data) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetBufferSubData).invokeExact(target, offset, size, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetBufferSubData") + default void getBufferSubData(int target, long offset, long size, MemorySegment data) { + throw new ContextException(); } - public static void getBufferSubData(SegmentAllocator allocator, int target, long offset, byte[] data) { - var seg = allocator.allocate(JAVA_BYTE, data.length); - getBufferSubData(target, offset, Integer.toUnsignedLong(data.length), seg); - RuntimeHelper.toArray(seg, data); + @Skip + default void getBufferSubData(SegmentAllocator allocator, int target, long offset, @Ref byte[] data) { + final MemorySegment segment = Marshal.marshal(allocator, data); + getBufferSubData(target, offset, segment.byteSize(), segment); + Unmarshal.copy(segment, data); } - public static void getBufferSubData(SegmentAllocator allocator, int target, long offset, short[] data) { - var seg = allocator.allocate(JAVA_SHORT, data.length); - getBufferSubData(target, offset, Integer.toUnsignedLong(data.length) << 1, seg); - RuntimeHelper.toArray(seg, data); + @Skip + default void getBufferSubData(SegmentAllocator allocator, int target, long offset, @Ref short[] data) { + final MemorySegment segment = Marshal.marshal(allocator, data); + getBufferSubData(target, offset, segment.byteSize(), segment); + Unmarshal.copy(segment, data); } - public static void getBufferSubData(SegmentAllocator allocator, int target, long offset, int[] data) { - var seg = allocator.allocate(JAVA_INT, data.length); - getBufferSubData(target, offset, Integer.toUnsignedLong(data.length) << 2, seg); - RuntimeHelper.toArray(seg, data); + @Skip + default void getBufferSubData(SegmentAllocator allocator, int target, long offset, @Ref int[] data) { + final MemorySegment segment = Marshal.marshal(allocator, data); + getBufferSubData(target, offset, segment.byteSize(), segment); + Unmarshal.copy(segment, data); } - public static void getBufferSubData(SegmentAllocator allocator, int target, long offset, long[] data) { - var seg = allocator.allocate(JAVA_LONG, data.length); - getBufferSubData(target, offset, Integer.toUnsignedLong(data.length) << 3, seg); - RuntimeHelper.toArray(seg, data); + @Skip + default void getBufferSubData(SegmentAllocator allocator, int target, long offset, @Ref long[] data) { + final MemorySegment segment = Marshal.marshal(allocator, data); + getBufferSubData(target, offset, segment.byteSize(), segment); + Unmarshal.copy(segment, data); } - public static void getBufferSubData(SegmentAllocator allocator, int target, long offset, float[] data) { - var seg = allocator.allocate(JAVA_FLOAT, data.length); - getBufferSubData(target, offset, Integer.toUnsignedLong(data.length) << 2, seg); - RuntimeHelper.toArray(seg, data); + @Skip + default void getBufferSubData(SegmentAllocator allocator, int target, long offset, @Ref float[] data) { + final MemorySegment segment = Marshal.marshal(allocator, data); + getBufferSubData(target, offset, segment.byteSize(), segment); + Unmarshal.copy(segment, data); } - public static void getBufferSubData(SegmentAllocator allocator, int target, long offset, double[] data) { - var seg = allocator.allocate(JAVA_DOUBLE, data.length); - getBufferSubData(target, offset, Integer.toUnsignedLong(data.length) << 3, seg); - RuntimeHelper.toArray(seg, data); + @Skip + default void getBufferSubData(SegmentAllocator allocator, int target, long offset, @Ref double[] data) { + final MemorySegment segment = Marshal.marshal(allocator, data); + getBufferSubData(target, offset, segment.byteSize(), segment); + Unmarshal.copy(segment, data); } - public static void getQueryObjectiv(int id, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetQueryObjectiv).invokeExact(id, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetQueryObjectiv") + default void getQueryObjectiv(int id, int pname, MemorySegment params) { + throw new ContextException(); } - public static int getQueryObjecti(int id, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getQueryObjectiv(int id, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getQueryObjectiv(id, pname, seg); - return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); + return seg.get(ValueLayout.JAVA_INT, 0); } } - public static void getQueryObjectuiv(int id, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetQueryObjectuiv).invokeExact(id, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetQueryObjectuiv") + default void getQueryObjectuiv(int id, int pname, MemorySegment params) { + throw new ContextException(); } - public static int getQueryObjectui(int id, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getQueryObjectuiv(int id, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getQueryObjectuiv(id, pname, seg); - return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); + return seg.get(ValueLayout.JAVA_INT, 0); } } - public static void getQueryiv(int target, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetQueryiv).invokeExact(target, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetQueryiv") + default void getQueryiv(int target, int pname, MemorySegment params) { + throw new ContextException(); } - public static int getQueryi(int target, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getQueryiv(int target, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getQueryiv(target, pname, seg); - return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); + return seg.get(ValueLayout.JAVA_INT, 0); } } - public static boolean isBuffer(int buffer) { - var caps = GLLoader.getCapabilities(); - try { - return (boolean) GLLoader.check(caps.glIsBuffer).invokeExact(buffer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIsBuffer") + default boolean isBuffer(int buffer) { + throw new ContextException(); } - public static boolean isQuery(int buffer) { - var caps = GLLoader.getCapabilities(); - try { - return (boolean) GLLoader.check(caps.glIsQuery).invokeExact(buffer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIsQuery") + default boolean isQuery(int buffer) { + throw new ContextException(); } - public static MemorySegment mapBuffer(int target, int access) { - var caps = GLLoader.getCapabilities(); - try { - final var seg = (MemorySegment) GLLoader.check(caps.glMapBuffer).invokeExact(target, access); - return access == READ_ONLY ? seg.asReadOnly() : seg; - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); + default MethodHandle glMapBuffer() { + throw new ContextException(); + } + + @Skip + default MemorySegment mapBuffer(int target, int access) { + long size = 0; + if (this instanceof GL32C gl32C) { + try { + size = gl32C.getBufferParameteri64v(target, BUFFER_SIZE); + } catch (ContextException e) { + size = getBufferParameteriv(target, BUFFER_SIZE); + } } + return mapBuffer(target, access, size); } - public static boolean unmapBuffer(int target) { - var caps = GLLoader.getCapabilities(); + @Skip + default MemorySegment mapBuffer(int target, int access, long bufferSize) { try { - return (boolean) GLLoader.check(caps.glUnmapBuffer).invokeExact(target); + final MemorySegment segment = ((MemorySegment) glMapBuffer().invokeExact(target, access)).reinterpret(bufferSize); + return access == READ_ONLY ? segment.asReadOnly() : segment; } catch (Throwable e) { - throw new AssertionError("should not reach here", e); + throw new RuntimeException(e); } } + + @Entrypoint("glUnmapBuffer") + default boolean unmapBuffer(int target) { + throw new ContextException(); + } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL20.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL20.java index 696ed4fa..2f225515 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL20.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL20.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2023 Overrun Organization + * Copyright (c) 2023-2024 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 @@ -22,9 +22,9 @@ * @author squid233 * @since 0.1.0 */ -public final class GL20 extends GL20C { - public static final int VERTEX_PROGRAM_TWO_SIDE = 0x8643; - public static final int POINT_SPRITE = 0x8861; - public static final int COORD_REPLACE = 0x8862; - public static final int MAX_TEXTURE_COORDS = 0x8871; +public sealed interface GL20 extends GL20C permits GLLegacy { + int VERTEX_PROGRAM_TWO_SIDE = 0x8643; + int POINT_SPRITE = 0x8861; + int COORD_REPLACE = 0x8862; + int MAX_TEXTURE_COORDS = 0x8871; } 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 f8dfe744..9a31659d 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL20C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL20C.java @@ -17,20 +17,21 @@ package overrungl.opengl; import org.jetbrains.annotations.Nullable; -import overrungl.internal.RuntimeHelper; +import overrun.marshal.Marshal; +import overrun.marshal.MemoryStack; +import overrun.marshal.Unmarshal; +import overrun.marshal.gen.Entrypoint; +import overrun.marshal.gen.Ref; +import overrun.marshal.gen.Skip; import overrungl.opengl.ext.arb.GLARBDrawBuffers; import overrungl.opengl.ext.arb.GLARBFragmentProgram; import overrungl.opengl.ext.arb.GLARBShaderObjects; import overrungl.opengl.ext.arb.GLARBVertexProgram; -import overrungl.util.MemoryStack; -import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; import static java.lang.foreign.ValueLayout.*; -import static overrungl.FunctionDescriptors.*; -import static overrungl.opengl.GLLoader.*; /** * The OpenGL 2.0 forward compatible functions. @@ -46,1517 +47,994 @@ * @author squid233 * @since 0.1.0 */ -public sealed class GL20C extends GL15C permits GL20, GL21C { - public static final int BLEND_EQUATION_RGB = 0x8009; - public static final int VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622; - public static final int VERTEX_ATTRIB_ARRAY_SIZE = 0x8623; - public static final int VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624; - public static final int VERTEX_ATTRIB_ARRAY_TYPE = 0x8625; - public static final int CURRENT_VERTEX_ATTRIB = 0x8626; - public static final int VERTEX_PROGRAM_POINT_SIZE = 0x8642; - public static final int VERTEX_ATTRIB_ARRAY_POINTER = 0x8645; - public static final int STENCIL_BACK_FUNC = 0x8800; - public static final int STENCIL_BACK_FAIL = 0x8801; - public static final int STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802; - public static final int STENCIL_BACK_PASS_DEPTH_PASS = 0x8803; - public static final int MAX_DRAW_BUFFERS = 0x8824; - public static final int DRAW_BUFFER0 = 0x8825; - public static final int DRAW_BUFFER1 = 0x8826; - public static final int DRAW_BUFFER2 = 0x8827; - public static final int DRAW_BUFFER3 = 0x8828; - public static final int DRAW_BUFFER4 = 0x8829; - public static final int DRAW_BUFFER5 = 0x882A; - public static final int DRAW_BUFFER6 = 0x882B; - public static final int DRAW_BUFFER7 = 0x882C; - public static final int DRAW_BUFFER8 = 0x882D; - public static final int DRAW_BUFFER9 = 0x882E; - public static final int DRAW_BUFFER10 = 0x882F; - public static final int DRAW_BUFFER11 = 0x8830; - public static final int DRAW_BUFFER12 = 0x8831; - public static final int DRAW_BUFFER13 = 0x8832; - public static final int DRAW_BUFFER14 = 0x8833; - public static final int DRAW_BUFFER15 = 0x8834; - public static final int BLEND_EQUATION_ALPHA = 0x883D; - public static final int MAX_VERTEX_ATTRIBS = 0x8869; - public static final int VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A; - public static final int MAX_TEXTURE_IMAGE_UNITS = 0x8872; - public static final int FRAGMENT_SHADER = 0x8B30; - public static final int VERTEX_SHADER = 0x8B31; - public static final int MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49; - public static final int MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A; - public static final int MAX_VARYING_FLOATS = 0x8B4B; - public static final int MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C; - public static final int MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D; - public static final int SHADER_TYPE = 0x8B4F; - public static final int FLOAT_VEC2 = 0x8B50; - public static final int FLOAT_VEC3 = 0x8B51; - public static final int FLOAT_VEC4 = 0x8B52; - public static final int INT_VEC2 = 0x8B53; - public static final int INT_VEC3 = 0x8B54; - public static final int INT_VEC4 = 0x8B55; - public static final int BOOL = 0x8B56; - public static final int BOOL_VEC2 = 0x8B57; - public static final int BOOL_VEC3 = 0x8B58; - public static final int BOOL_VEC4 = 0x8B59; - public static final int FLOAT_MAT2 = 0x8B5A; - public static final int FLOAT_MAT3 = 0x8B5B; - public static final int FLOAT_MAT4 = 0x8B5C; - public static final int SAMPLER_1D = 0x8B5D; - public static final int SAMPLER_2D = 0x8B5E; - public static final int SAMPLER_3D = 0x8B5F; - public static final int SAMPLER_CUBE = 0x8B60; - public static final int SAMPLER_1D_SHADOW = 0x8B61; - public static final int SAMPLER_2D_SHADOW = 0x8B62; - public static final int DELETE_STATUS = 0x8B80; - public static final int COMPILE_STATUS = 0x8B81; - public static final int LINK_STATUS = 0x8B82; - public static final int VALIDATE_STATUS = 0x8B83; - public static final int INFO_LOG_LENGTH = 0x8B84; - public static final int ATTACHED_SHADERS = 0x8B85; - public static final int ACTIVE_UNIFORMS = 0x8B86; - public static final int ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87; - public static final int SHADER_SOURCE_LENGTH = 0x8B88; - public static final int ACTIVE_ATTRIBUTES = 0x8B89; - public static final int ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A; - public static final int FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B; - public static final int SHADING_LANGUAGE_VERSION = 0x8B8C; - public static final int CURRENT_PROGRAM = 0x8B8D; - public static final int POINT_SPRITE_COORD_ORIGIN = 0x8CA0; - public static final int LOWER_LEFT = 0x8CA1; - public static final int UPPER_LEFT = 0x8CA2; - public static final int STENCIL_BACK_REF = 0x8CA3; - public static final int STENCIL_BACK_VALUE_MASK = 0x8CA4; - public static final int STENCIL_BACK_WRITEMASK = 0x8CA5; - - static boolean isSupported(GLCapabilities caps) { - return checkAll(caps.glAttachShader, caps.glBindAttribLocation, caps.glBlendEquationSeparate, caps.glCompileShader, caps.glCreateProgram, caps.glCreateShader, - caps.glDeleteProgram, caps.glDeleteShader, caps.glDetachShader, caps.glDisableVertexAttribArray, caps.glDrawBuffers, caps.glEnableVertexAttribArray, - caps.glGetActiveAttrib, caps.glGetActiveUniform, caps.glGetAttachedShaders, caps.glGetAttribLocation, caps.glGetProgramInfoLog, caps.glGetProgramiv, - caps.glGetShaderInfoLog, caps.glGetShaderSource, caps.glGetShaderiv, caps.glGetUniformLocation, caps.glGetUniformfv, caps.glGetUniformiv, - caps.glGetVertexAttribPointerv, caps.glGetVertexAttribdv, caps.glGetVertexAttribfv, caps.glGetVertexAttribiv, caps.glIsProgram, caps.glIsShader, - caps.glLinkProgram, caps.glShaderSource, caps.glStencilFuncSeparate, caps.glStencilMaskSeparate, caps.glStencilOpSeparate, caps.glUniform1f, - caps.glUniform1fv, caps.glUniform1i, caps.glUniform1iv, caps.glUniform2f, caps.glUniform2fv, caps.glUniform2i, - caps.glUniform2iv, caps.glUniform3f, caps.glUniform3fv, caps.glUniform3i, caps.glUniform3iv, caps.glUniform4f, - caps.glUniform4fv, caps.glUniform4i, caps.glUniform4iv, caps.glUniformMatrix2fv, caps.glUniformMatrix3fv, caps.glUniformMatrix4fv, - caps.glUseProgram, caps.glValidateProgram, caps.glVertexAttrib1d, caps.glVertexAttrib1dv, caps.glVertexAttrib1f, caps.glVertexAttrib1fv, - caps.glVertexAttrib1s, caps.glVertexAttrib1sv, caps.glVertexAttrib2d, caps.glVertexAttrib2dv, caps.glVertexAttrib2f, caps.glVertexAttrib2fv, - caps.glVertexAttrib2s, caps.glVertexAttrib2sv, caps.glVertexAttrib3d, caps.glVertexAttrib3dv, caps.glVertexAttrib3f, caps.glVertexAttrib3fv, - caps.glVertexAttrib3s, caps.glVertexAttrib3sv, caps.glVertexAttrib4Nbv, caps.glVertexAttrib4Niv, caps.glVertexAttrib4Nsv, caps.glVertexAttrib4Nub, - caps.glVertexAttrib4Nubv, caps.glVertexAttrib4Nuiv, caps.glVertexAttrib4Nusv, caps.glVertexAttrib4bv, caps.glVertexAttrib4d, caps.glVertexAttrib4dv, - caps.glVertexAttrib4f, caps.glVertexAttrib4fv, caps.glVertexAttrib4iv, caps.glVertexAttrib4s, caps.glVertexAttrib4sv, caps.glVertexAttrib4ubv, - caps.glVertexAttrib4uiv, caps.glVertexAttrib4usv, caps.glVertexAttribPointer); - } - - static void load(GLCapabilities caps, GLLoadFunc load) { - caps.glAttachShader = load.invoke("glAttachShader", IIV); - caps.glBindAttribLocation = load.invoke("glBindAttribLocation", IIPV); - caps.glBlendEquationSeparate = load.invoke("glBlendEquationSeparate", IIV); - caps.glCompileShader = load.invoke("glCompileShader", 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.invoke("glDisableVertexAttribArray", IV); - caps.glDrawBuffers = load.invoke("glDrawBuffers", IPV); - 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.invoke("glGetProgramiv", IIPV); - caps.glGetShaderInfoLog = load.invoke("glGetShaderInfoLog", IIPPV); - caps.glGetShaderSource = load.invoke("glGetShaderSource", IIPV); - 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.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); - caps.glUniform1iv = load.invoke("glUniform1iv", IIPV); - caps.glUniform2f = load.invoke("glUniform2f", IFFV); - caps.glUniform2fv = load.invoke("glUniform2fv", IIPV); - caps.glUniform2i = load.invoke("glUniform2i", IIIV); - caps.glUniform2iv = load.invoke("glUniform2iv", IIPV); - caps.glUniform3f = load.invoke("glUniform3f", IFFFV); - caps.glUniform3fv = load.invoke("glUniform3fv", IIPV); - caps.glUniform3i = load.invoke("glUniform3i", IIIIV); - caps.glUniform3iv = load.invoke("glUniform3iv", IIPV); - caps.glUniform4f = load.invoke("glUniform4f", IFFFFV); - caps.glUniform4fv = load.invoke("glUniform4fv", IIPV); - caps.glUniform4i = load.invoke("glUniform4i", IIIIIV); - caps.glUniform4iv = load.invoke("glUniform4iv", IIPV); - caps.glUniformMatrix2fv = load.invoke("glUniformMatrix2fv", IIZPV); - caps.glUniformMatrix3fv = load.invoke("glUniformMatrix3fv", IIZPV); - caps.glUniformMatrix4fv = load.invoke("glUniformMatrix4fv", IIZPV); - caps.glUseProgram = load.invoke("glUseProgram", IV); - caps.glValidateProgram = load.invoke("glValidateProgram", IV); - caps.glVertexAttrib1d = load.invoke("glVertexAttrib1d", IDV); - caps.glVertexAttrib1dv = load.invoke("glVertexAttrib1dv", IPV); - caps.glVertexAttrib1f = load.invoke("glVertexAttrib1f", IFV); - caps.glVertexAttrib1fv = load.invoke("glVertexAttrib1fv", IPV); - caps.glVertexAttrib1s = load.invoke("glVertexAttrib1s", ISV); - caps.glVertexAttrib1sv = load.invoke("glVertexAttrib1sv", IPV); - caps.glVertexAttrib2d = load.invoke("glVertexAttrib2d", IDDV); - caps.glVertexAttrib2dv = load.invoke("glVertexAttrib2dv", IPV); - caps.glVertexAttrib2f = load.invoke("glVertexAttrib2f", IFFV); - caps.glVertexAttrib2fv = load.invoke("glVertexAttrib2fv", IPV); - caps.glVertexAttrib2s = load.invoke("glVertexAttrib2s", ISSV); - caps.glVertexAttrib2sv = load.invoke("glVertexAttrib2sv", IPV); - caps.glVertexAttrib3d = load.invoke("glVertexAttrib3d", IDDDV); - caps.glVertexAttrib3dv = load.invoke("glVertexAttrib3dv", IPV); - caps.glVertexAttrib3f = load.invoke("glVertexAttrib3f", IFFFV); - caps.glVertexAttrib3fv = load.invoke("glVertexAttrib3fv", IPV); - caps.glVertexAttrib3s = load.invoke("glVertexAttrib3s", ISSSV); - caps.glVertexAttrib3sv = load.invoke("glVertexAttrib3sv", IPV); - caps.glVertexAttrib4Nbv = load.invoke("glVertexAttrib4Nbv", IPV); - caps.glVertexAttrib4Niv = load.invoke("glVertexAttrib4Niv", IPV); - caps.glVertexAttrib4Nsv = load.invoke("glVertexAttrib4Nsv", IPV); - caps.glVertexAttrib4Nub = load.invoke("glVertexAttrib4Nub", IBBBBV); - caps.glVertexAttrib4Nubv = load.invoke("glVertexAttrib4Nubv", IPV); - caps.glVertexAttrib4Nuiv = load.invoke("glVertexAttrib4Nuiv", IPV); - caps.glVertexAttrib4Nusv = load.invoke("glVertexAttrib4Nusv", IPV); - caps.glVertexAttrib4bv = load.invoke("glVertexAttrib4bv", IPV); - caps.glVertexAttrib4d = load.invoke("glVertexAttrib4d", IDDDV); - caps.glVertexAttrib4dv = load.invoke("glVertexAttrib4dv", IPV); - caps.glVertexAttrib4f = load.invoke("glVertexAttrib4f", IFFFV); - caps.glVertexAttrib4fv = load.invoke("glVertexAttrib4fv", IPV); - caps.glVertexAttrib4iv = load.invoke("glVertexAttrib4iv", IPV); - caps.glVertexAttrib4s = load.invoke("glVertexAttrib4s", ISSSV); - caps.glVertexAttrib4sv = load.invoke("glVertexAttrib4sv", IPV); - caps.glVertexAttrib4ubv = load.invoke("glVertexAttrib4ubv", IPV); - caps.glVertexAttrib4uiv = load.invoke("glVertexAttrib4uiv", IPV); - caps.glVertexAttrib4usv = load.invoke("glVertexAttrib4usv", IPV); - caps.glVertexAttribPointer = load.invoke("glVertexAttribPointer", IIIZIPV); - } - - public static void attachShader(int program, int shader) { - var caps = getCapabilities(); - try { - check(caps.glAttachShader).invokeExact(program, shader); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void bindAttribLocation(int program, int index, MemorySegment name) { - var caps = getCapabilities(); - try { - check(caps.glBindAttribLocation).invokeExact(program, index, name); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void bindAttribLocation(int program, int index, String name) { - final MemoryStack stack = MemoryStack.stackGet(); - final long stackPointer = stack.getPointer(); - try { - bindAttribLocation(program, index, stack.allocateFrom(name)); - } finally { - stack.setPointer(stackPointer); - } - } - - public static void blendEquationSeparate(int modeRGB, int modeAlpha) { - var caps = getCapabilities(); - try { - check(caps.glBlendEquationSeparate).invokeExact(modeRGB, modeAlpha); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void compileShader(int shader) { - var caps = getCapabilities(); - try { - check(caps.glCompileShader).invokeExact(shader); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static int createProgram() { - var caps = getCapabilities(); - try { - return (int) check(caps.glCreateProgram).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static int createShader(int type) { - var caps = getCapabilities(); - try { - return (int) check(caps.glCreateShader).invokeExact(type); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void deleteProgram(int program) { - var caps = getCapabilities(); - try { - check(caps.glDeleteProgram).invokeExact(program); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void deleteShader(int shader) { - var caps = getCapabilities(); - try { - check(caps.glDeleteShader).invokeExact(shader); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void detachShader(int program, int shader) { - var caps = getCapabilities(); - try { - check(caps.glDetachShader).invokeExact(program, shader); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void disableVertexAttribArray(int index) { - var caps = getCapabilities(); - try { - check(caps.glDisableVertexAttribArray).invokeExact(index); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } +public sealed interface GL20C extends GL15C permits GL20, GL21C { + int BLEND_EQUATION_RGB = 0x8009; + int VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622; + int VERTEX_ATTRIB_ARRAY_SIZE = 0x8623; + int VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624; + int VERTEX_ATTRIB_ARRAY_TYPE = 0x8625; + int CURRENT_VERTEX_ATTRIB = 0x8626; + int VERTEX_PROGRAM_POINT_SIZE = 0x8642; + int VERTEX_ATTRIB_ARRAY_POINTER = 0x8645; + int STENCIL_BACK_FUNC = 0x8800; + int STENCIL_BACK_FAIL = 0x8801; + int STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802; + int STENCIL_BACK_PASS_DEPTH_PASS = 0x8803; + int MAX_DRAW_BUFFERS = 0x8824; + int DRAW_BUFFER0 = 0x8825; + int DRAW_BUFFER1 = 0x8826; + int DRAW_BUFFER2 = 0x8827; + int DRAW_BUFFER3 = 0x8828; + int DRAW_BUFFER4 = 0x8829; + int DRAW_BUFFER5 = 0x882A; + int DRAW_BUFFER6 = 0x882B; + int DRAW_BUFFER7 = 0x882C; + int DRAW_BUFFER8 = 0x882D; + int DRAW_BUFFER9 = 0x882E; + int DRAW_BUFFER10 = 0x882F; + int DRAW_BUFFER11 = 0x8830; + int DRAW_BUFFER12 = 0x8831; + int DRAW_BUFFER13 = 0x8832; + int DRAW_BUFFER14 = 0x8833; + int DRAW_BUFFER15 = 0x8834; + int BLEND_EQUATION_ALPHA = 0x883D; + int MAX_VERTEX_ATTRIBS = 0x8869; + int VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A; + int MAX_TEXTURE_IMAGE_UNITS = 0x8872; + int FRAGMENT_SHADER = 0x8B30; + int VERTEX_SHADER = 0x8B31; + int MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49; + int MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A; + int MAX_VARYING_FLOATS = 0x8B4B; + int MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C; + int MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D; + int SHADER_TYPE = 0x8B4F; + int FLOAT_VEC2 = 0x8B50; + int FLOAT_VEC3 = 0x8B51; + int FLOAT_VEC4 = 0x8B52; + int INT_VEC2 = 0x8B53; + int INT_VEC3 = 0x8B54; + int INT_VEC4 = 0x8B55; + int BOOL = 0x8B56; + int BOOL_VEC2 = 0x8B57; + int BOOL_VEC3 = 0x8B58; + int BOOL_VEC4 = 0x8B59; + int FLOAT_MAT2 = 0x8B5A; + int FLOAT_MAT3 = 0x8B5B; + int FLOAT_MAT4 = 0x8B5C; + int SAMPLER_1D = 0x8B5D; + int SAMPLER_2D = 0x8B5E; + int SAMPLER_3D = 0x8B5F; + int SAMPLER_CUBE = 0x8B60; + int SAMPLER_1D_SHADOW = 0x8B61; + int SAMPLER_2D_SHADOW = 0x8B62; + int DELETE_STATUS = 0x8B80; + int COMPILE_STATUS = 0x8B81; + int LINK_STATUS = 0x8B82; + int VALIDATE_STATUS = 0x8B83; + int INFO_LOG_LENGTH = 0x8B84; + int ATTACHED_SHADERS = 0x8B85; + int ACTIVE_UNIFORMS = 0x8B86; + int ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87; + int SHADER_SOURCE_LENGTH = 0x8B88; + int ACTIVE_ATTRIBUTES = 0x8B89; + int ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A; + int FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B; + int SHADING_LANGUAGE_VERSION = 0x8B8C; + int CURRENT_PROGRAM = 0x8B8D; + int POINT_SPRITE_COORD_ORIGIN = 0x8CA0; + int LOWER_LEFT = 0x8CA1; + int UPPER_LEFT = 0x8CA2; + int STENCIL_BACK_REF = 0x8CA3; + int STENCIL_BACK_VALUE_MASK = 0x8CA4; + int STENCIL_BACK_WRITEMASK = 0x8CA5; + + @Entrypoint("glAttachShader") + default void attachShader(int program, int shader) { + throw new ContextException(); + } + + @Entrypoint("glBindAttribLocation") + default void bindAttribLocation(int program, int index, MemorySegment name) { + throw new ContextException(); + } + + @Entrypoint("glBindAttribLocation") + default void bindAttribLocation(int program, int index, String name) { + throw new ContextException(); + } + + @Entrypoint("glBlendEquationSeparate") + default void blendEquationSeparate(int modeRGB, int modeAlpha) { + throw new ContextException(); + } + + @Entrypoint("glCompileShader") + default void compileShader(int shader) { + throw new ContextException(); + } + + @Entrypoint("glCreateProgram") + default int createProgram() { + throw new ContextException(); + } + + @Entrypoint("glCreateShader") + default int createShader(int type) { + throw new ContextException(); + } + + @Entrypoint("glDeleteProgram") + default void deleteProgram(int program) { + throw new ContextException(); + } + + @Entrypoint("glDeleteShader") + default void deleteShader(int shader) { + throw new ContextException(); + } + + @Entrypoint("glDetachShader") + default void detachShader(int program, int shader) { + throw new ContextException(); + } + + @Entrypoint("glDisableVertexAttribArray") + default void disableVertexAttribArray(int index) { + throw new ContextException(); } - public static void drawBuffers(int n, MemorySegment bufs) { - var caps = getCapabilities(); - try { - check(caps.glDrawBuffers).invokeExact(n, bufs); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDrawBuffers") + default void drawBuffers(int n, MemorySegment bufs) { + throw new ContextException(); } - public static void drawBuffers(SegmentAllocator allocator, int[] bufs) { - drawBuffers(bufs.length, allocator.allocateFrom(JAVA_INT, bufs)); + @Skip + default void drawBuffers(SegmentAllocator allocator, int[] bufs) { + drawBuffers(bufs.length, Marshal.marshal(allocator, bufs)); } - public static void enableVertexAttribArray(int index) { - var caps = getCapabilities(); - try { - check(caps.glEnableVertexAttribArray).invokeExact(index); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEnableVertexAttribArray") + default void enableVertexAttribArray(int index) { + throw new ContextException(); } - public static void getActiveAttrib(int program, int index, int bufSize, MemorySegment length, MemorySegment size, MemorySegment type, MemorySegment name) { - var caps = getCapabilities(); - try { - check(caps.glGetActiveAttrib).invokeExact(program, index, bufSize, length, size, type, name); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetActiveAttrib") + default void getActiveAttrib(int program, int index, int bufSize, MemorySegment length, MemorySegment size, MemorySegment type, MemorySegment name) { + throw new ContextException(); } - public static void getActiveAttrib(SegmentAllocator allocator, int program, int index, int bufSize, int @Nullable [] length, int[] size, int[] type, String[] name) { - var pLen = length != null ? allocator.allocate(JAVA_INT) : MemorySegment.NULL; - var pSz = allocator.allocate(JAVA_INT); - var pType = allocator.allocate(JAVA_INT); + @Skip + default void getActiveAttrib(SegmentAllocator allocator, int program, int index, int bufSize, @Ref int @Nullable [] length, @Ref int[] size, @Ref int[] type, @Ref String[] name) { + var pLen = Marshal.marshal(allocator, length); + var pSz = Marshal.marshal(allocator, size); + var pType = Marshal.marshal(allocator, type); var pName = allocator.allocate(JAVA_BYTE, bufSize); getActiveAttrib(program, index, bufSize, pLen, pSz, pType, pName); - if (length != null && length.length > 0) { - length[0] = pLen.get(JAVA_INT, 0); - } - size[0] = pSz.get(JAVA_INT, 0); - type[0] = pType.get(JAVA_INT, 0); + Unmarshal.copy(pLen, length); + Unmarshal.copy(pSz, size); + Unmarshal.copy(pType, type); name[0] = pName.getString(0); } - public static void getActiveUniform(int program, int index, int bufSize, MemorySegment length, MemorySegment size, MemorySegment type, MemorySegment name) { - var caps = getCapabilities(); - try { - check(caps.glGetActiveUniform).invokeExact(program, index, bufSize, length, size, type, name); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetActiveUniform") + default void getActiveUniform(int program, int index, int bufSize, MemorySegment length, MemorySegment size, MemorySegment type, MemorySegment name) { + throw new ContextException(); } - public static void getActiveUniform(SegmentAllocator allocator, int program, int index, int bufSize, int @Nullable [] length, int[] size, int[] type, String[] name) { - var pLen = length != null ? allocator.allocate(JAVA_INT) : MemorySegment.NULL; - var pSz = allocator.allocate(JAVA_INT); - var pType = allocator.allocate(JAVA_INT); + @Skip + default void getActiveUniform(SegmentAllocator allocator, int program, int index, int bufSize, @Ref int @Nullable [] length, @Ref int[] size, @Ref int[] type, @Ref String[] name) { + var pLen = Marshal.marshal(allocator, length); + var pSz = Marshal.marshal(allocator, size); + var pType = Marshal.marshal(allocator, type); var pName = allocator.allocate(JAVA_BYTE, bufSize); getActiveUniform(program, index, bufSize, pLen, pSz, pType, pName); - if (length != null && length.length > 0) { - length[0] = pLen.get(JAVA_INT, 0); - } - size[0] = pSz.get(JAVA_INT, 0); - type[0] = pType.get(JAVA_INT, 0); + Unmarshal.copy(pLen, length); + Unmarshal.copy(pSz, size); + Unmarshal.copy(pType, type); name[0] = pName.getString(0); } - public static void getAttachedShaders(int program, int maxCount, MemorySegment count, MemorySegment shaders) { - var caps = getCapabilities(); - try { - check(caps.glGetAttachedShaders).invokeExact(program, maxCount, count, shaders); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetAttachedShaders") + default void getAttachedShaders(int program, int maxCount, MemorySegment count, MemorySegment shaders) { + throw new ContextException(); } - public static void getAttachedShaders(SegmentAllocator allocator, int program, int @Nullable [] count, int[] shaders) { - var pCount = count != null ? allocator.allocate(JAVA_INT) : MemorySegment.NULL; - var pShaders = allocator.allocate(JAVA_INT, shaders.length); - getAttachedShaders(program, shaders.length, pCount, pShaders); - if (count != null && count.length > 0) { - count[0] = pCount.get(JAVA_INT, 0); - } - RuntimeHelper.toArray(pShaders, shaders); + @Entrypoint("glGetAttachedShaders") + default void getAttachedShaders(SegmentAllocator allocator, int program, int maxCount, @Ref int @Nullable [] count, @Ref int[] shaders) { + throw new ContextException(); } - public static int getAttribLocation(int program, MemorySegment name) { - var caps = getCapabilities(); - try { - return (int) check(caps.glGetAttribLocation).invokeExact(program, name); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetAttribLocation") + default int getAttribLocation(int program, MemorySegment name) { + throw new ContextException(); } - public static int getAttribLocation(int program, String name) { - final MemoryStack stack = MemoryStack.stackGet(); - final long stackPointer = stack.getPointer(); - try { - return getAttribLocation(program, stack.allocateFrom(name)); - } finally { - stack.setPointer(stackPointer); - } + @Entrypoint("glGetAttribLocation") + default int getAttribLocation(int program, String name) { + throw new ContextException(); } - public static void getProgramInfoLog(int program, int bufSize, MemorySegment length, MemorySegment infoLog) { - var caps = getCapabilities(); - try { - check(caps.glGetProgramInfoLog).invokeExact(program, bufSize, length, infoLog); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetProgramInfoLog") + default void getProgramInfoLog(int program, int bufSize, MemorySegment length, MemorySegment infoLog) { + throw new ContextException(); } - 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.allocate(JAVA_BYTE, bufSize); - getProgramInfoLog(program, bufSize, pLen, pLog); - if (length != null && length.length > 0) { - length[0] = pLen.get(JAVA_INT, 0); - } - return pLog.getString(0); - } finally { - if (!(allocator instanceof MemoryStack)) allocator.close(); - } - } finally { - stack.setPointer(stackPointer); + @Skip + default String getProgramInfoLog(int program, int bufSize, @Ref int @Nullable [] length) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pLen = Marshal.marshal(stack, length); + var pLog = stack.allocate(JAVA_BYTE, bufSize); + getProgramInfoLog(program, bufSize, pLen, pLog); + Unmarshal.copy(pLen, length); + return pLog.getString(0); } } - public static String getProgramInfoLog(int program) { - return getProgramInfoLog(program, getProgrami(program, INFO_LOG_LENGTH), null); + @Skip + default String getProgramInfoLog(int program) { + return getProgramInfoLog(program, getProgramiv(program, INFO_LOG_LENGTH), null); } - public static void getProgramiv(int program, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetProgramiv).invokeExact(program, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetProgramiv") + default void getProgramiv(int program, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getProgramiv(SegmentAllocator allocator, int program, int pname, int[] params) { - var seg = allocator.allocate(JAVA_INT, params.length); - getProgramiv(program, pname, seg); - RuntimeHelper.toArray(seg, params); + @Entrypoint("glGetProgramiv") + default void getProgramiv(SegmentAllocator allocator, int program, int pname, @Ref int[] params) { + throw new ContextException(); } - public static int getProgrami(int program, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getProgramiv(int program, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getProgramiv(program, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getShaderInfoLog(int shader, int bufSize, MemorySegment length, MemorySegment infoLog) { - var caps = getCapabilities(); - try { - check(caps.glGetShaderInfoLog).invokeExact(shader, bufSize, length, infoLog); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetShaderInfoLog") + default void getShaderInfoLog(int shader, int bufSize, MemorySegment length, MemorySegment infoLog) { + throw new ContextException(); } - 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.allocate(JAVA_BYTE, bufSize); - getShaderInfoLog(shader, bufSize, pLen, pLog); - if (length != null && length.length > 0) { - length[0] = pLen.get(JAVA_INT, 0); - } - return pLog.getString(0); - } finally { - if (!(allocator instanceof MemoryStack)) allocator.close(); - } - } finally { - stack.setPointer(stackPointer); + @Skip + default String getShaderInfoLog(int shader, int bufSize, @Ref int @Nullable [] length) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pLen = Marshal.marshal(stack, length); + var pLog = stack.allocate(JAVA_BYTE, bufSize); + getShaderInfoLog(shader, bufSize, pLen, pLog); + Unmarshal.copy(pLen, length); + return pLog.getString(0); } } - public static String getShaderInfoLog(int shader) { - return getShaderInfoLog(shader, getShaderi(shader, INFO_LOG_LENGTH), null); + @Skip + default String getShaderInfoLog(int shader) { + return getShaderInfoLog(shader, getShaderiv(shader, INFO_LOG_LENGTH), null); } - public static void getShaderSource(int shader, int bufSize, MemorySegment length, MemorySegment source) { - var caps = getCapabilities(); - try { - check(caps.glGetShaderSource).invokeExact(shader, bufSize, length, source); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetShaderSource") + default void getShaderSource(int shader, int bufSize, MemorySegment length, MemorySegment source) { + throw new ContextException(); } - public static String getShaderSource(SegmentAllocator allocator, int shader, int bufSize, int @Nullable [] length) { - var pLen = length != null ? allocator.allocate(JAVA_INT) : MemorySegment.NULL; - var pSrc = allocator.allocate(JAVA_BYTE, bufSize); - getShaderSource(shader, bufSize, pLen, pSrc); - if (length != null && length.length > 0) { - length[0] = pLen.get(JAVA_INT, 0); + @Skip + default String getShaderSource(int shader, int bufSize, @Ref int @Nullable [] length) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pLen = Marshal.marshal(stack, length); + var pSrc = stack.allocate(JAVA_BYTE, bufSize); + getShaderSource(shader, bufSize, pLen, pSrc); + Unmarshal.copy(pLen, length); + return pSrc.getString(0); } - return pSrc.getString(0); } - public static String getShaderSource(SegmentAllocator allocator, int shader) { - return getShaderSource(allocator, shader, getShaderi(shader, SHADER_SOURCE_LENGTH), null); + @Skip + default String getShaderSource(int shader) { + return getShaderSource(shader, getShaderiv(shader, SHADER_SOURCE_LENGTH), null); } - public static void getShaderiv(int shader, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetShaderiv).invokeExact(shader, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetShaderiv") + default void getShaderiv(int shader, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getShaderiv(SegmentAllocator allocator, int shader, int pname, int[] params) { - var seg = allocator.allocate(JAVA_INT, params.length); - getShaderiv(shader, pname, seg); - RuntimeHelper.toArray(seg, params); + @Entrypoint("glGetShaderiv") + default void getShaderiv(SegmentAllocator allocator, int shader, int pname, @Ref int[] params) { + throw new ContextException(); } - public static int getShaderi(int shader, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getShaderiv(int shader, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getShaderiv(shader, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static int getUniformLocation(int program, MemorySegment name) { - var caps = getCapabilities(); - try { - return (int) check(caps.glGetUniformLocation).invokeExact(program, name); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetUniformLocation") + default int getUniformLocation(int program, MemorySegment name) { + throw new ContextException(); } - public static int getUniformLocation(int program, String name) { - final MemoryStack stack = MemoryStack.stackGet(); - final long stackPointer = stack.getPointer(); - try { - return getUniformLocation(program, stack.allocateFrom(name)); - } finally { - stack.setPointer(stackPointer); - } + @Entrypoint("glGetUniformLocation") + default int getUniformLocation(int program, String name) { + throw new ContextException(); } - public static void getUniformfv(int program, int location, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetUniformfv).invokeExact(program, location, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetUniformfv") + default void getUniformfv(int program, int location, MemorySegment params) { + throw new ContextException(); } - public static void getUniformfv(SegmentAllocator allocator, int program, int location, float[] params) { - var seg = allocator.allocate(JAVA_FLOAT, params.length); - getUniformfv(program, location, seg); - RuntimeHelper.toArray(seg, params); + @Entrypoint("glGetUniformfv") + default void getUniformfv(SegmentAllocator allocator, int program, int location, @Ref float[] params) { + throw new ContextException(); } - public static float getUniformf(int program, int location) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocFloat(); + @Skip + default float getUniformfv(int program, int location) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.floats(0F); getUniformfv(program, location, seg); return seg.get(JAVA_FLOAT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getUniformiv(int program, int location, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetUniformiv).invokeExact(program, location, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetUniformiv") + default void getUniformiv(int program, int location, MemorySegment params) { + throw new ContextException(); } - public static void getUniformiv(SegmentAllocator allocator, int program, int location, int[] params) { - var seg = allocator.allocate(JAVA_INT, params.length); - getUniformiv(program, location, seg); - RuntimeHelper.toArray(seg, params); + @Entrypoint("glGetUniformiv") + default void getUniformiv(SegmentAllocator allocator, int program, int location, @Ref int[] params) { + throw new ContextException(); } - public static int getUniformi(int program, int location) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getUniformiv(int program, int location) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getUniformiv(program, location, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getVertexAttribPointerv(int index, int pname, MemorySegment pointer) { - var caps = getCapabilities(); - try { - check(caps.glGetVertexAttribPointerv).invokeExact(index, pname, pointer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetVertexAttribPointerv") + default void getVertexAttribPointerv(int index, int pname, MemorySegment pointer) { + throw new ContextException(); } - public static void getVertexAttribPointerv(SegmentAllocator allocator, int index, int pname, byte[] pointer) { - var seg = allocator.allocate(JAVA_BYTE, pointer.length); - getVertexAttribPointerv(index, pname, seg); - RuntimeHelper.toArray(seg, pointer); + @Entrypoint("glGetVertexAttribPointerv") + default void getVertexAttribPointerv(SegmentAllocator allocator, int index, int pname, @Ref byte[] pointer) { + throw new ContextException(); } - public static void getVertexAttribPointerv(SegmentAllocator allocator, int index, int pname, short[] pointer) { - var seg = allocator.allocate(JAVA_SHORT, pointer.length); - getVertexAttribPointerv(index, pname, seg); - RuntimeHelper.toArray(seg, pointer); + @Entrypoint("glGetVertexAttribPointerv") + default void getVertexAttribPointerv(SegmentAllocator allocator, int index, int pname, @Ref short[] pointer) { + throw new ContextException(); } - public static void getVertexAttribPointerv(SegmentAllocator allocator, int index, int pname, int[] pointer) { - var seg = allocator.allocate(JAVA_INT, pointer.length); - getVertexAttribPointerv(index, pname, seg); - RuntimeHelper.toArray(seg, pointer); + @Entrypoint("glGetVertexAttribPointerv") + default void getVertexAttribPointerv(SegmentAllocator allocator, int index, int pname, @Ref int[] pointer) { + throw new ContextException(); } - public static void getVertexAttribPointerv(SegmentAllocator allocator, int index, int pname, float[] pointer) { - var seg = allocator.allocate(JAVA_FLOAT, pointer.length); - getVertexAttribPointerv(index, pname, seg); - RuntimeHelper.toArray(seg, pointer); + @Entrypoint("glGetVertexAttribPointerv") + default void getVertexAttribPointerv(SegmentAllocator allocator, int index, int pname, @Ref float[] pointer) { + throw new ContextException(); } - public static void getVertexAttribPointerv(SegmentAllocator allocator, int index, int pname, double[] pointer) { - var seg = allocator.allocate(JAVA_DOUBLE, pointer.length); - getVertexAttribPointerv(index, pname, seg); - RuntimeHelper.toArray(seg, pointer); + @Entrypoint("glGetVertexAttribPointerv") + default void getVertexAttribPointerv(SegmentAllocator allocator, int index, int pname, @Ref double[] pointer) { + throw new ContextException(); } - public static void getVertexAttribdv(int index, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetVertexAttribdv).invokeExact(index, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetVertexAttribdv") + default void getVertexAttribdv(int index, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getVertexAttribdv(SegmentAllocator allocator, int index, int pname, double[] params) { - var seg = allocator.allocate(JAVA_DOUBLE, params.length); - getVertexAttribdv(index, pname, seg); - RuntimeHelper.toArray(seg, params); + @Entrypoint("glGetVertexAttribdv") + default void getVertexAttribdv(SegmentAllocator allocator, int index, int pname, @Ref double[] params) { + throw new ContextException(); } - public static double getVertexAttribd(int index, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocDouble(); + @Skip + default double getVertexAttribdv(int index, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.doubles(0D); getVertexAttribdv(index, pname, seg); return seg.get(JAVA_DOUBLE, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getVertexAttribfv(int index, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetVertexAttribfv).invokeExact(index, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetVertexAttribfv") + default void getVertexAttribfv(int index, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getVertexAttribfv(SegmentAllocator allocator, int index, int pname, float[] params) { - var seg = allocator.allocate(JAVA_FLOAT, params.length); - getVertexAttribfv(index, pname, seg); - RuntimeHelper.toArray(seg, params); + @Entrypoint("glGetVertexAttribfv") + default void getVertexAttribfv(SegmentAllocator allocator, int index, int pname, @Ref float[] params) { + throw new ContextException(); } - public static float getVertexAttribf(int index, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocFloat(); + @Skip + default float getVertexAttribfv(int index, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.floats(0F); getVertexAttribfv(index, pname, seg); return seg.get(JAVA_FLOAT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getVertexAttribiv(int index, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetVertexAttribiv).invokeExact(index, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetVertexAttribiv") + default void getVertexAttribiv(int index, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getVertexAttribiv(SegmentAllocator allocator, int index, int pname, int[] params) { - var seg = allocator.allocate(JAVA_INT, params.length); - getVertexAttribiv(index, pname, seg); - RuntimeHelper.toArray(seg, params); + @Entrypoint("glGetVertexAttribiv") + default void getVertexAttribiv(SegmentAllocator allocator, int index, int pname, @Ref int[] params) { + throw new ContextException(); } - public static int getVertexAttribi(int index, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getVertexAttribiv(int index, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getVertexAttribiv(index, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static boolean isProgram(int program) { - var caps = getCapabilities(); - try { - return (boolean) check(caps.glIsProgram).invokeExact(program); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIsProgram") + default boolean isProgram(int program) { + throw new ContextException(); } - public static boolean isShader(int shader) { - var caps = getCapabilities(); - try { - return (boolean) check(caps.glIsShader).invokeExact(shader); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIsShader") + default boolean isShader(int shader) { + throw new ContextException(); } - public static void linkProgram(int program) { - var caps = getCapabilities(); - try { - check(caps.glLinkProgram).invokeExact(program); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glLinkProgram") + default void linkProgram(int program) { + throw new ContextException(); } - public static void shaderSource(int shader, int count, MemorySegment string, MemorySegment length) { - var caps = getCapabilities(); - try { - check(caps.glShaderSource).invokeExact(shader, count, string, length); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glShaderSource") + default void shaderSource(int shader, int count, MemorySegment string, MemorySegment length) { + throw new ContextException(); } - public static void shaderSource(SegmentAllocator allocator, int shader, String[] string) { - var pStr = allocator.allocate(ADDRESS, string.length); - var pLen = allocator.allocate(JAVA_INT, string.length); - for (int i = 0; i < string.length; i++) { - pStr.setAtIndex(ADDRESS, i, allocator.allocateFrom(string[i])); - pLen.setAtIndex(JAVA_INT, i, string[i].length()); - } - shaderSource(shader, string.length, pStr, pLen); + @Skip + default void shaderSource(SegmentAllocator allocator, int shader, String[] string) { + shaderSource(shader, string.length, Marshal.marshal(allocator, string), MemorySegment.NULL); } - public static void shaderSource(int shader, String string) { - final MemoryStack stack = MemoryStack.stackGet(); - final long stackPointer = stack.getPointer(); - try { - shaderSource(shader, 1, stack.allocateFrom(ADDRESS, stack.allocateFrom(string)), stack.allocateFrom(JAVA_INT, string.length())); - } finally { - stack.setPointer(stackPointer); + @Skip + default void shaderSource(int shader, String string) { + try (MemoryStack stack = MemoryStack.stackPush()) { + shaderSource(shader, 1, stack.allocateFrom(ADDRESS, Marshal.marshal(stack, string)), MemorySegment.NULL); } } - public static void stencilFuncSeparate(int face, int func, int ref, int mask) { - var caps = getCapabilities(); - try { - check(caps.glStencilFuncSeparate).invokeExact(face, func, ref, mask); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glStencilFuncSeparate") + default void stencilFuncSeparate(int face, int func, int ref, int mask) { + throw new ContextException(); } - public static void stencilMaskSeparate(int face, int mask) { - var caps = getCapabilities(); - try { - check(caps.glStencilMaskSeparate).invokeExact(face, mask); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glStencilMaskSeparate") + default void stencilMaskSeparate(int face, int mask) { + throw new ContextException(); } - public static void stencilOpSeparate(int face, int sfail, int dpfail, int dppass) { - var caps = getCapabilities(); - try { - check(caps.glStencilOpSeparate).invokeExact(face, sfail, dpfail, dppass); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glStencilOpSeparate") + default void stencilOpSeparate(int face, int sfail, int dpfail, int dppass) { + throw new ContextException(); } - public static void uniform1f(int location, float v0) { - var caps = getCapabilities(); - try { - check(caps.glUniform1f).invokeExact(location, v0); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform1f") + default void uniform1f(int location, float v0) { + throw new ContextException(); } - public static void uniform1fv(int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniform1fv).invokeExact(location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform1fv") + default void uniform1fv(int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void uniform1fv(SegmentAllocator allocator, int location, float[] value) { - uniform1fv(location, value.length, allocator.allocateFrom(JAVA_FLOAT, value)); + @Skip + default void uniform1fv(SegmentAllocator allocator, int location, float[] value) { + uniform1fv(location, value.length, Marshal.marshal(allocator, value)); } - public static void uniform1i(int location, int v0) { - var caps = getCapabilities(); - try { - check(caps.glUniform1i).invokeExact(location, v0); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform1i") + default void uniform1i(int location, int v0) { + throw new ContextException(); } - public static void uniform1iv(int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniform1iv).invokeExact(location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform1iv") + default void uniform1iv(int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void uniform1iv(SegmentAllocator allocator, int location, int[] value) { - uniform1iv(location, value.length, allocator.allocateFrom(JAVA_INT, value)); + @Skip + default void uniform1iv(SegmentAllocator allocator, int location, int[] value) { + uniform1iv(location, value.length, Marshal.marshal(allocator, value)); } - public static void uniform2f(int location, float v0, float v1) { - var caps = getCapabilities(); - try { - check(caps.glUniform2f).invokeExact(location, v0, v1); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform2f") + default void uniform2f(int location, float v0, float v1) { + throw new ContextException(); } - public static void uniform2fv(int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniform2fv).invokeExact(location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform2fv") + default void uniform2fv(int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void uniform2fv(SegmentAllocator allocator, int location, float[] value) { - uniform2fv(location, value.length >> 1, allocator.allocateFrom(JAVA_FLOAT, value)); + @Skip + default void uniform2fv(SegmentAllocator allocator, int location, float[] value) { + uniform2fv(location, value.length >> 1, Marshal.marshal(allocator, value)); } - public static void uniform2i(int location, int v0, int v1) { - var caps = getCapabilities(); - try { - check(caps.glUniform2i).invokeExact(location, v0, v1); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform2i") + default void uniform2i(int location, int v0, int v1) { + throw new ContextException(); } - public static void uniform2iv(int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniform2iv).invokeExact(location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform2iv") + default void uniform2iv(int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void uniform2iv(SegmentAllocator allocator, int location, int[] value) { - uniform2iv(location, value.length >> 1, allocator.allocateFrom(JAVA_INT, value)); + @Skip + default void uniform2iv(SegmentAllocator allocator, int location, int[] value) { + uniform2iv(location, value.length >> 1, Marshal.marshal(allocator, value)); } - public static void uniform3f(int location, float v0, float v1, float v2) { - var caps = getCapabilities(); - try { - check(caps.glUniform3f).invokeExact(location, v0, v1, v2); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform3f") + default void uniform3f(int location, float v0, float v1, float v2) { + throw new ContextException(); } - public static void uniform3fv(int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniform3fv).invokeExact(location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform3fv") + default void uniform3fv(int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void uniform3fv(SegmentAllocator allocator, int location, float[] value) { - uniform3fv(location, value.length / 3, allocator.allocateFrom(JAVA_FLOAT, value)); + @Skip + default void uniform3fv(SegmentAllocator allocator, int location, float[] value) { + uniform3fv(location, value.length / 3, Marshal.marshal(allocator, value)); } - public static void uniform3i(int location, int v0, int v1, int v2) { - var caps = getCapabilities(); - try { - check(caps.glUniform3i).invokeExact(location, v0, v1, v2); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform3i") + default void uniform3i(int location, int v0, int v1, int v2) { + throw new ContextException(); } - public static void uniform3iv(int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniform3iv).invokeExact(location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform3iv") + default void uniform3iv(int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void uniform3iv(SegmentAllocator allocator, int location, int[] value) { - uniform3iv(location, value.length / 3, allocator.allocateFrom(JAVA_INT, value)); + @Skip + default void uniform3iv(SegmentAllocator allocator, int location, int[] value) { + uniform3iv(location, value.length / 3, Marshal.marshal(allocator, value)); } - public static void uniform4f(int location, float v0, float v1, float v2, float v3) { - var caps = getCapabilities(); - try { - check(caps.glUniform4f).invokeExact(location, v0, v1, v2, v3); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform4f") + default void uniform4f(int location, float v0, float v1, float v2, float v3) { + throw new ContextException(); } - public static void uniform4fv(int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniform4fv).invokeExact(location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform4fv") + default void uniform4fv(int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void uniform4fv(SegmentAllocator allocator, int location, float[] value) { - uniform4fv(location, value.length >> 2, allocator.allocateFrom(JAVA_FLOAT, value)); + @Skip + default void uniform4fv(SegmentAllocator allocator, int location, float[] value) { + uniform4fv(location, value.length >> 2, Marshal.marshal(allocator, value)); } - public static void uniform4i(int location, int v0, int v1, int v2, int v3) { - var caps = getCapabilities(); - try { - check(caps.glUniform4i).invokeExact(location, v0, v1, v2, v3); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform4i") + default void uniform4i(int location, int v0, int v1, int v2, int v3) { + throw new ContextException(); } - public static void uniform4iv(int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniform4iv).invokeExact(location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform4iv") + default void uniform4iv(int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void uniform4iv(SegmentAllocator allocator, int location, int[] value) { - uniform4iv(location, value.length >> 2, allocator.allocateFrom(JAVA_INT, value)); + @Skip + default void uniform4iv(SegmentAllocator allocator, int location, int[] value) { + uniform4iv(location, value.length >> 2, Marshal.marshal(allocator, value)); } - public static void uniformMatrix2fv(int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniformMatrix2fv).invokeExact(location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniformMatrix2fv") + default void uniformMatrix2fv(int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void uniformMatrix2fv(SegmentAllocator allocator, int location, int count, boolean transpose, float[] value) { - uniformMatrix2fv(location, count, transpose, allocator.allocateFrom(JAVA_FLOAT, value)); + @Skip + default void uniformMatrix2fv(SegmentAllocator allocator, int location, int count, boolean transpose, float[] value) { + uniformMatrix2fv(location, count, transpose, Marshal.marshal(allocator, value)); } - public static void uniformMatrix2fv(SegmentAllocator allocator, int location, boolean transpose, float[] value) { + @Skip + default void uniformMatrix2fv(SegmentAllocator allocator, int location, boolean transpose, float[] value) { uniformMatrix2fv(allocator, location, value.length >> 2, transpose, value); } - public static void uniformMatrix3fv(int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniformMatrix3fv).invokeExact(location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniformMatrix3fv") + default void uniformMatrix3fv(int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void uniformMatrix3fv(SegmentAllocator allocator, int location, int count, boolean transpose, float[] value) { - uniformMatrix3fv(location, count, transpose, allocator.allocateFrom(JAVA_FLOAT, value)); + @Skip + default void uniformMatrix3fv(SegmentAllocator allocator, int location, int count, boolean transpose, float[] value) { + uniformMatrix3fv(location, count, transpose, Marshal.marshal(allocator, value)); } - public static void uniformMatrix3fv(SegmentAllocator allocator, int location, boolean transpose, float[] value) { + @Skip + default void uniformMatrix3fv(SegmentAllocator allocator, int location, boolean transpose, float[] value) { uniformMatrix3fv(allocator, location, value.length / 9, transpose, value); } - public static void uniformMatrix4fv(int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniformMatrix4fv).invokeExact(location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniformMatrix4fv") + default void uniformMatrix4fv(int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void uniformMatrix4fv(SegmentAllocator allocator, int location, int count, boolean transpose, float[] value) { - uniformMatrix4fv(location, count, transpose, allocator.allocateFrom(JAVA_FLOAT, value)); + @Skip + default void uniformMatrix4fv(SegmentAllocator allocator, int location, int count, boolean transpose, float[] value) { + uniformMatrix4fv(location, count, transpose, Marshal.marshal(allocator, value)); } - public static void uniformMatrix4fv(SegmentAllocator allocator, int location, boolean transpose, float[] value) { + @Skip + default void uniformMatrix4fv(SegmentAllocator allocator, int location, boolean transpose, float[] value) { uniformMatrix4fv(allocator, location, value.length >> 4, transpose, value); } - public static void useProgram(int program) { - var caps = getCapabilities(); - try { - check(caps.glUseProgram).invokeExact(program); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUseProgram") + default void useProgram(int program) { + throw new ContextException(); } - public static void validateProgram(int program) { - var caps = getCapabilities(); - try { - check(caps.glValidateProgram).invokeExact(program); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glValidateProgram") + default void validateProgram(int program) { + throw new ContextException(); } - public static void vertexAttrib1d(int index, double x) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib1d).invokeExact(index, x); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib1d") + default void vertexAttrib1d(int index, double x) { + throw new ContextException(); } - public static void vertexAttrib1dv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib1dv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib1dv") + default void vertexAttrib1dv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib1dv(SegmentAllocator allocator, int index, double[] v) { - vertexAttrib1dv(index, allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glVertexAttrib1dv") + default void vertexAttrib1dv(SegmentAllocator allocator, int index, double[] v) { + throw new ContextException(); } - public static void vertexAttrib1f(int index, float x) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib1f).invokeExact(index, x); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib1f") + default void vertexAttrib1f(int index, float x) { + throw new ContextException(); } - public static void vertexAttrib1fv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib1fv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib1fv") + default void vertexAttrib1fv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib1fv(SegmentAllocator allocator, int index, float[] v) { - vertexAttrib1fv(index, allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glVertexAttrib1fv") + default void vertexAttrib1fv(SegmentAllocator allocator, int index, float[] v) { + throw new ContextException(); } - public static void vertexAttrib1s(int index, short x) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib1s).invokeExact(index, x); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib1s") + default void vertexAttrib1s(int index, short x) { + throw new ContextException(); } - public static void vertexAttrib1sv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib1sv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib1sv") + default void vertexAttrib1sv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib1sv(SegmentAllocator allocator, int index, short[] v) { - vertexAttrib1sv(index, allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glVertexAttrib1sv") + default void vertexAttrib1sv(SegmentAllocator allocator, int index, short[] v) { + throw new ContextException(); } - public static void vertexAttrib2d(int index, double x, double y) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib2d).invokeExact(index, x, y); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib2d") + default void vertexAttrib2d(int index, double x, double y) { + throw new ContextException(); } - public static void vertexAttrib2dv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib2dv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib2dv") + default void vertexAttrib2dv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib2dv(SegmentAllocator allocator, int index, double[] v) { - vertexAttrib2dv(index, allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glVertexAttrib2dv") + default void vertexAttrib2dv(SegmentAllocator allocator, int index, double[] v) { + throw new ContextException(); } - public static void vertexAttrib2f(int index, float x, float y) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib2f).invokeExact(index, x, y); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib2f") + default void vertexAttrib2f(int index, float x, float y) { + throw new ContextException(); } - public static void vertexAttrib2fv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib2fv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib2fv") + default void vertexAttrib2fv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib2fv(SegmentAllocator allocator, int index, float[] v) { - vertexAttrib2fv(index, allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glVertexAttrib2fv") + default void vertexAttrib2fv(SegmentAllocator allocator, int index, float[] v) { + throw new ContextException(); } - public static void vertexAttrib2s(int index, short x, short y) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib2s).invokeExact(index, x, y); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib2s") + default void vertexAttrib2s(int index, short x, short y) { + throw new ContextException(); } - public static void vertexAttrib2sv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib2sv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib2sv") + default void vertexAttrib2sv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib2sv(SegmentAllocator allocator, int index, short[] v) { - vertexAttrib2sv(index, allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glVertexAttrib2sv") + default void vertexAttrib2sv(SegmentAllocator allocator, int index, short[] v) { + throw new ContextException(); } - public static void vertexAttrib3d(int index, double x, double y, double z) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib3d).invokeExact(index, x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib3d") + default void vertexAttrib3d(int index, double x, double y, double z) { + throw new ContextException(); } - public static void vertexAttrib3dv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib3dv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib3dv") + default void vertexAttrib3dv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib3dv(SegmentAllocator allocator, int index, double[] v) { - vertexAttrib3dv(index, allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glVertexAttrib3dv") + default void vertexAttrib3dv(SegmentAllocator allocator, int index, double[] v) { + throw new ContextException(); } - public static void vertexAttrib3f(int index, float x, float y, float z) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib3f).invokeExact(index, x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib3f") + default void vertexAttrib3f(int index, float x, float y, float z) { + throw new ContextException(); } - public static void vertexAttrib3fv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib3fv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib3fv") + default void vertexAttrib3fv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib3fv(SegmentAllocator allocator, int index, float[] v) { - vertexAttrib3fv(index, allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glVertexAttrib3fv") + default void vertexAttrib3fv(SegmentAllocator allocator, int index, float[] v) { + throw new ContextException(); } - public static void vertexAttrib3s(int index, short x, short y, short z) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib3s).invokeExact(index, x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib3s") + default void vertexAttrib3s(int index, short x, short y, short z) { + throw new ContextException(); } - public static void vertexAttrib3sv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib3sv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib3sv") + default void vertexAttrib3sv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib3sv(SegmentAllocator allocator, int index, short[] v) { - vertexAttrib3sv(index, allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glVertexAttrib3sv") + default void vertexAttrib3sv(SegmentAllocator allocator, int index, short[] v) { + throw new ContextException(); } - public static void vertexAttrib4Nbv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib4Nbv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib4Nbv") + default void vertexAttrib4Nbv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib4Nbv(SegmentAllocator allocator, int index, byte[] v) { - vertexAttrib4Nbv(index, allocator.allocateFrom(JAVA_BYTE, v)); + @Entrypoint("glVertexAttrib4Nbv") + default void vertexAttrib4Nbv(SegmentAllocator allocator, int index, byte[] v) { + throw new ContextException(); } - public static void vertexAttrib4Niv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib4Niv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib4Niv") + default void vertexAttrib4Niv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib4Niv(SegmentAllocator allocator, int index, int[] v) { - vertexAttrib4Niv(index, allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glVertexAttrib4Niv") + default void vertexAttrib4Niv(SegmentAllocator allocator, int index, int[] v) { + throw new ContextException(); } - public static void vertexAttrib4Nsv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib4Nsv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib4Nsv") + default void vertexAttrib4Nsv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib4Nsv(SegmentAllocator allocator, int index, short[] v) { - vertexAttrib4Nsv(index, allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glVertexAttrib4Nsv") + default void vertexAttrib4Nsv(SegmentAllocator allocator, int index, short[] v) { + throw new ContextException(); } - public static void vertexAttrib4Nub(int index, byte x, byte y, byte z, byte w) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib4Nub).invokeExact(index, x, y, z, w); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib4Nub") + default void vertexAttrib4Nub(int index, byte x, byte y, byte z, byte w) { + throw new ContextException(); } - public static void vertexAttrib4Nubv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib4Nubv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib4Nubv") + default void vertexAttrib4Nubv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib4Nubv(SegmentAllocator allocator, int index, byte[] v) { - vertexAttrib4Nubv(index, allocator.allocateFrom(JAVA_BYTE, v)); + @Entrypoint("glVertexAttrib4Nubv") + default void vertexAttrib4Nubv(SegmentAllocator allocator, int index, byte[] v) { + throw new ContextException(); } - public static void vertexAttrib4Nuiv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib4Nuiv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib4Nuiv") + default void vertexAttrib4Nuiv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib4Nuiv(SegmentAllocator allocator, int index, int[] v) { - vertexAttrib4Nuiv(index, allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glVertexAttrib4Nuiv") + default void vertexAttrib4Nuiv(SegmentAllocator allocator, int index, int[] v) { + throw new ContextException(); } - public static void vertexAttrib4Nusv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib4Nusv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib4Nusv") + default void vertexAttrib4Nusv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib4Nusv(SegmentAllocator allocator, int index, short[] v) { - vertexAttrib4Nusv(index, allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glVertexAttrib4Nusv") + default void vertexAttrib4Nusv(SegmentAllocator allocator, int index, short[] v) { + throw new ContextException(); } - public static void vertexAttrib4bv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib4bv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib4bv") + default void vertexAttrib4bv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib4bv(SegmentAllocator allocator, int index, byte[] v) { - vertexAttrib4bv(index, allocator.allocateFrom(JAVA_BYTE, v)); + @Entrypoint("glVertexAttrib4bv") + default void vertexAttrib4bv(SegmentAllocator allocator, int index, byte[] v) { + throw new ContextException(); } - public static void vertexAttrib4d(int index, double x, double y, double z, double w) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib4d).invokeExact(index, x, y, z, w); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib4d") + default void vertexAttrib4d(int index, double x, double y, double z, double w) { + throw new ContextException(); } - public static void vertexAttrib4dv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib4dv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib4dv") + default void vertexAttrib4dv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib4dv(SegmentAllocator allocator, int index, double[] v) { - vertexAttrib4dv(index, allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glVertexAttrib4dv") + default void vertexAttrib4dv(SegmentAllocator allocator, int index, double[] v) { + throw new ContextException(); } - public static void vertexAttrib4f(int index, float x, float y, float z, float w) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib4f).invokeExact(index, x, y, z, w); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib4f") + default void vertexAttrib4f(int index, float x, float y, float z, float w) { + throw new ContextException(); } - public static void vertexAttrib4fv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib4fv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib4fv") + default void vertexAttrib4fv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib4fv(SegmentAllocator allocator, int index, float[] v) { - vertexAttrib4fv(index, allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glVertexAttrib4fv") + default void vertexAttrib4fv(SegmentAllocator allocator, int index, float[] v) { + throw new ContextException(); } - public static void vertexAttrib4iv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib4iv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib4iv") + default void vertexAttrib4iv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib4iv(SegmentAllocator allocator, int index, int[] v) { - vertexAttrib4iv(index, allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glVertexAttrib4iv") + default void vertexAttrib4iv(SegmentAllocator allocator, int index, int[] v) { + throw new ContextException(); } - public static void vertexAttrib4s(int index, short x, short y, short z, short w) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib4s).invokeExact(index, x, y, z, w); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib4s") + default void vertexAttrib4s(int index, short x, short y, short z, short w) { + throw new ContextException(); } - public static void vertexAttrib4sv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib4sv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib4sv") + default void vertexAttrib4sv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib4sv(SegmentAllocator allocator, int index, short[] v) { - vertexAttrib4sv(index, allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glVertexAttrib4sv") + default void vertexAttrib4sv(SegmentAllocator allocator, int index, short[] v) { + throw new ContextException(); } - public static void vertexAttrib4ubv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib4ubv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib4ubv") + default void vertexAttrib4ubv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib4ubv(SegmentAllocator allocator, int index, byte[] v) { - vertexAttrib4ubv(index, allocator.allocateFrom(JAVA_BYTE, v)); + @Entrypoint("glVertexAttrib4ubv") + default void vertexAttrib4ubv(SegmentAllocator allocator, int index, byte[] v) { + throw new ContextException(); } - public static void vertexAttrib4uiv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib4uiv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib4uiv") + default void vertexAttrib4uiv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib4uiv(SegmentAllocator allocator, int index, int[] v) { - vertexAttrib4uiv(index, allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glVertexAttrib4uiv") + default void vertexAttrib4uiv(SegmentAllocator allocator, int index, int[] v) { + throw new ContextException(); } - public static void vertexAttrib4usv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttrib4usv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttrib4usv") + default void vertexAttrib4usv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttrib4usv(SegmentAllocator allocator, int index, short[] v) { - vertexAttrib4usv(index, allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glVertexAttrib4usv") + default void vertexAttrib4usv(SegmentAllocator allocator, int index, short[] v) { + throw new ContextException(); } - public static void vertexAttribPointer(int index, int size, int type, boolean normalized, int stride, MemorySegment pointer) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribPointer).invokeExact(index, size, type, normalized, stride, pointer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribPointer") + default void vertexAttribPointer(int index, int size, int type, boolean normalized, int stride, MemorySegment pointer) { + throw new ContextException(); } - public static void vertexAttribPointer(SegmentAllocator allocator, int index, int size, int type, boolean normalized, int stride, byte[] pointer) { - vertexAttribPointer(index, size, type, normalized, stride, allocator.allocateFrom(JAVA_BYTE, pointer)); + @Entrypoint("glVertexAttribPointer") + default void vertexAttribPointer(SegmentAllocator allocator, int index, int size, int type, boolean normalized, int stride, byte[] pointer) { + throw new ContextException(); } - public static void vertexAttribPointer(SegmentAllocator allocator, int index, int size, int type, boolean normalized, int stride, short[] pointer) { - vertexAttribPointer(index, size, type, normalized, stride, allocator.allocateFrom(JAVA_SHORT, pointer)); + @Entrypoint("glVertexAttribPointer") + default void vertexAttribPointer(SegmentAllocator allocator, int index, int size, int type, boolean normalized, int stride, short[] pointer) { + throw new ContextException(); } - public static void vertexAttribPointer(SegmentAllocator allocator, int index, int size, int type, boolean normalized, int stride, int[] pointer) { - vertexAttribPointer(index, size, type, normalized, stride, allocator.allocateFrom(JAVA_INT, pointer)); + @Entrypoint("glVertexAttribPointer") + default void vertexAttribPointer(SegmentAllocator allocator, int index, int size, int type, boolean normalized, int stride, int[] pointer) { + throw new ContextException(); } - public static void vertexAttribPointer(SegmentAllocator allocator, int index, int size, int type, boolean normalized, int stride, float[] pointer) { - vertexAttribPointer(index, size, type, normalized, stride, allocator.allocateFrom(JAVA_FLOAT, pointer)); + @Entrypoint("glVertexAttribPointer") + default void vertexAttribPointer(SegmentAllocator allocator, int index, int size, int type, boolean normalized, int stride, float[] pointer) { + throw new ContextException(); } - public static void vertexAttribPointer(SegmentAllocator allocator, int index, int size, int type, boolean normalized, int stride, double[] pointer) { - vertexAttribPointer(index, size, type, normalized, stride, allocator.allocateFrom(JAVA_DOUBLE, pointer)); + @Entrypoint("glVertexAttribPointer") + default void vertexAttribPointer(SegmentAllocator allocator, int index, int size, int type, boolean normalized, int stride, double[] pointer) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL21.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL21.java index 551425bd..563be0f6 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL21.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL21.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2023 Overrun Organization + * Copyright (c) 2023-2024 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 @@ -22,12 +22,12 @@ * @author squid233 * @since 0.1.0 */ -public final class GL21 extends GL21C { - public static final int CURRENT_RASTER_SECONDARY_COLOR = 0x845F; - public static final int SLUMINANCE_ALPHA = 0x8C44; - public static final int SLUMINANCE8_ALPHA8 = 0x8C45; - public static final int SLUMINANCE = 0x8C46; - public static final int SLUMINANCE8 = 0x8C47; - public static final int COMPRESSED_SLUMINANCE = 0x8C4A; - public static final int COMPRESSED_SLUMINANCE_ALPHA = 0x8C4B; +public sealed interface GL21 extends GL21C permits GLLegacy { + int CURRENT_RASTER_SECONDARY_COLOR = 0x845F; + int SLUMINANCE_ALPHA = 0x8C44; + int SLUMINANCE8_ALPHA8 = 0x8C45; + int SLUMINANCE = 0x8C46; + int SLUMINANCE8 = 0x8C47; + int COMPRESSED_SLUMINANCE = 0x8C4A; + int COMPRESSED_SLUMINANCE_ALPHA = 0x8C4B; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL21C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL21C.java index dcd436b4..f22c7f17 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL21C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL21C.java @@ -16,15 +16,13 @@ package overrungl.opengl; +import overrun.marshal.gen.Entrypoint; +import overrun.marshal.gen.Skip; import overrungl.opengl.ext.arb.GLARBPixelBufferObject; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; -import static java.lang.foreign.ValueLayout.JAVA_FLOAT; -import static overrungl.FunctionDescriptors.IIZPV; -import static overrungl.opengl.GLLoader.*; - /** * The OpenGL 2.1 forward compatible functions. *

@@ -36,136 +34,111 @@ * @author squid233 * @since 0.1.0 */ -public sealed class GL21C extends GL20C permits GL21, GL30C { - public static final int PIXEL_PACK_BUFFER = 0x88EB; - public static final int PIXEL_UNPACK_BUFFER = 0x88EC; - public static final int PIXEL_PACK_BUFFER_BINDING = 0x88ED; - public static final int PIXEL_UNPACK_BUFFER_BINDING = 0x88EF; - public static final int FLOAT_MAT2x3 = 0x8B65; - public static final int FLOAT_MAT2x4 = 0x8B66; - public static final int FLOAT_MAT3x2 = 0x8B67; - public static final int FLOAT_MAT3x4 = 0x8B68; - public static final int FLOAT_MAT4x2 = 0x8B69; - public static final int FLOAT_MAT4x3 = 0x8B6A; - public static final int SRGB = 0x8C40; - public static final int SRGB8 = 0x8C41; - public static final int SRGB_ALPHA = 0x8C42; - public static final int SRGB8_ALPHA8 = 0x8C43; - public static final int COMPRESSED_SRGB = 0x8C48; - public static final int COMPRESSED_SRGB_ALPHA = 0x8C49; - - static boolean isSupported(GLCapabilities caps) { - return checkAll(caps.glUniformMatrix2x3fv, caps.glUniformMatrix2x4fv, caps.glUniformMatrix3x2fv, caps.glUniformMatrix3x4fv, caps.glUniformMatrix4x2fv, caps.glUniformMatrix4x3fv); - } - - static void load(GLCapabilities caps, GLLoadFunc load) { - caps.glUniformMatrix2x3fv = load.invoke("glUniformMatrix2x3fv", IIZPV); - caps.glUniformMatrix2x4fv = load.invoke("glUniformMatrix2x4fv", IIZPV); - caps.glUniformMatrix3x2fv = load.invoke("glUniformMatrix3x2fv", IIZPV); - caps.glUniformMatrix3x4fv = load.invoke("glUniformMatrix3x4fv", IIZPV); - caps.glUniformMatrix4x2fv = load.invoke("glUniformMatrix4x2fv", IIZPV); - caps.glUniformMatrix4x3fv = load.invoke("glUniformMatrix4x3fv", IIZPV); - } - - public static void uniformMatrix2x3fv(int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniformMatrix2x3fv).invokeExact(location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void uniformMatrix2x3fv(SegmentAllocator allocator, int location, int count, boolean transpose, float[] value) { - uniformMatrix2x3fv(location, count, transpose, allocator.allocateFrom(JAVA_FLOAT, value)); - } - - public static void uniformMatrix2x3fv(SegmentAllocator allocator, int location, boolean transpose, float[] value) { +public sealed interface GL21C extends GL20C permits GL21, GL30C { + int PIXEL_PACK_BUFFER = 0x88EB; + int PIXEL_UNPACK_BUFFER = 0x88EC; + int PIXEL_PACK_BUFFER_BINDING = 0x88ED; + int PIXEL_UNPACK_BUFFER_BINDING = 0x88EF; + int FLOAT_MAT2x3 = 0x8B65; + int FLOAT_MAT2x4 = 0x8B66; + int FLOAT_MAT3x2 = 0x8B67; + int FLOAT_MAT3x4 = 0x8B68; + int FLOAT_MAT4x2 = 0x8B69; + int FLOAT_MAT4x3 = 0x8B6A; + int SRGB = 0x8C40; + int SRGB8 = 0x8C41; + int SRGB_ALPHA = 0x8C42; + int SRGB8_ALPHA8 = 0x8C43; + int COMPRESSED_SRGB = 0x8C48; + int COMPRESSED_SRGB_ALPHA = 0x8C49; + + @Entrypoint("glUniformMatrix2x3fv") + default void uniformMatrix2x3fv(int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); + } + + @Entrypoint("glUniformMatrix2x3fv") + default void uniformMatrix2x3fv(SegmentAllocator allocator, int location, int count, boolean transpose, float[] value) { + throw new ContextException(); + } + + @Skip + default void uniformMatrix2x3fv(SegmentAllocator allocator, int location, boolean transpose, float[] value) { uniformMatrix2x3fv(allocator, location, value.length / 6, transpose, value); } - public static void uniformMatrix2x4fv(int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniformMatrix2x4fv).invokeExact(location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniformMatrix2x4fv") + default void uniformMatrix2x4fv(int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void uniformMatrix2x4fv(SegmentAllocator allocator, int location, int count, boolean transpose, float[] value) { - uniformMatrix2x4fv(location, count, transpose, allocator.allocateFrom(JAVA_FLOAT, value)); + @Entrypoint("glUniformMatrix2x4fv") + default void uniformMatrix2x4fv(SegmentAllocator allocator, int location, int count, boolean transpose, float[] value) { + throw new ContextException(); } - public static void uniformMatrix2x4fv(SegmentAllocator allocator, int location, boolean transpose, float[] value) { + @Skip + default void uniformMatrix2x4fv(SegmentAllocator allocator, int location, boolean transpose, float[] value) { uniformMatrix2x4fv(allocator, location, value.length >> 3, transpose, value); } - public static void uniformMatrix3x2fv(int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniformMatrix3x2fv).invokeExact(location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniformMatrix3x2fv") + default void uniformMatrix3x2fv(int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void uniformMatrix3x2fv(SegmentAllocator allocator, int location, int count, boolean transpose, float[] value) { - uniformMatrix3x2fv(location, count, transpose, allocator.allocateFrom(JAVA_FLOAT, value)); + @Entrypoint("glUniformMatrix3x2fv") + default void uniformMatrix3x2fv(SegmentAllocator allocator, int location, int count, boolean transpose, float[] value) { + throw new ContextException(); } - public static void uniformMatrix3x2fv(SegmentAllocator allocator, int location, boolean transpose, float[] value) { + @Skip + default void uniformMatrix3x2fv(SegmentAllocator allocator, int location, boolean transpose, float[] value) { uniformMatrix3x2fv(allocator, location, value.length / 6, transpose, value); } - public static void uniformMatrix3x4fv(int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniformMatrix3x4fv).invokeExact(location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniformMatrix3x4fv") + default void uniformMatrix3x4fv(int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void uniformMatrix3x4fv(SegmentAllocator allocator, int location, int count, boolean transpose, float[] value) { - uniformMatrix3x4fv(location, count, transpose, allocator.allocateFrom(JAVA_FLOAT, value)); + @Entrypoint("glUniformMatrix3x4fv") + default void uniformMatrix3x4fv(SegmentAllocator allocator, int location, int count, boolean transpose, float[] value) { + throw new ContextException(); } - public static void uniformMatrix3x4fv(SegmentAllocator allocator, int location, boolean transpose, float[] value) { + @Skip + default void uniformMatrix3x4fv(SegmentAllocator allocator, int location, boolean transpose, float[] value) { uniformMatrix3x4fv(allocator, location, value.length / 12, transpose, value); } - public static void uniformMatrix4x2fv(int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniformMatrix4x2fv).invokeExact(location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniformMatrix4x2fv") + default void uniformMatrix4x2fv(int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void uniformMatrix4x2fv(SegmentAllocator allocator, int location, int count, boolean transpose, float[] value) { - uniformMatrix4x2fv(location, count, transpose, allocator.allocateFrom(JAVA_FLOAT, value)); + @Entrypoint("glUniformMatrix4x2fv") + default void uniformMatrix4x2fv(SegmentAllocator allocator, int location, int count, boolean transpose, float[] value) { + throw new ContextException(); } - public static void uniformMatrix4x2fv(SegmentAllocator allocator, int location, boolean transpose, float[] value) { + @Skip + default void uniformMatrix4x2fv(SegmentAllocator allocator, int location, boolean transpose, float[] value) { uniformMatrix4x2fv(allocator, location, value.length >> 3, transpose, value); } - public static void uniformMatrix4x3fv(int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniformMatrix4x3fv).invokeExact(location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniformMatrix4x3fv") + default void uniformMatrix4x3fv(int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void uniformMatrix4x3fv(SegmentAllocator allocator, int location, int count, boolean transpose, float[] value) { - uniformMatrix4x3fv(location, count, transpose, allocator.allocateFrom(JAVA_FLOAT, value)); + @Entrypoint("glUniformMatrix4x3fv") + default void uniformMatrix4x3fv(SegmentAllocator allocator, int location, int count, boolean transpose, float[] value) { + throw new ContextException(); } - public static void uniformMatrix4x3fv(SegmentAllocator allocator, int location, boolean transpose, float[] value) { + @Skip + default void uniformMatrix4x3fv(SegmentAllocator allocator, int location, boolean transpose, float[] value) { uniformMatrix4x3fv(allocator, location, value.length / 12, transpose, value); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL30.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL30.java index 36e666af..03f83bab 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL30.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL30.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2023 Overrun Organization + * Copyright (c) 2023-2024 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 @@ -22,8 +22,8 @@ * @author squid233 * @since 0.1.0 */ -public final class GL30 extends GL30C { - public static final int CLAMP_VERTEX_COLOR = 0x891A; - public static final int CLAMP_FRAGMENT_COLOR = 0x891B; - public static final int ALPHA_INTEGER = 0x8D97; +public sealed interface GL30 extends GL30C permits GLLegacy { + int CLAMP_VERTEX_COLOR = 0x891A; + int CLAMP_FRAGMENT_COLOR = 0x891B; + int ALPHA_INTEGER = 0x8D97; } 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 22afb3fe..04c22a36 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL30C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL30C.java @@ -17,17 +17,21 @@ package overrungl.opengl; import org.jetbrains.annotations.Nullable; +import overrun.marshal.Marshal; +import overrun.marshal.MemoryStack; +import overrun.marshal.Unmarshal; +import overrun.marshal.gen.Entrypoint; +import overrun.marshal.gen.Ref; +import overrun.marshal.gen.SizedSeg; +import overrun.marshal.gen.Skip; import overrungl.opengl.ext.arb.GLARBColorBufferFloat; import overrungl.opengl.ext.arb.GLARBTextureFloat; -import overrungl.internal.RuntimeHelper; -import overrungl.util.MemoryStack; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; +import java.lang.invoke.MethodHandle; import static java.lang.foreign.ValueLayout.*; -import static overrungl.FunctionDescriptors.*; -import static overrungl.opengl.GLLoader.*; /** * The OpenGL 3.0 core profile functions. @@ -44,1498 +48,1009 @@ * @author squid233 * @since 0.1.0 */ -public sealed class GL30C extends GL21C permits GL30, GL31C { - public static final int COMPARE_REF_TO_TEXTURE = 0x884E; - public static final int CLIP_DISTANCE0 = 0x3000; - public static final int CLIP_DISTANCE1 = 0x3001; - public static final int CLIP_DISTANCE2 = 0x3002; - public static final int CLIP_DISTANCE3 = 0x3003; - public static final int CLIP_DISTANCE4 = 0x3004; - public static final int CLIP_DISTANCE5 = 0x3005; - public static final int CLIP_DISTANCE6 = 0x3006; - public static final int CLIP_DISTANCE7 = 0x3007; - public static final int MAX_CLIP_DISTANCES = 0x0D32; - public static final int MAJOR_VERSION = 0x821B; - public static final int MINOR_VERSION = 0x821C; - public static final int NUM_EXTENSIONS = 0x821D; - public static final int CONTEXT_FLAGS = 0x821E; - public static final int COMPRESSED_RED = 0x8225; - public static final int COMPRESSED_RG = 0x8226; - public static final int CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 0x00000001; - public static final int RGBA32F = 0x8814; - public static final int RGB32F = 0x8815; - public static final int RGBA16F = 0x881A; - public static final int RGB16F = 0x881B; - public static final int VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD; - public static final int MAX_ARRAY_TEXTURE_LAYERS = 0x88FF; - public static final int MIN_PROGRAM_TEXEL_OFFSET = 0x8904; - public static final int MAX_PROGRAM_TEXEL_OFFSET = 0x8905; - public static final int CLAMP_READ_COLOR = 0x891C; - public static final int FIXED_ONLY = 0x891D; - public static final int MAX_VARYING_COMPONENTS = 0x8B4B; - public static final int TEXTURE_1D_ARRAY = 0x8C18; - public static final int PROXY_TEXTURE_1D_ARRAY = 0x8C19; - public static final int TEXTURE_2D_ARRAY = 0x8C1A; - public static final int PROXY_TEXTURE_2D_ARRAY = 0x8C1B; - public static final int TEXTURE_BINDING_1D_ARRAY = 0x8C1C; - public static final int TEXTURE_BINDING_2D_ARRAY = 0x8C1D; - public static final int R11F_G11F_B10F = 0x8C3A; - public static final int UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B; - public static final int RGB9_E5 = 0x8C3D; - public static final int UNSIGNED_INT_5_9_9_9_REV = 0x8C3E; - public static final int TEXTURE_SHARED_SIZE = 0x8C3F; - public static final int TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76; - public static final int TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F; - public static final int MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80; - public static final int TRANSFORM_FEEDBACK_VARYINGS = 0x8C83; - public static final int TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84; - public static final int TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85; - public static final int PRIMITIVES_GENERATED = 0x8C87; - public static final int TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88; - public static final int RASTERIZER_DISCARD = 0x8C89; - public static final int MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A; - public static final int MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B; - public static final int INTERLEAVED_ATTRIBS = 0x8C8C; - public static final int SEPARATE_ATTRIBS = 0x8C8D; - public static final int TRANSFORM_FEEDBACK_BUFFER = 0x8C8E; - public static final int TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F; - public static final int RGBA32UI = 0x8D70; - public static final int RGB32UI = 0x8D71; - public static final int RGBA16UI = 0x8D76; - public static final int RGB16UI = 0x8D77; - public static final int RGBA8UI = 0x8D7C; - public static final int RGB8UI = 0x8D7D; - public static final int RGBA32I = 0x8D82; - public static final int RGB32I = 0x8D83; - public static final int RGBA16I = 0x8D88; - public static final int RGB16I = 0x8D89; - public static final int RGBA8I = 0x8D8E; - public static final int RGB8I = 0x8D8F; - public static final int RED_INTEGER = 0x8D94; - public static final int GREEN_INTEGER = 0x8D95; - public static final int BLUE_INTEGER = 0x8D96; - public static final int RGB_INTEGER = 0x8D98; - public static final int RGBA_INTEGER = 0x8D99; - public static final int BGR_INTEGER = 0x8D9A; - public static final int BGRA_INTEGER = 0x8D9B; - public static final int SAMPLER_1D_ARRAY = 0x8DC0; - public static final int SAMPLER_2D_ARRAY = 0x8DC1; - public static final int SAMPLER_1D_ARRAY_SHADOW = 0x8DC3; - public static final int SAMPLER_2D_ARRAY_SHADOW = 0x8DC4; - public static final int SAMPLER_CUBE_SHADOW = 0x8DC5; - public static final int UNSIGNED_INT_VEC2 = 0x8DC6; - public static final int UNSIGNED_INT_VEC3 = 0x8DC7; - public static final int UNSIGNED_INT_VEC4 = 0x8DC8; - public static final int INT_SAMPLER_1D = 0x8DC9; - public static final int INT_SAMPLER_2D = 0x8DCA; - public static final int INT_SAMPLER_3D = 0x8DCB; - public static final int INT_SAMPLER_CUBE = 0x8DCC; - public static final int INT_SAMPLER_1D_ARRAY = 0x8DCE; - public static final int INT_SAMPLER_2D_ARRAY = 0x8DCF; - public static final int UNSIGNED_INT_SAMPLER_1D = 0x8DD1; - public static final int UNSIGNED_INT_SAMPLER_2D = 0x8DD2; - public static final int UNSIGNED_INT_SAMPLER_3D = 0x8DD3; - public static final int UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4; - public static final int UNSIGNED_INT_SAMPLER_1D_ARRAY = 0x8DD6; - public static final int UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7; - public static final int QUERY_WAIT = 0x8E13; - public static final int QUERY_NO_WAIT = 0x8E14; - public static final int QUERY_BY_REGION_WAIT = 0x8E15; - public static final int QUERY_BY_REGION_NO_WAIT = 0x8E16; - public static final int BUFFER_ACCESS_FLAGS = 0x911F; - public static final int BUFFER_MAP_LENGTH = 0x9120; - public static final int BUFFER_MAP_OFFSET = 0x9121; - public static final int DEPTH_COMPONENT32F = 0x8CAC; - public static final int DEPTH32F_STENCIL8 = 0x8CAD; - public static final int FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD; - public static final int INVALID_FRAMEBUFFER_OPERATION = 0x0506; - public static final int FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210; - public static final int FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211; - public static final int FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212; - public static final int FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213; - public static final int FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214; - public static final int FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215; - public static final int FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216; - public static final int FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217; - public static final int FRAMEBUFFER_DEFAULT = 0x8218; - public static final int FRAMEBUFFER_UNDEFINED = 0x8219; - public static final int DEPTH_STENCIL_ATTACHMENT = 0x821A; - public static final int MAX_RENDERBUFFER_SIZE = 0x84E8; - public static final int DEPTH_STENCIL = 0x84F9; - public static final int UNSIGNED_INT_24_8 = 0x84FA; - public static final int DEPTH24_STENCIL8 = 0x88F0; - public static final int TEXTURE_STENCIL_SIZE = 0x88F1; - public static final int TEXTURE_RED_TYPE = 0x8C10; - public static final int TEXTURE_GREEN_TYPE = 0x8C11; - public static final int TEXTURE_BLUE_TYPE = 0x8C12; - public static final int TEXTURE_ALPHA_TYPE = 0x8C13; - public static final int TEXTURE_DEPTH_TYPE = 0x8C16; - public static final int UNSIGNED_NORMALIZED = 0x8C17; - public static final int FRAMEBUFFER_BINDING = 0x8CA6; - public static final int DRAW_FRAMEBUFFER_BINDING = 0x8CA6; - public static final int RENDERBUFFER_BINDING = 0x8CA7; - public static final int READ_FRAMEBUFFER = 0x8CA8; - public static final int DRAW_FRAMEBUFFER = 0x8CA9; - public static final int READ_FRAMEBUFFER_BINDING = 0x8CAA; - public static final int RENDERBUFFER_SAMPLES = 0x8CAB; - public static final int FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0; - public static final int FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1; - public static final int FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2; - public static final int FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3; - public static final int FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4; - public static final int FRAMEBUFFER_COMPLETE = 0x8CD5; - public static final int FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6; - public static final int FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7; - public static final int FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB; - public static final int FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC; - public static final int FRAMEBUFFER_UNSUPPORTED = 0x8CDD; - public static final int MAX_COLOR_ATTACHMENTS = 0x8CDF; - public static final int COLOR_ATTACHMENT0 = 0x8CE0; - public static final int COLOR_ATTACHMENT1 = 0x8CE1; - public static final int COLOR_ATTACHMENT2 = 0x8CE2; - public static final int COLOR_ATTACHMENT3 = 0x8CE3; - public static final int COLOR_ATTACHMENT4 = 0x8CE4; - public static final int COLOR_ATTACHMENT5 = 0x8CE5; - public static final int COLOR_ATTACHMENT6 = 0x8CE6; - public static final int COLOR_ATTACHMENT7 = 0x8CE7; - public static final int COLOR_ATTACHMENT8 = 0x8CE8; - public static final int COLOR_ATTACHMENT9 = 0x8CE9; - public static final int COLOR_ATTACHMENT10 = 0x8CEA; - public static final int COLOR_ATTACHMENT11 = 0x8CEB; - public static final int COLOR_ATTACHMENT12 = 0x8CEC; - public static final int COLOR_ATTACHMENT13 = 0x8CED; - public static final int COLOR_ATTACHMENT14 = 0x8CEE; - public static final int COLOR_ATTACHMENT15 = 0x8CEF; - public static final int COLOR_ATTACHMENT16 = 0x8CF0; - public static final int COLOR_ATTACHMENT17 = 0x8CF1; - public static final int COLOR_ATTACHMENT18 = 0x8CF2; - public static final int COLOR_ATTACHMENT19 = 0x8CF3; - public static final int COLOR_ATTACHMENT20 = 0x8CF4; - public static final int COLOR_ATTACHMENT21 = 0x8CF5; - public static final int COLOR_ATTACHMENT22 = 0x8CF6; - public static final int COLOR_ATTACHMENT23 = 0x8CF7; - public static final int COLOR_ATTACHMENT24 = 0x8CF8; - public static final int COLOR_ATTACHMENT25 = 0x8CF9; - public static final int COLOR_ATTACHMENT26 = 0x8CFA; - public static final int COLOR_ATTACHMENT27 = 0x8CFB; - public static final int COLOR_ATTACHMENT28 = 0x8CFC; - public static final int COLOR_ATTACHMENT29 = 0x8CFD; - public static final int COLOR_ATTACHMENT30 = 0x8CFE; - public static final int COLOR_ATTACHMENT31 = 0x8CFF; - public static final int DEPTH_ATTACHMENT = 0x8D00; - public static final int STENCIL_ATTACHMENT = 0x8D20; - public static final int FRAMEBUFFER = 0x8D40; - public static final int RENDERBUFFER = 0x8D41; - public static final int RENDERBUFFER_WIDTH = 0x8D42; - public static final int RENDERBUFFER_HEIGHT = 0x8D43; - public static final int RENDERBUFFER_INTERNAL_FORMAT = 0x8D44; - public static final int STENCIL_INDEX1 = 0x8D46; - public static final int STENCIL_INDEX4 = 0x8D47; - public static final int STENCIL_INDEX8 = 0x8D48; - public static final int STENCIL_INDEX16 = 0x8D49; - public static final int RENDERBUFFER_RED_SIZE = 0x8D50; - public static final int RENDERBUFFER_GREEN_SIZE = 0x8D51; - public static final int RENDERBUFFER_BLUE_SIZE = 0x8D52; - public static final int RENDERBUFFER_ALPHA_SIZE = 0x8D53; - public static final int RENDERBUFFER_DEPTH_SIZE = 0x8D54; - public static final int RENDERBUFFER_STENCIL_SIZE = 0x8D55; - public static final int FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56; - public static final int MAX_SAMPLES = 0x8D57; - public static final int FRAMEBUFFER_SRGB = 0x8DB9; - public static final int HALF_FLOAT = 0x140B; - public static final int MAP_READ_BIT = 0x0001; - public static final int MAP_WRITE_BIT = 0x0002; - public static final int MAP_INVALIDATE_RANGE_BIT = 0x0004; - public static final int MAP_INVALIDATE_BUFFER_BIT = 0x0008; - public static final int MAP_FLUSH_EXPLICIT_BIT = 0x0010; - public static final int MAP_UNSYNCHRONIZED_BIT = 0x0020; - public static final int COMPRESSED_RED_RGTC1 = 0x8DBB; - public static final int COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC; - public static final int COMPRESSED_RG_RGTC2 = 0x8DBD; - public static final int COMPRESSED_SIGNED_RG_RGTC2 = 0x8DBE; - public static final int RG = 0x8227; - public static final int RG_INTEGER = 0x8228; - public static final int R8 = 0x8229; - public static final int R16 = 0x822A; - public static final int RG8 = 0x822B; - public static final int RG16 = 0x822C; - public static final int R16F = 0x822D; - public static final int R32F = 0x822E; - public static final int RG16F = 0x822F; - public static final int RG32F = 0x8230; - public static final int R8I = 0x8231; - public static final int R8UI = 0x8232; - public static final int R16I = 0x8233; - public static final int R16UI = 0x8234; - public static final int R32I = 0x8235; - public static final int R32UI = 0x8236; - public static final int RG8I = 0x8237; - public static final int RG8UI = 0x8238; - public static final int RG16I = 0x8239; - public static final int RG16UI = 0x823A; - public static final int RG32I = 0x823B; - public static final int RG32UI = 0x823C; - public static final int VERTEX_ARRAY_BINDING = 0x85B5; - - static boolean isSupported(GLCapabilities caps) { - return checkAll(caps.glBeginConditionalRender, caps.glBeginTransformFeedback, caps.glBindBufferBase, caps.glBindBufferRange, caps.glBindFragDataLocation, caps.glBindFramebuffer, - caps.glBindRenderbuffer, caps.glBindVertexArray, caps.glBlitFramebuffer, caps.glCheckFramebufferStatus, caps.glClampColor, caps.glClearBufferfi, - caps.glClearBufferfv, caps.glClearBufferiv, caps.glClearBufferuiv, caps.glColorMaski, caps.glDeleteFramebuffers, caps.glDeleteRenderbuffers, - caps.glDeleteVertexArrays, caps.glDisablei, caps.glEnablei, caps.glEndConditionalRender, caps.glEndTransformFeedback, caps.glFlushMappedBufferRange, - caps.glFramebufferRenderbuffer, caps.glFramebufferTexture1D, caps.glFramebufferTexture2D, caps.glFramebufferTexture3D, caps.glFramebufferTextureLayer, caps.glGenFramebuffers, - caps.glGenRenderbuffers, caps.glGenVertexArrays, caps.glGenerateMipmap, caps.glGetBooleani_v, caps.glGetFragDataLocation, caps.glGetFramebufferAttachmentParameteriv, - caps.glGetIntegeri_v, caps.glGetRenderbufferParameteriv, caps.glGetStringi, caps.glGetTexParameterIiv, caps.glGetTexParameterIuiv, caps.glGetTransformFeedbackVarying, - caps.glGetUniformuiv, caps.glGetVertexAttribIiv, caps.glGetVertexAttribIuiv, caps.glIsEnabledi, caps.glIsFramebuffer, caps.glIsRenderbuffer, - caps.glIsVertexArray, caps.glMapBufferRange, caps.glRenderbufferStorage, caps.glRenderbufferStorageMultisample, caps.glTexParameterIiv, caps.glTexParameterIuiv, - caps.glTransformFeedbackVaryings, caps.glUniform1ui, caps.glUniform1uiv, caps.glUniform2ui, caps.glUniform2uiv, caps.glUniform3ui, - caps.glUniform3uiv, caps.glUniform4ui, caps.glUniform4uiv, caps.glVertexAttribI1i, caps.glVertexAttribI1iv, caps.glVertexAttribI1ui, - caps.glVertexAttribI1uiv, caps.glVertexAttribI2i, caps.glVertexAttribI2iv, caps.glVertexAttribI2ui, caps.glVertexAttribI2uiv, caps.glVertexAttribI3i, - caps.glVertexAttribI3iv, caps.glVertexAttribI3ui, caps.glVertexAttribI3uiv, caps.glVertexAttribI4bv, caps.glVertexAttribI4i, caps.glVertexAttribI4iv, - caps.glVertexAttribI4sv, caps.glVertexAttribI4ubv, caps.glVertexAttribI4ui, caps.glVertexAttribI4uiv, caps.glVertexAttribI4usv, caps.glVertexAttribIPointer); - } - - static void load(GLCapabilities caps, GLLoadFunc load) { - caps.glBeginConditionalRender = load.invoke("glBeginConditionalRender", IIV); - caps.glBeginTransformFeedback = load.invoke("glBeginTransformFeedback", IV); - caps.glBindBufferBase = load.invoke("glBindBufferBase", IIIV); - caps.glBindBufferRange = load.invoke("glBindBufferRange", IIIJJV); - caps.glBindFragDataLocation = load.invoke("glBindFragDataLocation", IIPV); - caps.glBindFramebuffer = load.invoke("glBindFramebuffer", IIV); - caps.glBindRenderbuffer = load.invoke("glBindRenderbuffer", IIV); - caps.glBindVertexArray = load.invoke("glBindVertexArray", IV); - caps.glBlitFramebuffer = load.invoke("glBlitFramebuffer", IIIIIIIIIIV); - caps.glCheckFramebufferStatus = load.invoke("glCheckFramebufferStatus", II); - 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.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); - caps.glFramebufferRenderbuffer = load.invoke("glFramebufferRenderbuffer", IIIIV); - caps.glFramebufferTexture1D = load.invoke("glFramebufferTexture1D", IIIIIV); - caps.glFramebufferTexture2D = load.invoke("glFramebufferTexture2D", IIIIIV); - caps.glFramebufferTexture3D = load.invoke("glFramebufferTexture3D", IIIIIIV); - caps.glFramebufferTextureLayer = load.invoke("glFramebufferTextureLayer", IIIIIV); - 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.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.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); - caps.glUniform2ui = load.invoke("glUniform2ui", IIIV); - caps.glUniform2uiv = load.invoke("glUniform2uiv", IIPV); - caps.glUniform3ui = load.invoke("glUniform3ui", IIIIV); - caps.glUniform3uiv = load.invoke("glUniform3uiv", IIPV); - caps.glUniform4ui = load.invoke("glUniform4ui", IIIIIV); - caps.glUniform4uiv = load.invoke("glUniform4uiv", IIPV); - caps.glVertexAttribI1i = load.invoke("glVertexAttribI1i", IIV); - caps.glVertexAttribI1iv = load.invoke("glVertexAttribI1iv", IPV); - caps.glVertexAttribI1ui = load.invoke("glVertexAttribI1ui", IIV); - caps.glVertexAttribI1uiv = load.invoke("glVertexAttribI1uiv", IPV); - caps.glVertexAttribI2i = load.invoke("glVertexAttribI2i", IIIV); - caps.glVertexAttribI2iv = load.invoke("glVertexAttribI2iv", IPV); - caps.glVertexAttribI2ui = load.invoke("glVertexAttribI2ui", IIIV); - caps.glVertexAttribI2uiv = load.invoke("glVertexAttribI2uiv", IPV); - caps.glVertexAttribI3i = load.invoke("glVertexAttribI3i", IIIIV); - caps.glVertexAttribI3iv = load.invoke("glVertexAttribI3iv", IPV); - caps.glVertexAttribI3ui = load.invoke("glVertexAttribI3ui", IIIIV); - caps.glVertexAttribI3uiv = load.invoke("glVertexAttribI3uiv", IPV); - caps.glVertexAttribI4bv = load.invoke("glVertexAttribI4bv", IPV); - caps.glVertexAttribI4i = load.invoke("glVertexAttribI4i", IIIIIV); - caps.glVertexAttribI4iv = load.invoke("glVertexAttribI4iv", IPV); - caps.glVertexAttribI4sv = load.invoke("glVertexAttribI4sv", IPV); - caps.glVertexAttribI4ubv = load.invoke("glVertexAttribI4ubv", IPV); - caps.glVertexAttribI4ui = load.invoke("glVertexAttribI4ui", IIIIIV); - caps.glVertexAttribI4uiv = load.invoke("glVertexAttribI4uiv", IPV); - caps.glVertexAttribI4usv = load.invoke("glVertexAttribI4usv", IPV); - caps.glVertexAttribIPointer = load.invoke("glVertexAttribIPointer", IIIIPV); - } - - public static void beginConditionalRender(int id, int mode) { - var caps = getCapabilities(); - try { - check(caps.glBeginConditionalRender).invokeExact(id, mode); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } +public sealed interface GL30C extends GL21C permits GL30, GL31C { + int COMPARE_REF_TO_TEXTURE = 0x884E; + int CLIP_DISTANCE0 = 0x3000; + int CLIP_DISTANCE1 = 0x3001; + int CLIP_DISTANCE2 = 0x3002; + int CLIP_DISTANCE3 = 0x3003; + int CLIP_DISTANCE4 = 0x3004; + int CLIP_DISTANCE5 = 0x3005; + int CLIP_DISTANCE6 = 0x3006; + int CLIP_DISTANCE7 = 0x3007; + int MAX_CLIP_DISTANCES = 0x0D32; + int MAJOR_VERSION = 0x821B; + int MINOR_VERSION = 0x821C; + int NUM_EXTENSIONS = 0x821D; + int CONTEXT_FLAGS = 0x821E; + int COMPRESSED_RED = 0x8225; + int COMPRESSED_RG = 0x8226; + int CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 0x00000001; + int RGBA32F = 0x8814; + int RGB32F = 0x8815; + int RGBA16F = 0x881A; + int RGB16F = 0x881B; + int VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD; + int MAX_ARRAY_TEXTURE_LAYERS = 0x88FF; + int MIN_PROGRAM_TEXEL_OFFSET = 0x8904; + int MAX_PROGRAM_TEXEL_OFFSET = 0x8905; + int CLAMP_READ_COLOR = 0x891C; + int FIXED_ONLY = 0x891D; + int MAX_VARYING_COMPONENTS = 0x8B4B; + int TEXTURE_1D_ARRAY = 0x8C18; + int PROXY_TEXTURE_1D_ARRAY = 0x8C19; + int TEXTURE_2D_ARRAY = 0x8C1A; + int PROXY_TEXTURE_2D_ARRAY = 0x8C1B; + int TEXTURE_BINDING_1D_ARRAY = 0x8C1C; + int TEXTURE_BINDING_2D_ARRAY = 0x8C1D; + int R11F_G11F_B10F = 0x8C3A; + int UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B; + int RGB9_E5 = 0x8C3D; + int UNSIGNED_INT_5_9_9_9_REV = 0x8C3E; + int TEXTURE_SHARED_SIZE = 0x8C3F; + int TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76; + int TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F; + int MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80; + int TRANSFORM_FEEDBACK_VARYINGS = 0x8C83; + int TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84; + int TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85; + int PRIMITIVES_GENERATED = 0x8C87; + int TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88; + int RASTERIZER_DISCARD = 0x8C89; + int MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A; + int MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B; + int INTERLEAVED_ATTRIBS = 0x8C8C; + int SEPARATE_ATTRIBS = 0x8C8D; + int TRANSFORM_FEEDBACK_BUFFER = 0x8C8E; + int TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F; + int RGBA32UI = 0x8D70; + int RGB32UI = 0x8D71; + int RGBA16UI = 0x8D76; + int RGB16UI = 0x8D77; + int RGBA8UI = 0x8D7C; + int RGB8UI = 0x8D7D; + int RGBA32I = 0x8D82; + int RGB32I = 0x8D83; + int RGBA16I = 0x8D88; + int RGB16I = 0x8D89; + int RGBA8I = 0x8D8E; + int RGB8I = 0x8D8F; + int RED_INTEGER = 0x8D94; + int GREEN_INTEGER = 0x8D95; + int BLUE_INTEGER = 0x8D96; + int RGB_INTEGER = 0x8D98; + int RGBA_INTEGER = 0x8D99; + int BGR_INTEGER = 0x8D9A; + int BGRA_INTEGER = 0x8D9B; + int SAMPLER_1D_ARRAY = 0x8DC0; + int SAMPLER_2D_ARRAY = 0x8DC1; + int SAMPLER_1D_ARRAY_SHADOW = 0x8DC3; + int SAMPLER_2D_ARRAY_SHADOW = 0x8DC4; + int SAMPLER_CUBE_SHADOW = 0x8DC5; + int UNSIGNED_INT_VEC2 = 0x8DC6; + int UNSIGNED_INT_VEC3 = 0x8DC7; + int UNSIGNED_INT_VEC4 = 0x8DC8; + int INT_SAMPLER_1D = 0x8DC9; + int INT_SAMPLER_2D = 0x8DCA; + int INT_SAMPLER_3D = 0x8DCB; + int INT_SAMPLER_CUBE = 0x8DCC; + int INT_SAMPLER_1D_ARRAY = 0x8DCE; + int INT_SAMPLER_2D_ARRAY = 0x8DCF; + int UNSIGNED_INT_SAMPLER_1D = 0x8DD1; + int UNSIGNED_INT_SAMPLER_2D = 0x8DD2; + int UNSIGNED_INT_SAMPLER_3D = 0x8DD3; + int UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4; + int UNSIGNED_INT_SAMPLER_1D_ARRAY = 0x8DD6; + int UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7; + int QUERY_WAIT = 0x8E13; + int QUERY_NO_WAIT = 0x8E14; + int QUERY_BY_REGION_WAIT = 0x8E15; + int QUERY_BY_REGION_NO_WAIT = 0x8E16; + int BUFFER_ACCESS_FLAGS = 0x911F; + int BUFFER_MAP_LENGTH = 0x9120; + int BUFFER_MAP_OFFSET = 0x9121; + int DEPTH_COMPONENT32F = 0x8CAC; + int DEPTH32F_STENCIL8 = 0x8CAD; + int FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD; + int INVALID_FRAMEBUFFER_OPERATION = 0x0506; + int FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210; + int FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211; + int FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212; + int FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213; + int FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214; + int FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215; + int FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216; + int FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217; + int FRAMEBUFFER_DEFAULT = 0x8218; + int FRAMEBUFFER_UNDEFINED = 0x8219; + int DEPTH_STENCIL_ATTACHMENT = 0x821A; + int MAX_RENDERBUFFER_SIZE = 0x84E8; + int DEPTH_STENCIL = 0x84F9; + int UNSIGNED_INT_24_8 = 0x84FA; + int DEPTH24_STENCIL8 = 0x88F0; + int TEXTURE_STENCIL_SIZE = 0x88F1; + int TEXTURE_RED_TYPE = 0x8C10; + int TEXTURE_GREEN_TYPE = 0x8C11; + int TEXTURE_BLUE_TYPE = 0x8C12; + int TEXTURE_ALPHA_TYPE = 0x8C13; + int TEXTURE_DEPTH_TYPE = 0x8C16; + int UNSIGNED_NORMALIZED = 0x8C17; + int FRAMEBUFFER_BINDING = 0x8CA6; + int DRAW_FRAMEBUFFER_BINDING = 0x8CA6; + int RENDERBUFFER_BINDING = 0x8CA7; + int READ_FRAMEBUFFER = 0x8CA8; + int DRAW_FRAMEBUFFER = 0x8CA9; + int READ_FRAMEBUFFER_BINDING = 0x8CAA; + int RENDERBUFFER_SAMPLES = 0x8CAB; + int FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0; + int FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1; + int FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2; + int FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3; + int FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4; + int FRAMEBUFFER_COMPLETE = 0x8CD5; + int FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6; + int FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7; + int FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB; + int FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC; + int FRAMEBUFFER_UNSUPPORTED = 0x8CDD; + int MAX_COLOR_ATTACHMENTS = 0x8CDF; + int COLOR_ATTACHMENT0 = 0x8CE0; + int COLOR_ATTACHMENT1 = 0x8CE1; + int COLOR_ATTACHMENT2 = 0x8CE2; + int COLOR_ATTACHMENT3 = 0x8CE3; + int COLOR_ATTACHMENT4 = 0x8CE4; + int COLOR_ATTACHMENT5 = 0x8CE5; + int COLOR_ATTACHMENT6 = 0x8CE6; + int COLOR_ATTACHMENT7 = 0x8CE7; + int COLOR_ATTACHMENT8 = 0x8CE8; + int COLOR_ATTACHMENT9 = 0x8CE9; + int COLOR_ATTACHMENT10 = 0x8CEA; + int COLOR_ATTACHMENT11 = 0x8CEB; + int COLOR_ATTACHMENT12 = 0x8CEC; + int COLOR_ATTACHMENT13 = 0x8CED; + int COLOR_ATTACHMENT14 = 0x8CEE; + int COLOR_ATTACHMENT15 = 0x8CEF; + int COLOR_ATTACHMENT16 = 0x8CF0; + int COLOR_ATTACHMENT17 = 0x8CF1; + int COLOR_ATTACHMENT18 = 0x8CF2; + int COLOR_ATTACHMENT19 = 0x8CF3; + int COLOR_ATTACHMENT20 = 0x8CF4; + int COLOR_ATTACHMENT21 = 0x8CF5; + int COLOR_ATTACHMENT22 = 0x8CF6; + int COLOR_ATTACHMENT23 = 0x8CF7; + int COLOR_ATTACHMENT24 = 0x8CF8; + int COLOR_ATTACHMENT25 = 0x8CF9; + int COLOR_ATTACHMENT26 = 0x8CFA; + int COLOR_ATTACHMENT27 = 0x8CFB; + int COLOR_ATTACHMENT28 = 0x8CFC; + int COLOR_ATTACHMENT29 = 0x8CFD; + int COLOR_ATTACHMENT30 = 0x8CFE; + int COLOR_ATTACHMENT31 = 0x8CFF; + int DEPTH_ATTACHMENT = 0x8D00; + int STENCIL_ATTACHMENT = 0x8D20; + int FRAMEBUFFER = 0x8D40; + int RENDERBUFFER = 0x8D41; + int RENDERBUFFER_WIDTH = 0x8D42; + int RENDERBUFFER_HEIGHT = 0x8D43; + int RENDERBUFFER_INTERNAL_FORMAT = 0x8D44; + int STENCIL_INDEX1 = 0x8D46; + int STENCIL_INDEX4 = 0x8D47; + int STENCIL_INDEX8 = 0x8D48; + int STENCIL_INDEX16 = 0x8D49; + int RENDERBUFFER_RED_SIZE = 0x8D50; + int RENDERBUFFER_GREEN_SIZE = 0x8D51; + int RENDERBUFFER_BLUE_SIZE = 0x8D52; + int RENDERBUFFER_ALPHA_SIZE = 0x8D53; + int RENDERBUFFER_DEPTH_SIZE = 0x8D54; + int RENDERBUFFER_STENCIL_SIZE = 0x8D55; + int FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56; + int MAX_SAMPLES = 0x8D57; + int FRAMEBUFFER_SRGB = 0x8DB9; + int HALF_FLOAT = 0x140B; + int MAP_READ_BIT = 0x0001; + int MAP_WRITE_BIT = 0x0002; + int MAP_INVALIDATE_RANGE_BIT = 0x0004; + int MAP_INVALIDATE_BUFFER_BIT = 0x0008; + int MAP_FLUSH_EXPLICIT_BIT = 0x0010; + int MAP_UNSYNCHRONIZED_BIT = 0x0020; + int COMPRESSED_RED_RGTC1 = 0x8DBB; + int COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC; + int COMPRESSED_RG_RGTC2 = 0x8DBD; + int COMPRESSED_SIGNED_RG_RGTC2 = 0x8DBE; + int RG = 0x8227; + int RG_INTEGER = 0x8228; + int R8 = 0x8229; + int R16 = 0x822A; + int RG8 = 0x822B; + int RG16 = 0x822C; + int R16F = 0x822D; + int R32F = 0x822E; + int RG16F = 0x822F; + int RG32F = 0x8230; + int R8I = 0x8231; + int R8UI = 0x8232; + int R16I = 0x8233; + int R16UI = 0x8234; + int R32I = 0x8235; + int R32UI = 0x8236; + int RG8I = 0x8237; + int RG8UI = 0x8238; + int RG16I = 0x8239; + int RG16UI = 0x823A; + int RG32I = 0x823B; + int RG32UI = 0x823C; + int VERTEX_ARRAY_BINDING = 0x85B5; + + @Entrypoint("glBeginConditionalRender") + default void beginConditionalRender(int id, int mode) { + throw new ContextException(); + } + + @Entrypoint("glBeginTransformFeedback") + default void beginTransformFeedback(int primitiveMode) { + throw new ContextException(); + } + + @Entrypoint("glBindBufferBase") + default void bindBufferBase(int target, int index, int buffer) { + throw new ContextException(); + } + + @Entrypoint("glBindBufferRange") + default void bindBufferRange(int target, int index, int buffer, long offset, long size) { + throw new ContextException(); + } + + @Entrypoint("glBindFragDataLocation") + default void bindFragDataLocation(int program, int color, MemorySegment name) { + throw new ContextException(); } - public static void beginTransformFeedback(int primitiveMode) { - var caps = getCapabilities(); - try { - check(caps.glBeginTransformFeedback).invokeExact(primitiveMode); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glBindFragDataLocation") + default void bindFragDataLocation(int program, int color, String name) { + throw new ContextException(); } - public static void bindBufferBase(int target, int index, int buffer) { - var caps = getCapabilities(); - try { - check(caps.glBindBufferBase).invokeExact(target, index, buffer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glBindFramebuffer") + default void bindFramebuffer(int target, int framebuffer) { + throw new ContextException(); } - public static void bindBufferRange(int target, int index, int buffer, long offset, long size) { - var caps = getCapabilities(); - try { - check(caps.glBindBufferRange).invokeExact(target, index, buffer, offset, size); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glBindRenderbuffer") + default void bindRenderbuffer(int target, int renderbuffer) { + throw new ContextException(); } - public static void bindFragDataLocation(int program, int color, MemorySegment name) { - var caps = getCapabilities(); - try { - check(caps.glBindFragDataLocation).invokeExact(program, color, name); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glBindVertexArray") + default void bindVertexArray(int array) { + throw new ContextException(); } - public static void bindFragDataLocation(int program, int color, String name) { - final MemoryStack stack = MemoryStack.stackGet(); - final long stackPointer = stack.getPointer(); - try { - bindFragDataLocation(program, color, stack.allocateFrom(name)); - } finally { - stack.setPointer(stackPointer); - } + @Entrypoint("glBlitFramebuffer") + default void blitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, int mask, int filter) { + throw new ContextException(); } - public static void bindFramebuffer(int target, int framebuffer) { - var caps = getCapabilities(); - try { - check(caps.glBindFramebuffer).invokeExact(target, framebuffer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCheckFramebufferStatus") + default int checkFramebufferStatus(int target) { + throw new ContextException(); } - public static void bindRenderbuffer(int target, int renderbuffer) { - var caps = getCapabilities(); - try { - check(caps.glBindRenderbuffer).invokeExact(target, renderbuffer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glClampColor") + default void clampColor(int target, int clamp) { + throw new ContextException(); } - public static void bindVertexArray(int array) { - var caps = getCapabilities(); - try { - check(caps.glBindVertexArray).invokeExact(array); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glClearBufferfi") + default void clearBufferfi(int buffer, int drawBuffer, float depth, int stencil) { + throw new ContextException(); } - public static void blitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, int mask, int filter) { - var caps = getCapabilities(); - try { - check(caps.glBlitFramebuffer).invokeExact(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glClearBufferfv") + default void clearBufferfv(int buffer, int drawBuffer, MemorySegment value) { + throw new ContextException(); } - public static int checkFramebufferStatus(int target) { - var caps = getCapabilities(); - try { - return (int) check(caps.glCheckFramebufferStatus).invokeExact(target); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glClearBufferfv") + default void clearBufferfv(SegmentAllocator allocator, int buffer, int drawBuffer, float[] value) { + throw new ContextException(); } - public static void clampColor(int target, int clamp) { - var caps = getCapabilities(); - try { - check(caps.glClampColor).invokeExact(target, clamp); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glClearBufferiv") + default void clearBufferiv(int buffer, int drawBuffer, MemorySegment value) { + throw new ContextException(); } - public static void clearBufferfi(int buffer, int drawBuffer, float depth, int stencil) { - var caps = getCapabilities(); - try { - check(caps.glClearBufferfi).invokeExact(buffer, drawBuffer, depth, stencil); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glClearBufferiv") + default void clearBufferiv(SegmentAllocator allocator, int buffer, int drawBuffer, int[] value) { + throw new ContextException(); } - public static void clearBufferfv(int buffer, int drawBuffer, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glClearBufferfv).invokeExact(buffer, drawBuffer, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glClearBufferuiv") + default void clearBufferuiv(int buffer, int drawBuffer, MemorySegment value) { + throw new ContextException(); } - public static void clearBufferfv(SegmentAllocator allocator, int buffer, int drawBuffer, float[] value) { - clearBufferfv(buffer, drawBuffer, allocator.allocateFrom(JAVA_FLOAT, value)); + @Entrypoint("glClearBufferuiv") + default void clearBufferuiv(SegmentAllocator allocator, int buffer, int drawBuffer, int[] value) { + throw new ContextException(); } - public static void clearBufferiv(int buffer, int drawBuffer, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glClearBufferiv).invokeExact(buffer, drawBuffer, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glColorMaski") + default void colorMaski(int index, boolean r, boolean g, boolean b, boolean a) { + throw new ContextException(); } - public static void clearBufferiv(SegmentAllocator allocator, int buffer, int drawBuffer, int[] value) { - clearBufferiv(buffer, drawBuffer, allocator.allocateFrom(JAVA_INT, value)); + @Entrypoint("glDeleteFramebuffers") + default void deleteFramebuffers(int n, MemorySegment framebuffers) { + throw new ContextException(); } - public static void clearBufferuiv(int buffer, int drawBuffer, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glClearBufferuiv).invokeExact(buffer, drawBuffer, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); + @Skip + default void deleteFramebuffers(int... framebuffers) { + try (MemoryStack stack = MemoryStack.stackPush()) { + deleteFramebuffers(framebuffers.length, Marshal.marshal(stack, framebuffers)); } } - public static void clearBufferuiv(SegmentAllocator allocator, int buffer, int drawBuffer, int[] value) { - clearBufferuiv(buffer, drawBuffer, allocator.allocateFrom(JAVA_INT, value)); + @Entrypoint("glDeleteRenderbuffers") + default void deleteRenderbuffers(int n, MemorySegment renderbuffers) { + throw new ContextException(); } - public static void colorMaski(int index, boolean r, boolean g, boolean b, boolean a) { - var caps = getCapabilities(); - try { - check(caps.glColorMaski).invokeExact(index, r, g, b, a); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); + @Skip + default void deleteRenderbuffers(int... renderbuffers) { + try (MemoryStack stack = MemoryStack.stackPush()) { + deleteRenderbuffers(renderbuffers.length, Marshal.marshal(stack, renderbuffers)); } } - public static void deleteFramebuffers(int n, MemorySegment framebuffers) { - var caps = getCapabilities(); - try { - check(caps.glDeleteFramebuffers).invokeExact(n, framebuffers); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDeleteVertexArrays") + default void deleteVertexArrays(int n, MemorySegment arrays) { + throw new ContextException(); } - public static void deleteFramebuffers(SegmentAllocator allocator, int[] framebuffers) { - deleteFramebuffers(framebuffers.length, allocator.allocateFrom(JAVA_INT, framebuffers)); - } - - public static void deleteFramebuffer(int framebuffer) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - deleteFramebuffers(1, stack.ints(framebuffer)); - } finally { - stack.setPointer(stackPointer); + @Skip + default void deleteVertexArrays(int... arrays) { + try (MemoryStack stack = MemoryStack.stackPush()) { + deleteVertexArrays(arrays.length, Marshal.marshal(stack, arrays)); } } - public static void deleteRenderbuffers(int n, MemorySegment renderbuffers) { - var caps = getCapabilities(); - try { - check(caps.glDeleteRenderbuffers).invokeExact(n, renderbuffers); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDisablei") + default void disablei(int target, int index) { + throw new ContextException(); } - public static void deleteRenderbuffers(SegmentAllocator allocator, int[] renderbuffers) { - deleteRenderbuffers(renderbuffers.length, allocator.allocateFrom(JAVA_INT, renderbuffers)); + @Entrypoint("glEnablei") + default void enablei(int target, int index) { + throw new ContextException(); } - public static void deleteRenderbuffer(int renderbuffer) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - deleteRenderbuffers(1, stack.ints(renderbuffer)); - } finally { - stack.setPointer(stackPointer); - } + @Entrypoint("glEndConditionalRender") + default void endConditionalRender() { + throw new ContextException(); } - public static void deleteVertexArrays(int n, MemorySegment arrays) { - var caps = getCapabilities(); - try { - check(caps.glDeleteVertexArrays).invokeExact(n, arrays); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEndTransformFeedback") + default void endTransformFeedback() { + throw new ContextException(); } - public static void deleteVertexArrays(SegmentAllocator allocator, int[] arrays) { - deleteVertexArrays(arrays.length, allocator.allocateFrom(JAVA_INT, arrays)); + @Entrypoint("glFlushMappedBufferRange") + default void flushMappedBufferRange(int target, long offset, long length) { + throw new ContextException(); } - public static void deleteVertexArray(int array) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - deleteVertexArrays(1, stack.ints(array)); - } finally { - stack.setPointer(stackPointer); - } + @Entrypoint("glFramebufferRenderbuffer") + default void framebufferRenderbuffer(int target, int attachment, int renderbufferTarget, int renderbuffer) { + throw new ContextException(); } - public static void disablei(int target, int index) { - var caps = getCapabilities(); - try { - check(caps.glDisablei).invokeExact(target, index); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glFramebufferTexture1D") + default void framebufferTexture1D(int target, int attachment, int texTarget, int texture, int level) { + throw new ContextException(); } - public static void enablei(int target, int index) { - var caps = getCapabilities(); - try { - check(caps.glEnablei).invokeExact(target, index); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glFramebufferTexture2D") + default void framebufferTexture2D(int target, int attachment, int texTarget, int texture, int level) { + throw new ContextException(); } - public static void endConditionalRender() { - var caps = getCapabilities(); - try { - check(caps.glEndConditionalRender).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glFramebufferTexture3D") + default void framebufferTexture3D(int target, int attachment, int texTarget, int texture, int level, int zoffset) { + throw new ContextException(); } - public static void endTransformFeedback() { - var caps = getCapabilities(); - try { - check(caps.glEndTransformFeedback).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void flushMappedBufferRange(int target, long offset, long length) { - var caps = getCapabilities(); - try { - check(caps.glFlushMappedBufferRange).invokeExact(target, offset, length); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void framebufferRenderbuffer(int target, int attachment, int renderbufferTarget, int renderbuffer) { - var caps = getCapabilities(); - try { - check(caps.glFramebufferRenderbuffer).invokeExact(target, attachment, renderbufferTarget, renderbuffer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void framebufferTexture1D(int target, int attachment, int texTarget, int texture, int level) { - var caps = getCapabilities(); - try { - check(caps.glFramebufferTexture1D).invokeExact(target, attachment, texTarget, texture, level); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glFramebufferTextureLayer") + default void framebufferTextureLayer(int target, int attachment, int texture, int level, int layer) { + throw new ContextException(); } - public static void framebufferTexture2D(int target, int attachment, int texTarget, int texture, int level) { - var caps = getCapabilities(); - try { - check(caps.glFramebufferTexture2D).invokeExact(target, attachment, texTarget, texture, level); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void framebufferTexture3D(int target, int attachment, int texTarget, int texture, int level, int zoffset) { - var caps = getCapabilities(); - try { - check(caps.glFramebufferTexture3D).invokeExact(target, attachment, texTarget, texture, level, zoffset); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void framebufferTextureLayer(int target, int attachment, int texture, int level, int layer) { - var caps = getCapabilities(); - try { - check(caps.glFramebufferTextureLayer).invokeExact(target, attachment, texture, level, layer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void genFramebuffers(int n, MemorySegment framebuffers) { - var caps = getCapabilities(); - try { - check(caps.glGenFramebuffers).invokeExact(n, framebuffers); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGenFramebuffers") + default void genFramebuffers(int n, MemorySegment framebuffers) { + throw new ContextException(); } - public static void genFramebuffers(SegmentAllocator allocator, int[] framebuffers) { - var seg = allocator.allocateFrom(JAVA_INT, framebuffers); + @Skip + default void genFramebuffers(SegmentAllocator allocator, @Ref int[] framebuffers) { + var seg = Marshal.marshal(allocator, framebuffers); genFramebuffers(framebuffers.length, seg); - RuntimeHelper.toArray(seg, framebuffers); + Unmarshal.copy(seg, framebuffers); } - public static int genFramebuffer() { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int genFramebuffers() { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); genFramebuffers(1, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void genRenderbuffers(int n, MemorySegment renderbuffers) { - var caps = getCapabilities(); - try { - check(caps.glGenRenderbuffers).invokeExact(n, renderbuffers); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGenRenderbuffers") + default void genRenderbuffers(int n, MemorySegment renderbuffers) { + throw new ContextException(); } - public static void genRenderbuffers(SegmentAllocator allocator, int[] renderbuffers) { - var seg = allocator.allocateFrom(JAVA_INT, renderbuffers); + @Skip + default void genRenderbuffers(SegmentAllocator allocator, @Ref int[] renderbuffers) { + var seg = Marshal.marshal(allocator, renderbuffers); genRenderbuffers(renderbuffers.length, seg); - RuntimeHelper.toArray(seg, renderbuffers); + Unmarshal.copy(seg, renderbuffers); } - public static int genRenderbuffer() { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int genRenderbuffers() { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); genRenderbuffers(1, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void genVertexArrays(int n, MemorySegment arrays) { - var caps = getCapabilities(); - try { - check(caps.glGenVertexArrays).invokeExact(n, arrays); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGenVertexArrays") + default void genVertexArrays(int n, MemorySegment arrays) { + throw new ContextException(); } - public static void genVertexArrays(SegmentAllocator allocator, int[] arrays) { - var seg = allocator.allocateFrom(JAVA_INT, arrays); + @Skip + default void genVertexArrays(SegmentAllocator allocator, @Ref int[] arrays) { + var seg = Marshal.marshal(allocator, arrays); genVertexArrays(arrays.length, seg); - RuntimeHelper.toArray(seg, arrays); + Unmarshal.copy(seg, arrays); } - public static int genVertexArray() { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int genVertexArrays() { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); genVertexArrays(1, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void generateMipmap(int target) { - var caps = getCapabilities(); - try { - check(caps.glGenerateMipmap).invokeExact(target); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGenerateMipmap") + default void generateMipmap(int target) { + throw new ContextException(); } - public static void getBooleani_v(int target, int index, MemorySegment data) { - var caps = getCapabilities(); - try { - check(caps.glGetBooleani_v).invokeExact(target, index, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetBooleani_v") + default void getBooleani_v(int target, int index, MemorySegment data) { + throw new ContextException(); } - public static void getBooleani_v(SegmentAllocator allocator, int target, int index, boolean[] data) { - var seg = allocator.allocate(JAVA_BOOLEAN, data.length); - getBooleani_v(target, index, seg); - RuntimeHelper.toArray(seg, data); + @Entrypoint("glGetBooleani_v") + default void getBooleani_v(SegmentAllocator allocator, int target, int index, @Ref boolean[] data) { + throw new ContextException(); } - public static boolean getBooleani(int target, int index) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.calloc(JAVA_BOOLEAN); + @Skip + default boolean getBooleani_v(int target, int index) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.allocate(JAVA_BOOLEAN); getBooleani_v(target, index, seg); return seg.get(JAVA_BOOLEAN, 0); - } finally { - stack.setPointer(stackPointer); } } - public static int getFragDataLocation(int program, MemorySegment name) { - var caps = getCapabilities(); - try { - return (int) check(caps.glGetFragDataLocation).invokeExact(program, name); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetFragDataLocation") + default int getFragDataLocation(int program, MemorySegment name) { + throw new ContextException(); } - public static int getFragDataLocation(int program, String name) { - final MemoryStack stack = MemoryStack.stackGet(); - final long stackPointer = stack.getPointer(); - try { - return getFragDataLocation(program, stack.allocateFrom(name)); - } finally { - stack.setPointer(stackPointer); - } + @Entrypoint("glGetFragDataLocation") + default int getFragDataLocation(int program, String name) { + throw new ContextException(); } - public static void getFramebufferAttachmentParameteriv(int target, int attachment, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetFramebufferAttachmentParameteriv).invokeExact(target, attachment, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetFramebufferAttachmentParameteriv") + default void getFramebufferAttachmentParameteriv(int target, int attachment, int pname, MemorySegment params) { + throw new ContextException(); } - public static int getFramebufferAttachmentParameteri(int target, int attachment, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getFramebufferAttachmentParameteriv(int target, int attachment, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getFramebufferAttachmentParameteriv(target, attachment, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getIntegeri_v(int target, int index, MemorySegment data) { - var caps = getCapabilities(); - try { - check(caps.glGetIntegeri_v).invokeExact(target, index, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetIntegeri_v") + default void getIntegeri_v(int target, int index, MemorySegment data) { + throw new ContextException(); } - public static void getIntegeri_v(SegmentAllocator allocator, int target, int index, int[] data) { - var seg = allocator.allocateFrom(JAVA_INT, data); - getIntegeri_v(target, index, seg); - RuntimeHelper.toArray(seg, data); + @Entrypoint("glGetIntegeri_v") + default void getIntegeri_v(SegmentAllocator allocator, int target, int index, @Ref int[] data) { + throw new ContextException(); } - public static int getIntegeri(int target, int index) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getIntegeri_v(int target, int index) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getIntegeri_v(target, index, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getRenderbufferParameteriv(int target, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetRenderbufferParameteriv).invokeExact(target, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetRenderbufferParameteriv") + default void getRenderbufferParameteriv(int target, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getRenderbufferParameteriv(int target, int pname, int[] params) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); - getRenderbufferParameteriv(target, pname, seg); - params[0] = seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); - } + @Entrypoint("glGetRenderbufferParameteriv") + default void getRenderbufferParameteriv(int target, int pname, @Ref int[] params) { + throw new ContextException(); } - public static int getRenderbufferParameteri(int target, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getRenderbufferParameteriv(int target, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getRenderbufferParameteriv(target, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static MemorySegment ngetStringi(int pname, int index) { - var caps = getCapabilities(); - try { - return (MemorySegment) check(caps.glGetStringi).invokeExact(pname, index); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetStringi") + default MemorySegment ngetStringi(int pname, int index) { + throw new ContextException(); } + @Entrypoint("glGetStringi") @Nullable - public static String getStringi(int pname, int index) { - var pStr = ngetStringi(pname, index); - return RuntimeHelper.isNullptr(pStr) ? null : pStr.getString(0); + @SizedSeg(Unmarshal.STR_SIZE) + default String getStringi(int pname, int index) { + throw new ContextException(); } - public static void getTexParameterIiv(int target, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetTexParameterIiv).invokeExact(target, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTexParameterIiv") + default void getTexParameterIiv(int target, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getTexParameterIiv(SegmentAllocator allocator, int target, int pname, int[] params) { - var seg = allocator.allocateFrom(JAVA_INT, params); - getTexParameterIiv(target, pname, seg); - RuntimeHelper.toArray(seg, params); + @Entrypoint("glGetTexParameterIiv") + default void getTexParameterIiv(SegmentAllocator allocator, int target, int pname, @Ref int[] params) { + throw new ContextException(); } - public static int getTexParameterIi(int target, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getTexParameterIiv(int target, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getTexParameterIiv(target, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getTexParameterIuiv(int target, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetTexParameterIuiv).invokeExact(target, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTexParameterIuiv") + default void getTexParameterIuiv(int target, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getTexParameterIuiv(SegmentAllocator allocator, int target, int pname, int[] params) { - var seg = allocator.allocateFrom(JAVA_INT, params); - getTexParameterIuiv(target, pname, seg); - RuntimeHelper.toArray(seg, params); + @Entrypoint("glGetTexParameterIuiv") + default void getTexParameterIuiv(SegmentAllocator allocator, int target, int pname, @Ref int[] params) { + throw new ContextException(); } - public static int getTexParameterIui(int target, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getTexParameterIuiv(int target, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getTexParameterIuiv(target, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getTransformFeedbackVarying(int program, int index, int bufSize, MemorySegment length, MemorySegment size, MemorySegment type, MemorySegment name) { - var caps = getCapabilities(); - try { - check(caps.glGetTransformFeedbackVarying).invokeExact(program, index, bufSize, length, size, type, name); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTransformFeedbackVarying") + default void getTransformFeedbackVarying(int program, int index, int bufSize, MemorySegment length, MemorySegment size, MemorySegment type, MemorySegment name) { + throw new ContextException(); } - public static void getTransformFeedbackVarying(SegmentAllocator allocator, int program, int index, int bufSize, int @Nullable [] length, int[] size, int[] type, String[] name) { - var pLen = length != null ? allocator.allocate(JAVA_INT) : MemorySegment.NULL; - var pSz = allocator.allocate(JAVA_INT); - var pType = allocator.allocate(JAVA_INT); + @Skip + default void getTransformFeedbackVarying(SegmentAllocator allocator, int program, int index, int bufSize, @Ref int @Nullable [] length, @Ref int[] size, @Ref int[] type, @Ref String[] name) { + var pLen = Marshal.marshal(allocator, length); + var pSz = Marshal.marshal(allocator, size); + var pType = Marshal.marshal(allocator, type); var pName = allocator.allocate(JAVA_BYTE, bufSize); getTransformFeedbackVarying(program, index, bufSize, pLen, pSz, pType, pName); - if (length != null && length.length > 0) { - length[0] = pLen.get(JAVA_INT, 0); - } - size[0] = pSz.get(JAVA_INT, 0); - type[0] = pType.get(JAVA_INT, 0); + Unmarshal.copy(pLen, length); + Unmarshal.copy(pSz, size); + Unmarshal.copy(pType, type); name[0] = pName.getString(0); } - public static void getUniformuiv(int program, int location, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetUniformuiv).invokeExact(program, location, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetUniformuiv") + default void getUniformuiv(int program, int location, MemorySegment params) { + throw new ContextException(); } - public static void getUniformuiv(SegmentAllocator allocator, int program, int location, int[] params) { - var seg = allocator.allocateFrom(JAVA_INT, params); - getUniformuiv(program, location, seg); - RuntimeHelper.toArray(seg, params); + @Entrypoint("glGetUniformuiv") + default void getUniformuiv(SegmentAllocator allocator, int program, int location, @Ref int[] params) { + throw new ContextException(); } - public static int getUniformui(int program, int location) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getUniformuiv(int program, int location) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getUniformuiv(program, location, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getVertexAttribIiv(int index, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetVertexAttribIiv).invokeExact(index, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetVertexAttribIiv") + default void getVertexAttribIiv(int index, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getVertexAttribIiv(SegmentAllocator allocator, int index, int pname, int[] params) { - var seg = allocator.allocateFrom(JAVA_INT, params); - getVertexAttribIiv(index, pname, seg); - RuntimeHelper.toArray(seg, params); + @Entrypoint("glGetVertexAttribIiv") + default void getVertexAttribIiv(SegmentAllocator allocator, int index, int pname, @Ref int[] params) { + throw new ContextException(); } - public static int getVertexAttribIi(int index, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getVertexAttribIiv(int index, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getVertexAttribIiv(index, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getVertexAttribIuiv(int index, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetVertexAttribIuiv).invokeExact(index, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetVertexAttribIuiv") + default void getVertexAttribIuiv(int index, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getVertexAttribIuiv(SegmentAllocator allocator, int index, int pname, int[] params) { - var seg = allocator.allocateFrom(JAVA_INT, params); - getVertexAttribIuiv(index, pname, seg); - RuntimeHelper.toArray(seg, params); + @Entrypoint("glGetVertexAttribIuiv") + default void getVertexAttribIuiv(SegmentAllocator allocator, int index, int pname, @Ref int[] params) { + throw new ContextException(); } - public static int getVertexAttribIui(int index, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getVertexAttribIuiv(int index, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getVertexAttribIuiv(index, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static boolean isEnabledi(int target, int index) { - var caps = getCapabilities(); - try { - return (boolean) check(caps.glIsEnabledi).invokeExact(target, index); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIsEnabledi") + default boolean isEnabledi(int target, int index) { + throw new ContextException(); } - public static boolean isFramebuffer(int framebuffer) { - var caps = getCapabilities(); - try { - return (boolean) check(caps.glIsFramebuffer).invokeExact(framebuffer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIsFramebuffer") + default boolean isFramebuffer(int framebuffer) { + throw new ContextException(); } - public static boolean isRenderbuffer(int renderbuffer) { - var caps = getCapabilities(); - try { - return (boolean) check(caps.glIsRenderbuffer).invokeExact(renderbuffer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIsRenderbuffer") + default boolean isRenderbuffer(int renderbuffer) { + throw new ContextException(); } - public static boolean isVertexArray(int array) { - var caps = getCapabilities(); - try { - return (boolean) check(caps.glIsVertexArray).invokeExact(array); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIsVertexArray") + default boolean isVertexArray(int array) { + throw new ContextException(); } - public static MemorySegment mapBufferRange(int target, long offset, long length, int access) { - var caps = getCapabilities(); - try { - return ((MemorySegment) check(caps.glMapBufferRange).invokeExact(target, offset, length, access)).reinterpret(length); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + default MethodHandle glMapBufferRange() { + throw new ContextException(); } - public static void renderbufferStorage(int target, int internalFormat, int width, int height) { - var caps = getCapabilities(); + @Skip + default MemorySegment mapBufferRange(int target, long offset, long length, int access) { try { - check(caps.glRenderbufferStorage).invokeExact(target, internalFormat, width, height); + return ((MemorySegment) glMapBufferRange().invokeExact(target, offset, length, access)).reinterpret(length); } catch (Throwable e) { - throw new AssertionError("should not reach here", e); + throw new RuntimeException(e); } } - public static void renderbufferStorageMultisample(int target, int samples, int internalFormat, int width, int height) { - var caps = getCapabilities(); - try { - check(caps.glRenderbufferStorageMultisample).invokeExact(target, samples, internalFormat, width, height); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRenderbufferStorage") + default void renderbufferStorage(int target, int internalFormat, int width, int height) { + throw new ContextException(); } - public static void texParameterIiv(int target, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glTexParameterIiv).invokeExact(target, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glRenderbufferStorageMultisample") + default void renderbufferStorageMultisample(int target, int samples, int internalFormat, int width, int height) { + throw new ContextException(); } - public static void texParameterIiv(SegmentAllocator allocator, int target, int pname, int[] params) { - texParameterIiv(target, pname, allocator.allocateFrom(JAVA_INT, params)); + @Entrypoint("glTexParameterIiv") + default void texParameterIiv(int target, int pname, MemorySegment params) { + throw new ContextException(); } - public static void texParameterIuiv(int target, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glTexParameterIuiv).invokeExact(target, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexParameterIiv") + default void texParameterIiv(SegmentAllocator allocator, int target, int pname, int[] params) { + throw new ContextException(); } - public static void texParameterIuiv(SegmentAllocator allocator, int target, int pname, int[] params) { - texParameterIuiv(target, pname, allocator.allocateFrom(JAVA_INT, params)); + @Entrypoint("glTexParameterIuiv") + default void texParameterIuiv(int target, int pname, MemorySegment params) { + throw new ContextException(); } - public static void transformFeedbackVaryings(int program, int count, MemorySegment varyings, int bufferMode) { - var caps = getCapabilities(); - try { - check(caps.glTransformFeedbackVaryings).invokeExact(program, count, varyings, bufferMode); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexParameterIuiv") + default void texParameterIuiv(SegmentAllocator allocator, int target, int pname, int[] params) { + throw new ContextException(); } - public static void transformFeedbackVaryings(SegmentAllocator allocator, int program, String[] varyings, int bufferMode) { - var seg = allocator.allocate(ADDRESS, varyings.length); - for (int i = 0; i < varyings.length; i++) { - seg.setAtIndex(ADDRESS, i, allocator.allocateFrom(varyings[i])); - } - transformFeedbackVaryings(program, varyings.length, seg, bufferMode); + @Entrypoint("glTransformFeedbackVaryings") + default void transformFeedbackVaryings(int program, int count, MemorySegment varyings, int bufferMode) { + throw new ContextException(); } - public static void uniform1ui(int location, int v0) { - var caps = getCapabilities(); - try { - check(caps.glUniform1ui).invokeExact(location, v0); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Skip + default void transformFeedbackVaryings(SegmentAllocator allocator, int program, String[] varyings, int bufferMode) { + transformFeedbackVaryings(program, varyings.length, Marshal.marshal(allocator, varyings), bufferMode); } - public static void uniform1uiv(int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniform1uiv).invokeExact(location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform1ui") + default void uniform1ui(int location, int v0) { + throw new ContextException(); } - public static void uniform1uiv(SegmentAllocator allocator, int location, int[] value) { - uniform1uiv(location, value.length, allocator.allocateFrom(JAVA_INT, value)); + @Entrypoint("glUniform1uiv") + default void uniform1uiv(int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void uniform2ui(int location, int v0, int v1) { - var caps = getCapabilities(); - try { - check(caps.glUniform2ui).invokeExact(location, v0, v1); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Skip + default void uniform1uiv(SegmentAllocator allocator, int location, int[] value) { + uniform1uiv(location, value.length, Marshal.marshal(allocator, value)); } - public static void uniform2uiv(int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniform2uiv).invokeExact(location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform2ui") + default void uniform2ui(int location, int v0, int v1) { + throw new ContextException(); } - public static void uniform2uiv(SegmentAllocator allocator, int location, int[] value) { - uniform2uiv(location, value.length >> 1, allocator.allocateFrom(JAVA_INT, value)); + @Entrypoint("glUniform2uiv") + default void uniform2uiv(int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void uniform3ui(int location, int v0, int v1, int v2) { - var caps = getCapabilities(); - try { - check(caps.glUniform3ui).invokeExact(location, v0, v1, v2); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Skip + default void uniform2uiv(SegmentAllocator allocator, int location, int[] value) { + uniform2uiv(location, value.length >> 1, Marshal.marshal(allocator, value)); } - public static void uniform3uiv(int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniform3uiv).invokeExact(location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform3ui") + default void uniform3ui(int location, int v0, int v1, int v2) { + throw new ContextException(); } - public static void uniform3uiv(SegmentAllocator allocator, int location, int[] value) { - uniform3uiv(location, value.length / 3, allocator.allocateFrom(JAVA_INT, value)); + @Entrypoint("glUniform3uiv") + default void uniform3uiv(int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void uniform4ui(int location, int v0, int v1, int v2, int v3) { - var caps = getCapabilities(); - try { - check(caps.glUniform4ui).invokeExact(location, v0, v1, v2, v3); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Skip + default void uniform3uiv(SegmentAllocator allocator, int location, int[] value) { + uniform3uiv(location, value.length / 3, Marshal.marshal(allocator, value)); } - public static void uniform4uiv(int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniform4uiv).invokeExact(location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform4ui") + default void uniform4ui(int location, int v0, int v1, int v2, int v3) { + throw new ContextException(); } - public static void uniform4uiv(SegmentAllocator allocator, int location, int[] value) { - uniform4uiv(location, value.length >> 2, allocator.allocateFrom(JAVA_INT, value)); + @Entrypoint("glUniform4uiv") + default void uniform4uiv(int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void vertexAttribI1i(int index, int x) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribI1i).invokeExact(index, x); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Skip + default void uniform4uiv(SegmentAllocator allocator, int location, int[] value) { + uniform4uiv(location, value.length >> 2, Marshal.marshal(allocator, value)); } - public static void vertexAttribI1iv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribI1iv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribI1i") + default void vertexAttribI1i(int index, int x) { + throw new ContextException(); } - public static void vertexAttribI1iv(SegmentAllocator allocator, int index, int[] v) { - vertexAttribI1iv(index, allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glVertexAttribI1iv") + default void vertexAttribI1iv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttribI1ui(int index, int x) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribI1ui).invokeExact(index, x); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribI1iv") + default void vertexAttribI1iv(SegmentAllocator allocator, int index, int[] v) { + throw new ContextException(); } - public static void vertexAttribI1uiv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribI1uiv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribI1ui") + default void vertexAttribI1ui(int index, int x) { + throw new ContextException(); } - public static void vertexAttribI1uiv(SegmentAllocator allocator, int index, int[] v) { - vertexAttribI1uiv(index, allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glVertexAttribI1uiv") + default void vertexAttribI1uiv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttribI2i(int index, int x, int y) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribI2i).invokeExact(index, x, y); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribI1uiv") + default void vertexAttribI1uiv(SegmentAllocator allocator, int index, int[] v) { + throw new ContextException(); } - public static void vertexAttribI2iv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribI2iv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribI2i") + default void vertexAttribI2i(int index, int x, int y) { + throw new ContextException(); } - public static void vertexAttribI2iv(SegmentAllocator allocator, int index, int[] v) { - vertexAttribI2iv(index, allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glVertexAttribI2iv") + default void vertexAttribI2iv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttribI2ui(int index, int x, int y) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribI2ui).invokeExact(index, x, y); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribI2iv") + default void vertexAttribI2iv(SegmentAllocator allocator, int index, int[] v) { + throw new ContextException(); } - public static void vertexAttribI2uiv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribI2uiv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribI2ui") + default void vertexAttribI2ui(int index, int x, int y) { + throw new ContextException(); } - public static void vertexAttribI2uiv(SegmentAllocator allocator, int index, int[] v) { - vertexAttribI2uiv(index, allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glVertexAttribI2uiv") + default void vertexAttribI2uiv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttribI3i(int index, int x, int y, int z) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribI3i).invokeExact(index, x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribI2uiv") + default void vertexAttribI2uiv(SegmentAllocator allocator, int index, int[] v) { + throw new ContextException(); } - public static void vertexAttribI3iv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribI3iv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribI3i") + default void vertexAttribI3i(int index, int x, int y, int z) { + throw new ContextException(); } - public static void vertexAttribI3iv(SegmentAllocator allocator, int index, int[] v) { - vertexAttribI3iv(index, allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glVertexAttribI3iv") + default void vertexAttribI3iv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttribI3ui(int index, int x, int y, int z) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribI3ui).invokeExact(index, x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribI3iv") + default void vertexAttribI3iv(SegmentAllocator allocator, int index, int[] v) { + throw new ContextException(); } - public static void vertexAttribI3uiv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribI3uiv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribI3ui") + default void vertexAttribI3ui(int index, int x, int y, int z) { + throw new ContextException(); } - public static void vertexAttribI3uiv(SegmentAllocator allocator, int index, int[] v) { - vertexAttribI3uiv(index, allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glVertexAttribI3uiv") + default void vertexAttribI3uiv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttribI4bv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribI4bv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribI3uiv") + default void vertexAttribI3uiv(SegmentAllocator allocator, int index, int[] v) { + throw new ContextException(); } - public static void vertexAttribI4bv(SegmentAllocator allocator, int index, byte[] v) { - vertexAttribI4bv(index, allocator.allocateFrom(JAVA_BYTE, v)); + @Entrypoint("glVertexAttribI4bv") + default void vertexAttribI4bv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttribI4i(int index, int x, int y, int z, int w) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribI4i).invokeExact(index, x, y, z, w); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribI4bv") + default void vertexAttribI4bv(SegmentAllocator allocator, int index, byte[] v) { + throw new ContextException(); } - public static void vertexAttribI4iv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribI4iv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribI4i") + default void vertexAttribI4i(int index, int x, int y, int z, int w) { + throw new ContextException(); } - public static void vertexAttribI4iv(SegmentAllocator allocator, int index, int[] v) { - vertexAttribI4iv(index, allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glVertexAttribI4iv") + default void vertexAttribI4iv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttribI4sv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribI4sv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribI4iv") + default void vertexAttribI4iv(SegmentAllocator allocator, int index, int[] v) { + throw new ContextException(); } - public static void vertexAttribI4sv(SegmentAllocator allocator, int index, short[] v) { - vertexAttribI4sv(index, allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glVertexAttribI4sv") + default void vertexAttribI4sv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttribI4ubv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribI4ubv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribI4sv") + default void vertexAttribI4sv(SegmentAllocator allocator, int index, short[] v) { + throw new ContextException(); } - public static void vertexAttribI4ubv(SegmentAllocator allocator, int index, byte[] v) { - vertexAttribI4ubv(index, allocator.allocateFrom(JAVA_BYTE, v)); + @Entrypoint("glVertexAttribI4ubv") + default void vertexAttribI4ubv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttribI4ui(int index, int x, int y, int z, int w) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribI4ui).invokeExact(index, x, y, z, w); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribI4ubv") + default void vertexAttribI4ubv(SegmentAllocator allocator, int index, byte[] v) { + throw new ContextException(); } - public static void vertexAttribI4uiv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribI4uiv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribI4ui") + default void vertexAttribI4ui(int index, int x, int y, int z, int w) { + throw new ContextException(); } - public static void vertexAttribI4uiv(SegmentAllocator allocator, int index, int[] v) { - vertexAttribI4uiv(index, allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glVertexAttribI4uiv") + default void vertexAttribI4uiv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttribI4usv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribI4usv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribI4uiv") + default void vertexAttribI4uiv(SegmentAllocator allocator, int index, int[] v) { + throw new ContextException(); } - public static void vertexAttribI4usv(SegmentAllocator allocator, int index, short[] v) { - vertexAttribI4usv(index, allocator.allocateFrom(JAVA_SHORT, v)); + @Entrypoint("glVertexAttribI4usv") + default void vertexAttribI4usv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttribIPointer(int index, int size, int type, int stride, MemorySegment pointer) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribIPointer).invokeExact(index, size, type, stride, pointer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribI4usv") + default void vertexAttribI4usv(SegmentAllocator allocator, int index, short[] v) { + throw new ContextException(); + } + + @Entrypoint("glVertexAttribIPointer") + default void vertexAttribIPointer(int index, int size, int type, int stride, MemorySegment pointer) { + throw new ContextException(); } - public static void vertexAttribIPointer(SegmentAllocator allocator, int index, int size, int type, int stride, byte[] pointer) { - vertexAttribIPointer(index, size, type, stride, allocator.allocateFrom(JAVA_BYTE, pointer)); + @Entrypoint("glVertexAttribIPointer") + default void vertexAttribIPointer(SegmentAllocator allocator, int index, int size, int type, int stride, byte[] pointer) { + throw new ContextException(); } - public static void vertexAttribIPointer(SegmentAllocator allocator, int index, int size, int type, int stride, short[] pointer) { - vertexAttribIPointer(index, size, type, stride, allocator.allocateFrom(JAVA_SHORT, pointer)); + @Entrypoint("glVertexAttribIPointer") + default void vertexAttribIPointer(SegmentAllocator allocator, int index, int size, int type, int stride, short[] pointer) { + throw new ContextException(); } - public static void vertexAttribIPointer(SegmentAllocator allocator, int index, int size, int type, int stride, int[] pointer) { - vertexAttribIPointer(index, size, type, stride, allocator.allocateFrom(JAVA_INT, pointer)); + @Entrypoint("glVertexAttribIPointer") + default void vertexAttribIPointer(SegmentAllocator allocator, int index, int size, int type, int stride, int[] pointer) { + throw new ContextException(); } } 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 9d7c1e63..5de483c6 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL31C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL31C.java @@ -16,16 +16,17 @@ package overrungl.opengl; -import org.jetbrains.annotations.Nullable; +import overrun.marshal.Marshal; +import overrun.marshal.MemoryStack; +import overrun.marshal.Unmarshal; +import overrun.marshal.gen.Entrypoint; +import overrun.marshal.gen.Ref; +import overrun.marshal.gen.Skip; import overrungl.opengl.ext.arb.GLARBTextureRectangle; -import overrungl.internal.RuntimeHelper; -import overrungl.util.MemoryStack; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; - -import static java.lang.foreign.ValueLayout.*; -import static overrungl.FunctionDescriptors.*; +import java.lang.foreign.ValueLayout; /** * The OpenGL 3.1 core profile functions. @@ -40,299 +41,203 @@ * @author squid233 * @since 0.1.0 */ -public sealed class GL31C extends GL30C permits GL32C { - public static final int SAMPLER_2D_RECT = 0x8B63; - public static final int SAMPLER_2D_RECT_SHADOW = 0x8B64; - public static final int SAMPLER_BUFFER = 0x8DC2; - public static final int INT_SAMPLER_2D_RECT = 0x8DCD; - public static final int INT_SAMPLER_BUFFER = 0x8DD0; - public static final int UNSIGNED_INT_SAMPLER_2D_RECT = 0x8DD5; - public static final int UNSIGNED_INT_SAMPLER_BUFFER = 0x8DD8; - public static final int TEXTURE_BUFFER = 0x8C2A; - public static final int MAX_TEXTURE_BUFFER_SIZE = 0x8C2B; - public static final int TEXTURE_BINDING_BUFFER = 0x8C2C; - public static final int TEXTURE_BUFFER_DATA_STORE_BINDING = 0x8C2D; - public static final int TEXTURE_RECTANGLE = 0x84F5; - public static final int TEXTURE_BINDING_RECTANGLE = 0x84F6; - public static final int PROXY_TEXTURE_RECTANGLE = 0x84F7; - public static final int MAX_RECTANGLE_TEXTURE_SIZE = 0x84F8; - public static final int R8_SNORM = 0x8F94; - public static final int RG8_SNORM = 0x8F95; - public static final int RGB8_SNORM = 0x8F96; - public static final int RGBA8_SNORM = 0x8F97; - public static final int R16_SNORM = 0x8F98; - public static final int RG16_SNORM = 0x8F99; - public static final int RGB16_SNORM = 0x8F9A; - public static final int RGBA16_SNORM = 0x8F9B; - public static final int SIGNED_NORMALIZED = 0x8F9C; - public static final int PRIMITIVE_RESTART = 0x8F9D; - public static final int PRIMITIVE_RESTART_INDEX = 0x8F9E; - public static final int COPY_READ_BUFFER = 0x8F36; - public static final int COPY_WRITE_BUFFER = 0x8F37; - public static final int UNIFORM_BUFFER = 0x8A11; - public static final int UNIFORM_BUFFER_BINDING = 0x8A28; - public static final int UNIFORM_BUFFER_START = 0x8A29; - public static final int UNIFORM_BUFFER_SIZE = 0x8A2A; - public static final int MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B; - public static final int MAX_GEOMETRY_UNIFORM_BLOCKS = 0x8A2C; - public static final int MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D; - public static final int MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E; - public static final int MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F; - public static final int MAX_UNIFORM_BLOCK_SIZE = 0x8A30; - public static final int MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31; - public static final int MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32; - public static final int MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33; - public static final int UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34; - public static final int ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35; - public static final int ACTIVE_UNIFORM_BLOCKS = 0x8A36; - public static final int UNIFORM_TYPE = 0x8A37; - public static final int UNIFORM_SIZE = 0x8A38; - public static final int UNIFORM_NAME_LENGTH = 0x8A39; - public static final int UNIFORM_BLOCK_INDEX = 0x8A3A; - public static final int UNIFORM_OFFSET = 0x8A3B; - public static final int UNIFORM_ARRAY_STRIDE = 0x8A3C; - public static final int UNIFORM_MATRIX_STRIDE = 0x8A3D; - public static final int UNIFORM_IS_ROW_MAJOR = 0x8A3E; - public static final int UNIFORM_BLOCK_BINDING = 0x8A3F; - public static final int UNIFORM_BLOCK_DATA_SIZE = 0x8A40; - public static final int UNIFORM_BLOCK_NAME_LENGTH = 0x8A41; - public static final int UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42; - public static final int UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43; - public static final int UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44; - public static final int UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45; - public static final int UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46; - public static final int INVALID_INDEX = 0xFFFFFFFF; - - static boolean isSupported(GLCapabilities caps) { - return GLLoader.checkAll(caps.glBindBufferBase, caps.glBindBufferRange, caps.glCopyBufferSubData, caps.glDrawArraysInstanced, caps.glDrawElementsInstanced, caps.glGetActiveUniformBlockName, - caps.glGetActiveUniformBlockiv, caps.glGetActiveUniformName, caps.glGetActiveUniformsiv, caps.glGetIntegeri_v, caps.glGetUniformBlockIndex, caps.glGetUniformIndices, - caps.glPrimitiveRestartIndex, caps.glTexBuffer, caps.glUniformBlockBinding); - } - - static void load(GLCapabilities caps, GLLoadFunc load) { - caps.glBindBufferBase = load.invoke("glBindBufferBase", IIIV); - caps.glBindBufferRange = load.invoke("glBindBufferRange", IIIJJV); - caps.glCopyBufferSubData = load.invoke("glCopyBufferSubData", IIJJJV); - caps.glDrawArraysInstanced = load.invoke("glDrawArraysInstanced", IIIIV); - caps.glDrawElementsInstanced = load.invoke("glDrawElementsInstanced", IIIPIV); - 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); - } - - public static void copyBufferSubData(int readTarget, int writeTarget, long readOffset, long writeOffset, long size) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glCopyBufferSubData).invokeExact(readTarget, writeTarget, readOffset, writeOffset, size); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void drawArraysInstanced(int mode, int first, int count, int instanceCount) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glDrawArraysInstanced).invokeExact(mode, first, count, instanceCount); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void drawElementsInstanced(int mode, int count, int type, MemorySegment indices, int instanceCount) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glDrawElementsInstanced).invokeExact(mode, count, type, indices, instanceCount); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void drawElementsInstanced(SegmentAllocator allocator, int mode, int count, int type, byte[] indices, int instanceCount) { - drawElementsInstanced(mode, count, type, allocator.allocateFrom(JAVA_BYTE, indices), instanceCount); - } - - public static void drawElementsInstanced(SegmentAllocator allocator, int mode, int count, int type, short[] indices, int instanceCount) { - drawElementsInstanced(mode, count, type, allocator.allocateFrom(JAVA_SHORT, indices), instanceCount); - } - - public static void drawElementsInstanced(SegmentAllocator allocator, int mode, int count, int type, int[] indices, int instanceCount) { - drawElementsInstanced(mode, count, type, allocator.allocateFrom(JAVA_INT, indices), instanceCount); - } - - public static void getActiveUniformBlockName(int program, int uniformBlockIndex, int bufSize, MemorySegment length, MemorySegment uniformBlockName) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetActiveUniformBlockName).invokeExact(program, uniformBlockIndex, bufSize, length, uniformBlockName); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } +public sealed interface GL31C extends GL30C permits GL32C { + int SAMPLER_2D_RECT = 0x8B63; + int SAMPLER_2D_RECT_SHADOW = 0x8B64; + int SAMPLER_BUFFER = 0x8DC2; + int INT_SAMPLER_2D_RECT = 0x8DCD; + int INT_SAMPLER_BUFFER = 0x8DD0; + int UNSIGNED_INT_SAMPLER_2D_RECT = 0x8DD5; + int UNSIGNED_INT_SAMPLER_BUFFER = 0x8DD8; + int TEXTURE_BUFFER = 0x8C2A; + int MAX_TEXTURE_BUFFER_SIZE = 0x8C2B; + int TEXTURE_BINDING_BUFFER = 0x8C2C; + int TEXTURE_BUFFER_DATA_STORE_BINDING = 0x8C2D; + int TEXTURE_RECTANGLE = 0x84F5; + int TEXTURE_BINDING_RECTANGLE = 0x84F6; + int PROXY_TEXTURE_RECTANGLE = 0x84F7; + int MAX_RECTANGLE_TEXTURE_SIZE = 0x84F8; + int R8_SNORM = 0x8F94; + int RG8_SNORM = 0x8F95; + int RGB8_SNORM = 0x8F96; + int RGBA8_SNORM = 0x8F97; + int R16_SNORM = 0x8F98; + int RG16_SNORM = 0x8F99; + int RGB16_SNORM = 0x8F9A; + int RGBA16_SNORM = 0x8F9B; + int SIGNED_NORMALIZED = 0x8F9C; + int PRIMITIVE_RESTART = 0x8F9D; + int PRIMITIVE_RESTART_INDEX = 0x8F9E; + int COPY_READ_BUFFER = 0x8F36; + int COPY_WRITE_BUFFER = 0x8F37; + int UNIFORM_BUFFER = 0x8A11; + int UNIFORM_BUFFER_BINDING = 0x8A28; + int UNIFORM_BUFFER_START = 0x8A29; + int UNIFORM_BUFFER_SIZE = 0x8A2A; + int MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B; + int MAX_GEOMETRY_UNIFORM_BLOCKS = 0x8A2C; + int MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D; + int MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E; + int MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F; + int MAX_UNIFORM_BLOCK_SIZE = 0x8A30; + int MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31; + int MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32; + int MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33; + int UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34; + int ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35; + int ACTIVE_UNIFORM_BLOCKS = 0x8A36; + int UNIFORM_TYPE = 0x8A37; + int UNIFORM_SIZE = 0x8A38; + int UNIFORM_NAME_LENGTH = 0x8A39; + int UNIFORM_BLOCK_INDEX = 0x8A3A; + int UNIFORM_OFFSET = 0x8A3B; + int UNIFORM_ARRAY_STRIDE = 0x8A3C; + int UNIFORM_MATRIX_STRIDE = 0x8A3D; + int UNIFORM_IS_ROW_MAJOR = 0x8A3E; + int UNIFORM_BLOCK_BINDING = 0x8A3F; + int UNIFORM_BLOCK_DATA_SIZE = 0x8A40; + int UNIFORM_BLOCK_NAME_LENGTH = 0x8A41; + int UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42; + int UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43; + int UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44; + int UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45; + int UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46; + int INVALID_INDEX = 0xFFFFFFFF; + + @Entrypoint("glCopyBufferSubData") + default void copyBufferSubData(int readTarget, int writeTarget, long readOffset, long writeOffset, long size) { + throw new ContextException(); + } + + @Entrypoint("glDrawArraysInstanced") + default void drawArraysInstanced(int mode, int first, int count, int instanceCount) { + throw new ContextException(); + } + + @Entrypoint("glDrawElementsInstanced") + default void drawElementsInstanced(int mode, int count, int type, MemorySegment indices, int instanceCount) { + throw new ContextException(); + } + + @Entrypoint("glDrawElementsInstanced") + default void drawElementsInstanced(SegmentAllocator allocator, int mode, int count, int type, byte[] indices, int instanceCount) { + throw new ContextException(); + } + + @Entrypoint("glDrawElementsInstanced") + default void drawElementsInstanced(SegmentAllocator allocator, int mode, int count, int type, short[] indices, int instanceCount) { + throw new ContextException(); + } + + @Entrypoint("glDrawElementsInstanced") + default void drawElementsInstanced(SegmentAllocator allocator, int mode, int count, int type, int[] indices, int instanceCount) { + throw new ContextException(); + } + + @Entrypoint("glGetActiveUniformBlockName") + default void getActiveUniformBlockName(int program, int uniformBlockIndex, int bufSize, MemorySegment length, MemorySegment uniformBlockName) { + throw new ContextException(); + } + + @Skip + default String getActiveUniformBlockName(int program, int uniformBlockIndex, int bufSize) { + try (MemoryStack stack = MemoryStack.stackPush()) { + final MemorySegment length = stack.ints(0); + var pName = stack.allocate(ValueLayout.JAVA_BYTE, bufSize); + getActiveUniformBlockName(program, uniformBlockIndex, bufSize, length, pName); + return pName.reinterpret(length.get(ValueLayout.JAVA_INT, 0L) + 1).getString(0); + } + } + + @Entrypoint("glGetActiveUniformBlockiv") + default void getActiveUniformBlockiv(int program, int uniformBlockIndex, int pname, MemorySegment params) { + throw new ContextException(); + } + + @Entrypoint("glGetActiveUniformBlockiv") + default void getActiveUniformBlockiv(int program, int uniformBlockIndex, int pname, @Ref int[] params) { + throw new ContextException(); + } + + @Entrypoint("glGetActiveUniformName") + default void getActiveUniformName(int program, int uniformIndex, int bufSize, MemorySegment length, MemorySegment uniformName) { + throw new ContextException(); + } - public static void getActiveUniformBlockName(SegmentAllocator allocator, int program, int uniformBlockIndex, int bufSize, int @Nullable [] length, String[] uniformBlockName) { - var pLen = length != null ? allocator.allocate(JAVA_INT) : MemorySegment.NULL; - var pName = allocator.allocate(JAVA_BYTE, bufSize); - getActiveUniformBlockName(program, uniformBlockIndex, bufSize, pLen, pName); - if (length != null && length.length > 0) { - length[0] = pLen.get(JAVA_INT, 0); + @Skip + default String getActiveUniformName(int program, int uniformIndex, int bufSize) { + try (MemoryStack stack = MemoryStack.stackPush()) { + final MemorySegment length = stack.ints(0); + var pName = stack.allocate(ValueLayout.JAVA_BYTE, bufSize); + getActiveUniformName(program, uniformIndex, bufSize, length, pName); + return pName.reinterpret(length.get(ValueLayout.JAVA_INT, 0L) + 1).getString(0); } - uniformBlockName[0] = pName.getString(0); } - public static String getActiveUniformBlockName(SegmentAllocator allocator, int program, int uniformBlockIndex, int bufSize) { - var pName = allocator.allocate(JAVA_BYTE, bufSize); - getActiveUniformBlockName(program, uniformBlockIndex, bufSize, MemorySegment.NULL, pName); - return pName.getString(0); + @Entrypoint("glGetActiveUniformsiv") + default void getActiveUniformsiv(int program, int uniformCount, MemorySegment uniformIndices, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getActiveUniformBlockiv(int program, int uniformBlockIndex, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetActiveUniformBlockiv).invokeExact(program, uniformBlockIndex, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void getActiveUniformBlockiv(SegmentAllocator allocator, int program, int uniformBlockIndex, int pname, int[] params) { - var seg = allocator.allocateFrom(JAVA_INT, params); - getActiveUniformBlockiv(program, uniformBlockIndex, pname, seg); - RuntimeHelper.toArray(seg, params); - } - - public static void getActiveUniformName(int program, int uniformIndex, int bufSize, MemorySegment length, MemorySegment uniformName) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetActiveUniformName).invokeExact(program, uniformIndex, bufSize, length, uniformName); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Skip + default void getActiveUniformsiv(SegmentAllocator allocator, int program, int[] uniformIndices, int pname, @Ref int[] params) { + var seg = Marshal.marshal(allocator, params); + getActiveUniformsiv(program, uniformIndices.length, Marshal.marshal(allocator, uniformIndices), pname, seg); + Unmarshal.copy(seg, params); } - public static void getActiveUniformName(SegmentAllocator allocator, int program, int uniformIndex, int bufSize, int @Nullable [] length, String[] uniformName) { - var pLen = length != null ? allocator.allocate(JAVA_INT) : MemorySegment.NULL; - var pName = allocator.allocate(JAVA_BYTE, bufSize); - getActiveUniformName(program, uniformIndex, bufSize, pLen, pName); - if (length != null && length.length > 0) { - length[0] = pLen.get(JAVA_INT, 0); - } - uniformName[0] = pName.getString(0); - } - - public static String getActiveUniformName(SegmentAllocator allocator, int program, int uniformIndex, int bufSize) { - var pName = allocator.allocate(JAVA_BYTE, bufSize); - getActiveUniformName(program, uniformIndex, bufSize, MemorySegment.NULL, pName); - return pName.getString(0); - } - - public static void getActiveUniformsiv(int program, int uniformCount, MemorySegment uniformIndices, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetActiveUniformsiv).invokeExact(program, uniformCount, uniformIndices, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void getActiveUniformsiv(SegmentAllocator allocator, int program, int[] uniformIndices, int pname, int[] params) { - var seg = allocator.allocateFrom(JAVA_INT, params); - getActiveUniformsiv(program, uniformIndices.length, allocator.allocateFrom(JAVA_INT, uniformIndices), pname, seg); - RuntimeHelper.toArray(seg, params); - } - - public static int getActiveUniformi(int program, int uniformIndex, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getActiveUniformsiv(int program, int uniformIndex, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getActiveUniformsiv(program, 1, stack.ints(uniformIndex), pname, seg); - return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); + return seg.get(ValueLayout.JAVA_INT, 0); } } - public static int getUniformBlockIndex(int program, MemorySegment uniformBlockName) { - var caps = GLLoader.getCapabilities(); - try { - return (int) GLLoader.check(caps.glGetUniformBlockIndex).invokeExact(program, uniformBlockName); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetUniformBlockIndex") + default int getUniformBlockIndex(int program, MemorySegment uniformBlockName) { + throw new ContextException(); } - public static int getUniformBlockIndex(int program, String uniformBlockName) { - final MemoryStack stack = MemoryStack.stackGet(); - final long stackPointer = stack.getPointer(); - try { - return getUniformBlockIndex(program, stack.allocateFrom(uniformBlockName)); - } finally { - stack.setPointer(stackPointer); - } + @Entrypoint("glGetUniformBlockIndex") + default int getUniformBlockIndex(int program, String uniformBlockName) { + throw new ContextException(); } - public static void getUniformIndices(int program, int uniformCount, MemorySegment uniformNames, MemorySegment uniformIndices) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetUniformIndices).invokeExact(program, uniformCount, uniformNames, uniformIndices); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetUniformIndices") + default void getUniformIndices(int program, int uniformCount, MemorySegment uniformNames, MemorySegment uniformIndices) { + throw new ContextException(); } - public static void getUniformIndices(SegmentAllocator allocator, int program, String[] uniformNames, int[] uniformIndices) { - final int count = uniformNames.length; - var pNames = allocator.allocate(ADDRESS, count); - for (int i = 0; i < count; i++) { - pNames.setAtIndex(ADDRESS, i, allocator.allocateFrom(uniformNames[i])); - } - var pIndices = allocator.allocate(JAVA_INT, count); - getUniformIndices(program, count, pNames, pIndices); - RuntimeHelper.toArray(pIndices, uniformIndices); + @Skip + default void getUniformIndices(SegmentAllocator allocator, int program, String[] uniformNames, @Ref int[] uniformIndices) { + var pIndices = allocator.allocate(ValueLayout.JAVA_INT, uniformNames.length); + getUniformIndices(program, uniformNames.length, Marshal.marshal(allocator, uniformNames), pIndices); + Unmarshal.copy(pIndices, uniformIndices); } - public static int getUniformIndex(int program, String uniformName) { - final MemoryStack stack = MemoryStack.stackGet(); - final long stackPointer = stack.getPointer(); - try { - var seg = stack.allocate(JAVA_INT); + @Skip + default int getUniformIndices(int program, String uniformName) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getUniformIndices(program, 1, stack.allocateFrom(uniformName), seg); - return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); + return seg.get(ValueLayout.JAVA_INT, 0); } } - public static void primitiveRestartIndex(int index) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glPrimitiveRestartIndex).invokeExact(index); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPrimitiveRestartIndex") + default void primitiveRestartIndex(int index) { + throw new ContextException(); } - public static void texBuffer(int target, int internalFormat, int buffer) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTexBuffer).invokeExact(target, internalFormat, buffer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexBuffer") + default void texBuffer(int target, int internalFormat, int buffer) { + throw new ContextException(); } - public static void uniformBlockBinding(int program, int uniformBlockIndex, int uniformBlockBinding) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glUniformBlockBinding).invokeExact(program, uniformBlockIndex, uniformBlockBinding); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniformBlockBinding") + default void uniformBlockBinding(int program, int uniformBlockIndex, int uniformBlockBinding) { + throw new ContextException(); } } 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 83adbc16..a25a7ac9 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL32C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL32C.java @@ -17,14 +17,17 @@ package overrungl.opengl; import org.jetbrains.annotations.Nullable; -import overrungl.internal.RuntimeHelper; -import overrungl.util.MemoryStack; +import overrun.marshal.Marshal; +import overrun.marshal.MemoryStack; +import overrun.marshal.Unmarshal; +import overrun.marshal.gen.Entrypoint; +import overrun.marshal.gen.Ref; +import overrun.marshal.gen.Skip; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; import static java.lang.foreign.ValueLayout.*; -import static overrungl.FunctionDescriptors.*; /** * The OpenGL 3.2 core profile functions. @@ -40,419 +43,310 @@ * @author squid233 * @since 0.1.0 */ -public sealed class GL32C extends GL31C permits GL33C { - public static final int CONTEXT_CORE_PROFILE_BIT = 0x00000001; - public static final int CONTEXT_COMPATIBILITY_PROFILE_BIT = 0x00000002; - public static final int LINES_ADJACENCY = 0x000A; - public static final int LINE_STRIP_ADJACENCY = 0x000B; - public static final int TRIANGLES_ADJACENCY = 0x000C; - public static final int TRIANGLE_STRIP_ADJACENCY = 0x000D; - public static final int PROGRAM_POINT_SIZE = 0x8642; - public static final int MAX_GEOMETRY_TEXTURE_IMAGE_UNITS = 0x8C29; - public static final int FRAMEBUFFER_ATTACHMENT_LAYERED = 0x8DA7; - public static final int FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 0x8DA8; - public static final int GEOMETRY_SHADER = 0x8DD9; - public static final int GEOMETRY_VERTICES_OUT = 0x8916; - public static final int GEOMETRY_INPUT_TYPE = 0x8917; - public static final int GEOMETRY_OUTPUT_TYPE = 0x8918; - public static final int MAX_GEOMETRY_UNIFORM_COMPONENTS = 0x8DDF; - public static final int MAX_GEOMETRY_OUTPUT_VERTICES = 0x8DE0; - public static final int MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = 0x8DE1; - public static final int MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122; - public static final int MAX_GEOMETRY_INPUT_COMPONENTS = 0x9123; - public static final int MAX_GEOMETRY_OUTPUT_COMPONENTS = 0x9124; - public static final int MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125; - public static final int CONTEXT_PROFILE_MASK = 0x9126; - public static final int DEPTH_CLAMP = 0x864F; - public static final int QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = 0x8E4C; - public static final int FIRST_VERTEX_CONVENTION = 0x8E4D; - public static final int LAST_VERTEX_CONVENTION = 0x8E4E; - public static final int PROVOKING_VERTEX = 0x8E4F; - public static final int TEXTURE_CUBE_MAP_SEAMLESS = 0x884F; - public static final int MAX_SERVER_WAIT_TIMEOUT = 0x9111; - public static final int OBJECT_TYPE = 0x9112; - public static final int SYNC_CONDITION = 0x9113; - public static final int SYNC_STATUS = 0x9114; - public static final int SYNC_FLAGS = 0x9115; - public static final int SYNC_FENCE = 0x9116; - public static final int SYNC_GPU_COMMANDS_COMPLETE = 0x9117; - public static final int UNSIGNALED = 0x9118; - public static final int SIGNALED = 0x9119; - public static final int ALREADY_SIGNALED = 0x911A; - public static final int TIMEOUT_EXPIRED = 0x911B; - public static final int CONDITION_SATISFIED = 0x911C; - public static final int WAIT_FAILED = 0x911D; - public static final long TIMEOUT_IGNORED = 0xFFFFFFFFFFFFFFFFL; - public static final int SYNC_FLUSH_COMMANDS_BIT = 0x00000001; - public static final int SAMPLE_POSITION = 0x8E50; - public static final int SAMPLE_MASK = 0x8E51; - public static final int SAMPLE_MASK_VALUE = 0x8E52; - public static final int MAX_SAMPLE_MASK_WORDS = 0x8E59; - public static final int TEXTURE_2D_MULTISAMPLE = 0x9100; - public static final int PROXY_TEXTURE_2D_MULTISAMPLE = 0x9101; - public static final int TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102; - public static final int PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9103; - public static final int TEXTURE_BINDING_2D_MULTISAMPLE = 0x9104; - public static final int TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 0x9105; - public static final int TEXTURE_SAMPLES = 0x9106; - public static final int TEXTURE_FIXED_SAMPLE_LOCATIONS = 0x9107; - public static final int SAMPLER_2D_MULTISAMPLE = 0x9108; - public static final int INT_SAMPLER_2D_MULTISAMPLE = 0x9109; - public static final int UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 0x910A; - public static final int SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910B; - public static final int INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910C; - public static final int UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910D; - public static final int MAX_COLOR_TEXTURE_SAMPLES = 0x910E; - public static final int MAX_DEPTH_TEXTURE_SAMPLES = 0x910F; - public static final int MAX_INTEGER_SAMPLES = 0x9110; - - static boolean isSupported(GLCapabilities caps) { - return GLLoader.checkAll(caps.glClientWaitSync, caps.glDeleteSync, caps.glDrawElementsBaseVertex, caps.glDrawElementsInstancedBaseVertex, caps.glDrawRangeElementsBaseVertex, caps.glFenceSync, - caps.glFramebufferTexture, caps.glGetBufferParameteri64v, caps.glGetInteger64i_v, caps.glGetInteger64v, caps.glGetMultisamplefv, caps.glGetSynciv, - caps.glIsSync, caps.glMultiDrawElementsBaseVertex, caps.glProvokingVertex, caps.glSampleMaski, caps.glTexImage2DMultisample, caps.glTexImage3DMultisample, - caps.glWaitSync); - } - - static void load(GLCapabilities caps, GLLoadFunc load) { - caps.glClientWaitSync = load.invoke("glClientWaitSync", PIJI); - 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.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.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); - } - - public static int clientWaitSync(MemorySegment sync, int flags, long timeout) { - var caps = GLLoader.getCapabilities(); - try { - return (int) GLLoader.check(caps.glClientWaitSync).invokeExact(sync, flags, timeout); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void deleteSync(MemorySegment sync) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glDeleteSync).invokeExact(sync); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void drawElementsBaseVertex(int mode, int count, int type, MemorySegment indices, int baseVertex) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glDrawElementsBaseVertex).invokeExact(mode, count, type, indices, baseVertex); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void drawElementsBaseVertex(SegmentAllocator allocator, int mode, int count, int type, byte[] indices, int baseVertex) { - drawElementsBaseVertex(mode, count, type, allocator.allocateFrom(JAVA_BYTE, indices), baseVertex); - } - - public static void drawElementsBaseVertex(SegmentAllocator allocator, int mode, int count, int type, short[] indices, int baseVertex) { - drawElementsBaseVertex(mode, count, type, allocator.allocateFrom(JAVA_SHORT, indices), baseVertex); - } - - public static void drawElementsBaseVertex(SegmentAllocator allocator, int mode, int count, int type, int[] indices, int baseVertex) { - drawElementsBaseVertex(mode, count, type, allocator.allocateFrom(JAVA_INT, indices), baseVertex); - } - - public static void drawElementsInstancedBaseVertex(int mode, int count, int type, MemorySegment indices, int instanceCount, int baseVertex) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glDrawElementsInstancedBaseVertex).invokeExact(mode, count, type, indices, instanceCount, baseVertex); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void drawElementsInstancedBaseVertex(SegmentAllocator allocator, int mode, int count, int type, byte[] indices, int instanceCount, int baseVertex) { - drawElementsInstancedBaseVertex(mode, count, type, allocator.allocateFrom(JAVA_BYTE, indices), instanceCount, baseVertex); - } - - public static void drawElementsInstancedBaseVertex(SegmentAllocator allocator, int mode, int count, int type, short[] indices, int instanceCount, int baseVertex) { - drawElementsInstancedBaseVertex(mode, count, type, allocator.allocateFrom(JAVA_SHORT, indices), instanceCount, baseVertex); - } - - public static void drawElementsInstancedBaseVertex(SegmentAllocator allocator, int mode, int count, int type, int[] indices, int instanceCount, int baseVertex) { - drawElementsInstancedBaseVertex(mode, count, type, allocator.allocateFrom(JAVA_INT, indices), instanceCount, baseVertex); +public sealed interface GL32C extends GL31C permits GL33C { + int CONTEXT_CORE_PROFILE_BIT = 0x00000001; + int CONTEXT_COMPATIBILITY_PROFILE_BIT = 0x00000002; + int LINES_ADJACENCY = 0x000A; + int LINE_STRIP_ADJACENCY = 0x000B; + int TRIANGLES_ADJACENCY = 0x000C; + int TRIANGLE_STRIP_ADJACENCY = 0x000D; + int PROGRAM_POINT_SIZE = 0x8642; + int MAX_GEOMETRY_TEXTURE_IMAGE_UNITS = 0x8C29; + int FRAMEBUFFER_ATTACHMENT_LAYERED = 0x8DA7; + int FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 0x8DA8; + int GEOMETRY_SHADER = 0x8DD9; + int GEOMETRY_VERTICES_OUT = 0x8916; + int GEOMETRY_INPUT_TYPE = 0x8917; + int GEOMETRY_OUTPUT_TYPE = 0x8918; + int MAX_GEOMETRY_UNIFORM_COMPONENTS = 0x8DDF; + int MAX_GEOMETRY_OUTPUT_VERTICES = 0x8DE0; + int MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = 0x8DE1; + int MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122; + int MAX_GEOMETRY_INPUT_COMPONENTS = 0x9123; + int MAX_GEOMETRY_OUTPUT_COMPONENTS = 0x9124; + int MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125; + int CONTEXT_PROFILE_MASK = 0x9126; + int DEPTH_CLAMP = 0x864F; + int QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = 0x8E4C; + int FIRST_VERTEX_CONVENTION = 0x8E4D; + int LAST_VERTEX_CONVENTION = 0x8E4E; + int PROVOKING_VERTEX = 0x8E4F; + int TEXTURE_CUBE_MAP_SEAMLESS = 0x884F; + int MAX_SERVER_WAIT_TIMEOUT = 0x9111; + int OBJECT_TYPE = 0x9112; + int SYNC_CONDITION = 0x9113; + int SYNC_STATUS = 0x9114; + int SYNC_FLAGS = 0x9115; + int SYNC_FENCE = 0x9116; + int SYNC_GPU_COMMANDS_COMPLETE = 0x9117; + int UNSIGNALED = 0x9118; + int SIGNALED = 0x9119; + int ALREADY_SIGNALED = 0x911A; + int TIMEOUT_EXPIRED = 0x911B; + int CONDITION_SATISFIED = 0x911C; + int WAIT_FAILED = 0x911D; + long TIMEOUT_IGNORED = 0xFFFFFFFFFFFFFFFFL; + int SYNC_FLUSH_COMMANDS_BIT = 0x00000001; + int SAMPLE_POSITION = 0x8E50; + int SAMPLE_MASK = 0x8E51; + int SAMPLE_MASK_VALUE = 0x8E52; + int MAX_SAMPLE_MASK_WORDS = 0x8E59; + int TEXTURE_2D_MULTISAMPLE = 0x9100; + int PROXY_TEXTURE_2D_MULTISAMPLE = 0x9101; + int TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102; + int PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9103; + int TEXTURE_BINDING_2D_MULTISAMPLE = 0x9104; + int TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 0x9105; + int TEXTURE_SAMPLES = 0x9106; + int TEXTURE_FIXED_SAMPLE_LOCATIONS = 0x9107; + int SAMPLER_2D_MULTISAMPLE = 0x9108; + int INT_SAMPLER_2D_MULTISAMPLE = 0x9109; + int UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 0x910A; + int SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910B; + int INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910C; + int UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910D; + int MAX_COLOR_TEXTURE_SAMPLES = 0x910E; + int MAX_DEPTH_TEXTURE_SAMPLES = 0x910F; + int MAX_INTEGER_SAMPLES = 0x9110; + + @Entrypoint("glClientWaitSync") + default int clientWaitSync(MemorySegment sync, int flags, long timeout) { + throw new ContextException(); + } + + @Entrypoint("glDeleteSync") + default void deleteSync(MemorySegment sync) { + throw new ContextException(); + } + + @Entrypoint("glDrawElementsBaseVertex") + default void drawElementsBaseVertex(int mode, int count, int type, MemorySegment indices, int baseVertex) { + throw new ContextException(); + } + + @Entrypoint("glDrawElementsBaseVertex") + default void drawElementsBaseVertex(SegmentAllocator allocator, int mode, int count, int type, byte[] indices, int baseVertex) { + throw new ContextException(); + } + + @Entrypoint("glDrawElementsBaseVertex") + default void drawElementsBaseVertex(SegmentAllocator allocator, int mode, int count, int type, short[] indices, int baseVertex) { + throw new ContextException(); + } + + @Entrypoint("glDrawElementsBaseVertex") + default void drawElementsBaseVertex(SegmentAllocator allocator, int mode, int count, int type, int[] indices, int baseVertex) { + throw new ContextException(); + } + + @Entrypoint("glDrawElementsInstancedBaseVertex") + default void drawElementsInstancedBaseVertex(int mode, int count, int type, MemorySegment indices, int instanceCount, int baseVertex) { + throw new ContextException(); + } + + @Entrypoint("glDrawElementsInstancedBaseVertex") + default void drawElementsInstancedBaseVertex(SegmentAllocator allocator, int mode, int count, int type, byte[] indices, int instanceCount, int baseVertex) { + throw new ContextException(); + } + + @Entrypoint("glDrawElementsInstancedBaseVertex") + default void drawElementsInstancedBaseVertex(SegmentAllocator allocator, int mode, int count, int type, short[] indices, int instanceCount, int baseVertex) { + throw new ContextException(); + } + + @Entrypoint("glDrawElementsInstancedBaseVertex") + default void drawElementsInstancedBaseVertex(SegmentAllocator allocator, int mode, int count, int type, int[] indices, int instanceCount, int baseVertex) { + throw new ContextException(); } - public static void drawRangeElementsBaseVertex(int mode, int start, int end, int count, int type, MemorySegment indices, int baseVertex) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glDrawRangeElementsBaseVertex).invokeExact(mode, start, end, count, type, indices, baseVertex); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDrawRangeElementsBaseVertex") + default void drawRangeElementsBaseVertex(int mode, int start, int end, int count, int type, MemorySegment indices, int baseVertex) { + throw new ContextException(); } - public static void drawRangeElementsBaseVertex(SegmentAllocator allocator, int mode, int start, int end, int count, int type, byte[] indices, int baseVertex) { - drawRangeElementsBaseVertex(mode, start, end, count, type, allocator.allocateFrom(JAVA_BYTE, indices), baseVertex); + @Entrypoint("glDrawRangeElementsBaseVertex") + default void drawRangeElementsBaseVertex(SegmentAllocator allocator, int mode, int start, int end, int count, int type, byte[] indices, int baseVertex) { + throw new ContextException(); } - public static void drawRangeElementsBaseVertex(SegmentAllocator allocator, int mode, int start, int end, int count, int type, short[] indices, int baseVertex) { - drawRangeElementsBaseVertex(mode, start, end, count, type, allocator.allocateFrom(JAVA_SHORT, indices), baseVertex); + @Entrypoint("glDrawRangeElementsBaseVertex") + default void drawRangeElementsBaseVertex(SegmentAllocator allocator, int mode, int start, int end, int count, int type, short[] indices, int baseVertex) { + throw new ContextException(); } - public static void drawRangeElementsBaseVertex(SegmentAllocator allocator, int mode, int start, int end, int count, int type, int[] indices, int baseVertex) { - drawRangeElementsBaseVertex(mode, start, end, count, type, allocator.allocateFrom(JAVA_INT, indices), baseVertex); + @Entrypoint("glDrawRangeElementsBaseVertex") + default void drawRangeElementsBaseVertex(SegmentAllocator allocator, int mode, int start, int end, int count, int type, int[] indices, int baseVertex) { + throw new ContextException(); } - public static MemorySegment fenceSync(int condition, int flags) { - var caps = GLLoader.getCapabilities(); - try { - return (MemorySegment) GLLoader.check(caps.glFenceSync).invokeExact(condition, flags); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glFenceSync") + default MemorySegment fenceSync(int condition, int flags) { + throw new ContextException(); } - public static void framebufferTexture(int target, int attachment, int texture, int level) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glFramebufferTexture).invokeExact(target, attachment, texture, level); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glFramebufferTexture") + default void framebufferTexture(int target, int attachment, int texture, int level) { + throw new ContextException(); } - public static void getBufferParameteri64v(int target, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetBufferParameteri64v).invokeExact(target, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetBufferParameteri64v") + default void getBufferParameteri64v(int target, int pname, MemorySegment params) { + throw new ContextException(); } - public static long getBufferParameteri64(int target, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocLong(); + @Skip + default long getBufferParameteri64v(int target, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.longs(0L); getBufferParameteri64v(target, pname, seg); return seg.get(JAVA_LONG, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getInteger64i_v(int target, int index, MemorySegment data) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetInteger64i_v).invokeExact(target, index, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetInteger64i_v") + default void getInteger64i_v(int target, int index, MemorySegment data) { + throw new ContextException(); } - public static void getInteger64i_v(SegmentAllocator allocator, int target, int index, long[] data) { - var seg = allocator.allocateFrom(JAVA_LONG, data); - getInteger64i_v(target, index, seg); - RuntimeHelper.toArray(seg, data); + @Entrypoint("glGetInteger64i_v") + default void getInteger64i_v(SegmentAllocator allocator, int target, int index, @Ref long[] data) { + throw new ContextException(); } - public static long getInteger64i(int target, int index) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocLong(); + @Skip + default long getInteger64i_v(int target, int index) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.longs(0L); getInteger64i_v(target, index, seg); return seg.get(JAVA_LONG, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getInteger64v(int pname, MemorySegment data) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetInteger64v).invokeExact(pname, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetInteger64v") + default void getInteger64v(int pname, MemorySegment data) { + throw new ContextException(); } - public static void getInteger64v(SegmentAllocator allocator, int pname, long[] data) { - var pData = allocator.allocateFrom(JAVA_LONG, data); - getInteger64v(pname, pData); - RuntimeHelper.toArray(pData, data); + @Entrypoint("glGetInteger64v") + default void getInteger64v(SegmentAllocator allocator, int pname, @Ref long[] data) { + throw new ContextException(); } - public static long getInteger64(int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pData = stack.callocLong(); + @Skip + default long getInteger64v(int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pData = stack.longs(0L); getInteger64v(pname, pData); return pData.get(JAVA_LONG, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getMultisamplefv(int pname, int index, MemorySegment val) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetMultisamplefv).invokeExact(pname, index, val); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetMultisamplefv") + default void getMultisamplefv(int pname, int index, MemorySegment val) { + throw new ContextException(); } - public static void getMultisamplefv(SegmentAllocator allocator, int pname, int index, float[] val) { - var seg = allocator.allocateFrom(JAVA_FLOAT, val); - getMultisamplefv(pname, index, seg); - RuntimeHelper.toArray(seg, val); + @Entrypoint("glGetMultisamplefv") + default void getMultisamplefv(SegmentAllocator allocator, int pname, int index, @Ref float[] val) { + throw new ContextException(); } - public static float[] getMultisamplefv(SegmentAllocator allocator, int pname, int index) { - var seg = allocator.allocate(JAVA_FLOAT, 2); - getMultisamplefv(pname, index, seg); - return new float[]{seg.get(JAVA_FLOAT, 0), seg.getAtIndex(JAVA_FLOAT, 1)}; + @Skip + default float[] getMultisamplefv(int pname, int index) { + try (MemoryStack stack = MemoryStack.stackPush()) { + float[] val = new float[2]; + getMultisamplefv(stack, pname, index, val); + return val; + } } - public static void getSynciv(MemorySegment sync, int pname, int count, MemorySegment length, MemorySegment values) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetSynciv).invokeExact(sync, pname, count, length, values); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetSynciv") + default void getSynciv(MemorySegment sync, int pname, int count, MemorySegment length, MemorySegment values) { + throw new ContextException(); } - public static void getSynciv(SegmentAllocator allocator, MemorySegment sync, int pname, int @Nullable [] length, int[] values) { - var pLen = length != null ? allocator.allocate(JAVA_INT) : MemorySegment.NULL; - var pVal = allocator.allocateFrom(JAVA_INT, values); + @Skip + default void getSynciv(SegmentAllocator allocator, MemorySegment sync, int pname, @Ref int @Nullable [] length, @Ref int[] values) { + var pLen = Marshal.marshal(allocator, length); + var pVal = Marshal.marshal(allocator, values); getSynciv(sync, pname, values.length, pLen, pVal); - if (length != null && length.length > 0) { - length[0] = pLen.get(JAVA_INT, 0); - } - RuntimeHelper.toArray(pVal, values); + Unmarshal.copy(pLen, length); + Unmarshal.copy(pVal, values); } - public static int getSynci(MemorySegment sync, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getSynciv(MemorySegment sync, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getSynciv(sync, pname, 1, MemorySegment.NULL, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static boolean isSync(MemorySegment sync) { - var caps = GLLoader.getCapabilities(); - try { - return (boolean) GLLoader.check(caps.glIsSync).invokeExact(sync); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIsSync") + default boolean isSync(MemorySegment sync) { + throw new ContextException(); } - public static void multiDrawElementsBaseVertex(int mode, MemorySegment count, int type, MemorySegment indices, int drawCount, MemorySegment baseVertex) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glMultiDrawElementsBaseVertex).invokeExact(mode, count, type, indices, drawCount, baseVertex); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiDrawElementsBaseVertex") + default void multiDrawElementsBaseVertex(int mode, MemorySegment count, int type, MemorySegment indices, int drawCount, MemorySegment baseVertex) { + throw new ContextException(); } - public static void multiDrawElementsBaseVertex(SegmentAllocator allocator, int mode, int[] count, int type, MemorySegment[] indices, int drawCount, int[] baseVertex) { - var seg = allocator.allocate(ADDRESS, indices.length); - for (int i = 0; i < indices.length; i++) { - seg.setAtIndex(ADDRESS, i, indices[i]); - } - multiDrawElementsBaseVertex(mode, allocator.allocateFrom(JAVA_INT, count), type, seg, drawCount, allocator.allocateFrom(JAVA_INT, baseVertex)); + @Entrypoint("glMultiDrawElementsBaseVertex") + default void multiDrawElementsBaseVertex(SegmentAllocator allocator, int mode, int[] count, int type, MemorySegment[] indices, int drawCount, int[] baseVertex) { + throw new ContextException(); } - public static void multiDrawElementsBaseVertex(SegmentAllocator allocator, int mode, int[] count, int type, byte[][] indices, int drawCount, int[] baseVertex) { + @Skip + default void multiDrawElementsBaseVertex(SegmentAllocator allocator, int mode, int[] count, int type, byte[][] indices, int drawCount, int[] baseVertex) { var seg = allocator.allocate(ADDRESS, indices.length); for (int i = 0; i < indices.length; i++) { - seg.setAtIndex(ADDRESS, i, allocator.allocateFrom(JAVA_BYTE, indices[i])); + seg.setAtIndex(ADDRESS, i, Marshal.marshal(allocator, indices[i])); } - multiDrawElementsBaseVertex(mode, allocator.allocateFrom(JAVA_INT, count), type, seg, drawCount, allocator.allocateFrom(JAVA_INT, baseVertex)); + multiDrawElementsBaseVertex(mode, Marshal.marshal(allocator, count), type, seg, drawCount, Marshal.marshal(allocator, baseVertex)); } - public static void multiDrawElementsBaseVertex(SegmentAllocator allocator, int mode, int[] count, int type, short[][] indices, int drawCount, int[] baseVertex) { + @Skip + default void multiDrawElementsBaseVertex(SegmentAllocator allocator, int mode, int[] count, int type, short[][] indices, int drawCount, int[] baseVertex) { var seg = allocator.allocate(ADDRESS, indices.length); for (int i = 0; i < indices.length; i++) { - seg.setAtIndex(ADDRESS, i, allocator.allocateFrom(JAVA_SHORT, indices[i])); + seg.setAtIndex(ADDRESS, i, Marshal.marshal(allocator, indices[i])); } - multiDrawElementsBaseVertex(mode, allocator.allocateFrom(JAVA_INT, count), type, seg, drawCount, allocator.allocateFrom(JAVA_INT, baseVertex)); + multiDrawElementsBaseVertex(mode, Marshal.marshal(allocator, count), type, seg, drawCount, Marshal.marshal(allocator, baseVertex)); } - public static void multiDrawElementsBaseVertex(SegmentAllocator allocator, int mode, int[] count, int type, int[][] indices, int drawCount, int[] baseVertex) { + @Skip + default void multiDrawElementsBaseVertex(SegmentAllocator allocator, int mode, int[] count, int type, int[][] indices, int drawCount, int[] baseVertex) { var seg = allocator.allocate(ADDRESS, indices.length); for (int i = 0; i < indices.length; i++) { - seg.setAtIndex(ADDRESS, i, allocator.allocateFrom(JAVA_INT, indices[i])); + seg.setAtIndex(ADDRESS, i, Marshal.marshal(allocator, indices[i])); } - multiDrawElementsBaseVertex(mode, allocator.allocateFrom(JAVA_INT, count), type, seg, drawCount, allocator.allocateFrom(JAVA_INT, baseVertex)); + multiDrawElementsBaseVertex(mode, Marshal.marshal(allocator, count), type, seg, drawCount, Marshal.marshal(allocator, baseVertex)); } - public static void provokingVertex(int mode) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glProvokingVertex).invokeExact(mode); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProvokingVertex") + default void provokingVertex(int mode) { + throw new ContextException(); } - public static void sampleMaski(int maskNumber, int mask) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glSampleMaski).invokeExact(maskNumber, mask); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSampleMaski") + default void sampleMaski(int maskNumber, int mask) { + throw new ContextException(); } - public static void texImage2DMultisample(int target, int samples, int internalFormat, int width, int height, boolean fixedSampleLocations) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTexImage2DMultisample).invokeExact(target, samples, internalFormat, width, height, fixedSampleLocations); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexImage2DMultisample") + default void texImage2DMultisample(int target, int samples, int internalFormat, int width, int height, boolean fixedSampleLocations) { + throw new ContextException(); } - public static void texImage3DMultisample(int target, int samples, int internalFormat, int width, int height, int depth, boolean fixedSampleLocations) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTexImage3DMultisample).invokeExact(target, samples, internalFormat, width, height, depth, fixedSampleLocations); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexImage3DMultisample") + default void texImage3DMultisample(int target, int samples, int internalFormat, int width, int height, int depth, boolean fixedSampleLocations) { + throw new ContextException(); } - public static void waitSync(MemorySegment sync, int flags, long timeout) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glWaitSync).invokeExact(sync, flags, timeout); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glWaitSync") + default void waitSync(MemorySegment sync, int flags, long timeout) { + throw new ContextException(); } } 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 9f6ebca3..3d61f403 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL33C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL33C.java @@ -16,16 +16,18 @@ package overrungl.opengl; +import overrun.marshal.Marshal; +import overrun.marshal.MemoryStack; +import overrun.marshal.Unmarshal; +import overrun.marshal.gen.Entrypoint; +import overrun.marshal.gen.Ref; +import overrun.marshal.gen.Skip; import overrungl.opengl.ext.arb.GLARBInstancedArrays; -import overrungl.internal.RuntimeHelper; -import overrungl.util.MemoryStack; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; import static java.lang.foreign.ValueLayout.*; -import static overrungl.FunctionDescriptors.*; -import static overrungl.opengl.GLLoader.*; /** * The OpenGL 3.3 core profile functions. @@ -42,492 +44,308 @@ * @author squid233 * @since 0.1.0 */ -public sealed class GL33C extends GL32C permits GL40C { - public static final int VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE; - public static final int SRC1_COLOR = 0x88F9; - public static final int ONE_MINUS_SRC1_COLOR = 0x88FA; - public static final int ONE_MINUS_SRC1_ALPHA = 0x88FB; - public static final int MAX_DUAL_SOURCE_DRAW_BUFFERS = 0x88FC; - public static final int ANY_SAMPLES_PASSED = 0x8C2F; - public static final int SAMPLER_BINDING = 0x8919; - public static final int RGB10_A2UI = 0x906F; - public static final int TEXTURE_SWIZZLE_R = 0x8E42; - public static final int TEXTURE_SWIZZLE_G = 0x8E43; - public static final int TEXTURE_SWIZZLE_B = 0x8E44; - public static final int TEXTURE_SWIZZLE_A = 0x8E45; - public static final int TEXTURE_SWIZZLE_RGBA = 0x8E46; - public static final int TIME_ELAPSED = 0x88BF; - public static final int TIMESTAMP = 0x8E28; - public static final int INT_2_10_10_10_REV = 0x8D9F; - - static boolean isSupported(GLCapabilities caps) { - return checkAll(caps.glBindFragDataLocationIndexed, caps.glBindSampler, caps.glDeleteSamplers, caps.glGenSamplers, caps.glGetFragDataIndex, caps.glGetQueryObjecti64v, - caps.glGetQueryObjectui64v, caps.glGetSamplerParameterIiv, caps.glGetSamplerParameterIuiv, caps.glGetSamplerParameterfv, caps.glGetSamplerParameteriv, caps.glIsSampler, - caps.glQueryCounter, caps.glSamplerParameterIiv, caps.glSamplerParameterIuiv, caps.glSamplerParameterf, caps.glSamplerParameterfv, caps.glSamplerParameteri, - caps.glSamplerParameteriv, caps.glVertexAttribDivisor, caps.glVertexAttribP1ui, caps.glVertexAttribP1uiv, caps.glVertexAttribP2ui, caps.glVertexAttribP2uiv, - caps.glVertexAttribP3ui, caps.glVertexAttribP3uiv, caps.glVertexAttribP4ui, caps.glVertexAttribP4uiv); - } - - static void load(GLCapabilities caps, GLLoadFunc load) { - caps.glBindFragDataLocationIndexed = load.invoke("glBindFragDataLocationIndexed", IIIPV); - caps.glBindSampler = load.invoke("glBindSampler", IIV); - 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.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); - caps.glVertexAttribP2ui = load.invoke("glVertexAttribP2ui", IIZIV); - caps.glVertexAttribP2uiv = load.invoke("glVertexAttribP2uiv", IIZPV); - caps.glVertexAttribP3ui = load.invoke("glVertexAttribP3ui", IIZIV); - caps.glVertexAttribP3uiv = load.invoke("glVertexAttribP3uiv", IIZPV); - caps.glVertexAttribP4ui = load.invoke("glVertexAttribP4ui", IIZIV); - caps.glVertexAttribP4uiv = load.invoke("glVertexAttribP4uiv", IIZPV); - } - - public static void bindFragDataLocationIndexed(int program, int colorNumber, int index, MemorySegment name) { - var caps = getCapabilities(); - try { - check(caps.glBindFragDataLocationIndexed).invokeExact(program, colorNumber, index, name); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } +public sealed interface GL33C extends GL32C permits GL40C { + int VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE; + int SRC1_COLOR = 0x88F9; + int ONE_MINUS_SRC1_COLOR = 0x88FA; + int ONE_MINUS_SRC1_ALPHA = 0x88FB; + int MAX_DUAL_SOURCE_DRAW_BUFFERS = 0x88FC; + int ANY_SAMPLES_PASSED = 0x8C2F; + int SAMPLER_BINDING = 0x8919; + int RGB10_A2UI = 0x906F; + int TEXTURE_SWIZZLE_R = 0x8E42; + int TEXTURE_SWIZZLE_G = 0x8E43; + int TEXTURE_SWIZZLE_B = 0x8E44; + int TEXTURE_SWIZZLE_A = 0x8E45; + int TEXTURE_SWIZZLE_RGBA = 0x8E46; + int TIME_ELAPSED = 0x88BF; + int TIMESTAMP = 0x8E28; + int INT_2_10_10_10_REV = 0x8D9F; - public static void bindFragDataLocationIndexed(int program, int colorNumber, int index, String name) { - final MemoryStack stack = MemoryStack.stackGet(); - final long stackPointer = stack.getPointer(); - try { - bindFragDataLocationIndexed(program, colorNumber, index, stack.allocateFrom(name)); - } finally { - stack.setPointer(stackPointer); - } + @Entrypoint("glBindFragDataLocationIndexed") + default void bindFragDataLocationIndexed(int program, int colorNumber, int index, MemorySegment name) { + throw new ContextException(); } - public static void bindSampler(int unit, int sampler) { - var caps = getCapabilities(); - try { - check(caps.glBindSampler).invokeExact(unit, sampler); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glBindFragDataLocationIndexed") + default void bindFragDataLocationIndexed(int program, int colorNumber, int index, String name) { + throw new ContextException(); } - public static void deleteSamplers(int count, MemorySegment samplers) { - var caps = getCapabilities(); - try { - check(caps.glDeleteSamplers).invokeExact(count, samplers); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glBindSampler") + default void bindSampler(int unit, int sampler) { + throw new ContextException(); } - public static void deleteSamplers(SegmentAllocator allocator, int[] samplers) { - deleteSamplers(samplers.length, allocator.allocateFrom(JAVA_INT, samplers)); + @Entrypoint("glDeleteSamplers") + default void deleteSamplers(int count, MemorySegment samplers) { + throw new ContextException(); } - public static void deleteSampler(int sampler) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - deleteSamplers(1, stack.ints(sampler)); - } finally { - stack.setPointer(stackPointer); + @Skip + default void deleteSamplers(int... samplers) { + try (MemoryStack stack = MemoryStack.stackPush()) { + deleteSamplers(samplers.length, Marshal.marshal(stack, samplers)); } } - public static void genSamplers(int count, MemorySegment samplers) { - var caps = getCapabilities(); - try { - check(caps.glGenSamplers).invokeExact(count, samplers); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGenSamplers") + default void genSamplers(int count, MemorySegment samplers) { + throw new ContextException(); } - public static void genSamplers(SegmentAllocator allocator, int[] samplers) { - var seg = allocator.allocateFrom(JAVA_INT, samplers); - genSamplers(samplers.length, seg); - RuntimeHelper.toArray(seg, samplers); + @Skip + default void genSamplers(SegmentAllocator allocator, @Ref int[] samplers) { + final MemorySegment segment = Marshal.marshal(allocator, samplers); + genSamplers(samplers.length, segment); + Unmarshal.copy(segment, samplers); } - public static int genSampler() { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int genSamplers() { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); genSamplers(1, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static int getFragDataIndex(int program, MemorySegment name) { - var caps = getCapabilities(); - try { - return (int) check(caps.glGetFragDataIndex).invokeExact(program, name); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetFragDataIndex") + default int getFragDataIndex(int program, MemorySegment name) { + throw new ContextException(); } - public static int getFragDataIndex(int program, String name) { - final MemoryStack stack = MemoryStack.stackGet(); - final long stackPointer = stack.getPointer(); - try { - return getFragDataIndex(program, stack.allocateFrom(name)); - } finally { - stack.setPointer(stackPointer); - } + @Entrypoint("glGetFragDataIndex") + default int getFragDataIndex(int program, String name) { + throw new ContextException(); } - public static void getQueryObjecti64v(int id, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetQueryObjecti64v).invokeExact(id, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetQueryObjecti64v") + default void getQueryObjecti64v(int id, int pname, MemorySegment params) { + throw new ContextException(); } - public static long getQueryObjecti64(int id, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocLong(); + @Skip + default long getQueryObjecti64v(int id, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.longs(0L); getQueryObjecti64v(id, pname, seg); return seg.get(JAVA_LONG, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getQueryObjectui64v(int id, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetQueryObjectui64v).invokeExact(id, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetQueryObjectui64v") + default void getQueryObjectui64v(int id, int pname, MemorySegment params) { + throw new ContextException(); } - public static long getQueryObjectui64(int id, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocLong(); + @Skip + default long getQueryObjectui64v(int id, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.longs(0); getQueryObjectui64v(id, pname, seg); return seg.get(JAVA_LONG, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getSamplerParameterIiv(int sampler, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetSamplerParameterIiv).invokeExact(sampler, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetSamplerParameterIiv") + default void getSamplerParameterIiv(int sampler, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getSamplerParameterIiv(SegmentAllocator allocator, int sampler, int pname, int[] params) { - var seg = allocator.allocateFrom(JAVA_INT, params); - getSamplerParameterIiv(sampler, pname, seg); - RuntimeHelper.toArray(seg, params); + @Entrypoint("glGetSamplerParameterIiv") + default void getSamplerParameterIiv(SegmentAllocator allocator, int sampler, int pname, @Ref int[] params) { + throw new ContextException(); } - public static int getSamplerParameterIi(int sampler, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getSamplerParameterIiv(int sampler, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getSamplerParameterIiv(sampler, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getSamplerParameterIuiv(int sampler, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetSamplerParameterIuiv).invokeExact(sampler, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetSamplerParameterIuiv") + default void getSamplerParameterIuiv(int sampler, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getSamplerParameterIuiv(SegmentAllocator allocator, int sampler, int pname, int[] params) { - var seg = allocator.allocateFrom(JAVA_INT, params); - getSamplerParameterIuiv(sampler, pname, seg); - RuntimeHelper.toArray(seg, params); + @Entrypoint("glGetSamplerParameterIuiv") + default void getSamplerParameterIuiv(SegmentAllocator allocator, int sampler, int pname, @Ref int[] params) { + throw new ContextException(); } - public static int getSamplerParameterIui(int sampler, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getSamplerParameterIuiv(int sampler, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getSamplerParameterIuiv(sampler, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getSamplerParameterfv(int sampler, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetSamplerParameterfv).invokeExact(sampler, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetSamplerParameterfv") + default void getSamplerParameterfv(int sampler, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getSamplerParameterfv(SegmentAllocator allocator, int sampler, int pname, float[] params) { - var seg = allocator.allocateFrom(JAVA_FLOAT, params); - getSamplerParameterfv(sampler, pname, seg); - RuntimeHelper.toArray(seg, params); + @Entrypoint("glGetSamplerParameterfv") + default void getSamplerParameterfv(SegmentAllocator allocator, int sampler, int pname, @Ref float[] params) { + throw new ContextException(); } - public static float getSamplerParameterf(int sampler, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocFloat(); + @Skip + default float getSamplerParameterf(int sampler, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.floats(0F); getSamplerParameterfv(sampler, pname, seg); return seg.get(JAVA_FLOAT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getSamplerParameteriv(int sampler, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetSamplerParameteriv).invokeExact(sampler, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetSamplerParameteriv") + default void getSamplerParameteriv(int sampler, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getSamplerParameteriv(SegmentAllocator allocator, int sampler, int pname, int[] params) { - var seg = allocator.allocateFrom(JAVA_INT, params); - getSamplerParameteriv(sampler, pname, seg); - RuntimeHelper.toArray(seg, params); + @Entrypoint("glGetSamplerParameteriv") + default void getSamplerParameteriv(SegmentAllocator allocator, int sampler, int pname, @Ref int[] params) { + throw new ContextException(); } - public static int getSamplerParameteri(int sampler, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getSamplerParameteri(int sampler, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getSamplerParameteriv(sampler, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static boolean isSampler(int sampler) { - var caps = getCapabilities(); - try { - return (boolean) check(caps.glIsSampler).invokeExact(sampler); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIsSampler") + default boolean isSampler(int sampler) { + throw new ContextException(); } - public static void queryCounter(int id, int target) { - var caps = getCapabilities(); - try { - check(caps.glQueryCounter).invokeExact(id, target); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glQueryCounter") + default void queryCounter(int id, int target) { + throw new ContextException(); } - public static void samplerParameterIiv(int sampler, int pname, MemorySegment param) { - var caps = getCapabilities(); - try { - check(caps.glSamplerParameterIiv).invokeExact(sampler, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSamplerParameterIiv") + default void samplerParameterIiv(int sampler, int pname, MemorySegment param) { + throw new ContextException(); } - public static void samplerParameterIiv(SegmentAllocator allocator, int sampler, int pname, int[] param) { - samplerParameterIiv(sampler, pname, allocator.allocateFrom(JAVA_INT, param)); + @Entrypoint("glSamplerParameterIiv") + default void samplerParameterIiv(SegmentAllocator allocator, int sampler, int pname, int[] param) { + throw new ContextException(); } - public static void samplerParameterIuiv(int sampler, int pname, MemorySegment param) { - var caps = getCapabilities(); - try { - check(caps.glSamplerParameterIuiv).invokeExact(sampler, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSamplerParameterIuiv") + default void samplerParameterIuiv(int sampler, int pname, MemorySegment param) { + throw new ContextException(); } - public static void samplerParameterIuiv(SegmentAllocator allocator, int sampler, int pname, int[] param) { - samplerParameterIuiv(sampler, pname, allocator.allocateFrom(JAVA_INT, param)); + @Entrypoint("glSamplerParameterIuiv") + default void samplerParameterIuiv(SegmentAllocator allocator, int sampler, int pname, int[] param) { + throw new ContextException(); } - public static void samplerParameterf(int sampler, int pname, int param) { - var caps = getCapabilities(); - try { - check(caps.glSamplerParameterf).invokeExact(sampler, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSamplerParameterf") + default void samplerParameterf(int sampler, int pname, float param) { + throw new ContextException(); } - public static void samplerParameterfv(int sampler, int pname, MemorySegment param) { - var caps = getCapabilities(); - try { - check(caps.glSamplerParameterfv).invokeExact(sampler, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSamplerParameterfv") + default void samplerParameterfv(int sampler, int pname, MemorySegment param) { + throw new ContextException(); } - public static void samplerParameterfv(SegmentAllocator allocator, int sampler, int pname, int[] param) { - samplerParameterfv(sampler, pname, allocator.allocateFrom(JAVA_INT, param)); + @Entrypoint("glSamplerParameterfv") + default void samplerParameterfv(SegmentAllocator allocator, int sampler, int pname, float[] param) { + throw new ContextException(); } - public static void samplerParameteri(int sampler, int pname, int param) { - var caps = getCapabilities(); - try { - check(caps.glSamplerParameteri).invokeExact(sampler, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSamplerParameteri") + default void samplerParameteri(int sampler, int pname, int param) { + throw new ContextException(); } - public static void samplerParameteriv(int sampler, int pname, MemorySegment param) { - var caps = getCapabilities(); - try { - check(caps.glSamplerParameteriv).invokeExact(sampler, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSamplerParameteriv") + default void samplerParameteriv(int sampler, int pname, MemorySegment param) { + throw new ContextException(); } - public static void samplerParameteriv(SegmentAllocator allocator, int sampler, int pname, int[] param) { - samplerParameteriv(sampler, pname, allocator.allocateFrom(JAVA_INT, param)); + @Entrypoint("glSamplerParameteriv") + default void samplerParameteriv(SegmentAllocator allocator, int sampler, int pname, int[] param) { + throw new ContextException(); } - public static void vertexAttribDivisor(int index, int divisor) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribDivisor).invokeExact(index, divisor); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribDivisor") + default void vertexAttribDivisor(int index, int divisor) { + throw new ContextException(); } - public static void vertexAttribP1ui(int index, int type, boolean normalized, int value) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribP1ui).invokeExact(index, type, normalized, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribP1ui") + default void vertexAttribP1ui(int index, int type, boolean normalized, int value) { + throw new ContextException(); } - public static void vertexAttribP1uiv(int index, int type, boolean normalized, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribP1uiv).invokeExact(index, type, normalized, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribP1uiv") + default void vertexAttribP1uiv(int index, int type, boolean normalized, MemorySegment value) { + throw new ContextException(); } - public static void vertexAttribP1uiv(SegmentAllocator allocator, int index, int type, boolean normalized, int[] value) { - vertexAttribP1uiv(index, type, normalized, allocator.allocateFrom(JAVA_INT, value)); + @Entrypoint("glVertexAttribP1uiv") + default void vertexAttribP1uiv(SegmentAllocator allocator, int index, int type, boolean normalized, int[] value) { + throw new ContextException(); } - public static void vertexAttribP2ui(int index, int type, boolean normalized, int value) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribP2ui).invokeExact(index, type, normalized, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribP2ui") + default void vertexAttribP2ui(int index, int type, boolean normalized, int value) { + throw new ContextException(); } - public static void vertexAttribP2uiv(int index, int type, boolean normalized, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribP2uiv).invokeExact(index, type, normalized, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribP2uiv") + default void vertexAttribP2uiv(int index, int type, boolean normalized, MemorySegment value) { + throw new ContextException(); } - public static void vertexAttribP2uiv(SegmentAllocator allocator, int index, int type, boolean normalized, int[] value) { - vertexAttribP2uiv(index, type, normalized, allocator.allocateFrom(JAVA_INT, value)); + @Entrypoint("glVertexAttribP2uiv") + default void vertexAttribP2uiv(SegmentAllocator allocator, int index, int type, boolean normalized, int[] value) { + throw new ContextException(); } - public static void vertexAttribP3ui(int index, int type, boolean normalized, int value) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribP3ui).invokeExact(index, type, normalized, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribP3ui") + default void vertexAttribP3ui(int index, int type, boolean normalized, int value) { + throw new ContextException(); } - public static void vertexAttribP3uiv(int index, int type, boolean normalized, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribP3uiv).invokeExact(index, type, normalized, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribP3uiv") + default void vertexAttribP3uiv(int index, int type, boolean normalized, MemorySegment value) { + throw new ContextException(); } - public static void vertexAttribP3uiv(SegmentAllocator allocator, int index, int type, boolean normalized, int[] value) { - vertexAttribP3uiv(index, type, normalized, allocator.allocateFrom(JAVA_INT, value)); + @Entrypoint("glVertexAttribP3uiv") + default void vertexAttribP3uiv(SegmentAllocator allocator, int index, int type, boolean normalized, int[] value) { + throw new ContextException(); } - public static void vertexAttribP4ui(int index, int type, boolean normalized, int value) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribP4ui).invokeExact(index, type, normalized, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribP4ui") + default void vertexAttribP4ui(int index, int type, boolean normalized, int value) { + throw new ContextException(); } - public static void vertexAttribP4uiv(int index, int type, boolean normalized, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribP4uiv).invokeExact(index, type, normalized, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribP4uiv") + default void vertexAttribP4uiv(int index, int type, boolean normalized, MemorySegment value) { + throw new ContextException(); } - public static void vertexAttribP4uiv(SegmentAllocator allocator, int index, int type, boolean normalized, int[] value) { - vertexAttribP4uiv(index, type, normalized, allocator.allocateFrom(JAVA_INT, value)); + @Entrypoint("glVertexAttribP4uiv") + default void vertexAttribP4uiv(SegmentAllocator allocator, int index, int type, boolean normalized, int[] value) { + throw new ContextException(); } } 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 c1a36a3a..8d71dddd 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL40C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL40C.java @@ -16,19 +16,21 @@ package overrungl.opengl; +import overrun.marshal.Marshal; +import overrun.marshal.MemoryStack; +import overrun.marshal.Unmarshal; +import overrun.marshal.gen.Entrypoint; +import overrun.marshal.gen.Ref; +import overrun.marshal.gen.Skip; import overrungl.opengl.ext.arb.GLARBDrawBuffersBlend; import overrungl.opengl.ext.arb.GLARBSampleShading; import overrungl.opengl.ext.arb.GLARBTextureCubeMapArray; import overrungl.opengl.ext.arb.GLARBTextureGather; -import overrungl.internal.RuntimeHelper; -import overrungl.util.MemoryStack; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; import static java.lang.foreign.ValueLayout.*; -import static overrungl.FunctionDescriptors.*; -import static overrungl.opengl.GLLoader.*; /** * The OpenGL 4.0 core profile functions. @@ -50,798 +52,556 @@ * @author squid233 * @since 0.1.0 */ -public sealed class GL40C extends GL33C permits GL41C { - public static final int SAMPLE_SHADING = 0x8C36; - public static final int MIN_SAMPLE_SHADING_VALUE = 0x8C37; - public static final int MIN_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5E; - public static final int MAX_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5F; - public static final int TEXTURE_CUBE_MAP_ARRAY = 0x9009; - public static final int TEXTURE_BINDING_CUBE_MAP_ARRAY = 0x900A; - public static final int PROXY_TEXTURE_CUBE_MAP_ARRAY = 0x900B; - public static final int SAMPLER_CUBE_MAP_ARRAY = 0x900C; - public static final int SAMPLER_CUBE_MAP_ARRAY_SHADOW = 0x900D; - public static final int INT_SAMPLER_CUBE_MAP_ARRAY = 0x900E; - public static final int UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY = 0x900F; - public static final int DRAW_INDIRECT_BUFFER = 0x8F3F; - public static final int DRAW_INDIRECT_BUFFER_BINDING = 0x8F43; - public static final int GEOMETRY_SHADER_INVOCATIONS = 0x887F; - public static final int MAX_GEOMETRY_SHADER_INVOCATIONS = 0x8E5A; - public static final int MIN_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5B; - public static final int MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C; - public static final int FRAGMENT_INTERPOLATION_OFFSET_BITS = 0x8E5D; - public static final int MAX_VERTEX_STREAMS = 0x8E71; - public static final int DOUBLE_VEC2 = 0x8FFC; - public static final int DOUBLE_VEC3 = 0x8FFD; - public static final int DOUBLE_VEC4 = 0x8FFE; - public static final int DOUBLE_MAT2 = 0x8F46; - public static final int DOUBLE_MAT3 = 0x8F47; - public static final int DOUBLE_MAT4 = 0x8F48; - public static final int DOUBLE_MAT2x3 = 0x8F49; - public static final int DOUBLE_MAT2x4 = 0x8F4A; - public static final int DOUBLE_MAT3x2 = 0x8F4B; - public static final int DOUBLE_MAT3x4 = 0x8F4C; - public static final int DOUBLE_MAT4x2 = 0x8F4D; - public static final int DOUBLE_MAT4x3 = 0x8F4E; - public static final int ACTIVE_SUBROUTINES = 0x8DE5; - public static final int ACTIVE_SUBROUTINE_UNIFORMS = 0x8DE6; - public static final int ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = 0x8E47; - public static final int ACTIVE_SUBROUTINE_MAX_LENGTH = 0x8E48; - public static final int ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = 0x8E49; - public static final int MAX_SUBROUTINES = 0x8DE7; - public static final int MAX_SUBROUTINE_UNIFORM_LOCATIONS = 0x8DE8; - public static final int NUM_COMPATIBLE_SUBROUTINES = 0x8E4A; - public static final int COMPATIBLE_SUBROUTINES = 0x8E4B; - public static final int PATCHES = 0x000E; - public static final int PATCH_VERTICES = 0x8E72; - public static final int PATCH_DEFAULT_INNER_LEVEL = 0x8E73; - public static final int PATCH_DEFAULT_OUTER_LEVEL = 0x8E74; - public static final int TESS_CONTROL_OUTPUT_VERTICES = 0x8E75; - public static final int TESS_GEN_MODE = 0x8E76; - public static final int TESS_GEN_SPACING = 0x8E77; - public static final int TESS_GEN_VERTEX_ORDER = 0x8E78; - public static final int TESS_GEN_POINT_MODE = 0x8E79; - public static final int ISOLINES = 0x8E7A; - public static final int FRACTIONAL_ODD = 0x8E7B; - public static final int FRACTIONAL_EVEN = 0x8E7C; - public static final int MAX_PATCH_VERTICES = 0x8E7D; - public static final int MAX_TESS_GEN_LEVEL = 0x8E7E; - public static final int MAX_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E7F; - public static final int MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E80; - public static final int MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = 0x8E81; - public static final int MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = 0x8E82; - public static final int MAX_TESS_CONTROL_OUTPUT_COMPONENTS = 0x8E83; - public static final int MAX_TESS_PATCH_COMPONENTS = 0x8E84; - public static final int MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = 0x8E85; - public static final int MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = 0x8E86; - public static final int MAX_TESS_CONTROL_UNIFORM_BLOCKS = 0x8E89; - public static final int MAX_TESS_EVALUATION_UNIFORM_BLOCKS = 0x8E8A; - public static final int MAX_TESS_CONTROL_INPUT_COMPONENTS = 0x886C; - public static final int MAX_TESS_EVALUATION_INPUT_COMPONENTS = 0x886D; - public static final int MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E1E; - public static final int MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E1F; - public static final int UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER = 0x84F0; - public static final int UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x84F1; - public static final int TESS_EVALUATION_SHADER = 0x8E87; - public static final int TESS_CONTROL_SHADER = 0x8E88; - public static final int TRANSFORM_FEEDBACK = 0x8E22; - public static final int TRANSFORM_FEEDBACK_BUFFER_PAUSED = 0x8E23; - public static final int TRANSFORM_FEEDBACK_BUFFER_ACTIVE = 0x8E24; - public static final int TRANSFORM_FEEDBACK_BINDING = 0x8E25; - public static final int MAX_TRANSFORM_FEEDBACK_BUFFERS = 0x8E70; - - static boolean isSupported(GLCapabilities caps) { - return checkAll(caps.glBeginQueryIndexed, caps.glBindTransformFeedback, caps.glBlendEquationSeparatei, caps.glBlendEquationi, caps.glBlendFuncSeparatei, caps.glBlendFunci, - caps.glDeleteTransformFeedbacks, caps.glDrawArraysIndirect, caps.glDrawElementsIndirect, caps.glDrawTransformFeedback, caps.glDrawTransformFeedbackStream, caps.glEndQueryIndexed, - caps.glGenTransformFeedbacks, caps.glGetActiveSubroutineName, caps.glGetActiveSubroutineUniformName, caps.glGetActiveSubroutineUniformiv, caps.glGetProgramStageiv, caps.glGetQueryIndexediv, - caps.glGetSubroutineIndex, caps.glGetSubroutineUniformLocation, caps.glGetUniformSubroutineuiv, caps.glGetUniformdv, caps.glIsTransformFeedback, caps.glMinSampleShading, - caps.glPatchParameterfv, caps.glPatchParameteri, caps.glPauseTransformFeedback, caps.glResumeTransformFeedback, caps.glUniform1d, caps.glUniform1dv, - caps.glUniform2d, caps.glUniform2dv, caps.glUniform3d, caps.glUniform3dv, caps.glUniform4d, caps.glUniform4dv, - caps.glUniformMatrix2dv, caps.glUniformMatrix2x3dv, caps.glUniformMatrix2x4dv, caps.glUniformMatrix3dv, caps.glUniformMatrix3x2dv, caps.glUniformMatrix3x4dv, - caps.glUniformMatrix4dv, caps.glUniformMatrix4x2dv, caps.glUniformMatrix4x3dv, caps.glUniformSubroutinesuiv); - } - - static void load(GLCapabilities caps, GLLoadFunc load) { - caps.glBeginQueryIndexed = load.invoke("glBeginQueryIndexed", IIIV); - caps.glBindTransformFeedback = load.invoke("glBindTransformFeedback", IIV); - 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.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); - caps.glUniform1dv = load.invoke("glUniform1dv", IIPV); - caps.glUniform2d = load.invoke("glUniform2d", IDDV); - caps.glUniform2dv = load.invoke("glUniform2dv", IIPV); - caps.glUniform3d = load.invoke("glUniform3d", IDDDV); - caps.glUniform3dv = load.invoke("glUniform3dv", IIPV); - caps.glUniform4d = load.invoke("glUniform4d", IDDDDV); - caps.glUniform4dv = load.invoke("glUniform4dv", IIPV); - caps.glUniformMatrix2dv = load.invoke("glUniformMatrix2dv", IIZPV); - caps.glUniformMatrix2x3dv = load.invoke("glUniformMatrix2x3dv", IIZPV); - caps.glUniformMatrix2x4dv = load.invoke("glUniformMatrix2x4dv", IIZPV); - caps.glUniformMatrix3dv = load.invoke("glUniformMatrix3dv", IIZPV); - caps.glUniformMatrix3x2dv = load.invoke("glUniformMatrix3x2dv", IIZPV); - caps.glUniformMatrix3x4dv = load.invoke("glUniformMatrix3x4dv", IIZPV); - caps.glUniformMatrix4dv = load.invoke("glUniformMatrix4dv", IIZPV); - caps.glUniformMatrix4x2dv = load.invoke("glUniformMatrix4x2dv", IIZPV); - caps.glUniformMatrix4x3dv = load.invoke("glUniformMatrix4x3dv", IIZPV); - caps.glUniformSubroutinesuiv = load.invoke("glUniformSubroutinesuiv", IIPV); - } - - public static void beginQueryIndexed(int target, int index, int id) { - var caps = getCapabilities(); - try { - check(caps.glBeginQueryIndexed).invokeExact(target, index, id); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void bindTransformFeedback(int target, int id) { - var caps = getCapabilities(); - try { - check(caps.glBindTransformFeedback).invokeExact(target, id); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void blendEquationSeparatei(int buf, int modeRGB, int modeAlpha) { - var caps = getCapabilities(); - try { - check(caps.glBlendEquationSeparatei).invokeExact(buf, modeRGB, modeAlpha); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void blendEquationi(int buf, int mode) { - var caps = getCapabilities(); - try { - check(caps.glBlendEquationi).invokeExact(buf, mode); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void blendEquationSeparatei(int buf, int srcRGB, int dstRGB, int srcAlpha, int dstAlpha) { - var caps = getCapabilities(); - try { - check(caps.glBlendEquationSeparatei).invokeExact(buf, srcRGB, dstRGB, srcAlpha, dstAlpha); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void blendFunci(int buf, int src, int dst) { - var caps = getCapabilities(); - try { - check(caps.glBlendFunci).invokeExact(buf, src, dst); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void deleteTransformFeedbacks(int n, MemorySegment ids) { - var caps = getCapabilities(); - try { - check(caps.glDeleteTransformFeedbacks).invokeExact(n, ids); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } +public sealed interface GL40C extends GL33C permits GL41C { + int SAMPLE_SHADING = 0x8C36; + int MIN_SAMPLE_SHADING_VALUE = 0x8C37; + int MIN_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5E; + int MAX_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5F; + int TEXTURE_CUBE_MAP_ARRAY = 0x9009; + int TEXTURE_BINDING_CUBE_MAP_ARRAY = 0x900A; + int PROXY_TEXTURE_CUBE_MAP_ARRAY = 0x900B; + int SAMPLER_CUBE_MAP_ARRAY = 0x900C; + int SAMPLER_CUBE_MAP_ARRAY_SHADOW = 0x900D; + int INT_SAMPLER_CUBE_MAP_ARRAY = 0x900E; + int UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY = 0x900F; + int DRAW_INDIRECT_BUFFER = 0x8F3F; + int DRAW_INDIRECT_BUFFER_BINDING = 0x8F43; + int GEOMETRY_SHADER_INVOCATIONS = 0x887F; + int MAX_GEOMETRY_SHADER_INVOCATIONS = 0x8E5A; + int MIN_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5B; + int MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C; + int FRAGMENT_INTERPOLATION_OFFSET_BITS = 0x8E5D; + int MAX_VERTEX_STREAMS = 0x8E71; + int DOUBLE_VEC2 = 0x8FFC; + int DOUBLE_VEC3 = 0x8FFD; + int DOUBLE_VEC4 = 0x8FFE; + int DOUBLE_MAT2 = 0x8F46; + int DOUBLE_MAT3 = 0x8F47; + int DOUBLE_MAT4 = 0x8F48; + int DOUBLE_MAT2x3 = 0x8F49; + int DOUBLE_MAT2x4 = 0x8F4A; + int DOUBLE_MAT3x2 = 0x8F4B; + int DOUBLE_MAT3x4 = 0x8F4C; + int DOUBLE_MAT4x2 = 0x8F4D; + int DOUBLE_MAT4x3 = 0x8F4E; + int ACTIVE_SUBROUTINES = 0x8DE5; + int ACTIVE_SUBROUTINE_UNIFORMS = 0x8DE6; + int ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = 0x8E47; + int ACTIVE_SUBROUTINE_MAX_LENGTH = 0x8E48; + int ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = 0x8E49; + int MAX_SUBROUTINES = 0x8DE7; + int MAX_SUBROUTINE_UNIFORM_LOCATIONS = 0x8DE8; + int NUM_COMPATIBLE_SUBROUTINES = 0x8E4A; + int COMPATIBLE_SUBROUTINES = 0x8E4B; + int PATCHES = 0x000E; + int PATCH_VERTICES = 0x8E72; + int PATCH_DEFAULT_INNER_LEVEL = 0x8E73; + int PATCH_DEFAULT_OUTER_LEVEL = 0x8E74; + int TESS_CONTROL_OUTPUT_VERTICES = 0x8E75; + int TESS_GEN_MODE = 0x8E76; + int TESS_GEN_SPACING = 0x8E77; + int TESS_GEN_VERTEX_ORDER = 0x8E78; + int TESS_GEN_POINT_MODE = 0x8E79; + int ISOLINES = 0x8E7A; + int FRACTIONAL_ODD = 0x8E7B; + int FRACTIONAL_EVEN = 0x8E7C; + int MAX_PATCH_VERTICES = 0x8E7D; + int MAX_TESS_GEN_LEVEL = 0x8E7E; + int MAX_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E7F; + int MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E80; + int MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = 0x8E81; + int MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = 0x8E82; + int MAX_TESS_CONTROL_OUTPUT_COMPONENTS = 0x8E83; + int MAX_TESS_PATCH_COMPONENTS = 0x8E84; + int MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = 0x8E85; + int MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = 0x8E86; + int MAX_TESS_CONTROL_UNIFORM_BLOCKS = 0x8E89; + int MAX_TESS_EVALUATION_UNIFORM_BLOCKS = 0x8E8A; + int MAX_TESS_CONTROL_INPUT_COMPONENTS = 0x886C; + int MAX_TESS_EVALUATION_INPUT_COMPONENTS = 0x886D; + int MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E1E; + int MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E1F; + int UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER = 0x84F0; + int UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x84F1; + int TESS_EVALUATION_SHADER = 0x8E87; + int TESS_CONTROL_SHADER = 0x8E88; + int TRANSFORM_FEEDBACK = 0x8E22; + int TRANSFORM_FEEDBACK_BUFFER_PAUSED = 0x8E23; + int TRANSFORM_FEEDBACK_BUFFER_ACTIVE = 0x8E24; + int TRANSFORM_FEEDBACK_BINDING = 0x8E25; + int MAX_TRANSFORM_FEEDBACK_BUFFERS = 0x8E70; + + @Entrypoint("glBeginQueryIndexed") + default void beginQueryIndexed(int target, int index, int id) { + throw new ContextException(); + } + + @Entrypoint("glBindTransformFeedback") + default void bindTransformFeedback(int target, int id) { + throw new ContextException(); + } + + @Entrypoint("glBlendEquationSeparatei") + default void blendEquationSeparatei(int buf, int modeRGB, int modeAlpha) { + throw new ContextException(); + } + + @Entrypoint("glBlendEquationi") + default void blendEquationi(int buf, int mode) { + throw new ContextException(); + } + + @Entrypoint("glBlendEquationSeparatei") + default void blendEquationSeparatei(int buf, int srcRGB, int dstRGB, int srcAlpha, int dstAlpha) { + throw new ContextException(); + } + + @Entrypoint("glBlendFunci") + default void blendFunci(int buf, int src, int dst) { + throw new ContextException(); + } + + @Entrypoint("glDeleteTransformFeedbacks") + default void deleteTransformFeedbacks(int n, MemorySegment ids) { + throw new ContextException(); + } + + @Skip + default void deleteTransformFeedbacks(int... ids) { + try (MemoryStack stack = MemoryStack.stackPush()) { + deleteTransformFeedbacks(ids.length, Marshal.marshal(stack, ids)); + } } - public static void deleteTransformFeedbacks(SegmentAllocator allocator, int[] ids) { - deleteTransformFeedbacks(ids.length, allocator.allocateFrom(JAVA_INT, ids)); + @Entrypoint("glDrawArraysIndirect") + default void drawArraysIndirect(int mode, MemorySegment indirect) { + throw new ContextException(); } - public static void deleteTransformFeedback(int id) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - deleteTransformFeedbacks(1, stack.ints(id)); - } finally { - stack.setPointer(stackPointer); - } + @Entrypoint("glDrawArraysIndirect") + default void drawArraysIndirect(int mode, DrawArraysIndirectCommand indirect) { + throw new ContextException(); } - public static void drawArraysIndirect(int mode, MemorySegment indirect) { - var caps = getCapabilities(); - try { - check(caps.glDrawArraysIndirect).invokeExact(mode, indirect); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDrawArraysIndirect") + default void drawArraysIndirect(SegmentAllocator allocator, int mode, int[] indirect) { + throw new ContextException(); } - public static void drawArraysIndirect(int mode, DrawArraysIndirectCommand indirect) { - drawArraysIndirect(mode, indirect.address()); + @Entrypoint("glDrawElementsIndirect") + default void drawElementsIndirect(int mode, int type, MemorySegment indirect) { + throw new ContextException(); } - public static void drawArraysIndirect(SegmentAllocator allocator, int mode, int[] indirect) { - drawArraysIndirect(mode, allocator.allocateFrom(JAVA_INT, indirect)); + @Entrypoint("glDrawElementsIndirect") + default void drawElementsIndirect(int mode, int type, DrawElementsIndirectCommand indirect) { + throw new ContextException(); } - public static void drawElementsIndirect(int mode, int type, MemorySegment indirect) { - var caps = getCapabilities(); - try { - check(caps.glDrawElementsIndirect).invokeExact(mode, type, indirect); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDrawElementsIndirect") + default void drawElementsIndirect(SegmentAllocator allocator, int mode, int type, int[] indirect) { + throw new ContextException(); } - public static void drawElementsIndirect(int mode, int type, DrawElementsIndirectCommand indirect) { - drawElementsIndirect(mode, type, indirect.address()); + @Entrypoint("glDrawTransformFeedback") + default void drawTransformFeedback(int mode, int id) { + throw new ContextException(); } - public static void drawElementsIndirect(SegmentAllocator allocator, int mode, int type, int[] indirect) { - drawElementsIndirect(mode, type, allocator.allocateFrom(JAVA_INT, indirect)); + @Entrypoint("glDrawTransformFeedbackStream") + default void drawTransformFeedbackStream(int mode, int id, int stream) { + throw new ContextException(); } - public static void drawTransformFeedback(int mode, int id) { - var caps = getCapabilities(); - try { - check(caps.glDrawTransformFeedback).invokeExact(mode, id); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEndQueryIndexed") + default void endQueryIndexed(int target, int index) { + throw new ContextException(); } - public static void drawTransformFeedbackStream(int mode, int id, int stream) { - var caps = getCapabilities(); - try { - check(caps.glDrawTransformFeedbackStream).invokeExact(mode, id, stream); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGenTransformFeedbacks") + default void genTransformFeedbacks(int n, MemorySegment ids) { + throw new ContextException(); } - public static void endQueryIndexed(int target, int index) { - var caps = getCapabilities(); - try { - check(caps.glEndQueryIndexed).invokeExact(target, index); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void genTransformFeedbacks(int n, MemorySegment ids) { - var caps = getCapabilities(); - try { - check(caps.glGenTransformFeedbacks).invokeExact(n, ids); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void genTransformFeedbacks(SegmentAllocator allocator, int[] ids) { - var seg = allocator.allocateFrom(JAVA_INT, ids); + @Skip + default void genTransformFeedbacks(SegmentAllocator allocator, @Ref int[] ids) { + var seg = Marshal.marshal(allocator, ids); genTransformFeedbacks(ids.length, seg); - RuntimeHelper.toArray(seg, ids); + Unmarshal.copy(seg, ids); } - public static int genTransformFeedback() { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int genTransformFeedbacks() { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); genTransformFeedbacks(1, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getActiveSubroutineName(int program, int shaderType, int index, int bufSize, MemorySegment length, MemorySegment name) { - var caps = getCapabilities(); - try { - check(caps.glGetActiveSubroutineName).invokeExact(program, shaderType, index, bufSize, length, name); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static String getActiveSubroutineName(SegmentAllocator allocator, int program, int shaderType, int index, int bufSize) { - var seg = allocator.allocate(JAVA_BYTE, bufSize); - getActiveSubroutineName(program, shaderType, index, bufSize, MemorySegment.NULL, seg); - return seg.getString(0); + @Entrypoint("glGetActiveSubroutineName") + default void getActiveSubroutineName(int program, int shaderType, int index, int bufSize, MemorySegment length, MemorySegment name) { + throw new ContextException(); } - public static void getActiveSubroutineUniformName(int program, int shaderType, int index, int bufSize, MemorySegment length, MemorySegment name) { - var caps = getCapabilities(); - try { - check(caps.glGetActiveSubroutineUniformName).invokeExact(program, shaderType, index, bufSize, length, name); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); + @Skip + default String getActiveSubroutineName(int program, int shaderType, int index, int bufSize) { + try (MemoryStack stack = MemoryStack.stackPush()) { + final MemorySegment length = stack.ints(0); + var seg = stack.allocate(JAVA_BYTE, bufSize); + getActiveSubroutineName(program, shaderType, index, bufSize, length, seg); + return seg.reinterpret(length.get(JAVA_INT, 0L) + 1).getString(0); } } - public static String getActiveSubroutineUniformName(SegmentAllocator allocator, int program, int shaderType, int index, int bufSize) { - var seg = allocator.allocate(JAVA_BYTE, bufSize); - getActiveSubroutineUniformName(program, shaderType, index, bufSize, MemorySegment.NULL, seg); - return seg.getString(0); + @Entrypoint("glGetActiveSubroutineUniformName") + default void getActiveSubroutineUniformName(int program, int shaderType, int index, int bufSize, MemorySegment length, MemorySegment name) { + throw new ContextException(); } - public static void getActiveSubroutineUniformiv(int program, int shaderType, int index, int pname, MemorySegment values) { - var caps = getCapabilities(); - try { - check(caps.glGetActiveSubroutineUniformiv).invokeExact(program, shaderType, index, pname, values); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); + @Skip + default String getActiveSubroutineUniformName(int program, int shaderType, int index, int bufSize) { + try (MemoryStack stack = MemoryStack.stackPush()) { + final MemorySegment length = stack.ints(0); + var seg = stack.allocate(JAVA_BYTE, bufSize); + getActiveSubroutineUniformName(program, shaderType, index, bufSize, length, seg); + return seg.reinterpret(length.get(JAVA_INT, 0L) + 1).getString(0); } } - public static void getActiveSubroutineUniformiv(SegmentAllocator allocator, int program, int shaderType, int index, int pname, int[] values) { - var seg = allocator.allocateFrom(JAVA_INT, values); - getActiveSubroutineUniformiv(program, shaderType, index, pname, seg); - RuntimeHelper.toArray(seg, values); + @Entrypoint("glGetActiveSubroutineUniformiv") + default void getActiveSubroutineUniformiv(int program, int shaderType, int index, int pname, MemorySegment values) { + throw new ContextException(); } - public static int getActiveSubroutineUniformi(int program, int shaderType, int index, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Entrypoint("glGetActiveSubroutineUniformiv") + default void getActiveSubroutineUniformiv(SegmentAllocator allocator, int program, int shaderType, int index, int pname, @Ref int[] values) { + throw new ContextException(); + } + + @Skip + default int getActiveSubroutineUniformiv(int program, int shaderType, int index, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getActiveSubroutineUniformiv(program, shaderType, index, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getProgramStageiv(int program, int shaderType, int pname, MemorySegment values) { - var caps = getCapabilities(); - try { - check(caps.glGetProgramStageiv).invokeExact(program, shaderType, pname, values); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetProgramStageiv") + default void getProgramStageiv(int program, int shaderType, int pname, MemorySegment values) { + throw new ContextException(); } - public static int getProgramStagei(int program, int shaderType, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getProgramStageiv(int program, int shaderType, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getProgramStageiv(program, shaderType, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getQueryIndexediv(int target, int index, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetQueryIndexediv).invokeExact(target, index, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetQueryIndexediv") + default void getQueryIndexediv(int target, int index, int pname, MemorySegment params) { + throw new ContextException(); } - public static int getQueryIndexedi(int target, int index, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getQueryIndexediv(int target, int index, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getQueryIndexediv(target, index, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static int getSubroutineIndex(int program, int shaderType, MemorySegment name) { - var caps = getCapabilities(); - try { - return (int) check(caps.glGetSubroutineIndex).invokeExact(program, shaderType, name); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetSubroutineIndex") + default int getSubroutineIndex(int program, int shaderType, MemorySegment name) { + throw new ContextException(); } - public static int getSubroutineIndex(int program, int shaderType, String name) { - final MemoryStack stack = MemoryStack.stackGet(); - final long stackPointer = stack.getPointer(); - try { - return getSubroutineIndex(program, shaderType, stack.allocateFrom(name)); - } finally { - stack.setPointer(stackPointer); - } + @Entrypoint("glGetSubroutineIndex") + default int getSubroutineIndex(int program, int shaderType, String name) { + throw new ContextException(); } - public static int getSubroutineUniformLocation(int program, int shaderType, MemorySegment name) { - var caps = getCapabilities(); - try { - return (int) check(caps.glGetSubroutineUniformLocation).invokeExact(program, shaderType, name); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetSubroutineUniformLocation") + default int getSubroutineUniformLocation(int program, int shaderType, MemorySegment name) { + throw new ContextException(); } - public static int getSubroutineUniformLocation(int program, int shaderType, String name) { - final MemoryStack stack = MemoryStack.stackGet(); - final long stackPointer = stack.getPointer(); - try { - return getSubroutineUniformLocation(program, shaderType, stack.allocateFrom(name)); - } finally { - stack.setPointer(stackPointer); - } + @Entrypoint("glGetSubroutineUniformLocation") + default int getSubroutineUniformLocation(int program, int shaderType, String name) { + throw new ContextException(); } - public static void getUniformSubroutineuiv(int shaderType, int location, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetUniformSubroutineuiv).invokeExact(shaderType, location, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetUniformSubroutineuiv") + default void getUniformSubroutineuiv(int shaderType, int location, MemorySegment params) { + throw new ContextException(); } - public static void getUniformSubroutineuiv(SegmentAllocator allocator, int shaderType, int location, int[] params) { - var seg = allocator.allocateFrom(JAVA_INT, params); - getUniformSubroutineuiv(shaderType, location, seg); - RuntimeHelper.toArray(seg, params); + @Entrypoint("glGetUniformSubroutineuiv") + default void getUniformSubroutineuiv(SegmentAllocator allocator, int shaderType, int location, @Ref int[] params) { + throw new ContextException(); } - public static void getUniformdv(int program, int location, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetUniformdv).invokeExact(program, location, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetUniformdv") + default void getUniformdv(int program, int location, MemorySegment params) { + throw new ContextException(); } - public static void getUniformdv(SegmentAllocator allocator, int program, int location, double[] params) { - var seg = allocator.allocateFrom(JAVA_DOUBLE, params); - getUniformdv(program, location, seg); - RuntimeHelper.toArray(seg, params); + @Entrypoint("glGetUniformdv") + default void getUniformdv(SegmentAllocator allocator, int program, int location, @Ref double[] params) { + throw new ContextException(); } - public static double getUniformd(int program, int location) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocDouble(); + @Skip + default double getUniformd(int program, int location) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.doubles(0D); getUniformdv(program, location, seg); return seg.get(JAVA_DOUBLE, 0); - } finally { - stack.setPointer(stackPointer); } } - public static boolean isTransformFeedback(int id) { - var caps = getCapabilities(); - try { - return (boolean) check(caps.glIsTransformFeedback).invokeExact(id); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIsTransformFeedback") + default boolean isTransformFeedback(int id) { + throw new ContextException(); } - public static void minSampleShading(float value) { - var caps = getCapabilities(); - try { - check(caps.glMinSampleShading).invokeExact(value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMinSampleShading") + default void minSampleShading(float value) { + throw new ContextException(); } - public static void patchParameterfv(int pname, MemorySegment values) { - var caps = getCapabilities(); - try { - check(caps.glPatchParameterfv).invokeExact(pname, values); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPatchParameterfv") + default void patchParameterfv(int pname, MemorySegment values) { + throw new ContextException(); } - public static void patchParameterfv(SegmentAllocator allocator, int pname, float[] values) { - patchParameterfv(pname, allocator.allocateFrom(JAVA_FLOAT, values)); + @Entrypoint("glPatchParameterfv") + default void patchParameterfv(SegmentAllocator allocator, int pname, float[] values) { + throw new ContextException(); } - public static void patchParameteri(int pname, int value) { - var caps = getCapabilities(); - try { - check(caps.glPatchParameteri).invokeExact(pname, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPatchParameteri") + default void patchParameteri(int pname, int value) { + throw new ContextException(); } - public static void pauseTransformFeedback() { - var caps = getCapabilities(); - try { - check(caps.glPauseTransformFeedback).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPauseTransformFeedback") + default void pauseTransformFeedback() { + throw new ContextException(); } - public static void resumeTransformFeedback() { - var caps = getCapabilities(); - try { - check(caps.glResumeTransformFeedback).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glResumeTransformFeedback") + default void resumeTransformFeedback() { + throw new ContextException(); } - public static void uniform1d(int location, double x) { - var caps = getCapabilities(); - try { - check(caps.glUniform1d).invokeExact(location, x); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform1d") + default void uniform1d(int location, double x) { + throw new ContextException(); } - public static void uniform1dv(int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniform1dv).invokeExact(location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform1dv") + default void uniform1dv(int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void uniform1dv(SegmentAllocator allocator, int location, double[] value) { - uniform1dv(location, value.length, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Skip + default void uniform1dv(SegmentAllocator allocator, int location, double[] value) { + uniform1dv(location, value.length, Marshal.marshal(allocator, value)); } - public static void uniform2d(int location, double x, double y) { - var caps = getCapabilities(); - try { - check(caps.glUniform2d).invokeExact(location, x, y); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform2d") + default void uniform2d(int location, double x, double y) { + throw new ContextException(); } - public static void uniform2dv(int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniform2dv).invokeExact(location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform2dv") + default void uniform2dv(int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void uniform2dv(SegmentAllocator allocator, int location, double[] value) { - uniform2dv(location, value.length >> 1, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Skip + default void uniform2dv(SegmentAllocator allocator, int location, double[] value) { + uniform2dv(location, value.length >> 1, Marshal.marshal(allocator, value)); } - public static void uniform3d(int location, double x, double y, double z) { - var caps = getCapabilities(); - try { - check(caps.glUniform3d).invokeExact(location, x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform3d") + default void uniform3d(int location, double x, double y, double z) { + throw new ContextException(); } - public static void uniform3dv(int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniform3dv).invokeExact(location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform3dv") + default void uniform3dv(int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void uniform3dv(SegmentAllocator allocator, int location, double[] value) { - uniform3dv(location, value.length / 3, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Skip + default void uniform3dv(SegmentAllocator allocator, int location, double[] value) { + uniform3dv(location, value.length / 3, Marshal.marshal(allocator, value)); } - public static void uniform4d(int location, double x, double y, double z, double w) { - var caps = getCapabilities(); - try { - check(caps.glUniform4d).invokeExact(location, x, y, z, w); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform4d") + default void uniform4d(int location, double x, double y, double z, double w) { + throw new ContextException(); } - public static void uniform4dv(int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniform4dv).invokeExact(location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniform4dv") + default void uniform4dv(int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void uniform4dv(SegmentAllocator allocator, int location, double[] value) { - uniform4dv(location, value.length >> 2, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Skip + default void uniform4dv(SegmentAllocator allocator, int location, double[] value) { + uniform4dv(location, value.length >> 2, Marshal.marshal(allocator, value)); } - public static void uniformMatrix2dv(int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniformMatrix2dv).invokeExact(location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniformMatrix2dv") + default void uniformMatrix2dv(int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void uniformMatrix2dv(SegmentAllocator allocator, int location, int count, boolean transpose, double[] value) { - uniformMatrix2dv(location, count, transpose, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Entrypoint("glUniformMatrix2dv") + default void uniformMatrix2dv(SegmentAllocator allocator, int location, int count, boolean transpose, double[] value) { + throw new ContextException(); } - public static void uniformMatrix2dv(SegmentAllocator allocator, int location, boolean transpose, double[] value) { + @Skip + default void uniformMatrix2dv(SegmentAllocator allocator, int location, boolean transpose, double[] value) { uniformMatrix2dv(allocator, location, value.length >> 2, transpose, value); } - public static void uniformMatrix2x3dv(int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniformMatrix2x3dv).invokeExact(location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniformMatrix2x3dv") + default void uniformMatrix2x3dv(int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void uniformMatrix2x3dv(SegmentAllocator allocator, int location, int count, boolean transpose, double[] value) { - uniformMatrix2x3dv(location, count, transpose, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Entrypoint("glUniformMatrix2x3dv") + default void uniformMatrix2x3dv(SegmentAllocator allocator, int location, int count, boolean transpose, double[] value) { + throw new ContextException(); } - public static void uniformMatrix2x3dv(SegmentAllocator allocator, int location, boolean transpose, double[] value) { + @Skip + default void uniformMatrix2x3dv(SegmentAllocator allocator, int location, boolean transpose, double[] value) { uniformMatrix2x3dv(allocator, location, value.length / 6, transpose, value); } - public static void uniformMatrix2x4dv(int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniformMatrix2x4dv).invokeExact(location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniformMatrix2x4dv") + default void uniformMatrix2x4dv(int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void uniformMatrix2x4dv(SegmentAllocator allocator, int location, int count, boolean transpose, double[] value) { - uniformMatrix2x4dv(location, count, transpose, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Entrypoint("glUniformMatrix2x4dv") + default void uniformMatrix2x4dv(SegmentAllocator allocator, int location, int count, boolean transpose, double[] value) { + throw new ContextException(); } - public static void uniformMatrix2x4dv(SegmentAllocator allocator, int location, boolean transpose, double[] value) { + @Skip + default void uniformMatrix2x4dv(SegmentAllocator allocator, int location, boolean transpose, double[] value) { uniformMatrix2x4dv(allocator, location, value.length >> 3, transpose, value); } - public static void uniformMatrix3dv(int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniformMatrix3dv).invokeExact(location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniformMatrix3dv") + default void uniformMatrix3dv(int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void uniformMatrix3dv(SegmentAllocator allocator, int location, int count, boolean transpose, double[] value) { - uniformMatrix3dv(location, count, transpose, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Entrypoint("glUniformMatrix3dv") + default void uniformMatrix3dv(SegmentAllocator allocator, int location, int count, boolean transpose, double[] value) { + throw new ContextException(); } - public static void uniformMatrix3dv(SegmentAllocator allocator, int location, boolean transpose, double[] value) { + @Skip + default void uniformMatrix3dv(SegmentAllocator allocator, int location, boolean transpose, double[] value) { uniformMatrix3dv(allocator, location, value.length / 9, transpose, value); } - public static void uniformMatrix3x2dv(int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniformMatrix3x2dv).invokeExact(location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniformMatrix3x2dv") + default void uniformMatrix3x2dv(int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void uniformMatrix3x2dv(SegmentAllocator allocator, int location, int count, boolean transpose, double[] value) { - uniformMatrix3x2dv(location, count, transpose, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Entrypoint("glUniformMatrix3x2dv") + default void uniformMatrix3x2dv(SegmentAllocator allocator, int location, int count, boolean transpose, double[] value) { + throw new ContextException(); } - public static void uniformMatrix3x2dv(SegmentAllocator allocator, int location, boolean transpose, double[] value) { + @Skip + default void uniformMatrix3x2dv(SegmentAllocator allocator, int location, boolean transpose, double[] value) { uniformMatrix3x2dv(allocator, location, value.length / 6, transpose, value); } - public static void uniformMatrix3x4dv(int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniformMatrix3x4dv).invokeExact(location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniformMatrix3x4dv") + default void uniformMatrix3x4dv(int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void uniformMatrix3x4dv(SegmentAllocator allocator, int location, int count, boolean transpose, double[] value) { - uniformMatrix3x4dv(location, count, transpose, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Entrypoint("glUniformMatrix3x4dv") + default void uniformMatrix3x4dv(SegmentAllocator allocator, int location, int count, boolean transpose, double[] value) { + throw new ContextException(); } - public static void uniformMatrix3x4dv(SegmentAllocator allocator, int location, boolean transpose, double[] value) { + @Skip + default void uniformMatrix3x4dv(SegmentAllocator allocator, int location, boolean transpose, double[] value) { uniformMatrix3x4dv(allocator, location, value.length / 12, transpose, value); } - public static void uniformMatrix4dv(int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniformMatrix4dv).invokeExact(location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniformMatrix4dv") + default void uniformMatrix4dv(int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void uniformMatrix4dv(SegmentAllocator allocator, int location, int count, boolean transpose, double[] value) { - uniformMatrix4dv(location, count, transpose, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Entrypoint("glUniformMatrix4dv") + default void uniformMatrix4dv(SegmentAllocator allocator, int location, int count, boolean transpose, double[] value) { + throw new ContextException(); } - public static void uniformMatrix4dv(SegmentAllocator allocator, int location, boolean transpose, double[] value) { + @Skip + default void uniformMatrix4dv(SegmentAllocator allocator, int location, boolean transpose, double[] value) { uniformMatrix4dv(allocator, location, value.length >> 4, transpose, value); } - public static void uniformMatrix4x2dv(int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniformMatrix4x2dv).invokeExact(location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniformMatrix4x2dv") + default void uniformMatrix4x2dv(int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void uniformMatrix4x2dv(SegmentAllocator allocator, int location, int count, boolean transpose, double[] value) { - uniformMatrix4x2dv(location, count, transpose, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Entrypoint("glUniformMatrix4x2dv") + default void uniformMatrix4x2dv(SegmentAllocator allocator, int location, int count, boolean transpose, double[] value) { + throw new ContextException(); } - public static void uniformMatrix4x2dv(SegmentAllocator allocator, int location, boolean transpose, double[] value) { + @Skip + default void uniformMatrix4x2dv(SegmentAllocator allocator, int location, boolean transpose, double[] value) { uniformMatrix4x2dv(allocator, location, value.length >> 3, transpose, value); } - public static void uniformMatrix4x3dv(int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glUniformMatrix4x3dv).invokeExact(location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniformMatrix4x3dv") + default void uniformMatrix4x3dv(int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void uniformMatrix4x3dv(SegmentAllocator allocator, int location, int count, boolean transpose, double[] value) { - uniformMatrix4x3dv(location, count, transpose, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Entrypoint("glUniformMatrix4x3dv") + default void uniformMatrix4x3dv(SegmentAllocator allocator, int location, int count, boolean transpose, double[] value) { + throw new ContextException(); } - public static void uniformMatrix4x3dv(SegmentAllocator allocator, int location, boolean transpose, double[] value) { + @Skip + default void uniformMatrix4x3dv(SegmentAllocator allocator, int location, boolean transpose, double[] value) { uniformMatrix4x3dv(allocator, location, value.length / 12, transpose, value); } - public static void uniformSubroutinesuiv(int shaderType, int count, MemorySegment indices) { - var caps = getCapabilities(); - try { - check(caps.glUniformSubroutinesuiv).invokeExact(shaderType, count, indices); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUniformSubroutinesuiv") + default void uniformSubroutinesuiv(int shaderType, int count, MemorySegment indices) { + throw new ContextException(); } - public static void uniformSubroutinesuiv(SegmentAllocator allocator, int shaderType, int[] indices) { - uniformSubroutinesuiv(shaderType, indices.length, allocator.allocateFrom(JAVA_INT, indices)); + @Skip + default void uniformSubroutinesuiv(SegmentAllocator allocator, int shaderType, int[] indices) { + uniformSubroutinesuiv(shaderType, indices.length, Marshal.marshal(allocator, indices)); } } 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 d855141b..8a1b8e06 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL41C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL41C.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2022-2023 Overrun Organization + * Copyright (c) 2022-2024 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 @@ -17,16 +17,18 @@ package overrungl.opengl; import org.jetbrains.annotations.Nullable; -import overrungl.internal.RuntimeHelper; +import overrun.marshal.Marshal; +import overrun.marshal.MemoryStack; +import overrun.marshal.Unmarshal; +import overrun.marshal.gen.Entrypoint; +import overrun.marshal.gen.Ref; +import overrun.marshal.gen.Skip; import overrungl.opengl.ext.arb.GLARBViewportArray; -import overrungl.util.MemoryStack; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; import static java.lang.foreign.ValueLayout.*; -import static overrungl.FunctionDescriptors.*; -import static overrungl.opengl.GLLoader.*; /** * The OpenGL 4.1 core profile functions. @@ -43,1350 +45,914 @@ * @author squid233 * @since 0.1.0 */ -public sealed class GL41C extends GL40C permits GL42C { - public static final int FIXED = 0x140C; - public static final int IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A; - public static final int IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B; - public static final int LOW_FLOAT = 0x8DF0; - public static final int MEDIUM_FLOAT = 0x8DF1; - public static final int HIGH_FLOAT = 0x8DF2; - public static final int LOW_INT = 0x8DF3; - public static final int MEDIUM_INT = 0x8DF4; - public static final int HIGH_INT = 0x8DF5; - public static final int SHADER_COMPILER = 0x8DFA; - public static final int SHADER_BINARY_FORMATS = 0x8DF8; - public static final int NUM_SHADER_BINARY_FORMATS = 0x8DF9; - public static final int MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB; - public static final int MAX_VARYING_VECTORS = 0x8DFC; - public static final int MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD; - public static final int RGB565 = 0x8D62; - public static final int PROGRAM_BINARY_RETRIEVABLE_HINT = 0x8257; - public static final int PROGRAM_BINARY_LENGTH = 0x8741; - public static final int NUM_PROGRAM_BINARY_FORMATS = 0x87FE; - public static final int PROGRAM_BINARY_FORMATS = 0x87FF; - public static final int VERTEX_SHADER_BIT = 0x00000001; - public static final int FRAGMENT_SHADER_BIT = 0x00000002; - public static final int GEOMETRY_SHADER_BIT = 0x00000004; - public static final int TESS_CONTROL_SHADER_BIT = 0x00000008; - public static final int TESS_EVALUATION_SHADER_BIT = 0x00000010; - public static final int ALL_SHADER_BITS = 0xFFFFFFFF; - public static final int PROGRAM_SEPARABLE = 0x8258; - public static final int ACTIVE_PROGRAM = 0x8259; - public static final int PROGRAM_PIPELINE_BINDING = 0x825A; - public static final int MAX_VIEWPORTS = 0x825B; - public static final int VIEWPORT_SUBPIXEL_BITS = 0x825C; - public static final int VIEWPORT_BOUNDS_RANGE = 0x825D; - public static final int LAYER_PROVOKING_VERTEX = 0x825E; - public static final int VIEWPORT_INDEX_PROVOKING_VERTEX = 0x825F; - public static final int UNDEFINED_VERTEX = 0x8260; - - static boolean isSupported(GLCapabilities caps) { - return checkAll(caps.glActiveShaderProgram, caps.glBindProgramPipeline, caps.glClearDepthf, caps.glCreateShaderProgramv, caps.glDeleteProgramPipelines, caps.glDepthRangeArrayv, - caps.glDepthRangeIndexed, caps.glDepthRangef, caps.glGenProgramPipelines, caps.glGetDoublei_v, caps.glGetFloati_v, caps.glGetProgramBinary, - caps.glGetProgramPipelineInfoLog, caps.glGetProgramPipelineiv, caps.glGetShaderPrecisionFormat, caps.glGetVertexAttribLdv, caps.glIsProgramPipeline, caps.glProgramBinary, - caps.glProgramParameteri, caps.glProgramUniform1d, caps.glProgramUniform1dv, caps.glProgramUniform1f, caps.glProgramUniform1fv, caps.glProgramUniform1i, - caps.glProgramUniform1iv, caps.glProgramUniform1ui, caps.glProgramUniform1uiv, caps.glProgramUniform2d, caps.glProgramUniform2dv, caps.glProgramUniform2f, - caps.glProgramUniform2fv, caps.glProgramUniform2i, caps.glProgramUniform2iv, caps.glProgramUniform2ui, caps.glProgramUniform2uiv, caps.glProgramUniform3d, - caps.glProgramUniform3dv, caps.glProgramUniform3f, caps.glProgramUniform3fv, caps.glProgramUniform3i, caps.glProgramUniform3iv, caps.glProgramUniform3ui, - caps.glProgramUniform3uiv, caps.glProgramUniform4d, caps.glProgramUniform4dv, caps.glProgramUniform4f, caps.glProgramUniform4fv, caps.glProgramUniform4i, - caps.glProgramUniform4iv, caps.glProgramUniform4ui, caps.glProgramUniform4uiv, caps.glProgramUniformMatrix2dv, caps.glProgramUniformMatrix2fv, caps.glProgramUniformMatrix2x3dv, - caps.glProgramUniformMatrix2x3fv, caps.glProgramUniformMatrix2x4dv, caps.glProgramUniformMatrix2x4fv, caps.glProgramUniformMatrix3dv, caps.glProgramUniformMatrix3fv, caps.glProgramUniformMatrix3x2dv, - caps.glProgramUniformMatrix3x2fv, caps.glProgramUniformMatrix3x4dv, caps.glProgramUniformMatrix3x4fv, caps.glProgramUniformMatrix4dv, caps.glProgramUniformMatrix4fv, caps.glProgramUniformMatrix4x2dv, - caps.glProgramUniformMatrix4x2fv, caps.glProgramUniformMatrix4x3dv, caps.glProgramUniformMatrix4x3fv, caps.glReleaseShaderCompiler, caps.glScissorArrayv, caps.glScissorIndexed, - caps.glScissorIndexedv, caps.glShaderBinary, caps.glUseProgramStages, caps.glValidateProgramPipeline, caps.glVertexAttribL1d, caps.glVertexAttribL1dv, - caps.glVertexAttribL2d, caps.glVertexAttribL2dv, caps.glVertexAttribL3d, caps.glVertexAttribL3dv, caps.glVertexAttribL4d, caps.glVertexAttribL4dv, - caps.glVertexAttribLPointer, caps.glViewportArrayv, caps.glViewportIndexedf, caps.glViewportIndexedfv); - } - - static void load(GLCapabilities caps, GLLoadFunc load) { - caps.glActiveShaderProgram = load.invoke("glActiveShaderProgram", IIV); - caps.glBindProgramPipeline = load.invoke("glBindProgramPipeline", IV); - 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.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); - caps.glProgramUniform1dv = load.invoke("glProgramUniform1dv", IIIPV); - caps.glProgramUniform1f = load.invoke("glProgramUniform1f", IIFV); - caps.glProgramUniform1fv = load.invoke("glProgramUniform1fv", IIIPV); - caps.glProgramUniform1i = load.invoke("glProgramUniform1i", IIIV); - caps.glProgramUniform1iv = load.invoke("glProgramUniform1iv", IIIPV); - caps.glProgramUniform1ui = load.invoke("glProgramUniform1ui", IIIV); - caps.glProgramUniform1uiv = load.invoke("glProgramUniform1uiv", IIIPV); - caps.glProgramUniform2d = load.invoke("glProgramUniform2d", IIDDV); - caps.glProgramUniform2dv = load.invoke("glProgramUniform2dv", IIIPV); - caps.glProgramUniform2f = load.invoke("glProgramUniform2f", IIFFV); - caps.glProgramUniform2fv = load.invoke("glProgramUniform2fv", IIIPV); - caps.glProgramUniform2i = load.invoke("glProgramUniform2i", IIIIV); - caps.glProgramUniform2iv = load.invoke("glProgramUniform2iv", IIIPV); - caps.glProgramUniform2ui = load.invoke("glProgramUniform2ui", IIIIV); - caps.glProgramUniform2uiv = load.invoke("glProgramUniform2uiv", IIIPV); - caps.glProgramUniform3d = load.invoke("glProgramUniform3d", IIDDDV); - caps.glProgramUniform3dv = load.invoke("glProgramUniform3dv", IIIPV); - caps.glProgramUniform3f = load.invoke("glProgramUniform3f", IIFFFV); - caps.glProgramUniform3fv = load.invoke("glProgramUniform3fv", IIIPV); - caps.glProgramUniform3i = load.invoke("glProgramUniform3i", IIIIIV); - caps.glProgramUniform3iv = load.invoke("glProgramUniform3iv", IIIPV); - caps.glProgramUniform3ui = load.invoke("glProgramUniform3ui", IIIIIV); - caps.glProgramUniform3uiv = load.invoke("glProgramUniform3uiv", IIIPV); - caps.glProgramUniform4d = load.invoke("glProgramUniform4d", IIDDDDV); - caps.glProgramUniform4dv = load.invoke("glProgramUniform4dv", IIIPV); - caps.glProgramUniform4f = load.invoke("glProgramUniform4f", IIFFFFV); - caps.glProgramUniform4fv = load.invoke("glProgramUniform4fv", IIIPV); - caps.glProgramUniform4i = load.invoke("glProgramUniform4i", IIIIIIV); - caps.glProgramUniform4iv = load.invoke("glProgramUniform4iv", IIIPV); - caps.glProgramUniform4ui = load.invoke("glProgramUniform4ui", IIIIIIV); - caps.glProgramUniform4uiv = load.invoke("glProgramUniform4uiv", IIIPV); - caps.glProgramUniformMatrix2dv = load.invoke("glProgramUniformMatrix2dv", IIIZPV); - caps.glProgramUniformMatrix2fv = load.invoke("glProgramUniformMatrix2fv", IIIZPV); - caps.glProgramUniformMatrix2x3dv = load.invoke("glProgramUniformMatrix2x3dv", IIIZPV); - caps.glProgramUniformMatrix2x3fv = load.invoke("glProgramUniformMatrix2x3fv", IIIZPV); - caps.glProgramUniformMatrix2x4dv = load.invoke("glProgramUniformMatrix2x4dv", IIIZPV); - caps.glProgramUniformMatrix2x4fv = load.invoke("glProgramUniformMatrix2x4fv", IIIZPV); - caps.glProgramUniformMatrix3dv = load.invoke("glProgramUniformMatrix3dv", IIIZPV); - caps.glProgramUniformMatrix3fv = load.invoke("glProgramUniformMatrix3fv", IIIZPV); - caps.glProgramUniformMatrix3x2dv = load.invoke("glProgramUniformMatrix3x2dv", IIIZPV); - caps.glProgramUniformMatrix3x2fv = load.invoke("glProgramUniformMatrix3x2fv", IIIZPV); - caps.glProgramUniformMatrix3x4dv = load.invoke("glProgramUniformMatrix3x4dv", IIIZPV); - caps.glProgramUniformMatrix3x4fv = load.invoke("glProgramUniformMatrix3x4fv", IIIZPV); - caps.glProgramUniformMatrix4dv = load.invoke("glProgramUniformMatrix4dv", IIIZPV); - caps.glProgramUniformMatrix4fv = load.invoke("glProgramUniformMatrix4fv", IIIZPV); - caps.glProgramUniformMatrix4x2dv = load.invoke("glProgramUniformMatrix4x2dv", IIIZPV); - caps.glProgramUniformMatrix4x2fv = load.invoke("glProgramUniformMatrix4x2fv", IIIZPV); - caps.glProgramUniformMatrix4x3dv = load.invoke("glProgramUniformMatrix4x3dv", IIIZPV); - caps.glProgramUniformMatrix4x3fv = load.invoke("glProgramUniformMatrix4x3fv", IIIZPV); - caps.glReleaseShaderCompiler = load.invoke("glReleaseShaderCompiler", V); - caps.glScissorArrayv = load.invoke("glScissorArrayv", IIPV); - 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); - caps.glVertexAttribL1d = load.invoke("glVertexAttribL1d", IDV); - caps.glVertexAttribL1dv = load.invoke("glVertexAttribL1dv", IPV); - caps.glVertexAttribL2d = load.invoke("glVertexAttribL2d", IDDV); - caps.glVertexAttribL2dv = load.invoke("glVertexAttribL2dv", IPV); - caps.glVertexAttribL3d = load.invoke("glVertexAttribL3d", IDDDV); - caps.glVertexAttribL3dv = load.invoke("glVertexAttribL3dv", IPV); - caps.glVertexAttribL4d = load.invoke("glVertexAttribL4d", IDDDDV); - caps.glVertexAttribL4dv = load.invoke("glVertexAttribL4dv", IPV); - caps.glVertexAttribLPointer = load.invoke("glVertexAttribLPointer", IIIIPV); - caps.glViewportArrayv = load.invoke("glViewportArrayv", IIPV); - caps.glViewportIndexedf = load.invoke("glViewportIndexedf", IFFFFV); - caps.glViewportIndexedfv = load.invoke("glViewportIndexedfv", IPV); - } - - public static void activeShaderProgram(int pipeline, int program) { - var caps = getCapabilities(); - try { - check(caps.glActiveShaderProgram).invokeExact(pipeline, program); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } +public sealed interface GL41C extends GL40C permits GL42C { + int FIXED = 0x140C; + int IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A; + int IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B; + int LOW_FLOAT = 0x8DF0; + int MEDIUM_FLOAT = 0x8DF1; + int HIGH_FLOAT = 0x8DF2; + int LOW_INT = 0x8DF3; + int MEDIUM_INT = 0x8DF4; + int HIGH_INT = 0x8DF5; + int SHADER_COMPILER = 0x8DFA; + int SHADER_BINARY_FORMATS = 0x8DF8; + int NUM_SHADER_BINARY_FORMATS = 0x8DF9; + int MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB; + int MAX_VARYING_VECTORS = 0x8DFC; + int MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD; + int RGB565 = 0x8D62; + int PROGRAM_BINARY_RETRIEVABLE_HINT = 0x8257; + int PROGRAM_BINARY_LENGTH = 0x8741; + int NUM_PROGRAM_BINARY_FORMATS = 0x87FE; + int PROGRAM_BINARY_FORMATS = 0x87FF; + int VERTEX_SHADER_BIT = 0x00000001; + int FRAGMENT_SHADER_BIT = 0x00000002; + int GEOMETRY_SHADER_BIT = 0x00000004; + int TESS_CONTROL_SHADER_BIT = 0x00000008; + int TESS_EVALUATION_SHADER_BIT = 0x00000010; + int ALL_SHADER_BITS = 0xFFFFFFFF; + int PROGRAM_SEPARABLE = 0x8258; + int ACTIVE_PROGRAM = 0x8259; + int PROGRAM_PIPELINE_BINDING = 0x825A; + int MAX_VIEWPORTS = 0x825B; + int VIEWPORT_SUBPIXEL_BITS = 0x825C; + int VIEWPORT_BOUNDS_RANGE = 0x825D; + int LAYER_PROVOKING_VERTEX = 0x825E; + int VIEWPORT_INDEX_PROVOKING_VERTEX = 0x825F; + int UNDEFINED_VERTEX = 0x8260; - public static void bindProgramPipeline(int pipeline) { - var caps = getCapabilities(); - try { - check(caps.glBindProgramPipeline).invokeExact(pipeline); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glActiveShaderProgram") + default void activeShaderProgram(int pipeline, int program) { + throw new ContextException(); } - public static void clearDepthf(float d) { - var caps = getCapabilities(); - try { - check(caps.glClearDepthf).invokeExact(d); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glBindProgramPipeline") + default void bindProgramPipeline(int pipeline) { + throw new ContextException(); } - public static int createShaderProgramv(int type, int count, MemorySegment strings) { - var caps = getCapabilities(); - try { - return (int) check(caps.glCreateShaderProgramv).invokeExact(type, count, strings); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glClearDepthf") + default void clearDepthf(float d) { + throw new ContextException(); } - public static int createShaderProgramv(SegmentAllocator allocator, int type, String[] strings) { - var seg = allocator.allocate(ADDRESS, strings.length); - for (int i = 0; i < strings.length; i++) { - seg.setAtIndex(ADDRESS, i, allocator.allocateFrom(strings[i])); - } - return createShaderProgramv(type, strings.length, seg); + @Entrypoint("glCreateShaderProgramv") + default int createShaderProgramv(int type, int count, MemorySegment strings) { + throw new ContextException(); } - public static int createShaderProgram(int type, String string) { - final MemoryStack stack = MemoryStack.stackGet(); - final long stackPointer = stack.getPointer(); - try { - return createShaderProgramv(type, 1, stack.allocateFrom(ADDRESS, stack.allocateFrom(string))); - } finally { - stack.setPointer(stackPointer); - } + @Skip + default int createShaderProgramv(SegmentAllocator allocator, int type, String[] strings) { + return createShaderProgramv(type, strings.length, Marshal.marshal(allocator, strings)); } - public static void deleteProgramPipelines(int n, MemorySegment pipelines) { - var caps = getCapabilities(); - try { - check(caps.glDeleteProgramPipelines).invokeExact(n, pipelines); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); + @Skip + default int createShaderProgramv(int type, String string) { + try (MemoryStack stack = MemoryStack.stackPush()) { + return createShaderProgramv(type, 1, stack.allocateFrom(ADDRESS, Marshal.marshal(stack, string))); } } - public static void deleteProgramPipelines(SegmentAllocator allocator, int[] pipelines) { - deleteProgramPipelines(pipelines.length, allocator.allocateFrom(JAVA_INT, pipelines)); + @Entrypoint("glDeleteProgramPipelines") + default void deleteProgramPipelines(int n, MemorySegment pipelines) { + throw new ContextException(); } - public static void deleteProgramPipeline(int pipeline) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - deleteProgramPipelines(1, stack.ints(pipeline)); - } finally { - stack.setPointer(stackPointer); + @Skip + default void deleteProgramPipelines(int... pipelines) { + try (MemoryStack stack = MemoryStack.stackPush()) { + deleteProgramPipelines(pipelines.length, Marshal.marshal(stack, pipelines)); } } - public static void depthRangeArrayv(int first, int count, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glDepthRangeArrayv).invokeExact(first, count, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDepthRangeArrayv") + default void depthRangeArrayv(int first, int count, MemorySegment v) { + throw new ContextException(); } - public static void depthRangeArrayv(SegmentAllocator allocator, int first, double[] v) { - depthRangeArrayv(first, v.length, allocator.allocateFrom(JAVA_DOUBLE, v)); + @Skip + default void depthRangeArrayv(SegmentAllocator allocator, int first, double[] v) { + depthRangeArrayv(first, v.length, Marshal.marshal(allocator, v)); } - public static void depthRangeIndexed(int index, double n, double f) { - var caps = getCapabilities(); - try { - check(caps.glDepthRangeIndexed).invokeExact(index, n, f); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDepthRangeIndexed") + default void depthRangeIndexed(int index, double n, double f) { + throw new ContextException(); } - public static void depthRangef(float n, float f) { - var caps = getCapabilities(); - try { - check(caps.glDepthRangef).invokeExact(n, f); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDepthRangef") + default void depthRangef(float n, float f) { + throw new ContextException(); } - public static void genProgramPipelines(int n, MemorySegment pipelines) { - var caps = getCapabilities(); - try { - check(caps.glGenProgramPipelines).invokeExact(n, pipelines); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGenProgramPipelines") + default void genProgramPipelines(int n, MemorySegment pipelines) { + throw new ContextException(); } - public static void genProgramPipelines(SegmentAllocator allocator, int[] pipelines) { - var seg = allocator.allocate(JAVA_INT, pipelines.length); + @Skip + default void genProgramPipelines(SegmentAllocator allocator, @Ref int[] pipelines) { + var seg = Marshal.marshal(allocator, pipelines); genProgramPipelines(pipelines.length, seg); - RuntimeHelper.toArray(seg, pipelines); + Unmarshal.copy(seg, pipelines); } - public static int genProgramPipeline() { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int genProgramPipelines() { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); genProgramPipelines(1, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getDoublei_v(int target, int index, MemorySegment data) { - var caps = getCapabilities(); - try { - check(caps.glGetDoublei_v).invokeExact(target, index, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetDoublei_v") + default void getDoublei_v(int target, int index, MemorySegment data) { + throw new ContextException(); } - public static void getDoublei_v(SegmentAllocator allocator, int target, int index, double[] data) { - var seg = allocator.allocate(JAVA_DOUBLE, data.length); - getDoublei_v(target, index, seg); - RuntimeHelper.toArray(seg, data); + @Entrypoint("glGetDoublei_v") + default void getDoublei_v(SegmentAllocator allocator, int target, int index, @Ref double[] data) { + throw new ContextException(); } - public static double getDoublei(int target, int index) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocDouble(); + @Skip + default double getDoublei_v(int target, int index) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.doubles(0D); getDoublei_v(target, index, seg); return seg.get(JAVA_DOUBLE, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getFloati_v(int target, int index, MemorySegment data) { - var caps = getCapabilities(); - try { - check(caps.glGetFloati_v).invokeExact(target, index, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetFloati_v") + default void getFloati_v(int target, int index, MemorySegment data) { + throw new ContextException(); } - public static void getFloati_v(SegmentAllocator allocator, int target, int index, float[] data) { - var seg = allocator.allocate(JAVA_FLOAT, data.length); - getFloati_v(target, index, seg); - RuntimeHelper.toArray(seg, data); + @Entrypoint("glGetFloati_v") + default void getFloati_v(SegmentAllocator allocator, int target, int index, @Ref float[] data) { + throw new ContextException(); } - public static float getFloati(int target, int index) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocFloat(); + @Skip + default float getFloati_v(int target, int index) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.floats(0F); getFloati_v(target, index, seg); return seg.get(JAVA_FLOAT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getProgramBinary(int program, int bufSize, MemorySegment length, MemorySegment binaryFormat, MemorySegment binary) { - var caps = getCapabilities(); - try { - check(caps.glGetProgramBinary).invokeExact(program, bufSize, length, binaryFormat, binary); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetProgramBinary") + default void getProgramBinary(int program, int bufSize, MemorySegment length, MemorySegment binaryFormat, MemorySegment binary) { + throw new ContextException(); } - public static void getProgramBinary(int program, int bufSize, int @Nullable [] length, int[] binaryFormat, MemorySegment binary) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - 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); - } - binaryFormat[0] = pf.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); - } + @Entrypoint("glGetProgramBinary") + default void getProgramBinary(int program, int bufSize, @Ref int @Nullable [] length, @Ref int[] binaryFormat, MemorySegment binary) { + throw new ContextException(); } - public static void getProgramBinary(int program, int @Nullable [] length, int[] binaryFormat, MemorySegment binary) { - getProgramBinary(program, (int) binary.byteSize(), length, binaryFormat, binary); + @Skip + default void getProgramBinary(int program, @Ref int @Nullable [] length, @Ref int[] binaryFormat, MemorySegment binary) { + getProgramBinary(program, Math.toIntExact(binary.byteSize()), length, binaryFormat, binary); } - public static void getProgramPipelineInfoLog(int pipeline, int bufSize, MemorySegment length, MemorySegment infoLog) { - var caps = getCapabilities(); - try { - check(caps.glGetProgramPipelineInfoLog).invokeExact(pipeline, bufSize, length, infoLog); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetProgramPipelineInfoLog") + default void getProgramPipelineInfoLog(int pipeline, int bufSize, MemorySegment length, MemorySegment infoLog) { + throw new ContextException(); } - public static void getProgramPipelineInfoLog(SegmentAllocator allocator, int pipeline, int bufSize, int @Nullable [] length, String[] infoLog) { - var pl = length != null ? allocator.allocate(JAVA_INT) : MemorySegment.NULL; + @Skip + default void getProgramPipelineInfoLog(SegmentAllocator allocator, int pipeline, int bufSize, @Ref int @Nullable [] length, @Ref String[] infoLog) { + var pl = Marshal.marshal(allocator, length); var pi = allocator.allocate(JAVA_BYTE, bufSize); getProgramPipelineInfoLog(pipeline, bufSize, pl, pi); - if (length != null && length.length > 0) { - length[0] = pl.get(JAVA_INT, 0); - } + Unmarshal.copy(pl, length); infoLog[0] = pi.getString(0); } - public static String getProgramPipelineInfoLog(SegmentAllocator allocator, int pipeline) { - final int sz = getProgramPipelinei(pipeline, INFO_LOG_LENGTH); + @Skip + default String getProgramPipelineInfoLog(SegmentAllocator allocator, int pipeline) { + final int sz = getProgramPipelineiv(pipeline, INFO_LOG_LENGTH); var pi = allocator.allocate(JAVA_BYTE, sz); getProgramPipelineInfoLog(pipeline, sz, MemorySegment.NULL, pi); return pi.getString(0); } - public static void getProgramPipelineiv(int pipeline, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetProgramPipelineiv).invokeExact(pipeline, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetProgramPipelineiv") + default void getProgramPipelineiv(int pipeline, int pname, MemorySegment params) { + throw new ContextException(); } - public static int getProgramPipelinei(int pipeline, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getProgramPipelineiv(int pipeline, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getProgramPipelineiv(pipeline, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getShaderPrecisionFormat(int shaderType, int precisionType, MemorySegment range, MemorySegment precision) { - var caps = getCapabilities(); - try { - check(caps.glGetShaderPrecisionFormat).invokeExact(shaderType, precisionType, range, precision); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetShaderPrecisionFormat") + default void getShaderPrecisionFormat(int shaderType, int precisionType, MemorySegment range, MemorySegment precision) { + throw new ContextException(); } - public static void getShaderPrecisionFormat(SegmentAllocator allocator, int shaderType, int precisionType, int[] range, int[] precision) { - var pr = allocator.allocate(JAVA_INT, range.length); - var pp = allocator.allocate(JAVA_INT); - getShaderPrecisionFormat(shaderType, precisionType, pr, pp); - RuntimeHelper.toArray(pr, range); - precision[0] = pp.get(JAVA_INT, 0); + @Entrypoint("glGetShaderPrecisionFormat") + default void getShaderPrecisionFormat(SegmentAllocator allocator, int shaderType, int precisionType, @Ref int[] range, @Ref int[] precision) { + throw new ContextException(); } - public static void getVertexAttribLdv(int index, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetVertexAttribLdv).invokeExact(index, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetVertexAttribLdv") + default void getVertexAttribLdv(int index, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getVertexAttribLdv(SegmentAllocator allocator, int index, int pname, double[] params) { - var seg = allocator.allocate(JAVA_DOUBLE, params.length); - getVertexAttribLdv(index, pname, seg); - RuntimeHelper.toArray(seg, params); + @Entrypoint("glGetVertexAttribLdv") + default void getVertexAttribLdv(SegmentAllocator allocator, int index, int pname, @Ref double[] params) { + throw new ContextException(); } - public static boolean isProgramPipeline(int pipeline) { - var caps = getCapabilities(); - try { - return (boolean) check(caps.glIsProgramPipeline).invokeExact(pipeline); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glIsProgramPipeline") + default boolean isProgramPipeline(int pipeline) { + throw new ContextException(); } - public static void programBinary(int program, int binaryFormat, MemorySegment binary, int length) { - var caps = getCapabilities(); - try { - check(caps.glProgramBinary).invokeExact(program, binaryFormat, binary, length); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramBinary") + default void programBinary(int program, int binaryFormat, MemorySegment binary, int length) { + throw new ContextException(); } - public static void programBinary(int program, int binaryFormat, MemorySegment binary) { - programBinary(program, binaryFormat, binary, (int) binary.byteSize()); + @Skip + default void programBinary(int program, int binaryFormat, MemorySegment binary) { + programBinary(program, binaryFormat, binary, Math.toIntExact(binary.byteSize())); } - public static void programParameteri(int program, int pname, int value) { - var caps = getCapabilities(); - try { - check(caps.glProgramParameteri).invokeExact(program, pname, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramParameteri") + default void programParameteri(int program, int pname, int value) { + throw new ContextException(); } - public static void programUniform1d(int program, int location, double v0) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform1d).invokeExact(program, location, v0); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform1d") + default void programUniform1d(int program, int location, double v0) { + throw new ContextException(); } - public static void programUniform1dv(int program, int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform1dv).invokeExact(program, location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform1dv") + default void programUniform1dv(int program, int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void programUniform1dv(SegmentAllocator allocator, int program, int location, double[] value) { - programUniform1dv(program, location, value.length, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Skip + default void programUniform1dv(SegmentAllocator allocator, int program, int location, double[] value) { + programUniform1dv(program, location, value.length, Marshal.marshal(allocator, value)); } - public static void programUniform1f(int program, int location, float v0) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform1f).invokeExact(program, location, v0); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform1f") + default void programUniform1f(int program, int location, float v0) { + throw new ContextException(); } - public static void programUniform1fv(int program, int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform1fv).invokeExact(program, location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform1fv") + default void programUniform1fv(int program, int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void programUniform1fv(SegmentAllocator allocator, int program, int location, float[] value) { - programUniform1fv(program, location, value.length, allocator.allocateFrom(JAVA_FLOAT, value)); + @Skip + default void programUniform1fv(SegmentAllocator allocator, int program, int location, float[] value) { + programUniform1fv(program, location, value.length, Marshal.marshal(allocator, value)); } - public static void programUniform1i(int program, int location, int v0) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform1i).invokeExact(program, location, v0); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform1i") + default void programUniform1i(int program, int location, int v0) { + throw new ContextException(); } - public static void programUniform1iv(int program, int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform1iv).invokeExact(program, location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform1iv") + default void programUniform1iv(int program, int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void programUniform1iv(SegmentAllocator allocator, int program, int location, int[] value) { - programUniform1iv(program, location, value.length, allocator.allocateFrom(JAVA_INT, value)); + @Skip + default void programUniform1iv(SegmentAllocator allocator, int program, int location, int[] value) { + programUniform1iv(program, location, value.length, Marshal.marshal(allocator, value)); } - public static void programUniform1ui(int program, int location, int v0) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform1ui).invokeExact(program, location, v0); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform1ui") + default void programUniform1ui(int program, int location, int v0) { + throw new ContextException(); } - public static void programUniform1uiv(int program, int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform1uiv).invokeExact(program, location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform1uiv") + default void programUniform1uiv(int program, int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void programUniform1uiv(SegmentAllocator allocator, int program, int location, int[] value) { - programUniform1uiv(program, location, value.length, allocator.allocateFrom(JAVA_INT, value)); + @Skip + default void programUniform1uiv(SegmentAllocator allocator, int program, int location, int[] value) { + programUniform1uiv(program, location, value.length, Marshal.marshal(allocator, value)); } - public static void programUniform2d(int program, int location, double v0, double v1) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform2d).invokeExact(program, location, v0, v1); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform2d") + default void programUniform2d(int program, int location, double v0, double v1) { + throw new ContextException(); } - public static void programUniform2dv(int program, int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform2dv).invokeExact(program, location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform2dv") + default void programUniform2dv(int program, int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void programUniform2dv(SegmentAllocator allocator, int program, int location, double[] value) { - programUniform2dv(program, location, value.length >> 2, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Skip + default void programUniform2dv(SegmentAllocator allocator, int program, int location, double[] value) { + programUniform2dv(program, location, value.length >> 2, Marshal.marshal(allocator, value)); } - public static void programUniform2f(int program, int location, float v0, float v1) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform2f).invokeExact(program, location, v0, v1); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform2f") + default void programUniform2f(int program, int location, float v0, float v1) { + throw new ContextException(); } - public static void programUniform2fv(int program, int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform2fv).invokeExact(program, location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform2fv") + default void programUniform2fv(int program, int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void programUniform2fv(SegmentAllocator allocator, int program, int location, float[] value) { - programUniform2fv(program, location, value.length >> 2, allocator.allocateFrom(JAVA_FLOAT, value)); + @Skip + default void programUniform2fv(SegmentAllocator allocator, int program, int location, float[] value) { + programUniform2fv(program, location, value.length >> 2, Marshal.marshal(allocator, value)); } - public static void programUniform2i(int program, int location, int v0, int v1) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform2i).invokeExact(program, location, v0, v1); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform2i") + default void programUniform2i(int program, int location, int v0, int v1) { + throw new ContextException(); } - public static void programUniform2iv(int program, int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform2iv).invokeExact(program, location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform2iv") + default void programUniform2iv(int program, int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void programUniform2iv(SegmentAllocator allocator, int program, int location, int[] value) { - programUniform2iv(program, location, value.length >> 2, allocator.allocateFrom(JAVA_INT, value)); + @Skip + default void programUniform2iv(SegmentAllocator allocator, int program, int location, int[] value) { + programUniform2iv(program, location, value.length >> 2, Marshal.marshal(allocator, value)); } - public static void programUniform2ui(int program, int location, int v0, int v1) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform2ui).invokeExact(program, location, v0, v1); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform2ui") + default void programUniform2ui(int program, int location, int v0, int v1) { + throw new ContextException(); } - public static void programUniform2uiv(int program, int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform2uiv).invokeExact(program, location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform2uiv") + default void programUniform2uiv(int program, int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void programUniform2uiv(SegmentAllocator allocator, int program, int location, int[] value) { - programUniform2uiv(program, location, value.length >> 2, allocator.allocateFrom(JAVA_INT, value)); + @Skip + default void programUniform2uiv(SegmentAllocator allocator, int program, int location, int[] value) { + programUniform2uiv(program, location, value.length >> 2, Marshal.marshal(allocator, value)); } - public static void programUniform3d(int program, int location, double v0, double v1, double v2) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform3d).invokeExact(program, location, v0, v1, v2); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform3d") + default void programUniform3d(int program, int location, double v0, double v1, double v2) { + throw new ContextException(); } - public static void programUniform3dv(int program, int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform3dv).invokeExact(program, location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform3dv") + default void programUniform3dv(int program, int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void programUniform3dv(SegmentAllocator allocator, int program, int location, double[] value) { - programUniform3dv(program, location, value.length / 3, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Skip + default void programUniform3dv(SegmentAllocator allocator, int program, int location, double[] value) { + programUniform3dv(program, location, value.length / 3, Marshal.marshal(allocator, value)); } - public static void programUniform3f(int program, int location, float v0, float v1, float v2) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform3f).invokeExact(program, location, v0, v1, v2); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform3f") + default void programUniform3f(int program, int location, float v0, float v1, float v2) { + throw new ContextException(); } - public static void programUniform3fv(int program, int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform3fv).invokeExact(program, location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform3fv") + default void programUniform3fv(int program, int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void programUniform3fv(SegmentAllocator allocator, int program, int location, float[] value) { - programUniform3fv(program, location, value.length / 3, allocator.allocateFrom(JAVA_FLOAT, value)); + @Skip + default void programUniform3fv(SegmentAllocator allocator, int program, int location, float[] value) { + programUniform3fv(program, location, value.length / 3, Marshal.marshal(allocator, value)); } - public static void programUniform3i(int program, int location, int v0, int v1, int v2) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform3i).invokeExact(program, location, v0, v1, v2); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform3i") + default void programUniform3i(int program, int location, int v0, int v1, int v2) { + throw new ContextException(); } - public static void programUniform3iv(int program, int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform3iv).invokeExact(program, location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform3iv") + default void programUniform3iv(int program, int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void programUniform3iv(SegmentAllocator allocator, int program, int location, int[] value) { - programUniform3iv(program, location, value.length / 3, allocator.allocateFrom(JAVA_INT, value)); + @Skip + default void programUniform3iv(SegmentAllocator allocator, int program, int location, int[] value) { + programUniform3iv(program, location, value.length / 3, Marshal.marshal(allocator, value)); } - public static void programUniform3ui(int program, int location, int v0, int v1, int v2) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform3ui).invokeExact(program, location, v0, v1, v2); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform3ui") + default void programUniform3ui(int program, int location, int v0, int v1, int v2) { + throw new ContextException(); } - public static void programUniform3uiv(int program, int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform3uiv).invokeExact(program, location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform3uiv") + default void programUniform3uiv(int program, int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void programUniform3uiv(SegmentAllocator allocator, int program, int location, int[] value) { - programUniform3uiv(program, location, value.length / 3, allocator.allocateFrom(JAVA_INT, value)); + @Skip + default void programUniform3uiv(SegmentAllocator allocator, int program, int location, int[] value) { + programUniform3uiv(program, location, value.length / 3, Marshal.marshal(allocator, value)); } - public static void programUniform4d(int program, int location, double v0, double v1, double v2, double v3) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform4d).invokeExact(program, location, v0, v1, v2, v3); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform4d") + default void programUniform4d(int program, int location, double v0, double v1, double v2, double v3) { + throw new ContextException(); } - public static void programUniform4dv(int program, int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform4dv).invokeExact(program, location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform4dv") + default void programUniform4dv(int program, int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void programUniform4dv(SegmentAllocator allocator, int program, int location, double[] value) { - programUniform4dv(program, location, value.length >> 2, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Skip + default void programUniform4dv(SegmentAllocator allocator, int program, int location, double[] value) { + programUniform4dv(program, location, value.length >> 2, Marshal.marshal(allocator, value)); } - public static void programUniform4f(int program, int location, float v0, float v1, float v2, float v3) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform4f).invokeExact(program, location, v0, v1, v2, v3); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform4f") + default void programUniform4f(int program, int location, float v0, float v1, float v2, float v3) { + throw new ContextException(); } - public static void programUniform4fv(int program, int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform4fv).invokeExact(program, location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform4fv") + default void programUniform4fv(int program, int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void programUniform4fv(SegmentAllocator allocator, int program, int location, float[] value) { - programUniform4fv(program, location, value.length >> 2, allocator.allocateFrom(JAVA_FLOAT, value)); + @Skip + default void programUniform4fv(SegmentAllocator allocator, int program, int location, float[] value) { + programUniform4fv(program, location, value.length >> 2, Marshal.marshal(allocator, value)); } - public static void programUniform4i(int program, int location, int v0, int v1, int v2, int v3) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform4i).invokeExact(program, location, v0, v1, v2, v3); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform4i") + default void programUniform4i(int program, int location, int v0, int v1, int v2, int v3) { + throw new ContextException(); } - public static void programUniform4iv(int program, int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform4iv).invokeExact(program, location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform4iv") + default void programUniform4iv(int program, int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void programUniform4iv(SegmentAllocator allocator, int program, int location, int[] value) { - programUniform4iv(program, location, value.length >> 2, allocator.allocateFrom(JAVA_INT, value)); + @Skip + default void programUniform4iv(SegmentAllocator allocator, int program, int location, int[] value) { + programUniform4iv(program, location, value.length >> 2, Marshal.marshal(allocator, value)); } - public static void programUniform4ui(int program, int location, int v0, int v1, int v2, int v3) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform4ui).invokeExact(program, location, v0, v1, v2, v3); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform4ui") + default void programUniform4ui(int program, int location, int v0, int v1, int v2, int v3) { + throw new ContextException(); } - public static void programUniform4uiv(int program, int location, int count, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniform4uiv).invokeExact(program, location, count, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniform4uiv") + default void programUniform4uiv(int program, int location, int count, MemorySegment value) { + throw new ContextException(); } - public static void programUniform4uiv(SegmentAllocator allocator, int program, int location, int[] value) { - programUniform4uiv(program, location, value.length >> 2, allocator.allocateFrom(JAVA_INT, value)); + @Skip + default void programUniform4uiv(SegmentAllocator allocator, int program, int location, int[] value) { + programUniform4uiv(program, location, value.length >> 2, Marshal.marshal(allocator, value)); } - public static void programUniformMatrix2dv(int program, int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniformMatrix2dv).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniformMatrix2dv") + default void programUniformMatrix2dv(int program, int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void programUniformMatrix2dv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, double[] value) { - programUniformMatrix2dv(program, location, count, transpose, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Entrypoint("glProgramUniformMatrix2dv") + default void programUniformMatrix2dv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, double[] value) { + throw new ContextException(); } - public static void programUniformMatrix2dv(SegmentAllocator allocator, int program, int location, boolean transpose, double[] value) { + @Skip + default void programUniformMatrix2dv(SegmentAllocator allocator, int program, int location, boolean transpose, double[] value) { programUniformMatrix2dv(allocator, program, location, value.length >> 2, transpose, value); } - public static void programUniformMatrix2fv(int program, int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniformMatrix2fv).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniformMatrix2fv") + default void programUniformMatrix2fv(int program, int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void programUniformMatrix2fv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, float[] value) { - programUniformMatrix2fv(program, location, count, transpose, allocator.allocateFrom(JAVA_FLOAT, value)); + @Entrypoint("glProgramUniformMatrix2fv") + default void programUniformMatrix2fv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, float[] value) { + throw new ContextException(); } - public static void programUniformMatrix2fv(SegmentAllocator allocator, int program, int location, boolean transpose, float[] value) { + @Skip + default void programUniformMatrix2fv(SegmentAllocator allocator, int program, int location, boolean transpose, float[] value) { programUniformMatrix2fv(allocator, program, location, value.length >> 2, transpose, value); } - public static void programUniformMatrix2x3dv(int program, int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniformMatrix2x3dv).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniformMatrix2x3dv") + default void programUniformMatrix2x3dv(int program, int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void programUniformMatrix2x3dv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, double[] value) { - programUniformMatrix2x3dv(program, location, count, transpose, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Entrypoint("glProgramUniformMatrix2x3dv") + default void programUniformMatrix2x3dv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, double[] value) { + throw new ContextException(); } - public static void programUniformMatrix2x3dv(SegmentAllocator allocator, int program, int location, boolean transpose, double[] value) { + @Skip + default void programUniformMatrix2x3dv(SegmentAllocator allocator, int program, int location, boolean transpose, double[] value) { programUniformMatrix2x3dv(allocator, program, location, value.length / 6, transpose, value); } - public static void programUniformMatrix2x3fv(int program, int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniformMatrix2x3fv).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniformMatrix2x3fv") + default void programUniformMatrix2x3fv(int program, int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void programUniformMatrix2x3fv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, float[] value) { - programUniformMatrix2x3fv(program, location, count, transpose, allocator.allocateFrom(JAVA_FLOAT, value)); + @Entrypoint("glProgramUniformMatrix2x3fv") + default void programUniformMatrix2x3fv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, float[] value) { + throw new ContextException(); } - public static void programUniformMatrix2x3fv(SegmentAllocator allocator, int program, int location, boolean transpose, float[] value) { + @Skip + default void programUniformMatrix2x3fv(SegmentAllocator allocator, int program, int location, boolean transpose, float[] value) { programUniformMatrix2x3fv(allocator, program, location, value.length / 6, transpose, value); } - public static void programUniformMatrix2x4dv(int program, int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniformMatrix2x4dv).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniformMatrix2x4dv") + default void programUniformMatrix2x4dv(int program, int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void programUniformMatrix2x4dv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, double[] value) { - programUniformMatrix2x4dv(program, location, count, transpose, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Entrypoint("glProgramUniformMatrix2x4dv") + default void programUniformMatrix2x4dv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, double[] value) { + throw new ContextException(); } - public static void programUniformMatrix2x4dv(SegmentAllocator allocator, int program, int location, boolean transpose, double[] value) { + @Skip + default void programUniformMatrix2x4dv(SegmentAllocator allocator, int program, int location, boolean transpose, double[] value) { programUniformMatrix2x4dv(allocator, program, location, value.length >> 3, transpose, value); } - public static void programUniformMatrix2x4fv(int program, int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniformMatrix2x4fv).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniformMatrix2x4fv") + default void programUniformMatrix2x4fv(int program, int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void programUniformMatrix2x4fv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, float[] value) { - programUniformMatrix2x4fv(program, location, count, transpose, allocator.allocateFrom(JAVA_FLOAT, value)); + @Entrypoint("glProgramUniformMatrix2x4fv") + default void programUniformMatrix2x4fv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, float[] value) { + throw new ContextException(); } - public static void programUniformMatrix2x4fv(SegmentAllocator allocator, int program, int location, boolean transpose, float[] value) { + @Skip + default void programUniformMatrix2x4fv(SegmentAllocator allocator, int program, int location, boolean transpose, float[] value) { programUniformMatrix2x4fv(allocator, program, location, value.length >> 3, transpose, value); } - public static void programUniformMatrix3dv(int program, int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniformMatrix3dv).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniformMatrix3dv") + default void programUniformMatrix3dv(int program, int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void programUniformMatrix3dv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, double[] value) { - programUniformMatrix3dv(program, location, count, transpose, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Entrypoint("glProgramUniformMatrix3dv") + default void programUniformMatrix3dv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, double[] value) { + throw new ContextException(); } - public static void programUniformMatrix3dv(SegmentAllocator allocator, int program, int location, boolean transpose, double[] value) { + @Skip + default void programUniformMatrix3dv(SegmentAllocator allocator, int program, int location, boolean transpose, double[] value) { programUniformMatrix3dv(allocator, program, location, value.length / 9, transpose, value); } - public static void programUniformMatrix3fv(int program, int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniformMatrix3fv).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniformMatrix3fv") + default void programUniformMatrix3fv(int program, int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void programUniformMatrix3fv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, float[] value) { - programUniformMatrix3fv(program, location, count, transpose, allocator.allocateFrom(JAVA_FLOAT, value)); + @Entrypoint("glProgramUniformMatrix3fv") + default void programUniformMatrix3fv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, float[] value) { + throw new ContextException(); } - public static void programUniformMatrix3fv(SegmentAllocator allocator, int program, int location, boolean transpose, float[] value) { + @Skip + default void programUniformMatrix3fv(SegmentAllocator allocator, int program, int location, boolean transpose, float[] value) { programUniformMatrix3fv(allocator, program, location, value.length / 9, transpose, value); } - public static void programUniformMatrix3x2dv(int program, int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniformMatrix3x2dv).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniformMatrix3x2dv") + default void programUniformMatrix3x2dv(int program, int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void programUniformMatrix3x2dv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, double[] value) { - programUniformMatrix3x2dv(program, location, count, transpose, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Entrypoint("glProgramUniformMatrix3x2dv") + default void programUniformMatrix3x2dv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, double[] value) { + throw new ContextException(); } - public static void programUniformMatrix3x2dv(SegmentAllocator allocator, int program, int location, boolean transpose, double[] value) { + @Skip + default void programUniformMatrix3x2dv(SegmentAllocator allocator, int program, int location, boolean transpose, double[] value) { programUniformMatrix3x2dv(allocator, program, location, value.length / 6, transpose, value); } - public static void programUniformMatrix3x2fv(int program, int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniformMatrix3x2fv).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniformMatrix3x2fv") + default void programUniformMatrix3x2fv(int program, int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void programUniformMatrix3x2fv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, float[] value) { - programUniformMatrix3x2fv(program, location, count, transpose, allocator.allocateFrom(JAVA_FLOAT, value)); + @Entrypoint("glProgramUniformMatrix3x2fv") + default void programUniformMatrix3x2fv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, float[] value) { + throw new ContextException(); } - public static void programUniformMatrix3x2fv(SegmentAllocator allocator, int program, int location, boolean transpose, float[] value) { + @Skip + default void programUniformMatrix3x2fv(SegmentAllocator allocator, int program, int location, boolean transpose, float[] value) { programUniformMatrix3x2fv(allocator, program, location, value.length / 6, transpose, value); } - public static void programUniformMatrix3x4dv(int program, int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniformMatrix3x4dv).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniformMatrix3x4dv") + default void programUniformMatrix3x4dv(int program, int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void programUniformMatrix3x4dv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, double[] value) { - programUniformMatrix3x4dv(program, location, count, transpose, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Entrypoint("glProgramUniformMatrix3x4dv") + default void programUniformMatrix3x4dv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, double[] value) { + throw new ContextException(); } - public static void programUniformMatrix3x4dv(SegmentAllocator allocator, int program, int location, boolean transpose, double[] value) { + @Skip + default void programUniformMatrix3x4dv(SegmentAllocator allocator, int program, int location, boolean transpose, double[] value) { programUniformMatrix3x4dv(allocator, program, location, value.length / 12, transpose, value); } - public static void programUniformMatrix3x4fv(int program, int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniformMatrix3x4fv).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniformMatrix3x4fv") + default void programUniformMatrix3x4fv(int program, int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void programUniformMatrix3x4fv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, float[] value) { - programUniformMatrix3x4fv(program, location, count, transpose, allocator.allocateFrom(JAVA_FLOAT, value)); + @Entrypoint("glProgramUniformMatrix3x4fv") + default void programUniformMatrix3x4fv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, float[] value) { + throw new ContextException(); } - public static void programUniformMatrix3x4fv(SegmentAllocator allocator, int program, int location, boolean transpose, float[] value) { + @Skip + default void programUniformMatrix3x4fv(SegmentAllocator allocator, int program, int location, boolean transpose, float[] value) { programUniformMatrix3x4fv(allocator, program, location, value.length / 12, transpose, value); } - public static void programUniformMatrix4dv(int program, int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniformMatrix4dv).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniformMatrix4dv") + default void programUniformMatrix4dv(int program, int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void programUniformMatrix4dv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, double[] value) { - programUniformMatrix4dv(program, location, count, transpose, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Entrypoint("glProgramUniformMatrix4dv") + default void programUniformMatrix4dv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, double[] value) { + throw new ContextException(); } - public static void programUniformMatrix4dv(SegmentAllocator allocator, int program, int location, boolean transpose, double[] value) { + @Skip + default void programUniformMatrix4dv(SegmentAllocator allocator, int program, int location, boolean transpose, double[] value) { programUniformMatrix4dv(allocator, program, location, value.length >> 4, transpose, value); } - public static void programUniformMatrix4fv(int program, int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniformMatrix4fv).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniformMatrix4fv") + default void programUniformMatrix4fv(int program, int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void programUniformMatrix4fv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, float[] value) { - programUniformMatrix4fv(program, location, count, transpose, allocator.allocateFrom(JAVA_FLOAT, value)); + @Entrypoint("glProgramUniformMatrix4fv") + default void programUniformMatrix4fv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, float[] value) { + throw new ContextException(); } - public static void programUniformMatrix4fv(SegmentAllocator allocator, int program, int location, boolean transpose, float[] value) { + @Skip + default void programUniformMatrix4fv(SegmentAllocator allocator, int program, int location, boolean transpose, float[] value) { programUniformMatrix4fv(allocator, program, location, value.length >> 4, transpose, value); } - public static void programUniformMatrix4x2dv(int program, int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniformMatrix4x2dv).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniformMatrix4x2dv") + default void programUniformMatrix4x2dv(int program, int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void programUniformMatrix4x2dv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, double[] value) { - programUniformMatrix4x2dv(program, location, count, transpose, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Entrypoint("glProgramUniformMatrix4x2dv") + default void programUniformMatrix4x2dv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, double[] value) { + throw new ContextException(); } - public static void programUniformMatrix4x2dv(SegmentAllocator allocator, int program, int location, boolean transpose, double[] value) { + @Skip + default void programUniformMatrix4x2dv(SegmentAllocator allocator, int program, int location, boolean transpose, double[] value) { programUniformMatrix4x2dv(allocator, program, location, value.length >> 3, transpose, value); } - public static void programUniformMatrix4x2fv(int program, int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniformMatrix4x2fv).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniformMatrix4x2fv") + default void programUniformMatrix4x2fv(int program, int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void programUniformMatrix4x2fv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, float[] value) { - programUniformMatrix4x2fv(program, location, count, transpose, allocator.allocateFrom(JAVA_FLOAT, value)); + @Entrypoint("glProgramUniformMatrix4x2fv") + default void programUniformMatrix4x2fv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, float[] value) { + throw new ContextException(); } - public static void programUniformMatrix4x2fv(SegmentAllocator allocator, int program, int location, boolean transpose, float[] value) { + @Skip + default void programUniformMatrix4x2fv(SegmentAllocator allocator, int program, int location, boolean transpose, float[] value) { programUniformMatrix4x2fv(allocator, program, location, value.length >> 3, transpose, value); } - public static void programUniformMatrix4x3dv(int program, int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniformMatrix4x3dv).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniformMatrix4x3dv") + default void programUniformMatrix4x3dv(int program, int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void programUniformMatrix4x3dv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, double[] value) { - programUniformMatrix4x3dv(program, location, count, transpose, allocator.allocateFrom(JAVA_DOUBLE, value)); + @Entrypoint("glProgramUniformMatrix4x3dv") + default void programUniformMatrix4x3dv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, double[] value) { + throw new ContextException(); } - public static void programUniformMatrix4x3dv(SegmentAllocator allocator, int program, int location, boolean transpose, double[] value) { + @Skip + default void programUniformMatrix4x3dv(SegmentAllocator allocator, int program, int location, boolean transpose, double[] value) { programUniformMatrix4x3dv(allocator, program, location, value.length / 12, transpose, value); } - public static void programUniformMatrix4x3fv(int program, int location, int count, boolean transpose, MemorySegment value) { - var caps = getCapabilities(); - try { - check(caps.glProgramUniformMatrix4x3fv).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glProgramUniformMatrix4x3fv") + default void programUniformMatrix4x3fv(int program, int location, int count, boolean transpose, MemorySegment value) { + throw new ContextException(); } - public static void programUniformMatrix4x3fv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, float[] value) { - programUniformMatrix4x3fv(program, location, count, transpose, allocator.allocateFrom(JAVA_FLOAT, value)); + @Entrypoint("glProgramUniformMatrix4x3fv") + default void programUniformMatrix4x3fv(SegmentAllocator allocator, int program, int location, int count, boolean transpose, float[] value) { + throw new ContextException(); } - public static void programUniformMatrix4x3fv(SegmentAllocator allocator, int program, int location, boolean transpose, float[] value) { + @Skip + default void programUniformMatrix4x3fv(SegmentAllocator allocator, int program, int location, boolean transpose, float[] value) { programUniformMatrix4x3fv(allocator, program, location, value.length / 12, transpose, value); } - public static void releaseShaderCompiler() { - var caps = getCapabilities(); - try { - check(caps.glReleaseShaderCompiler).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glReleaseShaderCompiler") + default void releaseShaderCompiler() { + throw new ContextException(); } - public static void scissorArrayv(int first, int count, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glScissorArrayv).invokeExact(first, count, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glScissorArrayv") + default void scissorArrayv(int first, int count, MemorySegment v) { + throw new ContextException(); } - public static void scissorArrayv(SegmentAllocator allocator, int first, int count, int[] v) { - scissorArrayv(first, count, allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glScissorArrayv") + default void scissorArrayv(SegmentAllocator allocator, int first, int count, int[] v) { + throw new ContextException(); } - public static void scissorIndexed(int index, int left, int bottom, int width, int height) { - var caps = getCapabilities(); - try { - check(caps.glScissorIndexed).invokeExact(index, left, bottom, width, height); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glScissorIndexed") + default void scissorIndexed(int index, int left, int bottom, int width, int height) { + throw new ContextException(); } - public static void scissorIndexedv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glScissorIndexedv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glScissorIndexedv") + default void scissorIndexedv(int index, MemorySegment v) { + throw new ContextException(); } - public static void scissorIndexedv(SegmentAllocator allocator, int index, int[] v) { - scissorIndexedv(index, allocator.allocateFrom(JAVA_INT, v)); + @Entrypoint("glScissorIndexedv") + default void scissorIndexedv(SegmentAllocator allocator, int index, int[] v) { + throw new ContextException(); } - public static void shaderBinary(int count, MemorySegment shaders, int binaryFormat, MemorySegment binary, int length) { - var caps = getCapabilities(); - try { - check(caps.glShaderBinary).invokeExact(count, shaders, binaryFormat, binary, length); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glShaderBinary") + default void shaderBinary(int count, MemorySegment shaders, int binaryFormat, MemorySegment binary, int length) { + throw new ContextException(); } - public static void shaderBinary(SegmentAllocator allocator, int[] shaders, int binaryFormat, MemorySegment binary, int length) { - shaderBinary(shaders.length, allocator.allocateFrom(JAVA_INT, shaders), binaryFormat, binary, length); + @Skip + default void shaderBinary(SegmentAllocator allocator, int[] shaders, int binaryFormat, MemorySegment binary, int length) { + shaderBinary(shaders.length, Marshal.marshal(allocator, shaders), binaryFormat, binary, length); } - public static void shaderBinary(SegmentAllocator allocator, int[] shaders, int binaryFormat, MemorySegment binary) { - shaderBinary(allocator, shaders, binaryFormat, binary, (int) binary.byteSize()); + @Skip + default void shaderBinary(SegmentAllocator allocator, int[] shaders, int binaryFormat, MemorySegment binary) { + shaderBinary(allocator, shaders, binaryFormat, binary, Math.toIntExact(binary.byteSize())); } - public static void useProgramStages(int pipeline, int stages, int program) { - var caps = getCapabilities(); - try { - check(caps.glUseProgramStages).invokeExact(pipeline, stages, program); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUseProgramStages") + default void useProgramStages(int pipeline, int stages, int program) { + throw new ContextException(); } - public static void validateProgramPipeline(int pipeline) { - var caps = getCapabilities(); - try { - check(caps.glValidateProgramPipeline).invokeExact(pipeline); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glValidateProgramPipeline") + default void validateProgramPipeline(int pipeline) { + throw new ContextException(); } - public static void vertexAttribL1d(int index, double x) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribL1d).invokeExact(index, x); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribL1d") + default void vertexAttribL1d(int index, double x) { + throw new ContextException(); } - public static void vertexAttribL1dv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribL1dv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribL1dv") + default void vertexAttribL1dv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttribL1dv(SegmentAllocator allocator, int index, double[] v) { - vertexAttribL1dv(index, allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glVertexAttribL1dv") + default void vertexAttribL1dv(SegmentAllocator allocator, int index, double[] v) { + throw new ContextException(); } - public static void vertexAttribL2d(int index, double x, double y) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribL2d).invokeExact(index, x, y); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribL2d") + default void vertexAttribL2d(int index, double x, double y) { + throw new ContextException(); } - public static void vertexAttribL2dv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribL2dv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribL2dv") + default void vertexAttribL2dv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttribL2dv(SegmentAllocator allocator, int index, double[] v) { - vertexAttribL2dv(index, allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glVertexAttribL2dv") + default void vertexAttribL2dv(SegmentAllocator allocator, int index, double[] v) { + throw new ContextException(); } - public static void vertexAttribL3d(int index, double x, double y, double z) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribL3d).invokeExact(index, x, y, z); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribL3d") + default void vertexAttribL3d(int index, double x, double y, double z) { + throw new ContextException(); } - public static void vertexAttribL3dv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribL3dv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribL3dv") + default void vertexAttribL3dv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttribL3dv(SegmentAllocator allocator, int index, double[] v) { - vertexAttribL3dv(index, allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glVertexAttribL3dv") + default void vertexAttribL3dv(SegmentAllocator allocator, int index, double[] v) { + throw new ContextException(); } - public static void vertexAttribL4d(int index, double x, double y, double z, double w) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribL4d).invokeExact(index, x, y, z, w); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribL4d") + default void vertexAttribL4d(int index, double x, double y, double z, double w) { + throw new ContextException(); } - public static void vertexAttribL4dv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribL4dv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribL4dv") + default void vertexAttribL4dv(int index, MemorySegment v) { + throw new ContextException(); } - public static void vertexAttribL4dv(SegmentAllocator allocator, int index, double[] v) { - vertexAttribL4dv(index, allocator.allocateFrom(JAVA_DOUBLE, v)); + @Entrypoint("glVertexAttribL4dv") + default void vertexAttribL4dv(SegmentAllocator allocator, int index, double[] v) { + throw new ContextException(); } - public static void vertexAttribLPointer(int index, int size, int type, int stride, MemorySegment pointer) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribLPointer).invokeExact(index, size, type, stride, pointer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribLPointer") + default void vertexAttribLPointer(int index, int size, int type, int stride, MemorySegment pointer) { + throw new ContextException(); } - public static void vertexAttribLPointer(SegmentAllocator allocator, int index, int size, int type, int stride, double[] pointer) { - vertexAttribLPointer(index, size, type, stride, allocator.allocateFrom(JAVA_DOUBLE, pointer)); + @Entrypoint("glVertexAttribLPointer") + default void vertexAttribLPointer(SegmentAllocator allocator, int index, int size, int type, int stride, double[] pointer) { + throw new ContextException(); } - public static void viewportArrayv(int first, int count, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glViewportArrayv).invokeExact(first, count, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glViewportArrayv") + default void viewportArrayv(int first, int count, MemorySegment v) { + throw new ContextException(); } - public static void viewportArrayv(SegmentAllocator allocator, int first, int count, float[] v) { - viewportArrayv(first, count, allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glViewportArrayv") + default void viewportArrayv(SegmentAllocator allocator, int first, int count, float[] v) { + throw new ContextException(); } - public static void viewportIndexedf(int index, float x, float y, float w, float h) { - var caps = getCapabilities(); - try { - check(caps.glViewportIndexedf).invokeExact(index, x, y, w, h); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glViewportIndexedf") + default void viewportIndexedf(int index, float x, float y, float w, float h) { + throw new ContextException(); } - public static void viewportIndexedfv(int index, MemorySegment v) { - var caps = getCapabilities(); - try { - check(caps.glViewportIndexedfv).invokeExact(index, v); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glViewportIndexedfv") + default void viewportIndexedfv(int index, MemorySegment v) { + throw new ContextException(); } - public static void viewportIndexedfv(SegmentAllocator allocator, int index, float[] v) { - viewportIndexedfv(index, allocator.allocateFrom(JAVA_FLOAT, v)); + @Entrypoint("glViewportIndexedfv") + default void viewportIndexedfv(SegmentAllocator allocator, int index, float[] v) { + throw new ContextException(); } } 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 b405e452..8111edce 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL42C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL42C.java @@ -16,16 +16,17 @@ package overrungl.opengl; +import overrun.marshal.Marshal; +import overrun.marshal.MemoryStack; +import overrun.marshal.Unmarshal; +import overrun.marshal.gen.Entrypoint; +import overrun.marshal.gen.Ref; +import overrun.marshal.gen.Skip; import overrungl.opengl.ext.arb.GLARBTextureCompressionBptc; -import overrungl.internal.RuntimeHelper; -import overrungl.util.MemoryStack; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; - -import static java.lang.foreign.ValueLayout.*; -import static overrungl.FunctionDescriptors.*; -import static overrungl.opengl.GLLoader.*; +import java.lang.foreign.ValueLayout; /** * The OpenGL 4.2 core profile functions. @@ -44,305 +45,237 @@ * @author squid233 * @since 0.1.0 */ -public sealed class GL42C extends GL41C permits GL43C { - public static final int COPY_READ_BUFFER_BINDING = 0x8F36; - public static final int COPY_WRITE_BUFFER_BINDING = 0x8F37; - public static final int TRANSFORM_FEEDBACK_ACTIVE = 0x8E24; - public static final int TRANSFORM_FEEDBACK_PAUSED = 0x8E23; - public static final int UNPACK_COMPRESSED_BLOCK_WIDTH = 0x9127; - public static final int UNPACK_COMPRESSED_BLOCK_HEIGHT = 0x9128; - public static final int UNPACK_COMPRESSED_BLOCK_DEPTH = 0x9129; - public static final int UNPACK_COMPRESSED_BLOCK_SIZE = 0x912A; - public static final int PACK_COMPRESSED_BLOCK_WIDTH = 0x912B; - public static final int PACK_COMPRESSED_BLOCK_HEIGHT = 0x912C; - public static final int PACK_COMPRESSED_BLOCK_DEPTH = 0x912D; - public static final int PACK_COMPRESSED_BLOCK_SIZE = 0x912E; - public static final int NUM_SAMPLE_COUNTS = 0x9380; - public static final int MIN_MAP_BUFFER_ALIGNMENT = 0x90BC; - public static final int ATOMIC_COUNTER_BUFFER = 0x92C0; - public static final int ATOMIC_COUNTER_BUFFER_BINDING = 0x92C1; - public static final int ATOMIC_COUNTER_BUFFER_START = 0x92C2; - public static final int ATOMIC_COUNTER_BUFFER_SIZE = 0x92C3; - public static final int ATOMIC_COUNTER_BUFFER_DATA_SIZE = 0x92C4; - public static final int ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS = 0x92C5; - public static final int ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES = 0x92C6; - public static final int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER = 0x92C7; - public static final int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER = 0x92C8; - public static final int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x92C9; - public static final int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER = 0x92CA; - public static final int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER = 0x92CB; - public static final int MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = 0x92CC; - public static final int MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS = 0x92CD; - public static final int MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = 0x92CE; - public static final int MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS = 0x92CF; - public static final int MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS = 0x92D0; - public static final int MAX_COMBINED_ATOMIC_COUNTER_BUFFERS = 0x92D1; - public static final int MAX_VERTEX_ATOMIC_COUNTERS = 0x92D2; - public static final int MAX_TESS_CONTROL_ATOMIC_COUNTERS = 0x92D3; - public static final int MAX_TESS_EVALUATION_ATOMIC_COUNTERS = 0x92D4; - public static final int MAX_GEOMETRY_ATOMIC_COUNTERS = 0x92D5; - public static final int MAX_FRAGMENT_ATOMIC_COUNTERS = 0x92D6; - public static final int MAX_COMBINED_ATOMIC_COUNTERS = 0x92D7; - public static final int MAX_ATOMIC_COUNTER_BUFFER_SIZE = 0x92D8; - public static final int MAX_ATOMIC_COUNTER_BUFFER_BINDINGS = 0x92DC; - public static final int ACTIVE_ATOMIC_COUNTER_BUFFERS = 0x92D9; - public static final int UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX = 0x92DA; - public static final int UNSIGNED_INT_ATOMIC_COUNTER = 0x92DB; - public static final int VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 0x00000001; - public static final int ELEMENT_ARRAY_BARRIER_BIT = 0x00000002; - public static final int UNIFORM_BARRIER_BIT = 0x00000004; - public static final int TEXTURE_FETCH_BARRIER_BIT = 0x00000008; - public static final int SHADER_IMAGE_ACCESS_BARRIER_BIT = 0x00000020; - public static final int COMMAND_BARRIER_BIT = 0x00000040; - public static final int PIXEL_BUFFER_BARRIER_BIT = 0x00000080; - public static final int TEXTURE_UPDATE_BARRIER_BIT = 0x00000100; - public static final int BUFFER_UPDATE_BARRIER_BIT = 0x00000200; - public static final int FRAMEBUFFER_BARRIER_BIT = 0x00000400; - public static final int TRANSFORM_FEEDBACK_BARRIER_BIT = 0x00000800; - public static final int ATOMIC_COUNTER_BARRIER_BIT = 0x00001000; - public static final int ALL_BARRIER_BITS = 0xFFFFFFFF; - public static final int MAX_IMAGE_UNITS = 0x8F38; - public static final int MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS = 0x8F39; - public static final int IMAGE_BINDING_NAME = 0x8F3A; - public static final int IMAGE_BINDING_LEVEL = 0x8F3B; - public static final int IMAGE_BINDING_LAYERED = 0x8F3C; - public static final int IMAGE_BINDING_LAYER = 0x8F3D; - public static final int IMAGE_BINDING_ACCESS = 0x8F3E; - public static final int IMAGE_1D = 0x904C; - public static final int IMAGE_2D = 0x904D; - public static final int IMAGE_3D = 0x904E; - public static final int IMAGE_2D_RECT = 0x904F; - public static final int IMAGE_CUBE = 0x9050; - public static final int IMAGE_BUFFER = 0x9051; - public static final int IMAGE_1D_ARRAY = 0x9052; - public static final int IMAGE_2D_ARRAY = 0x9053; - public static final int IMAGE_CUBE_MAP_ARRAY = 0x9054; - public static final int IMAGE_2D_MULTISAMPLE = 0x9055; - public static final int IMAGE_2D_MULTISAMPLE_ARRAY = 0x9056; - public static final int INT_IMAGE_1D = 0x9057; - public static final int INT_IMAGE_2D = 0x9058; - public static final int INT_IMAGE_3D = 0x9059; - public static final int INT_IMAGE_2D_RECT = 0x905A; - public static final int INT_IMAGE_CUBE = 0x905B; - public static final int INT_IMAGE_BUFFER = 0x905C; - public static final int INT_IMAGE_1D_ARRAY = 0x905D; - public static final int INT_IMAGE_2D_ARRAY = 0x905E; - public static final int INT_IMAGE_CUBE_MAP_ARRAY = 0x905F; - public static final int INT_IMAGE_2D_MULTISAMPLE = 0x9060; - public static final int INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9061; - public static final int UNSIGNED_INT_IMAGE_1D = 0x9062; - public static final int UNSIGNED_INT_IMAGE_2D = 0x9063; - public static final int UNSIGNED_INT_IMAGE_3D = 0x9064; - public static final int UNSIGNED_INT_IMAGE_2D_RECT = 0x9065; - public static final int UNSIGNED_INT_IMAGE_CUBE = 0x9066; - public static final int UNSIGNED_INT_IMAGE_BUFFER = 0x9067; - public static final int UNSIGNED_INT_IMAGE_1D_ARRAY = 0x9068; - public static final int UNSIGNED_INT_IMAGE_2D_ARRAY = 0x9069; - public static final int UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY = 0x906A; - public static final int UNSIGNED_INT_IMAGE_2D_MULTISAMPLE = 0x906B; - public static final int UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x906C; - public static final int MAX_IMAGE_SAMPLES = 0x906D; - public static final int IMAGE_BINDING_FORMAT = 0x906E; - public static final int IMAGE_FORMAT_COMPATIBILITY_TYPE = 0x90C7; - public static final int IMAGE_FORMAT_COMPATIBILITY_BY_SIZE = 0x90C8; - public static final int IMAGE_FORMAT_COMPATIBILITY_BY_CLASS = 0x90C9; - public static final int MAX_VERTEX_IMAGE_UNIFORMS = 0x90CA; - public static final int MAX_TESS_CONTROL_IMAGE_UNIFORMS = 0x90CB; - public static final int MAX_TESS_EVALUATION_IMAGE_UNIFORMS = 0x90CC; - public static final int MAX_GEOMETRY_IMAGE_UNIFORMS = 0x90CD; - public static final int MAX_FRAGMENT_IMAGE_UNIFORMS = 0x90CE; - public static final int MAX_COMBINED_IMAGE_UNIFORMS = 0x90CF; - public static final int COMPRESSED_RGBA_BPTC_UNORM = 0x8E8C; - public static final int COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 0x8E8D; - public static final int COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 0x8E8E; - public static final int COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 0x8E8F; - public static final int TEXTURE_IMMUTABLE_FORMAT = 0x912F; +public sealed interface GL42C extends GL41C permits GL43C { + int COPY_READ_BUFFER_BINDING = 0x8F36; + int COPY_WRITE_BUFFER_BINDING = 0x8F37; + int TRANSFORM_FEEDBACK_ACTIVE = 0x8E24; + int TRANSFORM_FEEDBACK_PAUSED = 0x8E23; + int UNPACK_COMPRESSED_BLOCK_WIDTH = 0x9127; + int UNPACK_COMPRESSED_BLOCK_HEIGHT = 0x9128; + int UNPACK_COMPRESSED_BLOCK_DEPTH = 0x9129; + int UNPACK_COMPRESSED_BLOCK_SIZE = 0x912A; + int PACK_COMPRESSED_BLOCK_WIDTH = 0x912B; + int PACK_COMPRESSED_BLOCK_HEIGHT = 0x912C; + int PACK_COMPRESSED_BLOCK_DEPTH = 0x912D; + int PACK_COMPRESSED_BLOCK_SIZE = 0x912E; + int NUM_SAMPLE_COUNTS = 0x9380; + int MIN_MAP_BUFFER_ALIGNMENT = 0x90BC; + int ATOMIC_COUNTER_BUFFER = 0x92C0; + int ATOMIC_COUNTER_BUFFER_BINDING = 0x92C1; + int ATOMIC_COUNTER_BUFFER_START = 0x92C2; + int ATOMIC_COUNTER_BUFFER_SIZE = 0x92C3; + int ATOMIC_COUNTER_BUFFER_DATA_SIZE = 0x92C4; + int ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS = 0x92C5; + int ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES = 0x92C6; + int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER = 0x92C7; + int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER = 0x92C8; + int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x92C9; + int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER = 0x92CA; + int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER = 0x92CB; + int MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = 0x92CC; + int MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS = 0x92CD; + int MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = 0x92CE; + int MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS = 0x92CF; + int MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS = 0x92D0; + int MAX_COMBINED_ATOMIC_COUNTER_BUFFERS = 0x92D1; + int MAX_VERTEX_ATOMIC_COUNTERS = 0x92D2; + int MAX_TESS_CONTROL_ATOMIC_COUNTERS = 0x92D3; + int MAX_TESS_EVALUATION_ATOMIC_COUNTERS = 0x92D4; + int MAX_GEOMETRY_ATOMIC_COUNTERS = 0x92D5; + int MAX_FRAGMENT_ATOMIC_COUNTERS = 0x92D6; + int MAX_COMBINED_ATOMIC_COUNTERS = 0x92D7; + int MAX_ATOMIC_COUNTER_BUFFER_SIZE = 0x92D8; + int MAX_ATOMIC_COUNTER_BUFFER_BINDINGS = 0x92DC; + int ACTIVE_ATOMIC_COUNTER_BUFFERS = 0x92D9; + int UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX = 0x92DA; + int UNSIGNED_INT_ATOMIC_COUNTER = 0x92DB; + int VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 0x00000001; + int ELEMENT_ARRAY_BARRIER_BIT = 0x00000002; + int UNIFORM_BARRIER_BIT = 0x00000004; + int TEXTURE_FETCH_BARRIER_BIT = 0x00000008; + int SHADER_IMAGE_ACCESS_BARRIER_BIT = 0x00000020; + int COMMAND_BARRIER_BIT = 0x00000040; + int PIXEL_BUFFER_BARRIER_BIT = 0x00000080; + int TEXTURE_UPDATE_BARRIER_BIT = 0x00000100; + int BUFFER_UPDATE_BARRIER_BIT = 0x00000200; + int FRAMEBUFFER_BARRIER_BIT = 0x00000400; + int TRANSFORM_FEEDBACK_BARRIER_BIT = 0x00000800; + int ATOMIC_COUNTER_BARRIER_BIT = 0x00001000; + int ALL_BARRIER_BITS = 0xFFFFFFFF; + int MAX_IMAGE_UNITS = 0x8F38; + int MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS = 0x8F39; + int IMAGE_BINDING_NAME = 0x8F3A; + int IMAGE_BINDING_LEVEL = 0x8F3B; + int IMAGE_BINDING_LAYERED = 0x8F3C; + int IMAGE_BINDING_LAYER = 0x8F3D; + int IMAGE_BINDING_ACCESS = 0x8F3E; + int IMAGE_1D = 0x904C; + int IMAGE_2D = 0x904D; + int IMAGE_3D = 0x904E; + int IMAGE_2D_RECT = 0x904F; + int IMAGE_CUBE = 0x9050; + int IMAGE_BUFFER = 0x9051; + int IMAGE_1D_ARRAY = 0x9052; + int IMAGE_2D_ARRAY = 0x9053; + int IMAGE_CUBE_MAP_ARRAY = 0x9054; + int IMAGE_2D_MULTISAMPLE = 0x9055; + int IMAGE_2D_MULTISAMPLE_ARRAY = 0x9056; + int INT_IMAGE_1D = 0x9057; + int INT_IMAGE_2D = 0x9058; + int INT_IMAGE_3D = 0x9059; + int INT_IMAGE_2D_RECT = 0x905A; + int INT_IMAGE_CUBE = 0x905B; + int INT_IMAGE_BUFFER = 0x905C; + int INT_IMAGE_1D_ARRAY = 0x905D; + int INT_IMAGE_2D_ARRAY = 0x905E; + int INT_IMAGE_CUBE_MAP_ARRAY = 0x905F; + int INT_IMAGE_2D_MULTISAMPLE = 0x9060; + int INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9061; + int UNSIGNED_INT_IMAGE_1D = 0x9062; + int UNSIGNED_INT_IMAGE_2D = 0x9063; + int UNSIGNED_INT_IMAGE_3D = 0x9064; + int UNSIGNED_INT_IMAGE_2D_RECT = 0x9065; + int UNSIGNED_INT_IMAGE_CUBE = 0x9066; + int UNSIGNED_INT_IMAGE_BUFFER = 0x9067; + int UNSIGNED_INT_IMAGE_1D_ARRAY = 0x9068; + int UNSIGNED_INT_IMAGE_2D_ARRAY = 0x9069; + int UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY = 0x906A; + int UNSIGNED_INT_IMAGE_2D_MULTISAMPLE = 0x906B; + int UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x906C; + int MAX_IMAGE_SAMPLES = 0x906D; + int IMAGE_BINDING_FORMAT = 0x906E; + int IMAGE_FORMAT_COMPATIBILITY_TYPE = 0x90C7; + int IMAGE_FORMAT_COMPATIBILITY_BY_SIZE = 0x90C8; + int IMAGE_FORMAT_COMPATIBILITY_BY_CLASS = 0x90C9; + int MAX_VERTEX_IMAGE_UNIFORMS = 0x90CA; + int MAX_TESS_CONTROL_IMAGE_UNIFORMS = 0x90CB; + int MAX_TESS_EVALUATION_IMAGE_UNIFORMS = 0x90CC; + int MAX_GEOMETRY_IMAGE_UNIFORMS = 0x90CD; + int MAX_FRAGMENT_IMAGE_UNIFORMS = 0x90CE; + int MAX_COMBINED_IMAGE_UNIFORMS = 0x90CF; + int COMPRESSED_RGBA_BPTC_UNORM = 0x8E8C; + int COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 0x8E8D; + int COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 0x8E8E; + int COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 0x8E8F; + int TEXTURE_IMMUTABLE_FORMAT = 0x912F; - static boolean isSupported(GLCapabilities caps) { - return checkAll(caps.glBindImageTexture, caps.glDrawArraysInstancedBaseInstance, caps.glDrawElementsInstancedBaseInstance, caps.glDrawElementsInstancedBaseVertexBaseInstance, caps.glDrawTransformFeedbackInstanced, caps.glDrawTransformFeedbackStreamInstanced, - caps.glGetActiveAtomicCounterBufferiv, caps.glGetInternalformativ, caps.glMemoryBarrier, caps.glTexStorage1D, caps.glTexStorage2D, caps.glTexStorage3D); + @Entrypoint("glBindImageTexture") + default void bindImageTexture(int unit, int texture, int level, boolean layered, int layer, int access, int format) { + throw new ContextException(); } - static void load(GLCapabilities caps, GLLoadFunc load) { - caps.glBindImageTexture = load.invoke("glBindImageTexture", IIIZIIIV); - caps.glDrawArraysInstancedBaseInstance = load.invoke("glDrawArraysInstancedBaseInstance", IIIIIV); - caps.glDrawElementsInstancedBaseInstance = load.invoke("glDrawElementsInstancedBaseInstance", IIIPIIV); - caps.glDrawElementsInstancedBaseVertexBaseInstance = load.invoke("glDrawElementsInstancedBaseVertexBaseInstance", IIIPIIIV); - caps.glDrawTransformFeedbackInstanced = load.invoke("glDrawTransformFeedbackInstanced", IIIV); - caps.glDrawTransformFeedbackStreamInstanced = load.invoke("glDrawTransformFeedbackStreamInstanced", IIIIV); - 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); - caps.glTexStorage3D = load.invoke("glTexStorage3D", IIIIIIV); + @Entrypoint("glDrawArraysInstancedBaseInstance") + default void drawArraysInstancedBaseInstance(int mode, int first, int count, int instanceCount, int baseInstance) { + throw new ContextException(); } - public static void bindImageTexture(int unit, int texture, int level, boolean layered, int layer, int access, int format) { - var caps = getCapabilities(); - try { - check(caps.glBindImageTexture).invokeExact(unit, texture, level, layered, layer, access, format); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDrawElementsInstancedBaseInstance") + default void drawElementsInstancedBaseInstance(int mode, int count, int type, MemorySegment indices, int instanceCount, int baseInstance) { + throw new ContextException(); } - public static void drawArraysInstancedBaseInstance(int mode, int first, int count, int instanceCount, int baseInstance) { - var caps = getCapabilities(); - try { - check(caps.glDrawArraysInstancedBaseInstance).invokeExact(mode, first, count, instanceCount, baseInstance); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDrawElementsInstancedBaseInstance") + default void drawElementsInstancedBaseInstance(SegmentAllocator allocator, int mode, int count, int type, byte[] indices, int instanceCount, int baseInstance) { + throw new ContextException(); } - public static void drawElementsInstancedBaseInstance(int mode, int count, int type, MemorySegment indices, int instanceCount, int baseInstance) { - var caps = getCapabilities(); - try { - check(caps.glDrawElementsInstancedBaseInstance).invokeExact(mode, count, type, indices, instanceCount, baseInstance); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDrawElementsInstancedBaseInstance") + default void drawElementsInstancedBaseInstance(SegmentAllocator allocator, int mode, int count, int type, short[] indices, int instanceCount, int baseInstance) { + throw new ContextException(); } - public static void drawElementsInstancedBaseInstance(SegmentAllocator allocator, int mode, int count, int type, byte[] indices, int instanceCount, int baseInstance) { - drawElementsInstancedBaseInstance(mode, count, type, allocator.allocateFrom(JAVA_BYTE, indices), instanceCount, baseInstance); + @Entrypoint("glDrawElementsInstancedBaseInstance") + default void drawElementsInstancedBaseInstance(SegmentAllocator allocator, int mode, int count, int type, int[] indices, int instanceCount, int baseInstance) { + throw new ContextException(); } - public static void drawElementsInstancedBaseInstance(SegmentAllocator allocator, int mode, int count, int type, short[] indices, int instanceCount, int baseInstance) { - drawElementsInstancedBaseInstance(mode, count, type, allocator.allocateFrom(JAVA_SHORT, indices), instanceCount, baseInstance); + @Entrypoint("glDrawElementsInstancedBaseVertexBaseInstance") + default void drawElementsInstancedBaseVertexBaseInstance(int mode, int count, int type, MemorySegment indices, int instanceCount, int baseVertex, int baseInstance) { + throw new ContextException(); } - public static void drawElementsInstancedBaseInstance(SegmentAllocator allocator, int mode, int count, int type, int[] indices, int instanceCount, int baseInstance) { - drawElementsInstancedBaseInstance(mode, count, type, allocator.allocateFrom(JAVA_INT, indices), instanceCount, baseInstance); + @Entrypoint("glDrawElementsInstancedBaseVertexBaseInstance") + default void drawElementsInstancedBaseVertexBaseInstance(SegmentAllocator allocator, int mode, int count, int type, byte[] indices, int instanceCount, int baseVertex, int baseInstance) { + throw new ContextException(); } - public static void drawElementsInstancedBaseVertexBaseInstance(int mode, int count, int type, MemorySegment indices, int instanceCount, int baseVertex, int baseInstance) { - var caps = getCapabilities(); - try { - check(caps.glDrawElementsInstancedBaseVertexBaseInstance).invokeExact(mode, count, type, indices, instanceCount, baseVertex, baseInstance); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDrawElementsInstancedBaseVertexBaseInstance") + default void drawElementsInstancedBaseVertexBaseInstance(SegmentAllocator allocator, int mode, int count, int type, short[] indices, int instanceCount, int baseVertex, int baseInstance) { + throw new ContextException(); } - public static void drawElementsInstancedBaseVertexBaseInstance(SegmentAllocator allocator, int mode, int count, int type, byte[] indices, int instanceCount, int baseVertex, int baseInstance) { - drawElementsInstancedBaseVertexBaseInstance(mode, count, type, allocator.allocateFrom(JAVA_BYTE, indices), instanceCount, baseVertex, baseInstance); + @Entrypoint("glDrawElementsInstancedBaseVertexBaseInstance") + default void drawElementsInstancedBaseVertexBaseInstance(SegmentAllocator allocator, int mode, int count, int type, int[] indices, int instanceCount, int baseVertex, int baseInstance) { + throw new ContextException(); } - public static void drawElementsInstancedBaseVertexBaseInstance(SegmentAllocator allocator, int mode, int count, int type, short[] indices, int instanceCount, int baseVertex, int baseInstance) { - drawElementsInstancedBaseVertexBaseInstance(mode, count, type, allocator.allocateFrom(JAVA_SHORT, indices), instanceCount, baseVertex, baseInstance); + @Entrypoint("glDrawTransformFeedbackInstanced") + default void drawTransformFeedbackInstanced(int mode, int id, int instanceCount) { + throw new ContextException(); } - public static void drawElementsInstancedBaseVertexBaseInstance(SegmentAllocator allocator, int mode, int count, int type, int[] indices, int instanceCount, int baseVertex, int baseInstance) { - drawElementsInstancedBaseVertexBaseInstance(mode, count, type, allocator.allocateFrom(JAVA_INT, indices), instanceCount, baseVertex, baseInstance); + @Entrypoint("glDrawTransformFeedbackStreamInstanced") + default void drawTransformFeedbackStreamInstanced(int mode, int id, int stream, int instanceCount) { + throw new ContextException(); } - public static void drawTransformFeedbackInstanced(int mode, int id, int instanceCount) { - var caps = getCapabilities(); - try { - check(caps.glDrawTransformFeedbackInstanced).invokeExact(mode, id, instanceCount); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetActiveAtomicCounterBufferiv") + default void getActiveAtomicCounterBufferiv(int program, int bufferIndex, int pname, MemorySegment params) { + throw new ContextException(); } - public static void drawTransformFeedbackStreamInstanced(int mode, int id, int stream, int instanceCount) { - var caps = getCapabilities(); - try { - check(caps.glDrawTransformFeedbackStreamInstanced).invokeExact(mode, id, stream, instanceCount); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetActiveAtomicCounterBufferiv") + default void getActiveAtomicCounterBufferiv(SegmentAllocator allocator, int program, int bufferIndex, int pname, @Ref int[] params) { + throw new ContextException(); } - public static void getActiveAtomicCounterBufferiv(int program, int bufferIndex, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetActiveAtomicCounterBufferiv).invokeExact(program, bufferIndex, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void getActiveAtomicCounterBufferiv(SegmentAllocator allocator, int program, int bufferIndex, int pname, int[] params) { - var seg = allocator.allocateFrom(JAVA_INT, params); - getActiveAtomicCounterBufferiv(program, bufferIndex, pname, seg); - RuntimeHelper.toArray(seg, params); - } - - public static int getActiveAtomicCounterBufferi(int program, int bufferIndex, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getActiveAtomicCounterBufferiv(int program, int bufferIndex, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getActiveAtomicCounterBufferiv(program, bufferIndex, pname, seg); - return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); + return seg.get(ValueLayout.JAVA_INT, 0); } } - public static void getInternalformativ(int target, int internalFormat, int pname, int count, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetInternalformativ).invokeExact(target, internalFormat, pname, count, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetInternalformativ") + default void getInternalformativ(int target, int internalFormat, int pname, int count, MemorySegment params) { + throw new ContextException(); } - public static void getInternalformativ(SegmentAllocator allocator, int target, int internalFormat, int pname, int[] params) { - var seg = allocator.allocateFrom(JAVA_INT, params); + @Skip + default void getInternalformativ(SegmentAllocator allocator, int target, int internalFormat, int pname, @Ref int[] params) { + var seg = Marshal.marshal(allocator, params); getInternalformativ(target, internalFormat, pname, params.length, seg); - RuntimeHelper.toArray(seg, params); + Unmarshal.copy(seg, params); } - public static int getInternalformati(int target, int internalFormat, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getInternalformativ(int target, int internalFormat, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getInternalformativ(target, internalFormat, pname, 1, seg); - return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); + return seg.get(ValueLayout.JAVA_INT, 0); } } - public static void memoryBarrier(int barriers) { - var caps = getCapabilities(); - try { - check(caps.glMemoryBarrier).invokeExact(barriers); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMemoryBarrier") + default void memoryBarrier(int barriers) { + throw new ContextException(); } - public static void texStorage1D(int target, int levels, int internalFormat, int width) { - var caps = getCapabilities(); - try { - check(caps.glTexStorage1D).invokeExact(target, levels, internalFormat, width); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexStorage1D") + default void texStorage1D(int target, int levels, int internalFormat, int width) { + throw new ContextException(); } - public static void texStorage2D(int target, int levels, int internalFormat, int width, int height) { - var caps = getCapabilities(); - try { - check(caps.glTexStorage2D).invokeExact(target, levels, internalFormat, width, height); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexStorage2D") + default void texStorage2D(int target, int levels, int internalFormat, int width, int height) { + throw new ContextException(); } - public static void texStorage3D(int target, int levels, int internalFormat, int width, int height, int depth) { - var caps = getCapabilities(); - try { - check(caps.glTexStorage3D).invokeExact(target, levels, internalFormat, width, height, depth); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexStorage3D") + default void texStorage3D(int target, int levels, int internalFormat, int width, int height, int depth) { + throw new ContextException(); } } 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 94d70f19..45028ca9 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL43C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL43C.java @@ -17,18 +17,20 @@ package overrungl.opengl; import org.jetbrains.annotations.Nullable; +import overrun.marshal.Marshal; +import overrun.marshal.MemoryStack; +import overrun.marshal.Unmarshal; +import overrun.marshal.gen.Entrypoint; +import overrun.marshal.gen.Ref; +import overrun.marshal.gen.Skip; import overrungl.opengl.ext.arb.GLARBDebugOutput; import overrungl.opengl.ext.arb.GLARBInternalformatQuery2; -import overrungl.internal.RuntimeHelper; -import overrungl.util.MemoryStack; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; import static java.lang.foreign.ValueLayout.*; -import static overrungl.FunctionDescriptors.*; -import static overrungl.opengl.GLLoader.*; /** * The OpenGL 4.3 core profile functions. @@ -55,959 +57,695 @@ * @author squid233 * @since 0.1.0 */ -public sealed class GL43C extends GL42C permits GL44C { - public static final int NUM_SHADING_LANGUAGE_VERSIONS = 0x82E9; - public static final int VERTEX_ATTRIB_ARRAY_LONG = 0x874E; - public static final int COMPRESSED_RGB8_ETC2 = 0x9274; - public static final int COMPRESSED_SRGB8_ETC2 = 0x9275; - public static final int COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276; - public static final int COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277; - public static final int COMPRESSED_RGBA8_ETC2_EAC = 0x9278; - public static final int COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279; - public static final int COMPRESSED_R11_EAC = 0x9270; - public static final int COMPRESSED_SIGNED_R11_EAC = 0x9271; - public static final int COMPRESSED_RG11_EAC = 0x9272; - public static final int COMPRESSED_SIGNED_RG11_EAC = 0x9273; - public static final int PRIMITIVE_RESTART_FIXED_INDEX = 0x8D69; - public static final int ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A; - public static final int MAX_ELEMENT_INDEX = 0x8D6B; - public static final int COMPUTE_SHADER = 0x91B9; - public static final int MAX_COMPUTE_UNIFORM_BLOCKS = 0x91BB; - public static final int MAX_COMPUTE_TEXTURE_IMAGE_UNITS = 0x91BC; - public static final int MAX_COMPUTE_IMAGE_UNIFORMS = 0x91BD; - public static final int MAX_COMPUTE_SHARED_MEMORY_SIZE = 0x8262; - public static final int MAX_COMPUTE_UNIFORM_COMPONENTS = 0x8263; - public static final int MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS = 0x8264; - public static final int MAX_COMPUTE_ATOMIC_COUNTERS = 0x8265; - public static final int MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS = 0x8266; - public static final int MAX_COMPUTE_WORK_GROUP_INVOCATIONS = 0x90EB; - public static final int MAX_COMPUTE_WORK_GROUP_COUNT = 0x91BE; - public static final int MAX_COMPUTE_WORK_GROUP_SIZE = 0x91BF; - public static final int COMPUTE_WORK_GROUP_SIZE = 0x8267; - public static final int UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER = 0x90EC; - public static final int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER = 0x90ED; - public static final int DISPATCH_INDIRECT_BUFFER = 0x90EE; - public static final int DISPATCH_INDIRECT_BUFFER_BINDING = 0x90EF; - public static final int COMPUTE_SHADER_BIT = 0x00000020; - public static final int DEBUG_OUTPUT_SYNCHRONOUS = 0x8242; - public static final int DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 0x8243; - public static final int DEBUG_CALLBACK_FUNCTION = 0x8244; - public static final int DEBUG_CALLBACK_USER_PARAM = 0x8245; - public static final int DEBUG_SOURCE_API = 0x8246; - public static final int DEBUG_SOURCE_WINDOW_SYSTEM = 0x8247; - public static final int DEBUG_SOURCE_SHADER_COMPILER = 0x8248; - public static final int DEBUG_SOURCE_THIRD_PARTY = 0x8249; - public static final int DEBUG_SOURCE_APPLICATION = 0x824A; - public static final int DEBUG_SOURCE_OTHER = 0x824B; - public static final int DEBUG_TYPE_ERROR = 0x824C; - public static final int DEBUG_TYPE_DEPRECATED_BEHAVIOR = 0x824D; - public static final int DEBUG_TYPE_UNDEFINED_BEHAVIOR = 0x824E; - public static final int DEBUG_TYPE_PORTABILITY = 0x824F; - public static final int DEBUG_TYPE_PERFORMANCE = 0x8250; - public static final int DEBUG_TYPE_OTHER = 0x8251; - public static final int MAX_DEBUG_MESSAGE_LENGTH = 0x9143; - public static final int MAX_DEBUG_LOGGED_MESSAGES = 0x9144; - public static final int DEBUG_LOGGED_MESSAGES = 0x9145; - public static final int DEBUG_SEVERITY_HIGH = 0x9146; - public static final int DEBUG_SEVERITY_MEDIUM = 0x9147; - public static final int DEBUG_SEVERITY_LOW = 0x9148; - public static final int DEBUG_TYPE_MARKER = 0x8268; - public static final int DEBUG_TYPE_PUSH_GROUP = 0x8269; - public static final int DEBUG_TYPE_POP_GROUP = 0x826A; - public static final int DEBUG_SEVERITY_NOTIFICATION = 0x826B; - public static final int MAX_DEBUG_GROUP_STACK_DEPTH = 0x826C; - public static final int DEBUG_GROUP_STACK_DEPTH = 0x826D; - public static final int BUFFER = 0x82E0; - public static final int SHADER = 0x82E1; - public static final int PROGRAM = 0x82E2; - public static final int QUERY = 0x82E3; - public static final int PROGRAM_PIPELINE = 0x82E4; - public static final int SAMPLER = 0x82E6; - public static final int MAX_LABEL_LENGTH = 0x82E8; - public static final int DEBUG_OUTPUT = 0x92E0; - public static final int CONTEXT_FLAG_DEBUG_BIT = 0x00000002; - public static final int MAX_UNIFORM_LOCATIONS = 0x826E; - public static final int FRAMEBUFFER_DEFAULT_WIDTH = 0x9310; - public static final int FRAMEBUFFER_DEFAULT_HEIGHT = 0x9311; - public static final int FRAMEBUFFER_DEFAULT_LAYERS = 0x9312; - public static final int FRAMEBUFFER_DEFAULT_SAMPLES = 0x9313; - public static final int FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS = 0x9314; - public static final int MAX_FRAMEBUFFER_WIDTH = 0x9315; - public static final int MAX_FRAMEBUFFER_HEIGHT = 0x9316; - public static final int MAX_FRAMEBUFFER_LAYERS = 0x9317; - public static final int MAX_FRAMEBUFFER_SAMPLES = 0x9318; - public static final int INTERNALFORMAT_SUPPORTED = 0x826F; - public static final int INTERNALFORMAT_PREFERRED = 0x8270; - public static final int INTERNALFORMAT_RED_SIZE = 0x8271; - public static final int INTERNALFORMAT_GREEN_SIZE = 0x8272; - public static final int INTERNALFORMAT_BLUE_SIZE = 0x8273; - public static final int INTERNALFORMAT_ALPHA_SIZE = 0x8274; - public static final int INTERNALFORMAT_DEPTH_SIZE = 0x8275; - public static final int INTERNALFORMAT_STENCIL_SIZE = 0x8276; - public static final int INTERNALFORMAT_SHARED_SIZE = 0x8277; - public static final int INTERNALFORMAT_RED_TYPE = 0x8278; - public static final int INTERNALFORMAT_GREEN_TYPE = 0x8279; - public static final int INTERNALFORMAT_BLUE_TYPE = 0x827A; - public static final int INTERNALFORMAT_ALPHA_TYPE = 0x827B; - public static final int INTERNALFORMAT_DEPTH_TYPE = 0x827C; - public static final int INTERNALFORMAT_STENCIL_TYPE = 0x827D; - public static final int MAX_WIDTH = 0x827E; - public static final int MAX_HEIGHT = 0x827F; - public static final int MAX_DEPTH = 0x8280; - public static final int MAX_LAYERS = 0x8281; - public static final int MAX_COMBINED_DIMENSIONS = 0x8282; - public static final int COLOR_COMPONENTS = 0x8283; - public static final int DEPTH_COMPONENTS = 0x8284; - public static final int STENCIL_COMPONENTS = 0x8285; - public static final int COLOR_RENDERABLE = 0x8286; - public static final int DEPTH_RENDERABLE = 0x8287; - public static final int STENCIL_RENDERABLE = 0x8288; - public static final int FRAMEBUFFER_RENDERABLE = 0x8289; - public static final int FRAMEBUFFER_RENDERABLE_LAYERED = 0x828A; - public static final int FRAMEBUFFER_BLEND = 0x828B; - public static final int READ_PIXELS = 0x828C; - public static final int READ_PIXELS_FORMAT = 0x828D; - public static final int READ_PIXELS_TYPE = 0x828E; - public static final int TEXTURE_IMAGE_FORMAT = 0x828F; - public static final int TEXTURE_IMAGE_TYPE = 0x8290; - public static final int GET_TEXTURE_IMAGE_FORMAT = 0x8291; - public static final int GET_TEXTURE_IMAGE_TYPE = 0x8292; - public static final int MIPMAP = 0x8293; - public static final int MANUAL_GENERATE_MIPMAP = 0x8294; - public static final int AUTO_GENERATE_MIPMAP = 0x8295; - public static final int COLOR_ENCODING = 0x8296; - public static final int SRGB_READ = 0x8297; - public static final int SRGB_WRITE = 0x8298; - public static final int FILTER = 0x829A; - public static final int VERTEX_TEXTURE = 0x829B; - public static final int TESS_CONTROL_TEXTURE = 0x829C; - public static final int TESS_EVALUATION_TEXTURE = 0x829D; - public static final int GEOMETRY_TEXTURE = 0x829E; - public static final int FRAGMENT_TEXTURE = 0x829F; - public static final int COMPUTE_TEXTURE = 0x82A0; - public static final int TEXTURE_SHADOW = 0x82A1; - public static final int TEXTURE_GATHER = 0x82A2; - public static final int TEXTURE_GATHER_SHADOW = 0x82A3; - public static final int SHADER_IMAGE_LOAD = 0x82A4; - public static final int SHADER_IMAGE_STORE = 0x82A5; - public static final int SHADER_IMAGE_ATOMIC = 0x82A6; - public static final int IMAGE_TEXEL_SIZE = 0x82A7; - public static final int IMAGE_COMPATIBILITY_CLASS = 0x82A8; - public static final int IMAGE_PIXEL_FORMAT = 0x82A9; - public static final int IMAGE_PIXEL_TYPE = 0x82AA; - public static final int SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST = 0x82AC; - public static final int SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST = 0x82AD; - public static final int SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE = 0x82AE; - public static final int SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE = 0x82AF; - public static final int TEXTURE_COMPRESSED_BLOCK_WIDTH = 0x82B1; - public static final int TEXTURE_COMPRESSED_BLOCK_HEIGHT = 0x82B2; - public static final int TEXTURE_COMPRESSED_BLOCK_SIZE = 0x82B3; - public static final int CLEAR_BUFFER = 0x82B4; - public static final int TEXTURE_VIEW = 0x82B5; - public static final int VIEW_COMPATIBILITY_CLASS = 0x82B6; - public static final int FULL_SUPPORT = 0x82B7; - public static final int CAVEAT_SUPPORT = 0x82B8; - public static final int IMAGE_CLASS_4_X_32 = 0x82B9; - public static final int IMAGE_CLASS_2_X_32 = 0x82BA; - public static final int IMAGE_CLASS_1_X_32 = 0x82BB; - public static final int IMAGE_CLASS_4_X_16 = 0x82BC; - public static final int IMAGE_CLASS_2_X_16 = 0x82BD; - public static final int IMAGE_CLASS_1_X_16 = 0x82BE; - public static final int IMAGE_CLASS_4_X_8 = 0x82BF; - public static final int IMAGE_CLASS_2_X_8 = 0x82C0; - public static final int IMAGE_CLASS_1_X_8 = 0x82C1; - public static final int IMAGE_CLASS_11_11_10 = 0x82C2; - public static final int IMAGE_CLASS_10_10_10_2 = 0x82C3; - public static final int VIEW_CLASS_128_BITS = 0x82C4; - public static final int VIEW_CLASS_96_BITS = 0x82C5; - public static final int VIEW_CLASS_64_BITS = 0x82C6; - public static final int VIEW_CLASS_48_BITS = 0x82C7; - public static final int VIEW_CLASS_32_BITS = 0x82C8; - public static final int VIEW_CLASS_24_BITS = 0x82C9; - public static final int VIEW_CLASS_16_BITS = 0x82CA; - public static final int VIEW_CLASS_8_BITS = 0x82CB; - public static final int VIEW_CLASS_S3TC_DXT1_RGB = 0x82CC; - public static final int VIEW_CLASS_S3TC_DXT1_RGBA = 0x82CD; - public static final int VIEW_CLASS_S3TC_DXT3_RGBA = 0x82CE; - public static final int VIEW_CLASS_S3TC_DXT5_RGBA = 0x82CF; - public static final int VIEW_CLASS_RGTC1_RED = 0x82D0; - public static final int VIEW_CLASS_RGTC2_RG = 0x82D1; - public static final int VIEW_CLASS_BPTC_UNORM = 0x82D2; - public static final int VIEW_CLASS_BPTC_FLOAT = 0x82D3; - public static final int UNIFORM = 0x92E1; - public static final int UNIFORM_BLOCK = 0x92E2; - public static final int PROGRAM_INPUT = 0x92E3; - public static final int PROGRAM_OUTPUT = 0x92E4; - public static final int BUFFER_VARIABLE = 0x92E5; - public static final int SHADER_STORAGE_BLOCK = 0x92E6; - public static final int VERTEX_SUBROUTINE = 0x92E8; - public static final int TESS_CONTROL_SUBROUTINE = 0x92E9; - public static final int TESS_EVALUATION_SUBROUTINE = 0x92EA; - public static final int GEOMETRY_SUBROUTINE = 0x92EB; - public static final int FRAGMENT_SUBROUTINE = 0x92EC; - public static final int COMPUTE_SUBROUTINE = 0x92ED; - public static final int VERTEX_SUBROUTINE_UNIFORM = 0x92EE; - public static final int TESS_CONTROL_SUBROUTINE_UNIFORM = 0x92EF; - public static final int TESS_EVALUATION_SUBROUTINE_UNIFORM = 0x92F0; - public static final int GEOMETRY_SUBROUTINE_UNIFORM = 0x92F1; - public static final int FRAGMENT_SUBROUTINE_UNIFORM = 0x92F2; - public static final int COMPUTE_SUBROUTINE_UNIFORM = 0x92F3; - public static final int TRANSFORM_FEEDBACK_VARYING = 0x92F4; - public static final int ACTIVE_RESOURCES = 0x92F5; - public static final int MAX_NAME_LENGTH = 0x92F6; - public static final int MAX_NUM_ACTIVE_VARIABLES = 0x92F7; - public static final int MAX_NUM_COMPATIBLE_SUBROUTINES = 0x92F8; - public static final int NAME_LENGTH = 0x92F9; - public static final int TYPE = 0x92FA; - public static final int ARRAY_SIZE = 0x92FB; - public static final int OFFSET = 0x92FC; - public static final int BLOCK_INDEX = 0x92FD; - public static final int ARRAY_STRIDE = 0x92FE; - public static final int MATRIX_STRIDE = 0x92FF; - public static final int IS_ROW_MAJOR = 0x9300; - public static final int ATOMIC_COUNTER_BUFFER_INDEX = 0x9301; - public static final int BUFFER_BINDING = 0x9302; - public static final int BUFFER_DATA_SIZE = 0x9303; - public static final int NUM_ACTIVE_VARIABLES = 0x9304; - public static final int ACTIVE_VARIABLES = 0x9305; - public static final int REFERENCED_BY_VERTEX_SHADER = 0x9306; - public static final int REFERENCED_BY_TESS_CONTROL_SHADER = 0x9307; - public static final int REFERENCED_BY_TESS_EVALUATION_SHADER = 0x9308; - public static final int REFERENCED_BY_GEOMETRY_SHADER = 0x9309; - public static final int REFERENCED_BY_FRAGMENT_SHADER = 0x930A; - public static final int REFERENCED_BY_COMPUTE_SHADER = 0x930B; - public static final int TOP_LEVEL_ARRAY_SIZE = 0x930C; - public static final int TOP_LEVEL_ARRAY_STRIDE = 0x930D; - public static final int LOCATION = 0x930E; - public static final int LOCATION_INDEX = 0x930F; - public static final int IS_PER_PATCH = 0x92E7; - public static final int SHADER_STORAGE_BUFFER = 0x90D2; - public static final int SHADER_STORAGE_BUFFER_BINDING = 0x90D3; - public static final int SHADER_STORAGE_BUFFER_START = 0x90D4; - public static final int SHADER_STORAGE_BUFFER_SIZE = 0x90D5; - public static final int MAX_VERTEX_SHADER_STORAGE_BLOCKS = 0x90D6; - public static final int MAX_GEOMETRY_SHADER_STORAGE_BLOCKS = 0x90D7; - public static final int MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS = 0x90D8; - public static final int MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS = 0x90D9; - public static final int MAX_FRAGMENT_SHADER_STORAGE_BLOCKS = 0x90DA; - public static final int MAX_COMPUTE_SHADER_STORAGE_BLOCKS = 0x90DB; - public static final int MAX_COMBINED_SHADER_STORAGE_BLOCKS = 0x90DC; - public static final int MAX_SHADER_STORAGE_BUFFER_BINDINGS = 0x90DD; - public static final int MAX_SHADER_STORAGE_BLOCK_SIZE = 0x90DE; - public static final int SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT = 0x90DF; - public static final int SHADER_STORAGE_BARRIER_BIT = 0x00002000; - public static final int MAX_COMBINED_SHADER_OUTPUT_RESOURCES = 0x8F39; - public static final int DEPTH_STENCIL_TEXTURE_MODE = 0x90EA; - public static final int TEXTURE_BUFFER_OFFSET = 0x919D; - public static final int TEXTURE_BUFFER_SIZE = 0x919E; - public static final int TEXTURE_BUFFER_OFFSET_ALIGNMENT = 0x919F; - public static final int TEXTURE_VIEW_MIN_LEVEL = 0x82DB; - public static final int TEXTURE_VIEW_NUM_LEVELS = 0x82DC; - public static final int TEXTURE_VIEW_MIN_LAYER = 0x82DD; - public static final int TEXTURE_VIEW_NUM_LAYERS = 0x82DE; - public static final int TEXTURE_IMMUTABLE_LEVELS = 0x82DF; - public static final int VERTEX_ATTRIB_BINDING = 0x82D4; - public static final int VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D5; - public static final int VERTEX_BINDING_DIVISOR = 0x82D6; - public static final int VERTEX_BINDING_OFFSET = 0x82D7; - public static final int VERTEX_BINDING_STRIDE = 0x82D8; - public static final int MAX_VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D9; - public static final int MAX_VERTEX_ATTRIB_BINDINGS = 0x82DA; - public static final int VERTEX_BINDING_BUFFER = 0x8F4F; - - static boolean isSupported(GLCapabilities caps) { - return checkAll(caps.glBindVertexBuffer, caps.glClearBufferData, caps.glClearBufferSubData, caps.glCopyImageSubData, caps.glDebugMessageCallback, caps.glDebugMessageControl, - caps.glDebugMessageInsert, caps.glDispatchCompute, caps.glDispatchComputeIndirect, caps.glFramebufferParameteri, caps.glGetDebugMessageLog, caps.glGetFramebufferParameteriv, - caps.glGetInternalformati64v, caps.glGetObjectLabel, caps.glGetObjectPtrLabel, caps.glGetPointerv, caps.glGetProgramInterfaceiv, caps.glGetProgramResourceIndex, - caps.glGetProgramResourceLocation, caps.glGetProgramResourceLocationIndex, caps.glGetProgramResourceName, caps.glGetProgramResourceiv, caps.glInvalidateBufferData, caps.glInvalidateBufferSubData, - caps.glInvalidateFramebuffer, caps.glInvalidateSubFramebuffer, caps.glInvalidateTexImage, caps.glInvalidateTexSubImage, caps.glMultiDrawArraysIndirect, caps.glMultiDrawElementsIndirect, - caps.glObjectLabel, caps.glObjectPtrLabel, caps.glPopDebugGroup, caps.glPushDebugGroup, caps.glShaderStorageBlockBinding, caps.glTexBufferRange, - caps.glTexStorage2DMultisample, caps.glTexStorage3DMultisample, caps.glTextureView, caps.glVertexAttribBinding, caps.glVertexAttribFormat, caps.glVertexAttribIFormat, - caps.glVertexAttribLFormat, caps.glVertexBindingDivisor); - } - - static void load(GLCapabilities caps, GLLoadFunc load) { - caps.glBindVertexBuffer = load.invoke("glBindVertexBuffer", IIJIV); - caps.glClearBufferData = load.invoke("glClearBufferData", IIIIPV); - caps.glClearBufferSubData = load.invoke("glClearBufferSubData", IIJJIIPV); - caps.glCopyImageSubData = load.invoke("glCopyImageSubData", IIIIIIIIIIIIIIIV); - caps.glDebugMessageCallback = load.invoke("glDebugMessageCallback", PPV); - caps.glDebugMessageControl = load.invoke("glDebugMessageControl", IIIIPZV); - caps.glDebugMessageInsert = load.invoke("glDebugMessageInsert", IIIIIPV); - caps.glDispatchCompute = load.invoke("glDispatchCompute", IIIV); - caps.glDispatchComputeIndirect = load.invoke("glDispatchComputeIndirect", JV); - caps.glFramebufferParameteri = load.invoke("glFramebufferParameteri", IIIV); - caps.glGetDebugMessageLog = load.invoke("glGetDebugMessageLog", IIPPPPPPI); - 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); - caps.glGetProgramResourceLocationIndex = load.invoke("glGetProgramResourceLocationIndex", IIPI); - caps.glGetProgramResourceName = load.invoke("glGetProgramResourceName", IIIIPPV); - caps.glGetProgramResourceiv = load.invoke("glGetProgramResourceiv", IIIIPIPPV); - caps.glInvalidateBufferData = load.invoke("glInvalidateBufferData", IV); - caps.glInvalidateBufferSubData = load.invoke("glInvalidateBufferSubData", IJJV); - caps.glInvalidateFramebuffer = load.invoke("glInvalidateFramebuffer", IIPV); - caps.glInvalidateSubFramebuffer = load.invoke("glInvalidateSubFramebuffer", IIPIIIIV); - caps.glInvalidateTexImage = load.invoke("glInvalidateTexImage", IIV); - caps.glInvalidateTexSubImage = load.invoke("glInvalidateTexSubImage", IIIIIIIIV); - caps.glMultiDrawArraysIndirect = load.invoke("glMultiDrawArraysIndirect", IPIIV); - caps.glMultiDrawElementsIndirect = load.invoke("glMultiDrawElementsIndirect", IIPIIV); - caps.glObjectLabel = load.invoke("glObjectLabel", IIIPV); - caps.glObjectPtrLabel = load.invoke("glObjectPtrLabel", PIPV); - caps.glPopDebugGroup = load.invoke("glPopDebugGroup", V); - caps.glPushDebugGroup = load.invoke("glPushDebugGroup", IIIPV); - caps.glShaderStorageBlockBinding = load.invoke("glShaderStorageBlockBinding", IIIV); - caps.glTexBufferRange = load.invoke("glTexBufferRange", IIIJJV); - caps.glTexStorage2DMultisample = load.invoke("glTexStorage2DMultisample", IIIIIZV); - caps.glTexStorage3DMultisample = load.invoke("glTexStorage3DMultisample", IIIIIIZV); - caps.glTextureView = load.invoke("glTextureView", IIIIIIIIV); - caps.glVertexAttribBinding = load.invoke("glVertexAttribBinding", IIV); - caps.glVertexAttribFormat = load.invoke("glVertexAttribFormat", IIIZIV); - caps.glVertexAttribIFormat = load.invoke("glVertexAttribIFormat", IIIIV); - caps.glVertexAttribLFormat = load.invoke("glVertexAttribLFormat", IIIIV); - caps.glVertexBindingDivisor = load.invoke("glVertexBindingDivisor", IIV); - } - - public static void bindVertexBuffer(int bindingIndex, int buffer, long offset, int stride) { - var caps = getCapabilities(); - try { - check(caps.glBindVertexBuffer).invokeExact(bindingIndex, buffer, offset, stride); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void clearBufferData(int target, int internalFormat, int format, int type, MemorySegment data) { - var caps = getCapabilities(); - try { - check(caps.glClearBufferData).invokeExact(target, internalFormat, format, type, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void clearBufferSubData(int target, int internalFormat, long offset, long size, int format, int type, MemorySegment data) { - var caps = getCapabilities(); - try { - check(caps.glClearBufferSubData).invokeExact(target, internalFormat, offset, size, format, type, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } +public sealed interface GL43C extends GL42C permits GL44C { + int NUM_SHADING_LANGUAGE_VERSIONS = 0x82E9; + int VERTEX_ATTRIB_ARRAY_LONG = 0x874E; + int COMPRESSED_RGB8_ETC2 = 0x9274; + int COMPRESSED_SRGB8_ETC2 = 0x9275; + int COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276; + int COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277; + int COMPRESSED_RGBA8_ETC2_EAC = 0x9278; + int COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279; + int COMPRESSED_R11_EAC = 0x9270; + int COMPRESSED_SIGNED_R11_EAC = 0x9271; + int COMPRESSED_RG11_EAC = 0x9272; + int COMPRESSED_SIGNED_RG11_EAC = 0x9273; + int PRIMITIVE_RESTART_FIXED_INDEX = 0x8D69; + int ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A; + int MAX_ELEMENT_INDEX = 0x8D6B; + int COMPUTE_SHADER = 0x91B9; + int MAX_COMPUTE_UNIFORM_BLOCKS = 0x91BB; + int MAX_COMPUTE_TEXTURE_IMAGE_UNITS = 0x91BC; + int MAX_COMPUTE_IMAGE_UNIFORMS = 0x91BD; + int MAX_COMPUTE_SHARED_MEMORY_SIZE = 0x8262; + int MAX_COMPUTE_UNIFORM_COMPONENTS = 0x8263; + int MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS = 0x8264; + int MAX_COMPUTE_ATOMIC_COUNTERS = 0x8265; + int MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS = 0x8266; + int MAX_COMPUTE_WORK_GROUP_INVOCATIONS = 0x90EB; + int MAX_COMPUTE_WORK_GROUP_COUNT = 0x91BE; + int MAX_COMPUTE_WORK_GROUP_SIZE = 0x91BF; + int COMPUTE_WORK_GROUP_SIZE = 0x8267; + int UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER = 0x90EC; + int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER = 0x90ED; + int DISPATCH_INDIRECT_BUFFER = 0x90EE; + int DISPATCH_INDIRECT_BUFFER_BINDING = 0x90EF; + int COMPUTE_SHADER_BIT = 0x00000020; + int DEBUG_OUTPUT_SYNCHRONOUS = 0x8242; + int DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 0x8243; + int DEBUG_CALLBACK_FUNCTION = 0x8244; + int DEBUG_CALLBACK_USER_PARAM = 0x8245; + int DEBUG_SOURCE_API = 0x8246; + int DEBUG_SOURCE_WINDOW_SYSTEM = 0x8247; + int DEBUG_SOURCE_SHADER_COMPILER = 0x8248; + int DEBUG_SOURCE_THIRD_PARTY = 0x8249; + int DEBUG_SOURCE_APPLICATION = 0x824A; + int DEBUG_SOURCE_OTHER = 0x824B; + int DEBUG_TYPE_ERROR = 0x824C; + int DEBUG_TYPE_DEPRECATED_BEHAVIOR = 0x824D; + int DEBUG_TYPE_UNDEFINED_BEHAVIOR = 0x824E; + int DEBUG_TYPE_PORTABILITY = 0x824F; + int DEBUG_TYPE_PERFORMANCE = 0x8250; + int DEBUG_TYPE_OTHER = 0x8251; + int MAX_DEBUG_MESSAGE_LENGTH = 0x9143; + int MAX_DEBUG_LOGGED_MESSAGES = 0x9144; + int DEBUG_LOGGED_MESSAGES = 0x9145; + int DEBUG_SEVERITY_HIGH = 0x9146; + int DEBUG_SEVERITY_MEDIUM = 0x9147; + int DEBUG_SEVERITY_LOW = 0x9148; + int DEBUG_TYPE_MARKER = 0x8268; + int DEBUG_TYPE_PUSH_GROUP = 0x8269; + int DEBUG_TYPE_POP_GROUP = 0x826A; + int DEBUG_SEVERITY_NOTIFICATION = 0x826B; + int MAX_DEBUG_GROUP_STACK_DEPTH = 0x826C; + int DEBUG_GROUP_STACK_DEPTH = 0x826D; + int BUFFER = 0x82E0; + int SHADER = 0x82E1; + int PROGRAM = 0x82E2; + int QUERY = 0x82E3; + int PROGRAM_PIPELINE = 0x82E4; + int SAMPLER = 0x82E6; + int MAX_LABEL_LENGTH = 0x82E8; + int DEBUG_OUTPUT = 0x92E0; + int CONTEXT_FLAG_DEBUG_BIT = 0x00000002; + int MAX_UNIFORM_LOCATIONS = 0x826E; + int FRAMEBUFFER_DEFAULT_WIDTH = 0x9310; + int FRAMEBUFFER_DEFAULT_HEIGHT = 0x9311; + int FRAMEBUFFER_DEFAULT_LAYERS = 0x9312; + int FRAMEBUFFER_DEFAULT_SAMPLES = 0x9313; + int FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS = 0x9314; + int MAX_FRAMEBUFFER_WIDTH = 0x9315; + int MAX_FRAMEBUFFER_HEIGHT = 0x9316; + int MAX_FRAMEBUFFER_LAYERS = 0x9317; + int MAX_FRAMEBUFFER_SAMPLES = 0x9318; + int INTERNALFORMAT_SUPPORTED = 0x826F; + int INTERNALFORMAT_PREFERRED = 0x8270; + int INTERNALFORMAT_RED_SIZE = 0x8271; + int INTERNALFORMAT_GREEN_SIZE = 0x8272; + int INTERNALFORMAT_BLUE_SIZE = 0x8273; + int INTERNALFORMAT_ALPHA_SIZE = 0x8274; + int INTERNALFORMAT_DEPTH_SIZE = 0x8275; + int INTERNALFORMAT_STENCIL_SIZE = 0x8276; + int INTERNALFORMAT_SHARED_SIZE = 0x8277; + int INTERNALFORMAT_RED_TYPE = 0x8278; + int INTERNALFORMAT_GREEN_TYPE = 0x8279; + int INTERNALFORMAT_BLUE_TYPE = 0x827A; + int INTERNALFORMAT_ALPHA_TYPE = 0x827B; + int INTERNALFORMAT_DEPTH_TYPE = 0x827C; + int INTERNALFORMAT_STENCIL_TYPE = 0x827D; + int MAX_WIDTH = 0x827E; + int MAX_HEIGHT = 0x827F; + int MAX_DEPTH = 0x8280; + int MAX_LAYERS = 0x8281; + int MAX_COMBINED_DIMENSIONS = 0x8282; + int COLOR_COMPONENTS = 0x8283; + int DEPTH_COMPONENTS = 0x8284; + int STENCIL_COMPONENTS = 0x8285; + int COLOR_RENDERABLE = 0x8286; + int DEPTH_RENDERABLE = 0x8287; + int STENCIL_RENDERABLE = 0x8288; + int FRAMEBUFFER_RENDERABLE = 0x8289; + int FRAMEBUFFER_RENDERABLE_LAYERED = 0x828A; + int FRAMEBUFFER_BLEND = 0x828B; + int READ_PIXELS = 0x828C; + int READ_PIXELS_FORMAT = 0x828D; + int READ_PIXELS_TYPE = 0x828E; + int TEXTURE_IMAGE_FORMAT = 0x828F; + int TEXTURE_IMAGE_TYPE = 0x8290; + int GET_TEXTURE_IMAGE_FORMAT = 0x8291; + int GET_TEXTURE_IMAGE_TYPE = 0x8292; + int MIPMAP = 0x8293; + int MANUAL_GENERATE_MIPMAP = 0x8294; + int AUTO_GENERATE_MIPMAP = 0x8295; + int COLOR_ENCODING = 0x8296; + int SRGB_READ = 0x8297; + int SRGB_WRITE = 0x8298; + int FILTER = 0x829A; + int VERTEX_TEXTURE = 0x829B; + int TESS_CONTROL_TEXTURE = 0x829C; + int TESS_EVALUATION_TEXTURE = 0x829D; + int GEOMETRY_TEXTURE = 0x829E; + int FRAGMENT_TEXTURE = 0x829F; + int COMPUTE_TEXTURE = 0x82A0; + int TEXTURE_SHADOW = 0x82A1; + int TEXTURE_GATHER = 0x82A2; + int TEXTURE_GATHER_SHADOW = 0x82A3; + int SHADER_IMAGE_LOAD = 0x82A4; + int SHADER_IMAGE_STORE = 0x82A5; + int SHADER_IMAGE_ATOMIC = 0x82A6; + int IMAGE_TEXEL_SIZE = 0x82A7; + int IMAGE_COMPATIBILITY_CLASS = 0x82A8; + int IMAGE_PIXEL_FORMAT = 0x82A9; + int IMAGE_PIXEL_TYPE = 0x82AA; + int SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST = 0x82AC; + int SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST = 0x82AD; + int SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE = 0x82AE; + int SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE = 0x82AF; + int TEXTURE_COMPRESSED_BLOCK_WIDTH = 0x82B1; + int TEXTURE_COMPRESSED_BLOCK_HEIGHT = 0x82B2; + int TEXTURE_COMPRESSED_BLOCK_SIZE = 0x82B3; + int CLEAR_BUFFER = 0x82B4; + int TEXTURE_VIEW = 0x82B5; + int VIEW_COMPATIBILITY_CLASS = 0x82B6; + int FULL_SUPPORT = 0x82B7; + int CAVEAT_SUPPORT = 0x82B8; + int IMAGE_CLASS_4_X_32 = 0x82B9; + int IMAGE_CLASS_2_X_32 = 0x82BA; + int IMAGE_CLASS_1_X_32 = 0x82BB; + int IMAGE_CLASS_4_X_16 = 0x82BC; + int IMAGE_CLASS_2_X_16 = 0x82BD; + int IMAGE_CLASS_1_X_16 = 0x82BE; + int IMAGE_CLASS_4_X_8 = 0x82BF; + int IMAGE_CLASS_2_X_8 = 0x82C0; + int IMAGE_CLASS_1_X_8 = 0x82C1; + int IMAGE_CLASS_11_11_10 = 0x82C2; + int IMAGE_CLASS_10_10_10_2 = 0x82C3; + int VIEW_CLASS_128_BITS = 0x82C4; + int VIEW_CLASS_96_BITS = 0x82C5; + int VIEW_CLASS_64_BITS = 0x82C6; + int VIEW_CLASS_48_BITS = 0x82C7; + int VIEW_CLASS_32_BITS = 0x82C8; + int VIEW_CLASS_24_BITS = 0x82C9; + int VIEW_CLASS_16_BITS = 0x82CA; + int VIEW_CLASS_8_BITS = 0x82CB; + int VIEW_CLASS_S3TC_DXT1_RGB = 0x82CC; + int VIEW_CLASS_S3TC_DXT1_RGBA = 0x82CD; + int VIEW_CLASS_S3TC_DXT3_RGBA = 0x82CE; + int VIEW_CLASS_S3TC_DXT5_RGBA = 0x82CF; + int VIEW_CLASS_RGTC1_RED = 0x82D0; + int VIEW_CLASS_RGTC2_RG = 0x82D1; + int VIEW_CLASS_BPTC_UNORM = 0x82D2; + int VIEW_CLASS_BPTC_FLOAT = 0x82D3; + int UNIFORM = 0x92E1; + int UNIFORM_BLOCK = 0x92E2; + int PROGRAM_INPUT = 0x92E3; + int PROGRAM_OUTPUT = 0x92E4; + int BUFFER_VARIABLE = 0x92E5; + int SHADER_STORAGE_BLOCK = 0x92E6; + int VERTEX_SUBROUTINE = 0x92E8; + int TESS_CONTROL_SUBROUTINE = 0x92E9; + int TESS_EVALUATION_SUBROUTINE = 0x92EA; + int GEOMETRY_SUBROUTINE = 0x92EB; + int FRAGMENT_SUBROUTINE = 0x92EC; + int COMPUTE_SUBROUTINE = 0x92ED; + int VERTEX_SUBROUTINE_UNIFORM = 0x92EE; + int TESS_CONTROL_SUBROUTINE_UNIFORM = 0x92EF; + int TESS_EVALUATION_SUBROUTINE_UNIFORM = 0x92F0; + int GEOMETRY_SUBROUTINE_UNIFORM = 0x92F1; + int FRAGMENT_SUBROUTINE_UNIFORM = 0x92F2; + int COMPUTE_SUBROUTINE_UNIFORM = 0x92F3; + int TRANSFORM_FEEDBACK_VARYING = 0x92F4; + int ACTIVE_RESOURCES = 0x92F5; + int MAX_NAME_LENGTH = 0x92F6; + int MAX_NUM_ACTIVE_VARIABLES = 0x92F7; + int MAX_NUM_COMPATIBLE_SUBROUTINES = 0x92F8; + int NAME_LENGTH = 0x92F9; + int TYPE = 0x92FA; + int ARRAY_SIZE = 0x92FB; + int OFFSET = 0x92FC; + int BLOCK_INDEX = 0x92FD; + int ARRAY_STRIDE = 0x92FE; + int MATRIX_STRIDE = 0x92FF; + int IS_ROW_MAJOR = 0x9300; + int ATOMIC_COUNTER_BUFFER_INDEX = 0x9301; + int BUFFER_BINDING = 0x9302; + int BUFFER_DATA_SIZE = 0x9303; + int NUM_ACTIVE_VARIABLES = 0x9304; + int ACTIVE_VARIABLES = 0x9305; + int REFERENCED_BY_VERTEX_SHADER = 0x9306; + int REFERENCED_BY_TESS_CONTROL_SHADER = 0x9307; + int REFERENCED_BY_TESS_EVALUATION_SHADER = 0x9308; + int REFERENCED_BY_GEOMETRY_SHADER = 0x9309; + int REFERENCED_BY_FRAGMENT_SHADER = 0x930A; + int REFERENCED_BY_COMPUTE_SHADER = 0x930B; + int TOP_LEVEL_ARRAY_SIZE = 0x930C; + int TOP_LEVEL_ARRAY_STRIDE = 0x930D; + int LOCATION = 0x930E; + int LOCATION_INDEX = 0x930F; + int IS_PER_PATCH = 0x92E7; + int SHADER_STORAGE_BUFFER = 0x90D2; + int SHADER_STORAGE_BUFFER_BINDING = 0x90D3; + int SHADER_STORAGE_BUFFER_START = 0x90D4; + int SHADER_STORAGE_BUFFER_SIZE = 0x90D5; + int MAX_VERTEX_SHADER_STORAGE_BLOCKS = 0x90D6; + int MAX_GEOMETRY_SHADER_STORAGE_BLOCKS = 0x90D7; + int MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS = 0x90D8; + int MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS = 0x90D9; + int MAX_FRAGMENT_SHADER_STORAGE_BLOCKS = 0x90DA; + int MAX_COMPUTE_SHADER_STORAGE_BLOCKS = 0x90DB; + int MAX_COMBINED_SHADER_STORAGE_BLOCKS = 0x90DC; + int MAX_SHADER_STORAGE_BUFFER_BINDINGS = 0x90DD; + int MAX_SHADER_STORAGE_BLOCK_SIZE = 0x90DE; + int SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT = 0x90DF; + int SHADER_STORAGE_BARRIER_BIT = 0x00002000; + int MAX_COMBINED_SHADER_OUTPUT_RESOURCES = 0x8F39; + int DEPTH_STENCIL_TEXTURE_MODE = 0x90EA; + int TEXTURE_BUFFER_OFFSET = 0x919D; + int TEXTURE_BUFFER_SIZE = 0x919E; + int TEXTURE_BUFFER_OFFSET_ALIGNMENT = 0x919F; + int TEXTURE_VIEW_MIN_LEVEL = 0x82DB; + int TEXTURE_VIEW_NUM_LEVELS = 0x82DC; + int TEXTURE_VIEW_MIN_LAYER = 0x82DD; + int TEXTURE_VIEW_NUM_LAYERS = 0x82DE; + int TEXTURE_IMMUTABLE_LEVELS = 0x82DF; + int VERTEX_ATTRIB_BINDING = 0x82D4; + int VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D5; + int VERTEX_BINDING_DIVISOR = 0x82D6; + int VERTEX_BINDING_OFFSET = 0x82D7; + int VERTEX_BINDING_STRIDE = 0x82D8; + int MAX_VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D9; + int MAX_VERTEX_ATTRIB_BINDINGS = 0x82DA; + int VERTEX_BINDING_BUFFER = 0x8F4F; + + @Entrypoint("glBindVertexBuffer") + default void bindVertexBuffer(int bindingIndex, int buffer, long offset, int stride) { + throw new ContextException(); + } + + @Entrypoint("glClearBufferData") + default void clearBufferData(int target, int internalFormat, int format, int type, MemorySegment data) { + throw new ContextException(); + } + + @Entrypoint("glClearBufferSubData") + default void clearBufferSubData(int target, int internalFormat, long offset, long size, int format, int type, MemorySegment data) { + throw new ContextException(); + } + + @Entrypoint("glCopyImageSubData") + default void copyImageSubData(int srcName, int srcTarget, int srcLevel, int srcX, int srcY, int srcZ, int dstName, int dstTarget, int dstLevel, int dstX, int dstY, int dstZ, int srcWidth, int srcHeight, int srcDepth) { + throw new ContextException(); + } + + @Entrypoint("glDebugMessageCallback") + default void debugMessageCallback(MemorySegment callback, MemorySegment userParam) { + throw new ContextException(); + } + + @Entrypoint("glDebugMessageCallback") + default void debugMessageCallback(Arena arena, GLDebugProc callback, MemorySegment userParam) { + throw new ContextException(); + } + + @Entrypoint("glDebugMessageControl") + default void debugMessageControl(int source, int type, int severity, int count, MemorySegment ids, boolean enabled) { + throw new ContextException(); + } + + @Entrypoint("glDebugMessageControl") + default void debugMessageControl(SegmentAllocator allocator, int source, int type, int severity, int count, int[] ids, boolean enabled) { + throw new ContextException(); + } + + @Entrypoint("glDebugMessageInsert") + default void debugMessageInsert(int source, int type, int id, int severity, int length, MemorySegment buf) { + throw new ContextException(); + } + + @Skip + default void debugMessageInsert(int source, int type, int id, int severity, String buf) { + try (MemoryStack stack = MemoryStack.stackPush()) { + debugMessageInsert(source, type, id, severity, -1, Marshal.marshal(stack, buf)); + } + } + + @Entrypoint("glDispatchCompute") + default void dispatchCompute(int numGroupsX, int numGroupsY, int numGroupsZ) { + throw new ContextException(); } - public static void copyImageSubData(int srcName, int srcTarget, int srcLevel, int srcX, int srcY, int srcZ, int dstName, int dstTarget, int dstLevel, int dstX, int dstY, int dstZ, int srcWidth, int srcHeight, int srcDepth) { - var caps = getCapabilities(); - try { - check(caps.glCopyImageSubData).invokeExact(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDispatchComputeIndirect") + default void dispatchComputeIndirect(long indirect) { + throw new ContextException(); } - public static void debugMessageCallback(MemorySegment callback, MemorySegment userParam) { - var caps = getCapabilities(); - try { - check(caps.glDebugMessageCallback).invokeExact(callback, userParam); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glFramebufferParameteri") + default void framebufferParameteri(int target, int pname, int param) { + throw new ContextException(); } - public static void debugMessageCallback(Arena arena, GLDebugProc callback, MemorySegment userParam) { - debugMessageCallback(callback.address(arena), userParam); + @Entrypoint("glGetDebugMessageLog") + default int getDebugMessageLog(int count, int bufSize, MemorySegment sources, MemorySegment types, MemorySegment ids, MemorySegment severities, MemorySegment lengths, MemorySegment messageLog) { + throw new ContextException(); } - public static void debugMessageControl(int source, int type, int severity, int count, MemorySegment ids, boolean enabled) { - var caps = getCapabilities(); - try { - check(caps.glDebugMessageControl).invokeExact(source, type, severity, count, ids, enabled); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Skip + default int getDebugMessageLog(int count, MemorySegment sources, MemorySegment types, MemorySegment ids, MemorySegment severities, MemorySegment lengths, MemorySegment messageLog) { + return getDebugMessageLog(count, Math.toIntExact(messageLog.byteSize()), sources, types, ids, severities, lengths, messageLog); } - public static void debugMessageControl(SegmentAllocator allocator, int source, int type, int severity, int count, int[] ids, boolean enabled) { - debugMessageControl(source, type, severity, count, allocator.allocateFrom(JAVA_INT, ids), enabled); - } - - public static void debugMessageInsert(int source, int type, int id, int severity, int length, MemorySegment buf) { - var caps = getCapabilities(); - try { - check(caps.glDebugMessageInsert).invokeExact(source, type, id, severity, length, buf); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void debugMessageInsert(int source, int type, int id, int severity, String buf) { - final MemoryStack stack = MemoryStack.stackGet(); - final long stackPointer = stack.getPointer(); - try { - debugMessageInsert(source, type, id, severity, buf.length(), stack.allocateFrom(buf)); - } finally { - stack.setPointer(stackPointer); - } - } - - public static void dispatchCompute(int numGroupsX, int numGroupsY, int numGroupsZ) { - var caps = getCapabilities(); - try { - check(caps.glDispatchCompute).invokeExact(numGroupsX, numGroupsY, numGroupsZ); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void dispatchComputeIndirect(long indirect) { - var caps = getCapabilities(); - try { - check(caps.glDispatchComputeIndirect).invokeExact(indirect); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void framebufferParameteri(int target, int pname, int param) { - var caps = getCapabilities(); - try { - check(caps.glFramebufferParameteri).invokeExact(target, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static int getDebugMessageLog(int count, int bufSize, MemorySegment sources, MemorySegment types, MemorySegment ids, MemorySegment severities, MemorySegment lengths, MemorySegment messageLog) { - var caps = getCapabilities(); - try { - return (int) check(caps.glGetDebugMessageLog).invokeExact(count, bufSize, sources, types, ids, severities, lengths, messageLog); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static int getDebugMessageLog(int count, MemorySegment sources, MemorySegment types, MemorySegment ids, MemorySegment severities, MemorySegment lengths, MemorySegment messageLog) { - return getDebugMessageLog(count, (int) messageLog.byteSize(), sources, types, ids, severities, lengths, messageLog); - } - - public static int getDebugMessageLog(SegmentAllocator allocator, int count, int bufSize, int[] sources, int[] types, int[] ids, int[] severities, int[] lengths, String[] messageLog) { - var pSrc = allocator.allocateFrom(JAVA_INT, sources); - var pTypes = allocator.allocateFrom(JAVA_INT, types); - var pIds = allocator.allocateFrom(JAVA_INT, ids); - var pSvr = allocator.allocateFrom(JAVA_INT, severities); - var pLen = allocator.allocateFrom(JAVA_INT, lengths); + @Skip + default int getDebugMessageLog(SegmentAllocator allocator, int count, int bufSize, @Ref int[] sources, @Ref int[] types, @Ref int[] ids, @Ref int[] severities, @Ref int[] lengths, @Ref String[] messageLog) { + var pSrc = Marshal.marshal(allocator, sources); + var pTypes = Marshal.marshal(allocator, types); + var pIds = Marshal.marshal(allocator, ids); + var pSvr = Marshal.marshal(allocator, severities); + var pLen = Marshal.marshal(allocator, lengths); var pLog = allocator.allocate(JAVA_BYTE, bufSize); int num = getDebugMessageLog(count, bufSize, pSrc, pTypes, pIds, pSvr, pLen, pLog); - RuntimeHelper.toArray(pSrc, sources); - RuntimeHelper.toArray(pTypes, types); - RuntimeHelper.toArray(pIds, ids); - RuntimeHelper.toArray(pSvr, severities); - RuntimeHelper.toArray(pLen, lengths); - messageLog[0] = pLog.getString(0); + Unmarshal.copy(pSrc, sources); + Unmarshal.copy(pTypes, types); + Unmarshal.copy(pIds, ids); + Unmarshal.copy(pSvr, severities); + Unmarshal.copy(pLen, lengths); + Unmarshal.copy(pLog, messageLog); return num; } - public static void getFramebufferParameteriv(int target, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetFramebufferParameteriv).invokeExact(target, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetFramebufferParameteriv") + default void getFramebufferParameteriv(int target, int pname, MemorySegment params) { + throw new ContextException(); } - public static int getFramebufferParameteri(int target, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getFramebufferParameteriv(int target, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getFramebufferParameteriv(target, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getInternalformati64v(int target, int internalFormat, int pname, int count, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetInternalformati64v).invokeExact(target, internalFormat, pname, count, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetInternalformati64v") + default void getInternalformati64v(int target, int internalFormat, int pname, int count, MemorySegment params) { + throw new ContextException(); } - public static void getInternalformati64v(SegmentAllocator allocator, int target, int internalFormat, int pname, long[] params) { - var seg = allocator.allocateFrom(JAVA_LONG, params); + @Skip + default void getInternalformati64v(SegmentAllocator allocator, int target, int internalFormat, int pname, @Ref long[] params) { + var seg = Marshal.marshal(allocator, params); getInternalformati64v(target, internalFormat, pname, params.length, seg); - RuntimeHelper.toArray(seg, params); + Unmarshal.copy(seg, params); } - public static long getInternalformati64(int target, int internalFormat, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocLong(); + @Skip + default long getInternalformati64v(int target, int internalFormat, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.longs(0L); getInternalformati64v(target, internalFormat, pname, 1, seg); return seg.get(JAVA_LONG, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getObjectLabel(int identifier, int name, int bufSize, MemorySegment length, MemorySegment label) { - var caps = getCapabilities(); - try { - check(caps.glGetObjectLabel).invokeExact(identifier, name, bufSize, length, label); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetObjectLabel") + default void getObjectLabel(int identifier, int name, int bufSize, MemorySegment length, MemorySegment label) { + throw new ContextException(); } - public static void getObjectLabel(int identifier, int name, MemorySegment length, MemorySegment label) { - getObjectLabel(identifier, name, (int) label.byteSize(), length, label); + @Skip + default void getObjectLabel(int identifier, int name, MemorySegment length, MemorySegment label) { + getObjectLabel(identifier, name, Math.toIntExact(label.byteSize()), length, label); } - public static String getObjectLabel(SegmentAllocator allocator, int identifier, int name, int bufSize, int @Nullable [] length) { + @Skip + default String getObjectLabel(SegmentAllocator allocator, int identifier, int name, int bufSize, @Ref int @Nullable [] length) { var seg = allocator.allocate(JAVA_BYTE, bufSize); - var pLen = length != null ? allocator.allocate(JAVA_INT) : MemorySegment.NULL; + var pLen = Marshal.marshal(allocator, length); getObjectLabel(identifier, name, bufSize, seg, pLen); - if (length != null && length.length > 0) { - length[0] = pLen.get(JAVA_INT, 0); - } + Unmarshal.copy(pLen, length); return seg.getString(0); } - public static String getObjectLabel(SegmentAllocator allocator, int identifier, int name, int @Nullable [] length) { + @Skip + default String getObjectLabel(SegmentAllocator allocator, int identifier, int name, @Ref int @Nullable [] length) { return getObjectLabel(allocator, identifier, name, 1024, length); } - public static void getObjectPtrLabel(MemorySegment ptr, int bufSize, MemorySegment length, MemorySegment label) { - var caps = getCapabilities(); - try { - check(caps.glGetObjectPtrLabel).invokeExact(ptr, bufSize, length, label); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetObjectPtrLabel") + default void getObjectPtrLabel(MemorySegment ptr, int bufSize, MemorySegment length, MemorySegment label) { + throw new ContextException(); } - public static void getObjectPtrLabel(MemorySegment ptr, MemorySegment length, MemorySegment label) { - getObjectPtrLabel(ptr, (int) label.byteSize(), length, label); + @Skip + default void getObjectPtrLabel(MemorySegment ptr, MemorySegment length, MemorySegment label) { + getObjectPtrLabel(ptr, Math.toIntExact(label.byteSize()), length, label); } - public static String getObjectPtrLabel(SegmentAllocator allocator, MemorySegment ptr, int bufSize, int @Nullable [] length) { + @Skip + default String getObjectPtrLabel(SegmentAllocator allocator, MemorySegment ptr, int bufSize, @Ref int @Nullable [] length) { var seg = allocator.allocate(JAVA_BYTE, bufSize); - var pLen = length != null ? allocator.allocate(JAVA_INT) : MemorySegment.NULL; + var pLen = Marshal.marshal(allocator, length); getObjectPtrLabel(ptr, bufSize, seg, pLen); - if (length != null && length.length > 0) { - length[0] = pLen.get(JAVA_INT, 0); - } + Unmarshal.copy(pLen, length); return seg.getString(0); } - public static String getObjectPtrLabel(SegmentAllocator allocator, MemorySegment ptr, int @Nullable [] length) { + @Skip + default String getObjectPtrLabel(SegmentAllocator allocator, MemorySegment ptr, @Ref int @Nullable [] length) { return getObjectPtrLabel(allocator, ptr, 1024, length); } - public static void getProgramInterfaceiv(int program, int programInterface, int pname, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetProgramInterfaceiv).invokeExact(program, programInterface, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetProgramInterfaceiv") + default void getProgramInterfaceiv(int program, int programInterface, int pname, MemorySegment params) { + throw new ContextException(); } - public static int getProgramInterfacei(int program, int programInterface, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getProgramInterfaceiv(int program, int programInterface, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getProgramInterfaceiv(program, programInterface, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static int getProgramResourceIndex(int program, int programInterface, MemorySegment name) { - var caps = getCapabilities(); - try { - return (int) check(caps.glGetProgramResourceIndex).invokeExact(program, programInterface, name); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetProgramResourceIndex") + default int getProgramResourceIndex(int program, int programInterface, MemorySegment name) { + throw new ContextException(); } - public static int getProgramResourceIndex(int program, int programInterface, String name) { - final MemoryStack stack = MemoryStack.stackGet(); - final long stackPointer = stack.getPointer(); - try { - return getProgramResourceIndex(program, programInterface, stack.allocateFrom(name)); - } finally { - stack.setPointer(stackPointer); - } + @Entrypoint("glGetProgramResourceIndex") + default int getProgramResourceIndex(int program, int programInterface, String name) { + throw new ContextException(); } - public static int getProgramResourceLocation(int program, int programInterface, MemorySegment name) { - var caps = getCapabilities(); - try { - return (int) check(caps.glGetProgramResourceLocation).invokeExact(program, programInterface, name); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetProgramResourceLocation") + default int getProgramResourceLocation(int program, int programInterface, MemorySegment name) { + throw new ContextException(); } - public static int getProgramResourceLocation(int program, int programInterface, String name) { - final MemoryStack stack = MemoryStack.stackGet(); - final long stackPointer = stack.getPointer(); - try { - return getProgramResourceLocation(program, programInterface, stack.allocateFrom(name)); - } finally { - stack.setPointer(stackPointer); - } + @Entrypoint("glGetProgramResourceLocation") + default int getProgramResourceLocation(int program, int programInterface, String name) { + throw new ContextException(); } - public static int getProgramResourceLocationIndex(int program, int programInterface, MemorySegment name) { - var caps = getCapabilities(); - try { - return (int) check(caps.glGetProgramResourceLocationIndex).invokeExact(program, programInterface, name); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetProgramResourceLocationIndex") + default int getProgramResourceLocationIndex(int program, int programInterface, MemorySegment name) { + throw new ContextException(); } - public static int getProgramResourceLocationIndex(int program, int programInterface, String name) { - final MemoryStack stack = MemoryStack.stackGet(); - final long stackPointer = stack.getPointer(); - try { - return getProgramResourceLocationIndex(program, programInterface, stack.allocateFrom(name)); - } finally { - stack.setPointer(stackPointer); - } + @Entrypoint("glGetProgramResourceLocationIndex") + default int getProgramResourceLocationIndex(int program, int programInterface, String name) { + throw new ContextException(); } - public static void getProgramResourceName(int program, int programInterface, int index, int bufSize, MemorySegment length, MemorySegment name) { - var caps = getCapabilities(); - try { - check(caps.glGetProgramResourceName).invokeExact(program, programInterface, index, bufSize, length, name); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetProgramResourceName") + default void getProgramResourceName(int program, int programInterface, int index, int bufSize, MemorySegment length, MemorySegment name) { + throw new ContextException(); } - public static void getProgramResourceName(int program, int programInterface, int index, MemorySegment length, MemorySegment name) { - getProgramResourceName(program, programInterface, index, (int) name.byteSize(), length, name); + @Skip + default void getProgramResourceName(int program, int programInterface, int index, MemorySegment length, MemorySegment name) { + getProgramResourceName(program, programInterface, index, Math.toIntExact(name.byteSize()), length, name); } - public static String getProgramResourceName(SegmentAllocator allocator, int program, int programInterface, int index, int bufSize, int @Nullable [] length) { + @Skip + default String getProgramResourceName(SegmentAllocator allocator, int program, int programInterface, int index, int bufSize, @Ref int @Nullable [] length) { var seg = allocator.allocate(JAVA_BYTE, bufSize); - var pLen = length != null ? allocator.allocate(JAVA_INT) : MemorySegment.NULL; + var pLen = Marshal.marshal(allocator, length); getProgramResourceName(program, programInterface, index, bufSize, pLen, seg); - if (length != null && length.length > 0) { - length[0] = pLen.get(JAVA_INT, 0); - } + Unmarshal.copy(pLen, length); return seg.getString(0); } - public static String getProgramResourceName(SegmentAllocator allocator, int program, int programInterface, int index, int @Nullable [] length) { + @Skip + default String getProgramResourceName(SegmentAllocator allocator, int program, int programInterface, int index, @Ref int @Nullable [] length) { return getProgramResourceName(allocator, program, programInterface, index, 1024, length); } - public static void getProgramResourceiv(int program, int programInterface, int index, int propCount, MemorySegment props, int count, MemorySegment length, MemorySegment params) { - var caps = getCapabilities(); - try { - check(caps.glGetProgramResourceiv).invokeExact(program, programInterface, index, propCount, props, count, length, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetProgramResourceiv") + default void getProgramResourceiv(int program, int programInterface, int index, int propCount, MemorySegment props, int bufSize, MemorySegment length, MemorySegment params) { + throw new ContextException(); } - public static void getProgramResourceiv(int program, int programInterface, int index, MemorySegment props, MemorySegment length, MemorySegment params) { - getProgramResourceiv(program, programInterface, index, (int) (props.byteSize() >> 2), props, (int) params.byteSize(), length, params); + @Skip + default void getProgramResourceiv(int program, int programInterface, int index, MemorySegment props, int bufSize, MemorySegment length, MemorySegment params) { + getProgramResourceiv(program, programInterface, index, Math.toIntExact(props.byteSize() >> 2), props, bufSize, length, params); } - public static void getProgramResourceiv(SegmentAllocator allocator, int program, int programInterface, int index, int[] props, int @Nullable [] length, int[] params) { - var seg = allocator.allocateFrom(JAVA_INT, params); - var pLen = length != null ? allocator.allocate(JAVA_INT) : MemorySegment.NULL; - getProgramResourceiv(program, programInterface, index, props.length, allocator.allocateFrom(JAVA_INT, props), params.length, pLen, seg); - if (length != null && length.length > 0) { - length[0] = pLen.get(JAVA_INT, 0); - } - RuntimeHelper.toArray(seg, params); + @Skip + default void getProgramResourceiv(SegmentAllocator allocator, int program, int programInterface, int index, int[] props, int bufSize, @Ref int @Nullable [] length, @Ref int[] params) { + var seg = Marshal.marshal(allocator, params); + var pLen = Marshal.marshal(allocator, length); + getProgramResourceiv(program, programInterface, index, props.length, allocator.allocateFrom(JAVA_INT, props), bufSize, pLen, seg); + Unmarshal.copy(pLen, length); + Unmarshal.copy(seg, params); } - public static int getProgramResourceiv(SegmentAllocator allocator, int program, int programInterface, int index, int[] props) { + @Skip + default int getProgramResourceiv(SegmentAllocator allocator, int program, int programInterface, int index, int[] props, int bufSize) { var seg = allocator.allocate(JAVA_INT); - getProgramResourceiv(program, programInterface, index, props.length, allocator.allocateFrom(JAVA_INT, props), 1, MemorySegment.NULL, seg); + getProgramResourceiv(program, programInterface, index, props.length, Marshal.marshal(allocator, props), bufSize, MemorySegment.NULL, seg); return seg.get(JAVA_INT, 0); } - public static void invalidateBufferData(int buffer) { - var caps = getCapabilities(); - try { - check(caps.glInvalidateBufferData).invokeExact(buffer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glInvalidateBufferData") + default void invalidateBufferData(int buffer) { + throw new ContextException(); } - public static void invalidateBufferSubData(int buffer, long offset, long length) { - var caps = getCapabilities(); - try { - check(caps.glInvalidateBufferSubData).invokeExact(buffer, offset, length); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glInvalidateBufferSubData") + default void invalidateBufferSubData(int buffer, long offset, long length) { + throw new ContextException(); } - public static void invalidateFramebuffer(int target, int numAttachments, MemorySegment attachments) { - var caps = getCapabilities(); - try { - check(caps.glInvalidateFramebuffer).invokeExact(target, numAttachments, attachments); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void invalidateFramebuffer(SegmentAllocator allocator, int target, int[] attachments) { - invalidateFramebuffer(target, attachments.length, allocator.allocateFrom(JAVA_INT, attachments)); + @Entrypoint("glInvalidateFramebuffer") + default void invalidateFramebuffer(int target, int numAttachments, MemorySegment attachments) { + throw new ContextException(); } - public static void invalidateFramebuffer(int target, int attachment) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - invalidateFramebuffer(target, 1, stack.ints(attachment)); - } finally { - stack.setPointer(stackPointer); + @Skip + default void invalidateFramebuffer(int target, int... attachments) { + try (MemoryStack stack = MemoryStack.stackPush()) { + invalidateFramebuffer(target, attachments.length, Marshal.marshal(stack, attachments)); } } - public static void invalidateSubFramebuffer(int target, int numAttachments, MemorySegment attachments, int x, int y, int width, int height) { - var caps = getCapabilities(); - try { - check(caps.glInvalidateSubFramebuffer).invokeExact(target, numAttachments, attachments, x, y, width, height); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glInvalidateSubFramebuffer") + default void invalidateSubFramebuffer(int target, int numAttachments, MemorySegment attachments, int x, int y, int width, int height) { + throw new ContextException(); } - public static void invalidateSubFramebuffer(SegmentAllocator allocator, int target, int[] attachments, int x, int y, int width, int height) { - invalidateSubFramebuffer(target, attachments.length, allocator.allocateFrom(JAVA_INT, attachments), x, y, width, height); + @Skip + default void invalidateSubFramebuffer(SegmentAllocator allocator, int target, int[] attachments, int x, int y, int width, int height) { + invalidateSubFramebuffer(target, attachments.length, Marshal.marshal(allocator, attachments), x, y, width, height); } - public static void invalidateSubFramebuffer(int target, int attachment, int x, int y, int width, int height) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { + @Skip + default void invalidateSubFramebuffer(int target, int attachment, int x, int y, int width, int height) { + try (MemoryStack stack = MemoryStack.stackPush()) { invalidateSubFramebuffer(target, 1, stack.ints(attachment), x, y, width, height); - } finally { - stack.setPointer(stackPointer); } } - public static void invalidateTexImage(int texture, int level) { - var caps = getCapabilities(); - try { - check(caps.glInvalidateTexImage).invokeExact(texture, level); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glInvalidateTexImage") + default void invalidateTexImage(int texture, int level) { + throw new ContextException(); } - public static void invalidateTexSubImage(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth) { - var caps = getCapabilities(); - try { - check(caps.glInvalidateTexSubImage).invokeExact(texture, level, xoffset, yoffset, zoffset, width, height, depth); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glInvalidateTexSubImage") + default void invalidateTexSubImage(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth) { + throw new ContextException(); } - public static void multiDrawArraysIndirect(int mode, MemorySegment indirect, int drawCount, int stride) { - var caps = getCapabilities(); - try { - check(caps.glMultiDrawArraysIndirect).invokeExact(mode, indirect, drawCount, stride); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiDrawArraysIndirect") + default void multiDrawArraysIndirect(int mode, MemorySegment indirect, int drawCount, int stride) { + throw new ContextException(); } - public static void multiDrawArraysIndirect(int mode, DrawArraysIndirectCommand.Buffer indirect, int drawCount, int stride) { - multiDrawArraysIndirect(mode, indirect.address(), drawCount, stride); + @Entrypoint("glMultiDrawArraysIndirect") + default void multiDrawArraysIndirect(int mode, DrawArraysIndirectCommand indirect, int drawCount, int stride) { + throw new ContextException(); } - public static void multiDrawElementsIndirect(int mode, int type, MemorySegment indirect, int drawCount, int stride) { - var caps = getCapabilities(); - try { - check(caps.glMultiDrawElementsIndirect).invokeExact(mode, type, indirect, drawCount, stride); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glMultiDrawElementsIndirect") + default void multiDrawElementsIndirect(int mode, int type, MemorySegment indirect, int drawCount, int stride) { + throw new ContextException(); } - public static void multiDrawElementsIndirect(int mode, int type, DrawElementsIndirectCommand.Buffer indirect, int drawCount, int stride) { - multiDrawElementsIndirect(mode, type, indirect.address(), drawCount, stride); + @Entrypoint("glMultiDrawElementsIndirect") + default void multiDrawElementsIndirect(int mode, int type, DrawElementsIndirectCommand indirect, int drawCount, int stride) { + throw new ContextException(); } - public static void objectLabel(int identifier, int name, int length, MemorySegment label) { - var caps = getCapabilities(); - try { - check(caps.glObjectLabel).invokeExact(identifier, name, length, label); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glObjectLabel") + default void objectLabel(int identifier, int name, int length, MemorySegment label) { + throw new ContextException(); } - public static void objectLabel(int identifier, int name, String label) { - final MemoryStack stack = MemoryStack.stackGet(); - final long stackPointer = stack.getPointer(); - try { - objectLabel(identifier, name, label.length(), stack.allocateFrom(label)); - } finally { - stack.setPointer(stackPointer); + @Skip + default void objectLabel(int identifier, int name, String label) { + try (MemoryStack stack = MemoryStack.stackPush()) { + objectLabel(identifier, name, -1, Marshal.marshal(stack, label)); } } - public static void objectPtrLabel(MemorySegment ptr, int length, MemorySegment label) { - var caps = getCapabilities(); - try { - check(caps.glObjectPtrLabel).invokeExact(ptr, length, label); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glObjectPtrLabel") + default void objectPtrLabel(MemorySegment ptr, int length, MemorySegment label) { + throw new ContextException(); } - public static void objectPtrLabel(MemorySegment ptr, String label) { - final MemoryStack stack = MemoryStack.stackGet(); - final long stackPointer = stack.getPointer(); - try { - objectPtrLabel(ptr, label.length(), stack.allocateFrom(label)); - } finally { - stack.setPointer(stackPointer); + @Skip + default void objectPtrLabel(MemorySegment ptr, String label) { + try (MemoryStack stack = MemoryStack.stackPush()) { + objectPtrLabel(ptr, -1, Marshal.marshal(stack, label)); } } - public static void popDebugGroup() { - var caps = getCapabilities(); - try { - check(caps.glPopDebugGroup).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPopDebugGroup") + default void popDebugGroup() { + throw new ContextException(); } - public static void pushDebugGroup(int source, int id, int length, MemorySegment message) { - var caps = getCapabilities(); - try { - check(caps.glPushDebugGroup).invokeExact(source, id, length, message); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPushDebugGroup") + default void pushDebugGroup(int source, int id, int length, MemorySegment message) { + throw new ContextException(); } - public static void pushDebugGroup(int source, int id, String message) { - final MemoryStack stack = MemoryStack.stackGet(); - final long stackPointer = stack.getPointer(); - try { - pushDebugGroup(source, id, message.length(), stack.allocateFrom(message)); - } finally { - stack.setPointer(stackPointer); + @Skip + default void pushDebugGroup(int source, int id, String message) { + try (MemoryStack stack = MemoryStack.stackPush()) { + pushDebugGroup(source, id, -1, Marshal.marshal(stack, message)); } } - public static void shaderStorageBlockBinding(int program, int storageBlockIndex, int storageBlockBinding) { - var caps = getCapabilities(); - try { - check(caps.glShaderStorageBlockBinding).invokeExact(program, storageBlockIndex, storageBlockBinding); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glShaderStorageBlockBinding") + default void shaderStorageBlockBinding(int program, int storageBlockIndex, int storageBlockBinding) { + throw new ContextException(); } - public static void texBufferRange(int target, int internalFormat, int buffer, long offset, long size) { - var caps = getCapabilities(); - try { - check(caps.glTexBufferRange).invokeExact(target, internalFormat, buffer, offset, size); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexBufferRange") + default void texBufferRange(int target, int internalFormat, int buffer, long offset, long size) { + throw new ContextException(); } - public static void texStorage2DMultisample(int target, int samples, int internalFormat, int width, int height, boolean fixedSampleLocations) { - var caps = getCapabilities(); - try { - check(caps.glTexStorage2DMultisample).invokeExact(target, samples, internalFormat, width, height, fixedSampleLocations); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexStorage2DMultisample") + default void texStorage2DMultisample(int target, int samples, int internalFormat, int width, int height, boolean fixedSampleLocations) { + throw new ContextException(); } - public static void texStorage3DMultisample(int target, int samples, int internalFormat, int width, int height, int depth, boolean fixedSampleLocations) { - var caps = getCapabilities(); - try { - check(caps.glTexStorage3DMultisample).invokeExact(target, samples, internalFormat, width, height, depth, fixedSampleLocations); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTexStorage3DMultisample") + default void texStorage3DMultisample(int target, int samples, int internalFormat, int width, int height, int depth, boolean fixedSampleLocations) { + throw new ContextException(); } - public static void textureView(int texture, int target, int origTexture, int internalFormat, int minLevel, int numLevels, int minLayer, int numLayers) { - var caps = getCapabilities(); - try { - check(caps.glTextureView).invokeExact(texture, target, origTexture, internalFormat, minLevel, numLevels, minLayer, numLayers); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTextureView") + default void textureView(int texture, int target, int origTexture, int internalFormat, int minLevel, int numLevels, int minLayer, int numLayers) { + throw new ContextException(); } - public static void vertexAttribBinding(int attribIndex, int bindingIndex) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribBinding).invokeExact(attribIndex, bindingIndex); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribBinding") + default void vertexAttribBinding(int attribIndex, int bindingIndex) { + throw new ContextException(); } - public static void vertexAttribFormat(int attribIndex, int size, int type, boolean normalized, int relativeOffset) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribFormat).invokeExact(attribIndex, size, type, normalized, relativeOffset); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribFormat") + default void vertexAttribFormat(int attribIndex, int size, int type, boolean normalized, int relativeOffset) { + throw new ContextException(); } - public static void vertexAttribIFormat(int attribIndex, int size, int type, int relativeOffset) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribIFormat).invokeExact(attribIndex, size, type, relativeOffset); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribIFormat") + default void vertexAttribIFormat(int attribIndex, int size, int type, int relativeOffset) { + throw new ContextException(); } - public static void vertexAttribLFormat(int attribIndex, int size, int type, int relativeOffset) { - var caps = getCapabilities(); - try { - check(caps.glVertexAttribLFormat).invokeExact(attribIndex, size, type, relativeOffset); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexAttribLFormat") + default void vertexAttribLFormat(int attribIndex, int size, int type, int relativeOffset) { + throw new ContextException(); } - public static void vertexBindingDivisor(int bindingIndex, int divisor) { - var caps = getCapabilities(); - try { - check(caps.glVertexBindingDivisor).invokeExact(bindingIndex, divisor); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexBindingDivisor") + default void vertexBindingDivisor(int bindingIndex, int divisor) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL44C.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL44C.java index 9ffb207a..b597e9c9 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL44C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL44C.java @@ -16,13 +16,13 @@ package overrungl.opengl; +import overrun.marshal.Marshal; +import overrun.marshal.gen.Entrypoint; +import overrun.marshal.gen.Skip; + import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.FunctionDescriptors.*; -import static overrungl.opengl.GLLoader.*; - /** * The OpenGL 4.4 core profile functions. *

@@ -36,174 +36,140 @@ * @author squid233 * @since 0.1.0 */ -public sealed class GL44C extends GL43C permits GL45C { - public static final int MAX_VERTEX_ATTRIB_STRIDE = 0x82E5; - public static final int PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED = 0x8221; - public static final int TEXTURE_BUFFER_BINDING = 0x8C2A; - public static final int MAP_PERSISTENT_BIT = 0x0040; - public static final int MAP_COHERENT_BIT = 0x0080; - public static final int DYNAMIC_STORAGE_BIT = 0x0100; - public static final int CLIENT_STORAGE_BIT = 0x0200; - public static final int CLIENT_MAPPED_BUFFER_BARRIER_BIT = 0x00004000; - public static final int BUFFER_IMMUTABLE_STORAGE = 0x821F; - public static final int BUFFER_STORAGE_FLAGS = 0x8220; - public static final int CLEAR_TEXTURE = 0x9365; - public static final int LOCATION_COMPONENT = 0x934A; - public static final int TRANSFORM_FEEDBACK_BUFFER_INDEX = 0x934B; - public static final int TRANSFORM_FEEDBACK_BUFFER_STRIDE = 0x934C; - public static final int QUERY_BUFFER = 0x9192; - public static final int QUERY_BUFFER_BARRIER_BIT = 0x00008000; - public static final int QUERY_BUFFER_BINDING = 0x9193; - public static final int QUERY_RESULT_NO_WAIT = 0x9194; - public static final int MIRROR_CLAMP_TO_EDGE = 0x8743; - - static boolean isSupported(GLCapabilities caps) { - return checkAll(caps.glBindBuffersBase, caps.glBindBuffersRange, caps.glBindImageTextures, caps.glBindSamplers, caps.glBindTextures, caps.glBindVertexBuffers, - caps.glBufferStorage, caps.glClearTexImage, caps.glClearTexSubImage); - } - - static void load(GLCapabilities caps, GLLoadFunc load) { - caps.glBindBuffersBase = load.invoke("glBindBuffersBase", IIIPV); - caps.glBindBuffersRange = load.invoke("glBindBuffersRange", IIIPPPV); - caps.glBindImageTextures = load.invoke("glBindImageTextures", IIPV); - caps.glBindSamplers = load.invoke("glBindSamplers", IIPV); - caps.glBindTextures = load.invoke("glBindTextures", IIPV); - caps.glBindVertexBuffers = load.invoke("glBindVertexBuffers", IIPPPV); - caps.glBufferStorage = load.invoke("glBufferStorage", IJPIV); - caps.glClearTexImage = load.invoke("glClearTexImage", IIIIPV); - caps.glClearTexSubImage = load.invoke("glClearTexSubImage", IIIIIIIIIIPV); - } +public sealed interface GL44C extends GL43C permits GL45C { + int MAX_VERTEX_ATTRIB_STRIDE = 0x82E5; + int PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED = 0x8221; + int TEXTURE_BUFFER_BINDING = 0x8C2A; + int MAP_PERSISTENT_BIT = 0x0040; + int MAP_COHERENT_BIT = 0x0080; + int DYNAMIC_STORAGE_BIT = 0x0100; + int CLIENT_STORAGE_BIT = 0x0200; + int CLIENT_MAPPED_BUFFER_BARRIER_BIT = 0x00004000; + int BUFFER_IMMUTABLE_STORAGE = 0x821F; + int BUFFER_STORAGE_FLAGS = 0x8220; + int CLEAR_TEXTURE = 0x9365; + int LOCATION_COMPONENT = 0x934A; + int TRANSFORM_FEEDBACK_BUFFER_INDEX = 0x934B; + int TRANSFORM_FEEDBACK_BUFFER_STRIDE = 0x934C; + int QUERY_BUFFER = 0x9192; + int QUERY_BUFFER_BARRIER_BIT = 0x00008000; + int QUERY_BUFFER_BINDING = 0x9193; + int QUERY_RESULT_NO_WAIT = 0x9194; + int MIRROR_CLAMP_TO_EDGE = 0x8743; - public static void bindBuffersBase(int target, int first, int count, MemorySegment buffers) { - var caps = getCapabilities(); - try { - check(caps.glBindBuffersBase).invokeExact(target, first, count, buffers); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glBindBuffersBase") + default void bindBuffersBase(int target, int first, int count, MemorySegment buffers) { + throw new ContextException(); } - public static void bindBuffersBase(SegmentAllocator allocator, int target, int first, int count, int[] buffers) { - bindBuffersBase(target, first, count, allocator.allocateFrom(JAVA_INT, buffers)); + @Entrypoint("glBindBuffersBase") + default void bindBuffersBase(SegmentAllocator allocator, int target, int first, int count, int[] buffers) { + throw new ContextException(); } - public static void bindBuffersRange(int target, int first, int count, MemorySegment buffers, MemorySegment offsets, MemorySegment sizes) { - var caps = getCapabilities(); - try { - check(caps.glBindBuffersRange).invokeExact(target, first, count, buffers, offsets, sizes); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glBindBuffersRange") + default void bindBuffersRange(int target, int first, int count, MemorySegment buffers, MemorySegment offsets, MemorySegment sizes) { + throw new ContextException(); } - public static void bindBuffersRange(SegmentAllocator allocator, int target, int first, int count, int[] buffers, long[] offsets, long[] sizes) { - bindBuffersRange(target, first, count, allocator.allocateFrom(JAVA_INT, buffers), allocator.allocateFrom(JAVA_LONG, offsets), allocator.allocateFrom(JAVA_LONG, sizes)); + @Entrypoint("glBindBuffersRange") + default void bindBuffersRange(SegmentAllocator allocator, int target, int first, int count, int[] buffers, long[] offsets, long[] sizes) { + throw new ContextException(); } - public static void bindImageTextures(int first, int count, MemorySegment textures) { - var caps = getCapabilities(); - try { - check(caps.glBindImageTextures).invokeExact(first, count, textures); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glBindImageTextures") + default void bindImageTextures(int first, int count, MemorySegment textures) { + throw new ContextException(); } - public static void bindImageTextures(SegmentAllocator allocator, int first, int count, int[] textures) { - bindImageTextures(first, count, allocator.allocateFrom(JAVA_INT, textures)); + @Entrypoint("glBindImageTextures") + default void bindImageTextures(SegmentAllocator allocator, int first, int count, int[] textures) { + throw new ContextException(); } - public static void bindSamplers(int first, int count, MemorySegment samplers) { - var caps = getCapabilities(); - try { - check(caps.glBindSamplers).invokeExact(first, count, samplers); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glBindSamplers") + default void bindSamplers(int first, int count, MemorySegment samplers) { + throw new ContextException(); } - public static void bindSamplers(SegmentAllocator allocator, int first, int count, int[] samplers) { - bindSamplers(first, count, allocator.allocateFrom(JAVA_INT, samplers)); + @Entrypoint("glBindSamplers") + default void bindSamplers(SegmentAllocator allocator, int first, int count, int[] samplers) { + throw new ContextException(); } - public static void bindTextures(int first, int count, MemorySegment textures) { - var caps = getCapabilities(); - try { - check(caps.glBindTextures).invokeExact(first, count, textures); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glBindTextures") + default void bindTextures(int first, int count, MemorySegment textures) { + throw new ContextException(); } - public static void bindTextures(SegmentAllocator allocator, int first, int count, int[] textures) { - bindTextures(first, count, allocator.allocateFrom(JAVA_INT, textures)); + @Entrypoint("glBindTextures") + default void bindTextures(SegmentAllocator allocator, int first, int count, int[] textures) { + throw new ContextException(); } - public static void bindVertexBuffers(int first, int count, MemorySegment buffers, MemorySegment offsets, MemorySegment strides) { - var caps = getCapabilities(); - try { - check(caps.glBindVertexBuffers).invokeExact(first, count, buffers, offsets, strides); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glBindVertexBuffers") + default void bindVertexBuffers(int first, int count, MemorySegment buffers, MemorySegment offsets, MemorySegment strides) { + throw new ContextException(); } - public static void bindVertexBuffers(SegmentAllocator allocator, int first, int count, int[] buffers, long[] offsets, long[] strides) { - bindVertexBuffers(first, count, allocator.allocateFrom(JAVA_INT, buffers), allocator.allocateFrom(JAVA_LONG, offsets), allocator.allocateFrom(JAVA_LONG, strides)); + @Entrypoint("glBindVertexBuffers") + default void bindVertexBuffers(SegmentAllocator allocator, int first, int count, int[] buffers, long[] offsets, long[] strides) { + throw new ContextException(); } - public static void bufferStorage(int target, long size, MemorySegment data, int flags) { - var caps = getCapabilities(); - try { - check(caps.glBufferStorage).invokeExact(target, size, data, flags); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glBufferStorage") + default void bufferStorage(int target, long size, MemorySegment data, int flags) { + throw new ContextException(); } - public static void bufferStorage(int target, long size, int flags) { + @Skip + default void bufferStorage(int target, long size, int flags) { bufferStorage(target, size, MemorySegment.NULL, flags); } - public static void bufferStorage(SegmentAllocator allocator, int target, byte[] data, int flags) { - bufferStorage(target, Integer.toUnsignedLong(data.length), allocator.allocateFrom(JAVA_BYTE, data), flags); + @Skip + default void bufferStorage(SegmentAllocator allocator, int target, byte[] data, int flags) { + final MemorySegment segment = Marshal.marshal(allocator, data); + bufferStorage(target, segment.byteSize(), segment, flags); } - public static void bufferStorage(SegmentAllocator allocator, int target, short[] data, int flags) { - bufferStorage(target, Integer.toUnsignedLong(data.length) << 1, allocator.allocateFrom(JAVA_SHORT, data), flags); + @Skip + default void bufferStorage(SegmentAllocator allocator, int target, short[] data, int flags) { + final MemorySegment segment = Marshal.marshal(allocator, data); + bufferStorage(target, segment.byteSize(), segment, flags); } - public static void bufferStorage(SegmentAllocator allocator, int target, int[] data, int flags) { - bufferStorage(target, Integer.toUnsignedLong(data.length) << 2, allocator.allocateFrom(JAVA_INT, data), flags); + @Skip + default void bufferStorage(SegmentAllocator allocator, int target, int[] data, int flags) { + final MemorySegment segment = Marshal.marshal(allocator, data); + bufferStorage(target, segment.byteSize(), segment, flags); } - public static void bufferStorage(SegmentAllocator allocator, int target, long[] data, int flags) { - bufferStorage(target, Integer.toUnsignedLong(data.length) << 3, allocator.allocateFrom(JAVA_LONG, data), flags); + @Skip + default void bufferStorage(SegmentAllocator allocator, int target, long[] data, int flags) { + final MemorySegment segment = Marshal.marshal(allocator, data); + bufferStorage(target, segment.byteSize(), segment, flags); } - public static void bufferStorage(SegmentAllocator allocator, int target, float[] data, int flags) { - bufferStorage(target, Integer.toUnsignedLong(data.length) << 2, allocator.allocateFrom(JAVA_FLOAT, data), flags); + @Skip + default void bufferStorage(SegmentAllocator allocator, int target, float[] data, int flags) { + final MemorySegment segment = Marshal.marshal(allocator, data); + bufferStorage(target, segment.byteSize(), segment, flags); } - public static void bufferStorage(SegmentAllocator allocator, int target, double[] data, int flags) { - bufferStorage(target, Integer.toUnsignedLong(data.length) << 3, allocator.allocateFrom(JAVA_DOUBLE, data), flags); + @Skip + default void bufferStorage(SegmentAllocator allocator, int target, double[] data, int flags) { + final MemorySegment segment = Marshal.marshal(allocator, data); + bufferStorage(target, segment.byteSize(), segment, flags); } - public static void clearTexImage(int texture, int level, int format, int type, MemorySegment data) { - var caps = getCapabilities(); - try { - check(caps.glClearTexImage).invokeExact(texture, level, format, type, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glClearTexImage") + default void clearTexImage(int texture, int level, int format, int type, MemorySegment data) { + throw new ContextException(); } - public static void clearTexSubImage(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, MemorySegment data) { - var caps = getCapabilities(); - try { - check(caps.glClearTexSubImage).invokeExact(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glClearTexSubImage") + default void clearTexSubImage(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, MemorySegment data) { + throw new ContextException(); } } 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 5b89df3a..bb512591 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL45C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL45C.java @@ -16,15 +16,19 @@ package overrungl.opengl; +import overrun.marshal.Marshal; +import overrun.marshal.MemoryStack; +import overrun.marshal.Unmarshal; +import overrun.marshal.gen.Entrypoint; +import overrun.marshal.gen.Ref; +import overrun.marshal.gen.Skip; import overrungl.opengl.ext.arb.GLARBRobustness; -import overrungl.internal.RuntimeHelper; -import overrungl.util.MemoryStack; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; +import java.lang.invoke.MethodHandle; import static java.lang.foreign.ValueLayout.*; -import static overrungl.FunctionDescriptors.*; /** * The OpenGL 4.5 core profile functions. @@ -43,1922 +47,1362 @@ * @author squid233 * @since 0.1.0 */ -public sealed class GL45C extends GL44C permits GL46C { - public static final int CONTEXT_LOST = 0x0507; - public static final int NEGATIVE_ONE_TO_ONE = 0x935E; - public static final int ZERO_TO_ONE = 0x935F; - public static final int CLIP_ORIGIN = 0x935C; - public static final int CLIP_DEPTH_MODE = 0x935D; - public static final int QUERY_WAIT_INVERTED = 0x8E17; - public static final int QUERY_NO_WAIT_INVERTED = 0x8E18; - public static final int QUERY_BY_REGION_WAIT_INVERTED = 0x8E19; - public static final int QUERY_BY_REGION_NO_WAIT_INVERTED = 0x8E1A; - public static final int MAX_CULL_DISTANCES = 0x82F9; - public static final int MAX_COMBINED_CLIP_AND_CULL_DISTANCES = 0x82FA; - public static final int TEXTURE_TARGET = 0x1006; - public static final int QUERY_TARGET = 0x82EA; - public static final int GUILTY_CONTEXT_RESET = 0x8253; - public static final int INNOCENT_CONTEXT_RESET = 0x8254; - public static final int UNKNOWN_CONTEXT_RESET = 0x8255; - public static final int RESET_NOTIFICATION_STRATEGY = 0x8256; - public static final int LOSE_CONTEXT_ON_RESET = 0x8252; - public static final int NO_RESET_NOTIFICATION = 0x8261; - public static final int CONTEXT_FLAG_ROBUST_ACCESS_BIT = 0x00000004; - public static final int CONTEXT_RELEASE_BEHAVIOR = 0x82FB; - public static final int CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x82FC; - - static boolean isSupported(GLCapabilities caps) { - return GLLoader.checkAll(caps.glBindTextureUnit, caps.glBlitNamedFramebuffer, caps.glCheckNamedFramebufferStatus, caps.glClearNamedBufferData, caps.glClearNamedBufferSubData, caps.glClearNamedFramebufferfi, - caps.glClearNamedFramebufferfv, caps.glClearNamedFramebufferiv, caps.glClearNamedFramebufferuiv, caps.glClipControl, caps.glCompressedTextureSubImage1D, caps.glCompressedTextureSubImage2D, - caps.glCompressedTextureSubImage3D, caps.glCopyNamedBufferSubData, caps.glCopyTextureSubImage1D, caps.glCopyTextureSubImage2D, caps.glCopyTextureSubImage3D, caps.glCreateBuffers, - caps.glCreateFramebuffers, caps.glCreateProgramPipelines, caps.glCreateQueries, caps.glCreateRenderbuffers, caps.glCreateSamplers, caps.glCreateTextures, - caps.glCreateTransformFeedbacks, caps.glCreateVertexArrays, caps.glDisableVertexArrayAttrib, caps.glEnableVertexArrayAttrib, caps.glFlushMappedNamedBufferRange, caps.glGenerateTextureMipmap, - caps.glGetCompressedTextureImage, caps.glGetCompressedTextureSubImage, caps.glGetGraphicsResetStatus, caps.glGetNamedBufferParameteri64v, caps.glGetNamedBufferParameteriv, caps.glGetNamedBufferPointerv, - caps.glGetNamedBufferSubData, caps.glGetNamedFramebufferAttachmentParameteriv, caps.glGetNamedFramebufferParameteriv, caps.glGetNamedRenderbufferParameteriv, caps.glGetQueryBufferObjecti64v, caps.glGetQueryBufferObjectiv, - caps.glGetQueryBufferObjectui64v, caps.glGetQueryBufferObjectuiv, caps.glGetTextureImage, caps.glGetTextureLevelParameterfv, caps.glGetTextureLevelParameteriv, caps.glGetTextureParameterIiv, - caps.glGetTextureParameterIuiv, caps.glGetTextureParameterfv, caps.glGetTextureParameteriv, caps.glGetTextureSubImage, caps.glGetTransformFeedbacki64_v, caps.glGetTransformFeedbacki_v, - caps.glGetTransformFeedbackiv, caps.glGetVertexArrayIndexed64iv, caps.glGetVertexArrayIndexediv, caps.glGetVertexArrayiv, caps.glGetnCompressedTexImage, caps.glGetnTexImage, - caps.glGetnUniformdv, caps.glGetnUniformfv, caps.glGetnUniformiv, caps.glGetnUniformuiv, caps.glInvalidateNamedFramebufferData, caps.glInvalidateNamedFramebufferSubData, - caps.glMapNamedBuffer, caps.glMapNamedBufferRange, caps.glMemoryBarrierByRegion, caps.glNamedBufferData, caps.glNamedBufferStorage, caps.glNamedBufferSubData, - caps.glNamedFramebufferDrawBuffer, caps.glNamedFramebufferDrawBuffers, caps.glNamedFramebufferParameteri, caps.glNamedFramebufferReadBuffer, caps.glNamedFramebufferRenderbuffer, caps.glNamedFramebufferTexture, - caps.glNamedFramebufferTextureLayer, caps.glNamedRenderbufferStorage, caps.glNamedRenderbufferStorageMultisample, caps.glReadnPixels, caps.glTextureBarrier, caps.glTextureBuffer, - caps.glTextureBufferRange, caps.glTextureParameterIiv, caps.glTextureParameterIuiv, caps.glTextureParameterf, caps.glTextureParameterfv, caps.glTextureParameteri, - caps.glTextureParameteriv, caps.glTextureStorage1D, caps.glTextureStorage2D, caps.glTextureStorage2DMultisample, caps.glTextureStorage3D, caps.glTextureStorage3DMultisample, - caps.glTextureSubImage1D, caps.glTextureSubImage2D, caps.glTextureSubImage3D, caps.glTransformFeedbackBufferBase, caps.glTransformFeedbackBufferRange, caps.glUnmapNamedBuffer, - caps.glVertexArrayAttribBinding, caps.glVertexArrayAttribFormat, caps.glVertexArrayAttribIFormat, caps.glVertexArrayAttribLFormat, caps.glVertexArrayBindingDivisor, caps.glVertexArrayElementBuffer, - caps.glVertexArrayVertexBuffer, caps.glVertexArrayVertexBuffers); - } - - static void load(GLCapabilities caps, GLLoadFunc load) { - caps.glBindTextureUnit = load.invoke("glBindTextureUnit", IIV); - caps.glBlitNamedFramebuffer = load.invoke("glBlitNamedFramebuffer", IIIIIIIIIIIIV); - caps.glCheckNamedFramebufferStatus = load.invoke("glCheckNamedFramebufferStatus", III); - caps.glClearNamedBufferData = load.invoke("glClearNamedBufferData", IIIIPV); - caps.glClearNamedBufferSubData = load.invoke("glClearNamedBufferSubData", IIJJIIPV); - caps.glClearNamedFramebufferfi = load.invoke("glClearNamedFramebufferfi", IIIFIV); - caps.glClearNamedFramebufferfv = load.invoke("glClearNamedFramebufferfv", IIIPV); - caps.glClearNamedFramebufferiv = load.invoke("glClearNamedFramebufferiv", IIIPV); - caps.glClearNamedFramebufferuiv = load.invoke("glClearNamedFramebufferuiv", IIIPV); - caps.glClipControl = load.invoke("glClipControl", IIV); - caps.glCompressedTextureSubImage1D = load.invoke("glCompressedTextureSubImage1D", IIIIIIPV); - caps.glCompressedTextureSubImage2D = load.invoke("glCompressedTextureSubImage2D", IIIIIIIIPV); - caps.glCompressedTextureSubImage3D = load.invoke("glCompressedTextureSubImage3D", IIIIIIIIIIPV); - caps.glCopyNamedBufferSubData = load.invoke("glCopyNamedBufferSubData", IIJJJV); - caps.glCopyTextureSubImage1D = load.invoke("glCopyTextureSubImage1D", IIIIIIV); - caps.glCopyTextureSubImage2D = load.invoke("glCopyTextureSubImage2D", IIIIIIIIV); - caps.glCopyTextureSubImage3D = load.invoke("glCopyTextureSubImage3D", IIIIIIIIIV); - 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.invoke("glGetNamedBufferParameteri64v", IIPV); - caps.glGetNamedBufferParameteriv = load.invoke("glGetNamedBufferParameteriv", IIPV); - caps.glGetNamedBufferPointerv = load.invoke("glGetNamedBufferPointerv", IIPV); - caps.glGetNamedBufferSubData = load.invoke("glGetNamedBufferSubData", IJJPV); - 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.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.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); - caps.glGetnUniformfv = load.invoke("glGetnUniformfv", IIIPV); - caps.glGetnUniformiv = load.invoke("glGetnUniformiv", IIIPV); - caps.glGetnUniformuiv = load.invoke("glGetnUniformuiv", IIIPV); - caps.glInvalidateNamedFramebufferData = load.invoke("glInvalidateNamedFramebufferData", IIPV); - caps.glInvalidateNamedFramebufferSubData = load.invoke("glInvalidateNamedFramebufferSubData", IIPIIIIV); - caps.glMapNamedBuffer = load.invoke("glMapNamedBuffer", IIP); - caps.glMapNamedBufferRange = load.invoke("glMapNamedBufferRange", IJJIP); - caps.glMemoryBarrierByRegion = load.invoke("glMemoryBarrierByRegion", IV); - caps.glNamedBufferData = load.invoke("glNamedBufferData", IJPIV); - caps.glNamedBufferStorage = load.invoke("glNamedBufferStorage", IJPIV); - caps.glNamedBufferSubData = load.invoke("glNamedBufferSubData", IJJPV); - caps.glNamedFramebufferDrawBuffer = load.invoke("glNamedFramebufferDrawBuffer", II); - caps.glNamedFramebufferDrawBuffers = load.invoke("glNamedFramebufferDrawBuffers", IIPV); - caps.glNamedFramebufferParameteri = load.invoke("glNamedFramebufferParameteri", IIIV); - caps.glNamedFramebufferReadBuffer = load.invoke("glNamedFramebufferReadBuffer", IIV); - caps.glNamedFramebufferRenderbuffer = load.invoke("glNamedFramebufferRenderbuffer", IIIIV); - caps.glNamedFramebufferTexture = load.invoke("glNamedFramebufferTexture", IIIIV); - caps.glNamedFramebufferTextureLayer = load.invoke("glNamedFramebufferTextureLayer", IIIIIV); - caps.glNamedRenderbufferStorage = load.invoke("glNamedRenderbufferStorage", IIIIV); - caps.glNamedRenderbufferStorageMultisample = load.invoke("glNamedRenderbufferStorageMultisample", IIIIIV); - caps.glReadnPixels = load.invoke("glReadnPixels", IIIIIIIPV); - caps.glTextureBarrier = load.invoke("glTextureBarrier", V); - caps.glTextureBuffer = load.invoke("glTextureBuffer", IIIV); - caps.glTextureBufferRange = load.invoke("glTextureBufferRange", IIIJJV); - 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); - caps.glTextureStorage3D = load.invoke("glTextureStorage3D", IIIIIIV); - caps.glTextureStorage3DMultisample = load.invoke("glTextureStorage3DMultisample", IIIIIIZV); - caps.glTextureSubImage1D = load.invoke("glTextureSubImage1D", IIIIIIPV); - caps.glTextureSubImage2D = load.invoke("glTextureSubImage2D", IIIIIIIIPV); - caps.glTextureSubImage3D = load.invoke("glTextureSubImage3D", IIIIIIIIIIPV); - caps.glTransformFeedbackBufferBase = load.invoke("glTransformFeedbackBufferBase", IIIV); - caps.glTransformFeedbackBufferRange = load.invoke("glTransformFeedbackBufferRange", IIIJJV); - caps.glUnmapNamedBuffer = load.invoke("glUnmapNamedBuffer", IZ); - caps.glVertexArrayAttribBinding = load.invoke("glVertexArrayAttribBinding", IIIV); - caps.glVertexArrayAttribFormat = load.invoke("glVertexArrayAttribFormat", IIIIZIV); - caps.glVertexArrayAttribIFormat = load.invoke("glVertexArrayAttribIFormat", IIIIIV); - caps.glVertexArrayAttribLFormat = load.invoke("glVertexArrayAttribLFormat", IIIIIV); - caps.glVertexArrayBindingDivisor = load.invoke("glVertexArrayBindingDivisor", IIIV); - caps.glVertexArrayElementBuffer = load.invoke("glVertexArrayElementBuffer", IIV); - caps.glVertexArrayVertexBuffer = load.invoke("glVertexArrayVertexBuffer", IIIJIV); - caps.glVertexArrayVertexBuffers = load.invoke("glVertexArrayVertexBuffers", IIIPPPV); - } - - public static void bindTextureUnit(int unit, int texture) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glBindTextureUnit).invokeExact(unit, texture); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } +public sealed interface GL45C extends GL44C permits GL46C { + int CONTEXT_LOST = 0x0507; + int NEGATIVE_ONE_TO_ONE = 0x935E; + int ZERO_TO_ONE = 0x935F; + int CLIP_ORIGIN = 0x935C; + int CLIP_DEPTH_MODE = 0x935D; + int QUERY_WAIT_INVERTED = 0x8E17; + int QUERY_NO_WAIT_INVERTED = 0x8E18; + int QUERY_BY_REGION_WAIT_INVERTED = 0x8E19; + int QUERY_BY_REGION_NO_WAIT_INVERTED = 0x8E1A; + int MAX_CULL_DISTANCES = 0x82F9; + int MAX_COMBINED_CLIP_AND_CULL_DISTANCES = 0x82FA; + int TEXTURE_TARGET = 0x1006; + int QUERY_TARGET = 0x82EA; + int GUILTY_CONTEXT_RESET = 0x8253; + int INNOCENT_CONTEXT_RESET = 0x8254; + int UNKNOWN_CONTEXT_RESET = 0x8255; + int RESET_NOTIFICATION_STRATEGY = 0x8256; + int LOSE_CONTEXT_ON_RESET = 0x8252; + int NO_RESET_NOTIFICATION = 0x8261; + int CONTEXT_FLAG_ROBUST_ACCESS_BIT = 0x00000004; + int CONTEXT_RELEASE_BEHAVIOR = 0x82FB; + int CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x82FC; + + @Entrypoint("glBindTextureUnit") + default void bindTextureUnit(int unit, int texture) { + throw new ContextException(); } - public static void blitNamedFramebuffer(int readFramebuffer, int drawFramebuffer, int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, int mask, int filter) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glBlitNamedFramebuffer).invokeExact(readFramebuffer, drawFramebuffer, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glBlitNamedFramebuffer") + default void blitNamedFramebuffer(int readFramebuffer, int drawFramebuffer, int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, int mask, int filter) { + throw new ContextException(); } - public static int checkNamedFramebufferStatus(int framebuffer, int target) { - var caps = GLLoader.getCapabilities(); - try { - return (int) GLLoader.check(caps.glCheckNamedFramebufferStatus).invokeExact(framebuffer, target); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCheckNamedFramebufferStatus") + default int checkNamedFramebufferStatus(int framebuffer, int target) { + throw new ContextException(); } - public static void clearNamedBufferData(int buffer, int internalFormat, int format, int type, MemorySegment data) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glClearNamedBufferData).invokeExact(buffer, internalFormat, format, type, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glClearNamedBufferData") + default void clearNamedBufferData(int buffer, int internalFormat, int format, int type, MemorySegment data) { + throw new ContextException(); } - public static void clearNamedBufferSubData(int buffer, int internalFormat, long offset, long size, int format, int type, MemorySegment data) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glClearNamedBufferSubData).invokeExact(buffer, internalFormat, offset, size, format, type, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glClearNamedBufferSubData") + default void clearNamedBufferSubData(int buffer, int internalFormat, long offset, long size, int format, int type, MemorySegment data) { + throw new ContextException(); } - public static void clearNamedFramebufferfi(int framebuffer, int buffer, int drawBuffer, float depth, int stencil) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glClearNamedFramebufferfi).invokeExact(framebuffer, buffer, drawBuffer, depth, stencil); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glClearNamedFramebufferfi") + default void clearNamedFramebufferfi(int framebuffer, int buffer, int drawBuffer, float depth, int stencil) { + throw new ContextException(); } - public static void clearNamedFramebufferfv(int framebuffer, int buffer, int drawBuffer, MemorySegment value) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glClearNamedFramebufferfv).invokeExact(framebuffer, buffer, drawBuffer, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glClearNamedFramebufferfv") + default void clearNamedFramebufferfv(int framebuffer, int buffer, int drawBuffer, MemorySegment value) { + throw new ContextException(); } - public static void clearNamedFramebufferfv(SegmentAllocator allocator, int framebuffer, int buffer, int drawBuffer, float[] value) { - clearNamedFramebufferfv(framebuffer, buffer, drawBuffer, allocator.allocateFrom(JAVA_FLOAT, value)); + @Entrypoint("glClearNamedFramebufferfv") + default void clearNamedFramebufferfv(SegmentAllocator allocator, int framebuffer, int buffer, int drawBuffer, float[] value) { + throw new ContextException(); } - public static void clearNamedFramebufferiv(int framebuffer, int buffer, int drawBuffer, MemorySegment value) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glClearNamedFramebufferiv).invokeExact(framebuffer, buffer, drawBuffer, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glClearNamedFramebufferiv") + default void clearNamedFramebufferiv(int framebuffer, int buffer, int drawBuffer, MemorySegment value) { + throw new ContextException(); } - public static void clearNamedFramebufferiv(SegmentAllocator allocator, int framebuffer, int buffer, int drawBuffer, int[] value) { - clearNamedFramebufferiv(framebuffer, buffer, drawBuffer, allocator.allocateFrom(JAVA_INT, value)); + @Entrypoint("glClearNamedFramebufferiv") + default void clearNamedFramebufferiv(SegmentAllocator allocator, int framebuffer, int buffer, int drawBuffer, int[] value) { + throw new ContextException(); } - public static void clearNamedFramebufferuiv(int framebuffer, int buffer, int drawBuffer, MemorySegment value) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glClearNamedFramebufferuiv).invokeExact(framebuffer, buffer, drawBuffer, value); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glClearNamedFramebufferuiv") + default void clearNamedFramebufferuiv(int framebuffer, int buffer, int drawBuffer, MemorySegment value) { + throw new ContextException(); } - public static void clearNamedFramebufferuiv(SegmentAllocator allocator, int framebuffer, int buffer, int drawBuffer, int[] value) { - clearNamedFramebufferuiv(framebuffer, buffer, drawBuffer, allocator.allocateFrom(JAVA_INT, value)); + @Entrypoint("glClearNamedFramebufferuiv") + default void clearNamedFramebufferuiv(SegmentAllocator allocator, int framebuffer, int buffer, int drawBuffer, int[] value) { + throw new ContextException(); } - public static void clipControl(int origin, int depth) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glClipControl).invokeExact(origin, depth); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glClipControl") + default void clipControl(int origin, int depth) { + throw new ContextException(); } - public static void compressedTextureSubImage1D(int texture, int level, int xoffset, int width, int format, int imageSize, MemorySegment data) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glCompressedTextureSubImage1D).invokeExact(texture, level, xoffset, width, format, imageSize, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCompressedTextureSubImage1D") + default void compressedTextureSubImage1D(int texture, int level, int xoffset, int width, int format, int imageSize, MemorySegment data) { + throw new ContextException(); } - public static void compressedTextureSubImage2D(int texture, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, MemorySegment data) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glCompressedTextureSubImage2D).invokeExact(texture, level, xoffset, yoffset, width, height, format, imageSize, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCompressedTextureSubImage2D") + default void compressedTextureSubImage2D(int texture, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, MemorySegment data) { + throw new ContextException(); } - public static void compressedTextureSubImage3D(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, MemorySegment data) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glCompressedTextureSubImage3D).invokeExact(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCompressedTextureSubImage3D") + default void compressedTextureSubImage3D(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, MemorySegment data) { + throw new ContextException(); } - public static void copyNamedBufferSubData(int readBuffer, int writeBuffer, long readOffset, long writeOffset, long size) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glCopyNamedBufferSubData).invokeExact(readBuffer, writeBuffer, readOffset, writeOffset, size); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCopyNamedBufferSubData") + default void copyNamedBufferSubData(int readBuffer, int writeBuffer, long readOffset, long writeOffset, long size) { + throw new ContextException(); } - public static void copyTextureSubImage1D(int texture, int level, int xoffset, int x, int y, int width) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glCopyTextureSubImage1D).invokeExact(texture, level, xoffset, x, y, width); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCopyTextureSubImage1D") + default void copyTextureSubImage1D(int texture, int level, int xoffset, int x, int y, int width) { + throw new ContextException(); } - public static void copyTextureSubImage2D(int texture, int level, int xoffset, int yoffset, int x, int y, int width, int height) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glCopyTextureSubImage2D).invokeExact(texture, level, xoffset, yoffset, x, y, width, height); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCopyTextureSubImage2D") + default void copyTextureSubImage2D(int texture, int level, int xoffset, int yoffset, int x, int y, int width, int height) { + throw new ContextException(); } - public static void copyTextureSubImage3D(int texture, int level, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glCopyTextureSubImage3D).invokeExact(texture, level, xoffset, yoffset, zoffset, x, y, width, height); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCopyTextureSubImage3D") + default void copyTextureSubImage3D(int texture, int level, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height) { + throw new ContextException(); } - public static void createBuffers(int n, MemorySegment buffers) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glCreateBuffers).invokeExact(n, buffers); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCreateBuffers") + default void createBuffers(int n, MemorySegment buffers) { + throw new ContextException(); } - public static void createBuffers(SegmentAllocator allocator, int[] buffers) { - var seg = allocator.allocateFrom(JAVA_INT, buffers); + @Skip + default void createBuffers(SegmentAllocator allocator, @Ref int[] buffers) { + var seg = Marshal.marshal(allocator, buffers); createBuffers(buffers.length, seg); - RuntimeHelper.toArray(seg, buffers); + Unmarshal.copy(seg, buffers); } - public static int createBuffer() { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int createBuffers() { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); createBuffers(1, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void createFramebuffers(int n, MemorySegment framebuffers) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glCreateFramebuffers).invokeExact(n, framebuffers); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCreateFramebuffers") + default void createFramebuffers(int n, MemorySegment framebuffers) { + throw new ContextException(); } - public static void createFramebuffers(SegmentAllocator allocator, int[] framebuffers) { - var seg = allocator.allocateFrom(JAVA_INT, framebuffers); + @Skip + default void createFramebuffers(SegmentAllocator allocator, @Ref int[] framebuffers) { + var seg = Marshal.marshal(allocator, framebuffers); createFramebuffers(framebuffers.length, seg); - RuntimeHelper.toArray(seg, framebuffers); + Unmarshal.copy(seg, framebuffers); } - public static int createFramebuffer() { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int createFramebuffers() { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); createFramebuffers(1, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void createProgramPipelines(int n, MemorySegment pipelines) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glCreateProgramPipelines).invokeExact(n, pipelines); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCreateProgramPipelines") + default void createProgramPipelines(int n, MemorySegment pipelines) { + throw new ContextException(); } - public static void createProgramPipelines(SegmentAllocator allocator, int[] pipelines) { - var seg = allocator.allocateFrom(JAVA_INT, pipelines.length); + @Skip + default void createProgramPipelines(SegmentAllocator allocator, @Ref int[] pipelines) { + var seg = Marshal.marshal(allocator, pipelines); createProgramPipelines(pipelines.length, seg); - RuntimeHelper.toArray(seg, pipelines); + Unmarshal.copy(seg, pipelines); } - public static int createProgramPipeline() { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int createProgramPipelines() { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); createProgramPipelines(1, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void createQueries(int target, int n, MemorySegment ids) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glCreateQueries).invokeExact(target, n, ids); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCreateQueries") + default void createQueries(int target, int n, MemorySegment ids) { + throw new ContextException(); } - public static void createQueries(SegmentAllocator allocator, int target, int[] ids) { - var seg = allocator.allocateFrom(JAVA_INT, ids); + @Skip + default void createQueries(SegmentAllocator allocator, int target, @Ref int[] ids) { + var seg = Marshal.marshal(allocator, ids); createQueries(target, ids.length, seg); - RuntimeHelper.toArray(seg, ids); + Unmarshal.copy(seg, ids); } - public static int createQuery(int target) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int createQueries(int target) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); createQueries(target, 1, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void createRenderbuffers(int n, MemorySegment renderbuffers) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glCreateRenderbuffers).invokeExact(n, renderbuffers); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCreateRenderbuffers") + default void createRenderbuffers(int n, MemorySegment renderbuffers) { + throw new ContextException(); } - public static void createRenderbuffers(SegmentAllocator allocator, int[] renderbuffers) { - var seg = allocator.allocateFrom(JAVA_INT, renderbuffers); + @Skip + default void createRenderbuffers(SegmentAllocator allocator, @Ref int[] renderbuffers) { + var seg = Marshal.marshal(allocator, renderbuffers); createRenderbuffers(renderbuffers.length, seg); - RuntimeHelper.toArray(seg, renderbuffers); + Unmarshal.copy(seg, renderbuffers); } - public static int createRenderbuffer() { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int createRenderbuffers() { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); createRenderbuffers(1, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void createSamplers(int n, MemorySegment samplers) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glCreateSamplers).invokeExact(n, samplers); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCreateSamplers") + default void createSamplers(int n, MemorySegment samplers) { + throw new ContextException(); } - public static void createSamplers(SegmentAllocator allocator, int[] samplers) { - var seg = allocator.allocateFrom(JAVA_INT, samplers); + @Skip + default void createSamplers(SegmentAllocator allocator, @Ref int[] samplers) { + var seg = Marshal.marshal(allocator, samplers); createSamplers(samplers.length, seg); - RuntimeHelper.toArray(seg, samplers); + Unmarshal.copy(seg, samplers); } - public static int createSampler() { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int createSamplers() { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); createSamplers(1, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void createTextures(int target, int n, MemorySegment textures) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glCreateTextures).invokeExact(target, n, textures); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCreateTextures") + default void createTextures(int target, int n, MemorySegment textures) { + throw new ContextException(); } - public static void createTextures(SegmentAllocator allocator, int target, int[] textures) { - final int n = textures.length; - var pTex = allocator.allocate(JAVA_INT, n); - createTextures(target, n, pTex); - RuntimeHelper.toArray(pTex, textures); + @Skip + default void createTextures(SegmentAllocator allocator, int target, @Ref int[] textures) { + var pTex = Marshal.marshal(allocator, textures); + createTextures(target, textures.length, pTex); + Unmarshal.copy(pTex, textures); } - public static int createTexture(int target) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pTex = stack.callocInt(); + @Skip + default int createTextures(int target) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pTex = stack.ints(0); createTextures(target, 1, pTex); return pTex.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void createTransformFeedbacks(int n, MemorySegment ids) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glCreateTransformFeedbacks).invokeExact(n, ids); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCreateTransformFeedbacks") + default void createTransformFeedbacks(int n, MemorySegment ids) { + throw new ContextException(); } - public static void createTransformFeedbacks(SegmentAllocator allocator, int[] ids) { - var seg = allocator.allocateFrom(JAVA_INT, ids); + @Skip + default void createTransformFeedbacks(SegmentAllocator allocator, @Ref int[] ids) { + var seg = Marshal.marshal(allocator, ids); createTransformFeedbacks(ids.length, seg); - RuntimeHelper.toArray(seg, ids); + Unmarshal.copy(seg, ids); } - public static int createTransformFeedback() { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int createTransformFeedbacks() { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); createTransformFeedbacks(1, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void createVertexArrays(int n, MemorySegment arrays) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glCreateVertexArrays).invokeExact(n, arrays); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glCreateVertexArrays") + default void createVertexArrays(int n, MemorySegment arrays) { + throw new ContextException(); } - public static void createVertexArrays(SegmentAllocator allocator, int[] arrays) { - var seg = allocator.allocateFrom(JAVA_INT, arrays); + @Skip + default void createVertexArrays(SegmentAllocator allocator, @Ref int[] arrays) { + var seg = Marshal.marshal(allocator, arrays); createVertexArrays(arrays.length, seg); - RuntimeHelper.toArray(seg, arrays); + Unmarshal.copy(seg, arrays); } - public static int createVertexArray() { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int createVertexArrays() { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); createVertexArrays(1, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void disableVertexArrayAttrib(int vaobj, int index) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glDisableVertexArrayAttrib).invokeExact(vaobj, index); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glDisableVertexArrayAttrib") + default void disableVertexArrayAttrib(int vaobj, int index) { + throw new ContextException(); } - public static void enableVertexArrayAttrib(int vaobj, int index) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glEnableVertexArrayAttrib).invokeExact(vaobj, index); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glEnableVertexArrayAttrib") + default void enableVertexArrayAttrib(int vaobj, int index) { + throw new ContextException(); } - public static void flushMappedNamedBufferRange(int buffer, long offset, long length) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glFlushMappedNamedBufferRange).invokeExact(buffer, offset, length); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glFlushMappedNamedBufferRange") + default void flushMappedNamedBufferRange(int buffer, long offset, long length) { + throw new ContextException(); } - public static void generateTextureMipmap(int texture) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGenerateTextureMipmap).invokeExact(texture); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGenerateTextureMipmap") + default void generateTextureMipmap(int texture) { + throw new ContextException(); } - public static void getCompressedTextureImage(int texture, int level, int bufSize, MemorySegment pixels) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetCompressedTextureImage).invokeExact(texture, level, bufSize, pixels); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetCompressedTextureImage") + default void getCompressedTextureImage(int texture, int level, int bufSize, MemorySegment pixels) { + throw new ContextException(); } - public static void getCompressedTextureSubImage(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int bufSize, MemorySegment pixels) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetCompressedTextureSubImage).invokeExact(texture, level, xoffset, yoffset, zoffset, width, height, depth, bufSize, pixels); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetCompressedTextureSubImage") + default void getCompressedTextureSubImage(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int bufSize, MemorySegment pixels) { + throw new ContextException(); } - public static int getGraphicsResetStatus() { - var caps = GLLoader.getCapabilities(); - try { - return (int) GLLoader.check(caps.glGetGraphicsResetStatus).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetGraphicsResetStatus") + default int getGraphicsResetStatus() { + throw new ContextException(); } - public static void getNamedBufferParameteri64v(int buffer, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetNamedBufferParameteri64v).invokeExact(buffer, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetNamedBufferParameteri64v") + default void getNamedBufferParameteri64v(int buffer, int pname, MemorySegment params) { + throw new ContextException(); } - public static long getNamedBufferParameteri64(int buffer, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocLong(); + @Skip + default long getNamedBufferParameteri64v(int buffer, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.longs(0L); getNamedBufferParameteri64v(buffer, pname, seg); return seg.get(JAVA_LONG, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getNamedBufferParameteriv(int buffer, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetNamedBufferParameteriv).invokeExact(buffer, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetNamedBufferParameteriv") + default void getNamedBufferParameteriv(int buffer, int pname, MemorySegment params) { + throw new ContextException(); } - public static int getNamedBufferParameteri(int buffer, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getNamedBufferParameteriv(int buffer, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getNamedBufferParameteriv(buffer, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getNamedBufferPointerv(int target, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetNamedBufferPointerv).invokeExact(target, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetNamedBufferPointerv") + default void getNamedBufferPointerv(int target, int pname, MemorySegment params) { + throw new ContextException(); } - public static MemorySegment getNamedBufferPointer(int target, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocPointer(); + @Skip + default MemorySegment getNamedBufferPointerv(int target, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.segments(MemorySegment.NULL); getNamedBufferPointerv(target, pname, seg); - return seg.get(RuntimeHelper.ADDRESS_UNBOUNDED, 0); - } finally { - stack.setPointer(stackPointer); + return seg.get(ADDRESS, 0); } } - public static void getNamedBufferSubData(int buffer, long offset, long size, MemorySegment data) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetNamedBufferSubData).invokeExact(buffer, offset, size, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetNamedBufferSubData") + default void getNamedBufferSubData(int buffer, long offset, long size, MemorySegment data) { + throw new ContextException(); } - public static void getNamedBufferSubData(SegmentAllocator allocator, int buffer, long offset, byte[] data) { - var seg = allocator.allocateFrom(JAVA_BYTE, data); - getNamedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.length), seg); - RuntimeHelper.toArray(seg, data); + @Skip + default void getNamedBufferSubData(SegmentAllocator allocator, int buffer, long offset, @Ref byte[] data) { + var seg = Marshal.marshal(allocator, data); + getNamedBufferSubData(buffer, offset, seg.byteSize(), seg); + Unmarshal.copy(seg, data); } - public static void getNamedBufferSubData(SegmentAllocator allocator, int buffer, long offset, short[] data) { - var seg = allocator.allocateFrom(JAVA_SHORT, data); - getNamedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.length) << 1, seg); - RuntimeHelper.toArray(seg, data); + @Skip + default void getNamedBufferSubData(SegmentAllocator allocator, int buffer, long offset, @Ref short[] data) { + var seg = Marshal.marshal(allocator, data); + getNamedBufferSubData(buffer, offset, seg.byteSize(), seg); + Unmarshal.copy(seg, data); } - public static void getNamedBufferSubData(SegmentAllocator allocator, int buffer, long offset, int[] data) { - var seg = allocator.allocateFrom(JAVA_INT, data); - getNamedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.length) << 2, seg); - RuntimeHelper.toArray(seg, data); + @Skip + default void getNamedBufferSubData(SegmentAllocator allocator, int buffer, long offset, @Ref int[] data) { + var seg = Marshal.marshal(allocator, data); + getNamedBufferSubData(buffer, offset, seg.byteSize(), seg); + Unmarshal.copy(seg, data); } - public static void getNamedBufferSubData(SegmentAllocator allocator, int buffer, long offset, long[] data) { - var seg = allocator.allocateFrom(JAVA_LONG, data); - getNamedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.length) << 3, seg); - RuntimeHelper.toArray(seg, data); + @Skip + default void getNamedBufferSubData(SegmentAllocator allocator, int buffer, long offset, @Ref long[] data) { + var seg = Marshal.marshal(allocator, data); + getNamedBufferSubData(buffer, offset, seg.byteSize(), seg); + Unmarshal.copy(seg, data); } - public static void getNamedBufferSubData(SegmentAllocator allocator, int buffer, long offset, float[] data) { - var seg = allocator.allocateFrom(JAVA_FLOAT, data); - getNamedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.length) << 2, seg); - RuntimeHelper.toArray(seg, data); + @Skip + default void getNamedBufferSubData(SegmentAllocator allocator, int buffer, long offset, @Ref float[] data) { + var seg = Marshal.marshal(allocator, data); + getNamedBufferSubData(buffer, offset, seg.byteSize(), seg); + Unmarshal.copy(seg, data); } - public static void getNamedBufferSubData(SegmentAllocator allocator, int buffer, long offset, double[] data) { - var seg = allocator.allocateFrom(JAVA_DOUBLE, data); - getNamedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.length) << 3, seg); - RuntimeHelper.toArray(seg, data); + @Skip + default void getNamedBufferSubData(SegmentAllocator allocator, int buffer, long offset, @Ref double[] data) { + var seg = Marshal.marshal(allocator, data); + getNamedBufferSubData(buffer, offset, seg.byteSize(), seg); + Unmarshal.copy(seg, data); } - public static void getNamedFramebufferAttachmentParameteriv(int framebuffer, int attachment, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetNamedFramebufferAttachmentParameteriv).invokeExact(framebuffer, attachment, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetNamedFramebufferAttachmentParameteriv") + default void getNamedFramebufferAttachmentParameteriv(int framebuffer, int attachment, int pname, MemorySegment params) { + throw new ContextException(); } - public static int getNamedFramebufferAttachmentParameteri(int framebuffer, int attachment, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getNamedFramebufferAttachmentParameteriv(int framebuffer, int attachment, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getNamedFramebufferAttachmentParameteriv(framebuffer, attachment, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getNamedFramebufferParameteriv(int framebuffer, int pname, MemorySegment param) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetNamedFramebufferParameteriv).invokeExact(framebuffer, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetNamedFramebufferParameteriv") + default void getNamedFramebufferParameteriv(int framebuffer, int pname, MemorySegment param) { + throw new ContextException(); } - public static int getNamedFramebufferParameteri(int framebuffer, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getNamedFramebufferParameteriv(int framebuffer, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getNamedFramebufferParameteriv(framebuffer, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getNamedRenderbufferParameteriv(int renderbuffer, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetNamedRenderbufferParameteriv).invokeExact(renderbuffer, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetNamedRenderbufferParameteriv") + default void getNamedRenderbufferParameteriv(int renderbuffer, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getNamedRenderbufferParameteriv(int renderbuffer, int pname, int[] params) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); - getNamedRenderbufferParameteriv(renderbuffer, pname, seg); - params[0] = seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); - } + @Entrypoint("glGetNamedRenderbufferParameteriv") + default void getNamedRenderbufferParameteriv(int renderbuffer, int pname, @Ref int[] params) { + throw new ContextException(); } - public static int getNamedRenderbufferParameteri(int renderbuffer, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getNamedRenderbufferParameteriv(int renderbuffer, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getNamedRenderbufferParameteriv(renderbuffer, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getQueryBufferObjecti64v(int id, int buffer, int pname, long offset) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetQueryBufferObjecti64v).invokeExact(id, buffer, pname, offset); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetQueryBufferObjecti64v") + default void getQueryBufferObjecti64v(int id, int buffer, int pname, long offset) { + throw new ContextException(); } - public static void getQueryBufferObjectiv(int id, int buffer, int pname, long offset) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetQueryBufferObjectiv).invokeExact(id, buffer, pname, offset); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetQueryBufferObjectiv") + default void getQueryBufferObjectiv(int id, int buffer, int pname, long offset) { + throw new ContextException(); } - public static void getQueryBufferObjectui64v(int id, int buffer, int pname, long offset) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetQueryBufferObjectui64v).invokeExact(id, buffer, pname, offset); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetQueryBufferObjectui64v") + default void getQueryBufferObjectui64v(int id, int buffer, int pname, long offset) { + throw new ContextException(); } - public static void getQueryBufferObjectuiv(int id, int buffer, int pname, long offset) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetQueryBufferObjectuiv).invokeExact(id, buffer, pname, offset); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetQueryBufferObjectuiv") + default void getQueryBufferObjectuiv(int id, int buffer, int pname, long offset) { + throw new ContextException(); } - public static void getTextureImage(int texture, int level, int format, int type, int bufSize, MemorySegment pixels) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetTextureImage).invokeExact(texture, level, format, type, bufSize, pixels); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTextureImage") + default void getTextureImage(int texture, int level, int format, int type, int bufSize, MemorySegment pixels) { + throw new ContextException(); } - public static void getTextureLevelParameterfv(int texture, int level, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetTextureLevelParameterfv).invokeExact(texture, level, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTextureLevelParameterfv") + default void getTextureLevelParameterfv(int texture, int level, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getTextureLevelParameterfv(SegmentAllocator allocator, int texture, int level, int pname, float[] params) { - var pParams = allocator.allocateFrom(JAVA_FLOAT, params); - getTextureLevelParameterfv(texture, level, pname, pParams); - RuntimeHelper.toArray(pParams, params); + @Entrypoint("glGetTextureLevelParameterfv") + default void getTextureLevelParameterfv(SegmentAllocator allocator, int texture, int level, int pname, @Ref float[] params) { + throw new ContextException(); } - public static float getTextureLevelParameterf(int texture, int level, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pParams = stack.callocFloat(); + @Skip + default float getTextureLevelParameterfv(int texture, int level, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pParams = stack.floats(0F); getTextureLevelParameterfv(texture, level, pname, pParams); return pParams.get(JAVA_FLOAT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getTextureLevelParameteriv(int texture, int level, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetTextureLevelParameteriv).invokeExact(texture, level, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTextureLevelParameteriv") + default void getTextureLevelParameteriv(int texture, int level, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getTextureLevelParameteriv(SegmentAllocator allocator, int texture, int level, int pname, int[] params) { - var pParams = allocator.allocateFrom(JAVA_INT, params); - getTextureLevelParameteriv(texture, level, pname, pParams); - RuntimeHelper.toArray(pParams, params); + @Entrypoint("glGetTextureLevelParameteriv") + default void getTextureLevelParameteriv(SegmentAllocator allocator, int texture, int level, int pname, @Ref int[] params) { + throw new ContextException(); } - public static int getTextureLevelParameteri(int texture, int level, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pParams = stack.callocInt(); + @Skip + default int getTextureLevelParameteriv(int texture, int level, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pParams = stack.ints(0); getTextureLevelParameteriv(texture, level, pname, pParams); return pParams.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getTextureParameterIiv(int texture, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetTextureParameterIiv).invokeExact(texture, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTextureParameterIiv") + default void getTextureParameterIiv(int texture, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getTextureParameterIiv(SegmentAllocator allocator, int texture, int pname, int[] params) { - var seg = allocator.allocateFrom(JAVA_INT, params); - getTextureParameterIiv(texture, pname, seg); - RuntimeHelper.toArray(seg, params); + @Entrypoint("glGetTextureParameterIiv") + default void getTextureParameterIiv(SegmentAllocator allocator, int texture, int pname, @Ref int[] params) { + throw new ContextException(); } - public static int getTextureParameterIi(int texture, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getTextureParameterIiv(int texture, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getTextureParameterIiv(texture, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getTextureParameterIuiv(int texture, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetTextureParameterIuiv).invokeExact(texture, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTextureParameterIuiv") + default void getTextureParameterIuiv(int texture, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getTextureParameterIuiv(SegmentAllocator allocator, int texture, int pname, int[] params) { - var seg = allocator.allocateFrom(JAVA_INT, params); - getTextureParameterIuiv(texture, pname, seg); - RuntimeHelper.toArray(seg, params); + @Entrypoint("glGetTextureParameterIuiv") + default void getTextureParameterIuiv(SegmentAllocator allocator, int texture, int pname, @Ref int[] params) { + throw new ContextException(); } - public static int getTextureParameterIui(int texture, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getTextureParameterIuiv(int texture, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getTextureParameterIuiv(texture, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getTextureParameterfv(int texture, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetTextureParameterfv).invokeExact(texture, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTextureParameterfv") + default void getTextureParameterfv(int texture, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getTextureParameterfv(SegmentAllocator allocator, int texture, int pname, float[] params) { - var pParams = allocator.allocateFrom(JAVA_FLOAT, params); - getTextureParameterfv(texture, pname, pParams); - RuntimeHelper.toArray(pParams, params); + @Entrypoint("glGetTextureParameterfv") + default void getTextureParameterfv(SegmentAllocator allocator, int texture, int pname, @Ref float[] params) { + throw new ContextException(); } - public static float getTextureParameterf(int texture, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pParams = stack.callocFloat(); + @Skip + default float getTextureParameterfv(int texture, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pParams = stack.floats(0F); getTextureParameterfv(texture, pname, pParams); return pParams.get(JAVA_FLOAT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getTextureParameteriv(int texture, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetTextureParameteriv).invokeExact(texture, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTextureParameteriv") + default void getTextureParameteriv(int texture, int pname, MemorySegment params) { + throw new ContextException(); } - public static void getTextureParameteriv(SegmentAllocator allocator, int texture, int pname, int[] params) { - var pParams = allocator.allocateFrom(JAVA_INT, params); - getTextureParameteriv(texture, pname, pParams); - RuntimeHelper.toArray(pParams, params); + @Entrypoint("glGetTextureParameteriv") + default void getTextureParameteriv(SegmentAllocator allocator, int texture, int pname, @Ref int[] params) { + throw new ContextException(); } - public static int getTextureParameteri(int texture, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var pParams = stack.callocInt(); + @Skip + default int getTextureParameteriv(int texture, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var pParams = stack.ints(0); getTextureParameteriv(texture, pname, pParams); return pParams.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getTextureSubImage(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, int bufSize, MemorySegment pixels) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetTextureSubImage).invokeExact(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize, pixels); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTextureSubImage") + default void getTextureSubImage(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, int bufSize, MemorySegment pixels) { + throw new ContextException(); } - public static void getTextureSubImage(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, byte[] pixels) { - var seg = allocator.allocateFrom(JAVA_BYTE, pixels); + @Skip + default void getTextureSubImage(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, @Ref byte[] pixels) { + var seg = Marshal.marshal(allocator, pixels); getTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels.length, seg); - RuntimeHelper.toArray(seg, pixels); + Unmarshal.copy(seg, pixels); } - public static void getTextureSubImage(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, short[] pixels) { - var seg = allocator.allocateFrom(JAVA_SHORT, pixels); + @Skip + default void getTextureSubImage(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, @Ref short[] pixels) { + var seg = Marshal.marshal(allocator, pixels); getTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels.length, seg); - RuntimeHelper.toArray(seg, pixels); + Unmarshal.copy(seg, pixels); } - public static void getTextureSubImage(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, int[] pixels) { - var seg = allocator.allocateFrom(JAVA_INT, pixels); + @Skip + default void getTextureSubImage(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, @Ref int[] pixels) { + var seg = Marshal.marshal(allocator, pixels); getTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels.length, seg); - RuntimeHelper.toArray(seg, pixels); + Unmarshal.copy(seg, pixels); } - public static void getTextureSubImage(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, float[] pixels) { - var seg = allocator.allocateFrom(JAVA_FLOAT, pixels); + @Skip + default void getTextureSubImage(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, @Ref float[] pixels) { + var seg = Marshal.marshal(allocator, pixels); getTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels.length, seg); - RuntimeHelper.toArray(seg, pixels); + Unmarshal.copy(seg, pixels); } - public static void getTransformFeedbacki64_v(int xfb, int pname, int index, MemorySegment param) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetTransformFeedbacki64_v).invokeExact(xfb, pname, index, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTransformFeedbacki64_v") + default void getTransformFeedbacki64_v(int xfb, int pname, int index, MemorySegment param) { + throw new ContextException(); } - public static void getTransformFeedbacki64_v(SegmentAllocator allocator, int xfb, int pname, int index, long[] param) { - var seg = allocator.allocateFrom(JAVA_LONG, param); - getTransformFeedbacki64_v(xfb, pname, index, seg); - RuntimeHelper.toArray(seg, param); + @Entrypoint("glGetTransformFeedbacki64_v") + default void getTransformFeedbacki64_v(SegmentAllocator allocator, int xfb, int pname, int index, @Ref long[] param) { + throw new ContextException(); } - public static void getTransformFeedbacki_v(int xfb, int pname, int index, MemorySegment param) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetTransformFeedbacki_v).invokeExact(xfb, pname, index, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTransformFeedbacki_v") + default void getTransformFeedbacki_v(int xfb, int pname, int index, MemorySegment param) { + throw new ContextException(); } - public static void getTransformFeedbacki_v(SegmentAllocator allocator, int xfb, int pname, int index, int[] param) { - var seg = allocator.allocateFrom(JAVA_INT, param); - getTransformFeedbacki_v(xfb, pname, index, seg); - RuntimeHelper.toArray(seg, param); + @Entrypoint("glGetTransformFeedbacki_v") + default void getTransformFeedbacki_v(SegmentAllocator allocator, int xfb, int pname, int index, @Ref int[] param) { + throw new ContextException(); } - public static void getTransformFeedbackiv(int xfb, int pname, MemorySegment param) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetTransformFeedbackiv).invokeExact(xfb, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetTransformFeedbackiv") + default void getTransformFeedbackiv(int xfb, int pname, MemorySegment param) { + throw new ContextException(); } - public static void getTransformFeedbackiv(SegmentAllocator allocator, int xfb, int pname, int[] param) { - var seg = allocator.allocateFrom(JAVA_INT, param); - getTransformFeedbackiv(xfb, pname, seg); - RuntimeHelper.toArray(seg, param); + @Entrypoint("glGetTransformFeedbackiv") + default void getTransformFeedbackiv(SegmentAllocator allocator, int xfb, int pname, @Ref int[] param) { + throw new ContextException(); } - public static void getVertexArrayIndexed64iv(int vaobj, int index, int pname, MemorySegment param) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetVertexArrayIndexed64iv).invokeExact(vaobj, index, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetVertexArrayIndexed64iv") + default void getVertexArrayIndexed64iv(int vaobj, int index, int pname, MemorySegment param) { + throw new ContextException(); } - public static long getVertexArrayIndexed64i(int vaobj, int index, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocLong(); + @Skip + default long getVertexArrayIndexed64iv(int vaobj, int index, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.longs(0L); getVertexArrayIndexed64iv(vaobj, index, pname, seg); return seg.get(JAVA_LONG, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getVertexArrayIndexediv(int vaobj, int index, int pname, MemorySegment param) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetVertexArrayIndexediv).invokeExact(vaobj, index, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetVertexArrayIndexediv") + default void getVertexArrayIndexediv(int vaobj, int index, int pname, MemorySegment param) { + throw new ContextException(); } - public static int getVertexArrayIndexedi(int vaobj, int index, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getVertexArrayIndexediv(int vaobj, int index, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getVertexArrayIndexediv(vaobj, index, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getVertexArrayiv(int vaobj, int pname, MemorySegment param) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetVertexArrayiv).invokeExact(vaobj, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetVertexArrayiv") + default void getVertexArrayiv(int vaobj, int pname, MemorySegment param) { + throw new ContextException(); } - public static int getVertexArrayi(int vaobj, int pname) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { - var seg = stack.callocInt(); + @Skip + default int getVertexArrayiv(int vaobj, int pname) { + try (MemoryStack stack = MemoryStack.stackPush()) { + var seg = stack.ints(0); getVertexArrayiv(vaobj, pname, seg); return seg.get(JAVA_INT, 0); - } finally { - stack.setPointer(stackPointer); } } - public static void getnCompressedTexImage(int target, int lod, int bufSize, MemorySegment pixels) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetnCompressedTexImage).invokeExact(target, lod, bufSize, pixels); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetnCompressedTexImage") + default void getnCompressedTexImage(int target, int lod, int bufSize, MemorySegment pixels) { + throw new ContextException(); } - public static void getnCompressedTexImage(int target, int lod, MemorySegment pixels) { - getnCompressedTexImage(target, lod, (int) pixels.byteSize(), pixels); + @Skip + default void getnCompressedTexImage(int target, int lod, MemorySegment pixels) { + getnCompressedTexImage(target, lod, Math.toIntExact(pixels.byteSize()), pixels); } - public static void getnTexImage(int target, int level, int format, int type, int bufSize, MemorySegment pixels) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetnTexImage).invokeExact(target, level, format, type, bufSize, pixels); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetnTexImage") + default void getnTexImage(int target, int level, int format, int type, int bufSize, MemorySegment pixels) { + throw new ContextException(); } - public static void getnTexImage(int target, int level, int format, int type, MemorySegment pixels) { - getnTexImage(target, level, format, type, (int) pixels.byteSize(), pixels); + @Skip + default void getnTexImage(int target, int level, int format, int type, MemorySegment pixels) { + getnTexImage(target, level, format, type, Math.toIntExact(pixels.byteSize()), pixels); } - public static void getnTexImage(SegmentAllocator allocator, int target, int level, int format, int type, byte[] pixels) { - var seg = allocator.allocateFrom(JAVA_BYTE, pixels); + @Skip + default void getnTexImage(SegmentAllocator allocator, int target, int level, int format, int type, @Ref byte[] pixels) { + var seg = Marshal.marshal(allocator, pixels); getnTexImage(target, level, format, type, pixels.length, seg); - RuntimeHelper.toArray(seg, pixels); + Unmarshal.copy(seg, pixels); } - public static void getnTexImage(SegmentAllocator allocator, int target, int level, int format, int type, short[] pixels) { - var seg = allocator.allocateFrom(JAVA_SHORT, pixels); + @Skip + default void getnTexImage(SegmentAllocator allocator, int target, int level, int format, int type, @Ref short[] pixels) { + var seg = Marshal.marshal(allocator, pixels); getnTexImage(target, level, format, type, pixels.length, seg); - RuntimeHelper.toArray(seg, pixels); + Unmarshal.copy(seg, pixels); } - public static void getnTexImage(SegmentAllocator allocator, int target, int level, int format, int type, int[] pixels) { - var seg = allocator.allocateFrom(JAVA_INT, pixels); + @Skip + default void getnTexImage(SegmentAllocator allocator, int target, int level, int format, int type, @Ref int[] pixels) { + var seg = Marshal.marshal(allocator, pixels); getnTexImage(target, level, format, type, pixels.length, seg); - RuntimeHelper.toArray(seg, pixels); + Unmarshal.copy(seg, pixels); } - public static void getnTexImage(SegmentAllocator allocator, int target, int level, int format, int type, float[] pixels) { - var seg = allocator.allocateFrom(JAVA_FLOAT, pixels); + @Skip + default void getnTexImage(SegmentAllocator allocator, int target, int level, int format, int type, @Ref float[] pixels) { + var seg = Marshal.marshal(allocator, pixels); getnTexImage(target, level, format, type, pixels.length, seg); - RuntimeHelper.toArray(seg, pixels); + Unmarshal.copy(seg, pixels); } - public static void getnUniformdv(int program, int location, int bufSize, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetnUniformdv).invokeExact(program, location, bufSize, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetnUniformdv") + default void getnUniformdv(int program, int location, int bufSize, MemorySegment params) { + throw new ContextException(); } - public static void getnUniformdv(int program, int location, MemorySegment params) { - getnUniformdv(program, location, (int) params.byteSize(), params); + @Skip + default void getnUniformdv(int program, int location, MemorySegment params) { + getnUniformdv(program, location, Math.toIntExact(params.byteSize()), params); } - public static void getnUniformdv(SegmentAllocator allocator, int program, int location, double[] params) { - var seg = allocator.allocateFrom(JAVA_DOUBLE, params); + @Skip + default void getnUniformdv(SegmentAllocator allocator, int program, int location, @Ref double[] params) { + var seg = Marshal.marshal(allocator, params); getnUniformdv(program, location, params.length, seg); - RuntimeHelper.toArray(seg, params); + Unmarshal.copy(seg, params); } - public static void getnUniformfv(int program, int location, int bufSize, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetnUniformfv).invokeExact(program, location, bufSize, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetnUniformfv") + default void getnUniformfv(int program, int location, int bufSize, MemorySegment params) { + throw new ContextException(); } - public static void getnUniformfv(int program, int location, MemorySegment params) { - getnUniformfv(program, location, (int) params.byteSize(), params); + @Skip + default void getnUniformfv(int program, int location, MemorySegment params) { + getnUniformfv(program, location, Math.toIntExact(params.byteSize()), params); } - public static void getnUniformfv(SegmentAllocator allocator, int program, int location, float[] params) { - var seg = allocator.allocateFrom(JAVA_FLOAT, params); + @Skip + default void getnUniformfv(SegmentAllocator allocator, int program, int location, @Ref float[] params) { + var seg = Marshal.marshal(allocator, params); getnUniformfv(program, location, params.length, seg); - RuntimeHelper.toArray(seg, params); + Unmarshal.copy(seg, params); } - public static void getnUniformiv(int program, int location, int bufSize, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetnUniformiv).invokeExact(program, location, bufSize, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetnUniformiv") + default void getnUniformiv(int program, int location, int bufSize, MemorySegment params) { + throw new ContextException(); } - public static void getnUniformiv(int program, int location, MemorySegment params) { - getnUniformiv(program, location, (int) params.byteSize(), params); + @Skip + default void getnUniformiv(int program, int location, MemorySegment params) { + getnUniformiv(program, location, Math.toIntExact(params.byteSize()), params); } - public static void getnUniformiv(SegmentAllocator allocator, int program, int location, int[] params) { - var seg = allocator.allocateFrom(JAVA_INT, params); + @Skip + default void getnUniformiv(SegmentAllocator allocator, int program, int location, @Ref int[] params) { + var seg = Marshal.marshal(allocator, params); getnUniformiv(program, location, params.length, seg); - RuntimeHelper.toArray(seg, params); + Unmarshal.copy(seg, params); } - public static void getnUniformuiv(int program, int location, int bufSize, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glGetnUniformuiv).invokeExact(program, location, bufSize, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glGetnUniformuiv") + default void getnUniformuiv(int program, int location, int bufSize, MemorySegment params) { + throw new ContextException(); } - public static void getnUniformuiv(int program, int location, MemorySegment params) { - getnUniformuiv(program, location, (int) params.byteSize(), params); + @Skip + default void getnUniformuiv(int program, int location, MemorySegment params) { + getnUniformuiv(program, location, Math.toIntExact(params.byteSize()), params); } - public static void getnUniformuiv(SegmentAllocator allocator, int program, int location, int[] params) { - var seg = allocator.allocateFrom(JAVA_INT, params); + @Skip + default void getnUniformuiv(SegmentAllocator allocator, int program, int location, @Ref int[] params) { + var seg = Marshal.marshal(allocator, params); getnUniformuiv(program, location, params.length, seg); - RuntimeHelper.toArray(seg, params); + Unmarshal.copy(seg, params); } - public static void invalidateNamedFramebufferData(int framebuffer, int numAttachments, MemorySegment attachments) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glInvalidateNamedFramebufferData).invokeExact(framebuffer, numAttachments, attachments); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glInvalidateNamedFramebufferData") + default void invalidateNamedFramebufferData(int framebuffer, int numAttachments, MemorySegment attachments) { + throw new ContextException(); } - public static void invalidateNamedFramebufferData(SegmentAllocator allocator, int framebuffer, int[] attachments) { - invalidateNamedFramebufferData(framebuffer, attachments.length, allocator.allocateFrom(JAVA_INT, attachments)); + @Skip + default void invalidateNamedFramebufferData(SegmentAllocator allocator, int framebuffer, int[] attachments) { + invalidateNamedFramebufferData(framebuffer, attachments.length, Marshal.marshal(allocator, attachments)); } - public static void invalidateNamedFramebufferData(int framebuffer, int attachment) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { + @Skip + default void invalidateNamedFramebufferData(int framebuffer, int attachment) { + try (MemoryStack stack = MemoryStack.stackPush()) { invalidateNamedFramebufferData(framebuffer, 1, stack.ints(attachment)); - } finally { - stack.setPointer(stackPointer); } } - public static void invalidateNamedFramebufferSubData(int framebuffer, int numAttachments, MemorySegment attachments, int x, int y, int width, int height) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glInvalidateNamedFramebufferSubData).invokeExact(framebuffer, numAttachments, attachments, x, y, width, height); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glInvalidateNamedFramebufferSubData") + default void invalidateNamedFramebufferSubData(int framebuffer, int numAttachments, MemorySegment attachments, int x, int y, int width, int height) { + throw new ContextException(); } - public static void invalidateNamedFramebufferSubData(SegmentAllocator allocator, int framebuffer, int[] attachments, int x, int y, int width, int height) { - invalidateNamedFramebufferSubData(framebuffer, attachments.length, allocator.allocateFrom(JAVA_INT, attachments), x, y, width, height); + @Skip + default void invalidateNamedFramebufferSubData(SegmentAllocator allocator, int framebuffer, int[] attachments, int x, int y, int width, int height) { + invalidateNamedFramebufferSubData(framebuffer, attachments.length, Marshal.marshal(allocator, attachments), x, y, width, height); } - public static void invalidateNamedFramebufferSubData(int framebuffer, int attachment, int x, int y, int width, int height) { - var stack = MemoryStack.stackGet(); - long stackPointer = stack.getPointer(); - try { + @Skip + default void invalidateNamedFramebufferSubData(int framebuffer, int attachment, int x, int y, int width, int height) { + try (MemoryStack stack = MemoryStack.stackPush()) { invalidateNamedFramebufferSubData(framebuffer, 1, stack.ints(attachment), x, y, width, height); - } finally { - stack.setPointer(stackPointer); } } - public static MemorySegment mapNamedBuffer(int buffer, int access) { - var caps = GLLoader.getCapabilities(); - try { - final var seg = (MemorySegment) GLLoader.check(caps.glMapNamedBuffer).invokeExact(buffer, access); - return access == READ_ONLY ? seg.asReadOnly() : seg; - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + default MethodHandle glMapNamedBuffer() { + throw new ContextException(); } - public static MemorySegment mapNamedBufferRange(int buffer, long offset, long length, int access) { - var caps = GLLoader.getCapabilities(); - try { - return ((MemorySegment) GLLoader.check(caps.glMapNamedBufferRange).invokeExact(buffer, offset, length, access)).reinterpret(length); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Skip + default MemorySegment mapNamedBuffer(int buffer, int access) { + return mapNamedBuffer(buffer, access, getNamedBufferParameteri64v(buffer, BUFFER_SIZE)); } - public static void memoryBarrierByRegion(int barriers) { - var caps = GLLoader.getCapabilities(); + @Skip + default MemorySegment mapNamedBuffer(int buffer, int access, long bufferSize) { try { - GLLoader.check(caps.glMemoryBarrierByRegion).invokeExact(barriers); + final MemorySegment segment = ((MemorySegment) glMapNamedBuffer().invokeExact(buffer, access)).reinterpret(bufferSize); + return access == READ_ONLY ? segment.asReadOnly() : segment; } catch (Throwable e) { - throw new AssertionError("should not reach here", e); + throw new RuntimeException(e); } } - public static void namedBufferData(int buffer, long size, MemorySegment data, int usage) { - var caps = GLLoader.getCapabilities(); + default MethodHandle glMapNamedBufferRange() { + throw new ContextException(); + } + + @Skip + default MemorySegment mapNamedBufferRange(int buffer, long offset, long length, int access) { try { - GLLoader.check(caps.glNamedBufferData).invokeExact(buffer, size, data, usage); + return ((MemorySegment) glMapNamedBufferRange().invokeExact(buffer, offset, length, access)).reinterpret(length); } catch (Throwable e) { - throw new AssertionError("should not reach here", e); + throw new RuntimeException(e); } } - public static void namedBufferData(int buffer, MemorySegment data, int usage) { + @Entrypoint("glMemoryBarrierByRegion") + default void memoryBarrierByRegion(int barriers) { + throw new ContextException(); + } + + @Entrypoint("glNamedBufferData") + default void namedBufferData(int buffer, long size, MemorySegment data, int usage) { + throw new ContextException(); + } + + @Skip + default void namedBufferData(int buffer, MemorySegment data, int usage) { namedBufferData(buffer, data.byteSize(), data, usage); } - public static void namedBufferData(int buffer, long size, int usage) { + @Skip + default void namedBufferData(int buffer, long size, int usage) { namedBufferData(buffer, size, MemorySegment.NULL, usage); } - public static void namedBufferData(SegmentAllocator allocator, int buffer, byte[] data, int usage) { - namedBufferData(buffer, Integer.toUnsignedLong(data.length), allocator.allocateFrom(JAVA_BYTE, data), usage); + @Skip + default void namedBufferData(SegmentAllocator allocator, int buffer, byte[] data, int usage) { + namedBufferData(buffer, Marshal.marshal(allocator, data), usage); } - public static void namedBufferData(SegmentAllocator allocator, int buffer, short[] data, int usage) { - namedBufferData(buffer, Integer.toUnsignedLong(data.length) << 1, allocator.allocateFrom(JAVA_SHORT, data), usage); + @Skip + default void namedBufferData(SegmentAllocator allocator, int buffer, short[] data, int usage) { + namedBufferData(buffer, Marshal.marshal(allocator, data), usage); } - public static void namedBufferData(SegmentAllocator allocator, int buffer, int[] data, int usage) { - namedBufferData(buffer, Integer.toUnsignedLong(data.length) << 2, allocator.allocateFrom(JAVA_INT, data), usage); + @Skip + default void namedBufferData(SegmentAllocator allocator, int buffer, int[] data, int usage) { + namedBufferData(buffer, Marshal.marshal(allocator, data), usage); } - public static void namedBufferData(SegmentAllocator allocator, int buffer, long[] data, int usage) { - namedBufferData(buffer, Integer.toUnsignedLong(data.length) << 3, allocator.allocateFrom(JAVA_LONG, data), usage); + @Skip + default void namedBufferData(SegmentAllocator allocator, int buffer, long[] data, int usage) { + namedBufferData(buffer, Marshal.marshal(allocator, data), usage); } - public static void namedBufferData(SegmentAllocator allocator, int buffer, float[] data, int usage) { - namedBufferData(buffer, Integer.toUnsignedLong(data.length) << 2, allocator.allocateFrom(JAVA_FLOAT, data), usage); + @Skip + default void namedBufferData(SegmentAllocator allocator, int buffer, float[] data, int usage) { + namedBufferData(buffer, Marshal.marshal(allocator, data), usage); } - public static void namedBufferData(SegmentAllocator allocator, int buffer, double[] data, int usage) { - namedBufferData(buffer, Integer.toUnsignedLong(data.length) << 3, allocator.allocateFrom(JAVA_DOUBLE, data), usage); + @Skip + default void namedBufferData(SegmentAllocator allocator, int buffer, double[] data, int usage) { + namedBufferData(buffer, Marshal.marshal(allocator, data), usage); } - public static void namedBufferStorage(int buffer, long size, MemorySegment data, int flags) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glNamedBufferStorage).invokeExact(buffer, size, data, flags); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNamedBufferStorage") + default void namedBufferStorage(int buffer, long size, MemorySegment data, int flags) { + throw new ContextException(); } - public static void namedBufferStorage(int buffer, long size, int flags) { + @Skip + default void namedBufferStorage(int buffer, long size, int flags) { namedBufferStorage(buffer, size, MemorySegment.NULL, flags); } - public static void namedBufferStorage(SegmentAllocator allocator, int buffer, byte[] data, int flags) { - namedBufferStorage(buffer, Integer.toUnsignedLong(data.length), allocator.allocateFrom(JAVA_BYTE, data), flags); + @Skip + default void namedBufferStorage(SegmentAllocator allocator, int buffer, byte[] data, int flags) { + final MemorySegment segment = Marshal.marshal(allocator, data); + namedBufferStorage(buffer, segment.byteSize(), segment, flags); } - public static void namedBufferStorage(SegmentAllocator allocator, int buffer, short[] data, int flags) { - namedBufferStorage(buffer, Integer.toUnsignedLong(data.length) << 1, allocator.allocateFrom(JAVA_SHORT, data), flags); + @Skip + default void namedBufferStorage(SegmentAllocator allocator, int buffer, short[] data, int flags) { + final MemorySegment segment = Marshal.marshal(allocator, data); + namedBufferStorage(buffer, segment.byteSize(), segment, flags); } - public static void namedBufferStorage(SegmentAllocator allocator, int buffer, int[] data, int flags) { - namedBufferStorage(buffer, Integer.toUnsignedLong(data.length) << 2, allocator.allocateFrom(JAVA_INT, data), flags); + @Skip + default void namedBufferStorage(SegmentAllocator allocator, int buffer, int[] data, int flags) { + final MemorySegment segment = Marshal.marshal(allocator, data); + namedBufferStorage(buffer, segment.byteSize(), segment, flags); } - public static void namedBufferStorage(SegmentAllocator allocator, int buffer, long[] data, int flags) { - namedBufferStorage(buffer, Integer.toUnsignedLong(data.length) << 3, allocator.allocateFrom(JAVA_LONG, data), flags); + @Skip + default void namedBufferStorage(SegmentAllocator allocator, int buffer, long[] data, int flags) { + final MemorySegment segment = Marshal.marshal(allocator, data); + namedBufferStorage(buffer, segment.byteSize(), segment, flags); } - public static void namedBufferStorage(SegmentAllocator allocator, int buffer, float[] data, int flags) { - namedBufferStorage(buffer, Integer.toUnsignedLong(data.length) << 2, allocator.allocateFrom(JAVA_FLOAT, data), flags); + @Skip + default void namedBufferStorage(SegmentAllocator allocator, int buffer, float[] data, int flags) { + final MemorySegment segment = Marshal.marshal(allocator, data); + namedBufferStorage(buffer, segment.byteSize(), segment, flags); } - public static void namedBufferStorage(SegmentAllocator allocator, int buffer, double[] data, int flags) { - namedBufferStorage(buffer, Integer.toUnsignedLong(data.length) << 3, allocator.allocateFrom(JAVA_DOUBLE, data), flags); + @Skip + default void namedBufferStorage(SegmentAllocator allocator, int buffer, double[] data, int flags) { + final MemorySegment segment = Marshal.marshal(allocator, data); + namedBufferStorage(buffer, segment.byteSize(), segment, flags); } - public static void namedBufferSubData(int buffer, long offset, long size, MemorySegment data) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glNamedBufferSubData).invokeExact(buffer, offset, size, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNamedBufferSubData") + default void namedBufferSubData(int buffer, long offset, long size, MemorySegment data) { + throw new ContextException(); } - public static void namedBufferSubData(int buffer, long offset, MemorySegment data) { + @Skip + default void namedBufferSubData(int buffer, long offset, MemorySegment data) { namedBufferSubData(buffer, offset, data.byteSize(), data); } - public static void namedBufferSubData(SegmentAllocator allocator, int buffer, long offset, byte[] data) { - namedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.length), allocator.allocateFrom(JAVA_BYTE, data)); + @Skip + default void namedBufferSubData(SegmentAllocator allocator, int buffer, long offset, byte[] data) { + namedBufferSubData(buffer, offset, Marshal.marshal(allocator, data)); } - public static void namedBufferSubData(SegmentAllocator allocator, int buffer, long offset, short[] data) { - namedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.length) << 1, allocator.allocateFrom(JAVA_SHORT, data)); + @Skip + default void namedBufferSubData(SegmentAllocator allocator, int buffer, long offset, short[] data) { + namedBufferSubData(buffer, offset, Marshal.marshal(allocator, data)); } - public static void namedBufferSubData(SegmentAllocator allocator, int buffer, long offset, int[] data) { - namedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.length) << 2, allocator.allocateFrom(JAVA_INT, data)); + @Skip + default void namedBufferSubData(SegmentAllocator allocator, int buffer, long offset, int[] data) { + namedBufferSubData(buffer, offset, Marshal.marshal(allocator, data)); } - public static void namedBufferSubData(SegmentAllocator allocator, int buffer, long offset, long[] data) { - namedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.length) << 3, allocator.allocateFrom(JAVA_LONG, data)); + @Skip + default void namedBufferSubData(SegmentAllocator allocator, int buffer, long offset, long[] data) { + namedBufferSubData(buffer, offset, Marshal.marshal(allocator, data)); } - public static void namedBufferSubData(SegmentAllocator allocator, int buffer, long offset, float[] data) { - namedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.length) << 2, allocator.allocateFrom(JAVA_FLOAT, data)); + @Skip + default void namedBufferSubData(SegmentAllocator allocator, int buffer, long offset, float[] data) { + namedBufferSubData(buffer, offset, Marshal.marshal(allocator, data)); } - public static void namedBufferSubData(SegmentAllocator allocator, int buffer, long offset, double[] data) { - namedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.length) << 3, allocator.allocateFrom(JAVA_DOUBLE, data)); + @Skip + default void namedBufferSubData(SegmentAllocator allocator, int buffer, long offset, double[] data) { + namedBufferSubData(buffer, offset, Marshal.marshal(allocator, data)); } - public static void namedFramebufferDrawBuffer(int framebuffer, int buf) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glNamedFramebufferDrawBuffer).invokeExact(framebuffer, buf); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNamedFramebufferDrawBuffer") + default void namedFramebufferDrawBuffer(int framebuffer, int buf) { + throw new ContextException(); } - public static void namedFramebufferDrawBuffers(int framebuffer, int n, MemorySegment bufs) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glNamedFramebufferDrawBuffers).invokeExact(framebuffer, n, bufs); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNamedFramebufferDrawBuffers") + default void namedFramebufferDrawBuffers(int framebuffer, int n, MemorySegment bufs) { + throw new ContextException(); } - public static void namedFramebufferDrawBuffers(SegmentAllocator allocator, int framebuffer, int[] bufs) { - namedFramebufferDrawBuffers(framebuffer, bufs.length, allocator.allocateFrom(JAVA_INT, bufs)); + @Skip + default void namedFramebufferDrawBuffers(SegmentAllocator allocator, int framebuffer, int[] bufs) { + namedFramebufferDrawBuffers(framebuffer, bufs.length, Marshal.marshal(allocator, bufs)); } - public static void namedFramebufferParameteri(int framebuffer, int pname, int param) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glNamedFramebufferParameteri).invokeExact(framebuffer, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNamedFramebufferParameteri") + default void namedFramebufferParameteri(int framebuffer, int pname, int param) { + throw new ContextException(); } - public static void namedFramebufferReadBuffer(int framebuffer, int src) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glNamedFramebufferReadBuffer).invokeExact(framebuffer, src); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNamedFramebufferReadBuffer") + default void namedFramebufferReadBuffer(int framebuffer, int src) { + throw new ContextException(); } - public static void namedFramebufferRenderbuffer(int framebuffer, int attachment, int renderbufferTarget, int renderbuffer) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glNamedFramebufferRenderbuffer).invokeExact(framebuffer, attachment, renderbufferTarget, renderbuffer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNamedFramebufferRenderbuffer") + default void namedFramebufferRenderbuffer(int framebuffer, int attachment, int renderbufferTarget, int renderbuffer) { + throw new ContextException(); } - public static void namedFramebufferTexture(int framebuffer, int attachment, int texture, int level) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glNamedFramebufferTexture).invokeExact(framebuffer, attachment, texture, level); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNamedFramebufferTexture") + default void namedFramebufferTexture(int framebuffer, int attachment, int texture, int level) { + throw new ContextException(); } - public static void namedFramebufferTextureLayer(int framebuffer, int attachment, int texture, int level, int layer) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glNamedFramebufferTextureLayer).invokeExact(framebuffer, attachment, texture, level, layer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNamedFramebufferTextureLayer") + default void namedFramebufferTextureLayer(int framebuffer, int attachment, int texture, int level, int layer) { + throw new ContextException(); } - public static void namedRenderbufferStorage(int renderbuffer, int internalFormat, int width, int height) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glNamedRenderbufferStorage).invokeExact(renderbuffer, internalFormat, width, height); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNamedRenderbufferStorage") + default void namedRenderbufferStorage(int renderbuffer, int internalFormat, int width, int height) { + throw new ContextException(); } - public static void namedRenderbufferStorageMultisample(int renderbuffer, int samples, int internalFormat, int width, int height) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glNamedRenderbufferStorageMultisample).invokeExact(renderbuffer, samples, internalFormat, width, height); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glNamedRenderbufferStorageMultisample") + default void namedRenderbufferStorageMultisample(int renderbuffer, int samples, int internalFormat, int width, int height) { + throw new ContextException(); } - public static void readnPixels(int x, int y, int width, int height, int format, int type, int bufSize, MemorySegment data) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glReadnPixels).invokeExact(x, y, width, height, format, type, bufSize, data); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glReadnPixels") + default void readnPixels(int x, int y, int width, int height, int format, int type, int bufSize, MemorySegment data) { + throw new ContextException(); } - public static void readnPixels(int x, int y, int width, int height, int format, int type, MemorySegment data) { - readnPixels(x, y, width, height, format, type, (int) data.byteSize(), data); + @Skip + default void readnPixels(int x, int y, int width, int height, int format, int type, MemorySegment data) { + readnPixels(x, y, width, height, format, type, Math.toIntExact(data.byteSize()), data); } - public static void readnPixels(SegmentAllocator allocator, int x, int y, int width, int height, int format, int type, byte[] data) { - var seg = allocator.allocateFrom(JAVA_BYTE, data); - readnPixels(x, y, width, height, format, type, data.length, seg); - RuntimeHelper.toArray(seg, data); + @Skip + default void readnPixels(SegmentAllocator allocator, int x, int y, int width, int height, int format, int type, @Ref byte[] data) { + var seg = Marshal.marshal(allocator, data); + readnPixels(x, y, width, height, format, type, seg); + Unmarshal.copy(seg, data); } - public static void readnPixels(SegmentAllocator allocator, int x, int y, int width, int height, int format, int type, short[] data) { - var seg = allocator.allocateFrom(JAVA_SHORT, data); - readnPixels(x, y, width, height, format, type, data.length, seg); - RuntimeHelper.toArray(seg, data); + @Skip + default void readnPixels(SegmentAllocator allocator, int x, int y, int width, int height, int format, int type, @Ref short[] data) { + var seg = Marshal.marshal(allocator, data); + readnPixels(x, y, width, height, format, type, seg); + Unmarshal.copy(seg, data); } - public static void readnPixels(SegmentAllocator allocator, int x, int y, int width, int height, int format, int type, int[] data) { - var seg = allocator.allocateFrom(JAVA_INT, data); - readnPixels(x, y, width, height, format, type, data.length, seg); - RuntimeHelper.toArray(seg, data); + @Skip + default void readnPixels(SegmentAllocator allocator, int x, int y, int width, int height, int format, int type, @Ref int[] data) { + var seg = Marshal.marshal(allocator, data); + readnPixels(x, y, width, height, format, type, seg); + Unmarshal.copy(seg, data); } - public static void readnPixels(SegmentAllocator allocator, int x, int y, int width, int height, int format, int type, float[] data) { - var seg = allocator.allocateFrom(JAVA_FLOAT, data); - readnPixels(x, y, width, height, format, type, data.length, seg); - RuntimeHelper.toArray(seg, data); + @Skip + default void readnPixels(SegmentAllocator allocator, int x, int y, int width, int height, int format, int type, @Ref float[] data) { + var seg = Marshal.marshal(allocator, data); + readnPixels(x, y, width, height, format, type, seg); + Unmarshal.copy(seg, data); } - public static void textureBarrier() { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTextureBarrier).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTextureBarrier") + default void textureBarrier() { + throw new ContextException(); } - public static void textureBuffer(int texture, int internalFormat, int buffer) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTextureBuffer).invokeExact(texture, internalFormat, buffer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTextureBuffer") + default void textureBuffer(int texture, int internalFormat, int buffer) { + throw new ContextException(); } - public static void textureBufferRange(int texture, int internalFormat, int buffer, long offset, long size) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTextureBufferRange).invokeExact(texture, internalFormat, buffer, offset, size); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTextureBufferRange") + default void textureBufferRange(int texture, int internalFormat, int buffer, long offset, long size) { + throw new ContextException(); } - public static void textureParameterIiv(int texture, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTextureParameterIiv).invokeExact(texture, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTextureParameterIiv") + default void textureParameterIiv(int texture, int pname, MemorySegment params) { + throw new ContextException(); } - public static void textureParameterIiv(SegmentAllocator allocator, int texture, int pname, int[] params) { - textureParameterIiv(texture, pname, allocator.allocateFrom(JAVA_INT, params)); + @Entrypoint("glTextureParameterIiv") + default void textureParameterIiv(SegmentAllocator allocator, int texture, int pname, int[] params) { + throw new ContextException(); } - public static void textureParameterIuiv(int texture, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTextureParameterIuiv).invokeExact(texture, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTextureParameterIuiv") + default void textureParameterIuiv(int texture, int pname, MemorySegment params) { + throw new ContextException(); } - public static void textureParameterIuiv(SegmentAllocator allocator, int texture, int pname, int[] params) { - textureParameterIuiv(texture, pname, allocator.allocateFrom(JAVA_INT, params)); + @Entrypoint("glTextureParameterIuiv") + default void textureParameterIuiv(SegmentAllocator allocator, int texture, int pname, int[] params) { + throw new ContextException(); } - public static void textureParameterf(int texture, int pname, float param) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTextureParameterf).invokeExact(texture, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTextureParameterf") + default void textureParameterf(int texture, int pname, float param) { + throw new ContextException(); } - public static void textureParameterfv(int texture, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTextureParameterfv).invokeExact(texture, pname, params); - } catch (Throwable e) { - throw new RuntimeException(e); - } + @Entrypoint("glTextureParameterfv") + default void textureParameterfv(int texture, int pname, MemorySegment params) { + throw new ContextException(); } - public static void textureParameterfv(SegmentAllocator allocator, int texture, int pname, float[] params) { - textureParameterfv(texture, pname, allocator.allocateFrom(JAVA_FLOAT, params)); + @Entrypoint("glTextureParameterfv") + default void textureParameterfv(SegmentAllocator allocator, int texture, int pname, float[] params) { + throw new ContextException(); } - public static void textureParameteri(int texture, int pname, int param) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTextureParameteri).invokeExact(texture, pname, param); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTextureParameteri") + default void textureParameteri(int texture, int pname, int param) { + throw new ContextException(); } - public static void textureParameteriv(int texture, int pname, MemorySegment params) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTextureParameteriv).invokeExact(texture, pname, params); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTextureParameteriv") + default void textureParameteriv(int texture, int pname, MemorySegment params) { + throw new ContextException(); } - public static void textureParameteriv(SegmentAllocator allocator, int texture, int pname, int[] params) { - textureParameteriv(texture, pname, allocator.allocateFrom(JAVA_INT, params)); + @Entrypoint("glTextureParameteriv") + default void textureParameteriv(SegmentAllocator allocator, int texture, int pname, int[] params) { + throw new ContextException(); } - public static void textureStorage1D(int texture, int levels, int internalFormat, int width) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTextureStorage1D).invokeExact(texture, levels, internalFormat, width); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTextureStorage1D") + default void textureStorage1D(int texture, int levels, int internalFormat, int width) { + throw new ContextException(); } - public static void textureStorage2D(int texture, int levels, int internalFormat, int width, int height) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTextureStorage2D).invokeExact(texture, levels, internalFormat, width, height); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTextureStorage2D") + default void textureStorage2D(int texture, int levels, int internalFormat, int width, int height) { + throw new ContextException(); } - public static void textureStorage2DMultisample(int texture, int samples, int internalFormat, int width, int height, boolean fixedSampleLocations) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTextureStorage2DMultisample).invokeExact(texture, samples, internalFormat, width, height, fixedSampleLocations); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTextureStorage2DMultisample") + default void textureStorage2DMultisample(int texture, int samples, int internalFormat, int width, int height, boolean fixedSampleLocations) { + throw new ContextException(); } - public static void textureStorage3D(int texture, int levels, int internalFormat, int width, int height, int depth) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTextureStorage3D).invokeExact(texture, levels, internalFormat, width, height, depth); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTextureStorage3D") + default void textureStorage3D(int texture, int levels, int internalFormat, int width, int height, int depth) { + throw new ContextException(); } - public static void textureStorage3DMultisample(int texture, int samples, int internalFormat, int width, int height, int depth, boolean fixedSampleLocations) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTextureStorage3DMultisample).invokeExact(texture, samples, internalFormat, width, height, depth, fixedSampleLocations); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTextureStorage3DMultisample") + default void textureStorage3DMultisample(int texture, int samples, int internalFormat, int width, int height, int depth, boolean fixedSampleLocations) { + throw new ContextException(); } - public static void textureSubImage1D(int texture, int level, int xoffset, int width, int format, int type, MemorySegment pixels) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTextureSubImage1D).invokeExact(texture, level, xoffset, width, format, type, pixels); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTextureSubImage1D") + default void textureSubImage1D(int texture, int level, int xoffset, int width, int format, int type, MemorySegment pixels) { + throw new ContextException(); } - public static void textureSubImage1D(SegmentAllocator allocator, int texture, int level, int xoffset, int width, int format, int type, byte[] pixels) { - textureSubImage1D(texture, level, xoffset, width, format, type, allocator.allocateFrom(JAVA_BYTE, pixels)); + @Entrypoint("glTextureSubImage1D") + default void textureSubImage1D(SegmentAllocator allocator, int texture, int level, int xoffset, int width, int format, int type, byte[] pixels) { + throw new ContextException(); } - public static void textureSubImage1D(SegmentAllocator allocator, int texture, int level, int xoffset, int width, int format, int type, short[] pixels) { - textureSubImage1D(texture, level, xoffset, width, format, type, allocator.allocateFrom(JAVA_SHORT, pixels)); + @Entrypoint("glTextureSubImage1D") + default void textureSubImage1D(SegmentAllocator allocator, int texture, int level, int xoffset, int width, int format, int type, short[] pixels) { + throw new ContextException(); } - public static void textureSubImage1D(SegmentAllocator allocator, int texture, int level, int xoffset, int width, int format, int type, int[] pixels) { - textureSubImage1D(texture, level, xoffset, width, format, type, allocator.allocateFrom(JAVA_INT, pixels)); + @Entrypoint("glTextureSubImage1D") + default void textureSubImage1D(SegmentAllocator allocator, int texture, int level, int xoffset, int width, int format, int type, int[] pixels) { + throw new ContextException(); } - public static void textureSubImage1D(SegmentAllocator allocator, int texture, int level, int xoffset, int width, int format, int type, float[] pixels) { - textureSubImage1D(texture, level, xoffset, width, format, type, allocator.allocateFrom(JAVA_FLOAT, pixels)); + @Entrypoint("glTextureSubImage1D") + default void textureSubImage1D(SegmentAllocator allocator, int texture, int level, int xoffset, int width, int format, int type, float[] pixels) { + throw new ContextException(); } - public static void textureSubImage2D(int texture, int level, int xoffset, int yoffset, int width, int height, int format, int type, MemorySegment pixels) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTextureSubImage2D).invokeExact(texture, level, xoffset, yoffset, width, height, format, type, pixels); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTextureSubImage2D") + default void textureSubImage2D(int texture, int level, int xoffset, int yoffset, int width, int height, int format, int type, MemorySegment pixels) { + throw new ContextException(); } - public static void textureSubImage2D(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int width, int height, int format, int type, byte[] pixels) { - textureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, allocator.allocateFrom(JAVA_BYTE, pixels)); + @Entrypoint("glTextureSubImage2D") + default void textureSubImage2D(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int width, int height, int format, int type, byte[] pixels) { + throw new ContextException(); } - public static void textureSubImage2D(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int width, int height, int format, int type, short[] pixels) { - textureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, allocator.allocateFrom(JAVA_SHORT, pixels)); + @Entrypoint("glTextureSubImage2D") + default void textureSubImage2D(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int width, int height, int format, int type, short[] pixels) { + throw new ContextException(); } - public static void textureSubImage2D(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int width, int height, int format, int type, int[] pixels) { - textureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, allocator.allocateFrom(JAVA_INT, pixels)); + @Entrypoint("glTextureSubImage2D") + default void textureSubImage2D(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int width, int height, int format, int type, int[] pixels) { + throw new ContextException(); } - public static void textureSubImage2D(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int width, int height, int format, int type, float[] pixels) { - textureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, allocator.allocateFrom(JAVA_FLOAT, pixels)); + @Entrypoint("glTextureSubImage2D") + default void textureSubImage2D(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int width, int height, int format, int type, float[] pixels) { + throw new ContextException(); } - public static void textureSubImage3D(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, MemorySegment pixels) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTextureSubImage3D).invokeExact(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTextureSubImage3D") + default void textureSubImage3D(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, MemorySegment pixels) { + throw new ContextException(); } - public static void textureSubImage3D(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, byte[] pixels) { - textureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, allocator.allocateFrom(JAVA_BYTE, pixels)); + @Entrypoint("glTextureSubImage3D") + default void textureSubImage3D(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, byte[] pixels) { + throw new ContextException(); } - public static void textureSubImage3D(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, short[] pixels) { - textureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, allocator.allocateFrom(JAVA_SHORT, pixels)); + @Entrypoint("glTextureSubImage3D") + default void textureSubImage3D(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, short[] pixels) { + throw new ContextException(); } - public static void textureSubImage3D(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, int[] pixels) { - textureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, allocator.allocateFrom(JAVA_INT, pixels)); + @Entrypoint("glTextureSubImage3D") + default void textureSubImage3D(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, int[] pixels) { + throw new ContextException(); } - public static void textureSubImage3D(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, float[] pixels) { - textureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, allocator.allocateFrom(JAVA_FLOAT, pixels)); + @Entrypoint("glTextureSubImage3D") + default void textureSubImage3D(SegmentAllocator allocator, int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, float[] pixels) { + throw new ContextException(); } - public static void transformFeedbackBufferBase(int xfb, int index, int buffer) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTransformFeedbackBufferBase).invokeExact(xfb, index, buffer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTransformFeedbackBufferBase") + default void transformFeedbackBufferBase(int xfb, int index, int buffer) { + throw new ContextException(); } - public static void transformFeedbackBufferRange(int xfb, int index, int buffer, long offset, long size) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glTransformFeedbackBufferRange).invokeExact(xfb, index, buffer, offset, size); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glTransformFeedbackBufferRange") + default void transformFeedbackBufferRange(int xfb, int index, int buffer, long offset, long size) { + throw new ContextException(); } - public static boolean unmapNamedBuffer(int buffer) { - var caps = GLLoader.getCapabilities(); - try { - return (boolean) GLLoader.check(caps.glUnmapNamedBuffer).invokeExact(buffer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glUnmapNamedBuffer") + default boolean unmapNamedBuffer(int buffer) { + throw new ContextException(); } - public static void vertexArrayAttribBinding(int vaobj, int attribIndex, int bindingIndex) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glVertexArrayAttribBinding).invokeExact(vaobj, attribIndex, bindingIndex); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexArrayAttribBinding") + default void vertexArrayAttribBinding(int vaobj, int attribIndex, int bindingIndex) { + throw new ContextException(); } - public static void vertexArrayAttribFormat(int vaobj, int attribIndex, int size, int type, boolean normalized, int relativeOffset) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glVertexArrayAttribFormat).invokeExact(vaobj, attribIndex, size, type, normalized, relativeOffset); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexArrayAttribFormat") + default void vertexArrayAttribFormat(int vaobj, int attribIndex, int size, int type, boolean normalized, int relativeOffset) { + throw new ContextException(); } - public static void vertexArrayAttribIFormat(int vaobj, int attribIndex, int size, int type, int relativeOffset) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glVertexArrayAttribIFormat).invokeExact(vaobj, attribIndex, size, type, relativeOffset); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexArrayAttribIFormat") + default void vertexArrayAttribIFormat(int vaobj, int attribIndex, int size, int type, int relativeOffset) { + throw new ContextException(); } - public static void vertexArrayAttribLFormat(int vaobj, int attribIndex, int size, int type, int relativeOffset) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glVertexArrayAttribLFormat).invokeExact(vaobj, attribIndex, size, type, relativeOffset); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexArrayAttribLFormat") + default void vertexArrayAttribLFormat(int vaobj, int attribIndex, int size, int type, int relativeOffset) { + throw new ContextException(); } - public static void vertexArrayBindingDivisor(int vaobj, int bindingIndex, int divisor) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glVertexArrayBindingDivisor).invokeExact(vaobj, bindingIndex, divisor); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexArrayBindingDivisor") + default void vertexArrayBindingDivisor(int vaobj, int bindingIndex, int divisor) { + throw new ContextException(); } - public static void vertexArrayElementBuffer(int vaobj, int buffer) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glVertexArrayElementBuffer).invokeExact(vaobj, buffer); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexArrayElementBuffer") + default void vertexArrayElementBuffer(int vaobj, int buffer) { + throw new ContextException(); } - public static void vertexArrayVertexBuffer(int vaobj, int bindingIndex, int buffer, long offset, int stride) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glVertexArrayVertexBuffer).invokeExact(vaobj, bindingIndex, buffer, offset, stride); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexArrayVertexBuffer") + default void vertexArrayVertexBuffer(int vaobj, int bindingIndex, int buffer, long offset, int stride) { + throw new ContextException(); } - public static void vertexArrayVertexBuffers(int vaobj, int first, int count, MemorySegment buffers, MemorySegment offsets, MemorySegment strides) { - var caps = GLLoader.getCapabilities(); - try { - GLLoader.check(caps.glVertexArrayVertexBuffers).invokeExact(vaobj, first, count, buffers, offsets, strides); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glVertexArrayVertexBuffers") + default void vertexArrayVertexBuffers(int vaobj, int first, int count, MemorySegment buffers, MemorySegment offsets, MemorySegment strides) { + throw new ContextException(); } - public static void vertexArrayVertexBuffers(SegmentAllocator allocator, int vaobj, int first, int count, int[] buffers, long[] offsets, int[] strides) { - vertexArrayVertexBuffers(vaobj, first, count, allocator.allocateFrom(JAVA_INT, buffers), allocator.allocateFrom(JAVA_LONG, offsets), allocator.allocateFrom(JAVA_INT, strides)); + @Entrypoint("glVertexArrayVertexBuffers") + default void vertexArrayVertexBuffers(SegmentAllocator allocator, int vaobj, int first, int count, int[] buffers, long[] offsets, int[] strides) { + throw new ContextException(); } } 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 ebf81994..bfcc5fb0 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL46C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL46C.java @@ -17,18 +17,17 @@ package overrungl.opengl; import org.jetbrains.annotations.Nullable; +import overrun.marshal.Marshal; +import overrun.marshal.MemoryStack; +import overrun.marshal.gen.Entrypoint; +import overrun.marshal.gen.Skip; import overrungl.opengl.ext.arb.GLARBGLSpirv; import overrungl.opengl.ext.arb.GLARBIndirectParameters; import overrungl.opengl.ext.arb.GLARBPipelineStatisticsQuery; import overrungl.opengl.ext.arb.GLARBTransformFeedbackOverflowQuery; -import overrungl.util.MemoryStack; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; -import java.lang.foreign.ValueLayout; - -import static overrungl.FunctionDescriptors.*; -import static overrungl.opengl.GLLoader.*; /** * The OpenGL 4.6 core profile functions. @@ -45,96 +44,63 @@ * @author squid233 * @since 0.1.0 */ -public sealed class GL46C extends GL45C permits GL { - public static final int SHADER_BINARY_FORMAT_SPIR_V = 0x9551; - public static final int SPIR_V_BINARY = 0x9552; - public static final int PARAMETER_BUFFER = 0x80EE; - public static final int PARAMETER_BUFFER_BINDING = 0x80EF; - public static final int CONTEXT_FLAG_NO_ERROR_BIT = 0x00000008; - public static final int VERTICES_SUBMITTED = 0x82EE; - public static final int PRIMITIVES_SUBMITTED = 0x82EF; - public static final int VERTEX_SHADER_INVOCATIONS = 0x82F0; - public static final int TESS_CONTROL_SHADER_PATCHES = 0x82F1; - public static final int TESS_EVALUATION_SHADER_INVOCATIONS = 0x82F2; - public static final int GEOMETRY_SHADER_PRIMITIVES_EMITTED = 0x82F3; - public static final int FRAGMENT_SHADER_INVOCATIONS = 0x82F4; - public static final int COMPUTE_SHADER_INVOCATIONS = 0x82F5; - public static final int CLIPPING_INPUT_PRIMITIVES = 0x82F6; - public static final int CLIPPING_OUTPUT_PRIMITIVES = 0x82F7; - public static final int POLYGON_OFFSET_CLAMP = 0x8E1B; - public static final int SPIR_V_EXTENSIONS = 0x9553; - public static final int NUM_SPIR_V_EXTENSIONS = 0x9554; - public static final int TEXTURE_MAX_ANISOTROPY = 0x84FE; - public static final int MAX_TEXTURE_MAX_ANISOTROPY = 0x84FF; - public static final int TRANSFORM_FEEDBACK_OVERFLOW = 0x82EC; - public static final int TRANSFORM_FEEDBACK_STREAM_OVERFLOW = 0x82ED; +public sealed interface GL46C extends GL45C permits GL { + int SHADER_BINARY_FORMAT_SPIR_V = 0x9551; + int SPIR_V_BINARY = 0x9552; + int PARAMETER_BUFFER = 0x80EE; + int PARAMETER_BUFFER_BINDING = 0x80EF; + int CONTEXT_FLAG_NO_ERROR_BIT = 0x00000008; + int VERTICES_SUBMITTED = 0x82EE; + int PRIMITIVES_SUBMITTED = 0x82EF; + int VERTEX_SHADER_INVOCATIONS = 0x82F0; + int TESS_CONTROL_SHADER_PATCHES = 0x82F1; + int TESS_EVALUATION_SHADER_INVOCATIONS = 0x82F2; + int GEOMETRY_SHADER_PRIMITIVES_EMITTED = 0x82F3; + int FRAGMENT_SHADER_INVOCATIONS = 0x82F4; + int COMPUTE_SHADER_INVOCATIONS = 0x82F5; + int CLIPPING_INPUT_PRIMITIVES = 0x82F6; + int CLIPPING_OUTPUT_PRIMITIVES = 0x82F7; + int POLYGON_OFFSET_CLAMP = 0x8E1B; + int SPIR_V_EXTENSIONS = 0x9553; + int NUM_SPIR_V_EXTENSIONS = 0x9554; + int TEXTURE_MAX_ANISOTROPY = 0x84FE; + int MAX_TEXTURE_MAX_ANISOTROPY = 0x84FF; + int TRANSFORM_FEEDBACK_OVERFLOW = 0x82EC; + int TRANSFORM_FEEDBACK_STREAM_OVERFLOW = 0x82ED; - static boolean isSupported(GLCapabilities caps) { - return checkAll(caps.glMultiDrawArraysIndirectCount, caps.glMultiDrawElementsIndirectCount, caps.glPolygonOffsetClamp, caps.glSpecializeShader); + @Entrypoint("glMultiDrawArraysIndirectCount") + default void multiDrawArraysIndirectCount(int mode, MemorySegment indirect, long drawCount, int maxDrawCount, int stride) { + throw new ContextException(); } - static void load(GLCapabilities caps, GLLoadFunc load) { - caps.glMultiDrawArraysIndirectCount = load.invoke("glMultiDrawArraysIndirectCount", IPJIIV); - caps.glMultiDrawElementsIndirectCount = load.invoke("glMultiDrawElementsIndirectCount", IIPJIIV); - caps.glPolygonOffsetClamp = load.invoke("glPolygonOffsetClamp", FFFV); - caps.glSpecializeShader = load.invoke("glSpecializeShader", IPIPPV); + @Entrypoint("glMultiDrawElementsIndirectCount") + default void multiDrawElementsIndirectCount(int mode, int type, MemorySegment indirect, long drawCount, int maxDrawCount, int stride) { + throw new ContextException(); } - public static void multiDrawArraysIndirectCount(int mode, MemorySegment indirect, long drawCount, int maxDrawCount, int stride) { - var caps = getCapabilities(); - try { - check(caps.glMultiDrawArraysIndirectCount).invokeExact(mode, indirect, drawCount, maxDrawCount, stride); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void multiDrawElementsIndirectCount(int mode, int type, MemorySegment indirect, long drawCount, int maxDrawCount, int stride) { - var caps = getCapabilities(); - try { - check(caps.glMultiDrawElementsIndirectCount).invokeExact(mode, type, indirect, drawCount, maxDrawCount, stride); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glPolygonOffsetClamp") + default void polygonOffsetClamp(float factor, float units, float clamp) { + throw new ContextException(); } - public static void polygonOffsetClamp(float factor, float units, float clamp) { - var caps = getCapabilities(); - try { - check(caps.glPolygonOffsetClamp).invokeExact(factor, units, clamp); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - - public static void specializeShader(int shader, MemorySegment pEntryPoint, int numSpecializationConstants, MemorySegment pConstantIndex, MemorySegment pConstantValue) { - var caps = getCapabilities(); - try { - check(caps.glSpecializeShader).invokeExact(shader, pEntryPoint, numSpecializationConstants, pConstantIndex, pConstantValue); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } + @Entrypoint("glSpecializeShader") + default void specializeShader(int shader, MemorySegment pEntryPoint, int numSpecializationConstants, MemorySegment pConstantIndex, MemorySegment pConstantValue) { + throw new ContextException(); } - public static void specializeShader(SegmentAllocator allocator, int shader, @Nullable String pEntryPoint, int @Nullable [] pConstantIndex, int @Nullable [] pConstantValue) { - specializeShader(shader, - pEntryPoint != null ? allocator.allocateFrom(pEntryPoint) : MemorySegment.NULL, - pConstantIndex != null ? pConstantIndex.length : (pConstantValue != null ? pConstantValue.length : 0), - pConstantIndex != null ? allocator.allocateFrom(ValueLayout.JAVA_INT, pConstantIndex) : MemorySegment.NULL, - pConstantValue != null ? allocator.allocateFrom(ValueLayout.JAVA_INT, pConstantValue) : MemorySegment.NULL); + @Entrypoint("glSpecializeShader") + default void specializeShader(SegmentAllocator allocator, int shader, @Nullable String pEntryPoint, int numSpecializationConstants, int @Nullable [] pConstantIndex, int @Nullable [] pConstantValue) { + throw new ContextException(); } - public static void specializeShader(int shader, @Nullable String pEntryPoint) { - final MemoryStack stack = MemoryStack.stackGet(); - final long stackPointer = stack.getPointer(); - try { + @Skip + default void specializeShader(int shader, @Nullable String pEntryPoint) { + try (MemoryStack stack = MemoryStack.stackPush()) { specializeShader(shader, - pEntryPoint != null ? stack.allocateFrom(pEntryPoint) : MemorySegment.NULL, + Marshal.marshal(stack, pEntryPoint), 0, MemorySegment.NULL, MemorySegment.NULL); - } finally { - stack.setPointer(stackPointer); } } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLCapabilities.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLCapabilities.java deleted file mode 100644 index 95ad7588..00000000 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLCapabilities.java +++ /dev/null @@ -1,445 +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.opengl; - -import overrungl.Configurations; -import overrungl.FunctionDescriptors; - -import java.lang.foreign.Arena; -import java.lang.invoke.MethodHandle; -import java.util.function.Predicate; -import java.util.regex.Pattern; - -/** - * The OpenGL capabilities. - * - * @author squid233 - * @since 0.1.0 - */ -public class GLCapabilities { - private static final Pattern VERSION_PATTERN = Pattern.compile("^(\\d+)\\.(\\d+).*$"); - - /** - * OpenGL 1.0 method handles - */ - public MethodHandle glBlendFunc, glClear, glClearColor, glClearDepth, glClearStencil, glColorMask, glCullFace, glDepthFunc, - glDepthMask, glDepthRange, glDisable, glDrawBuffer, glEnable, glFinish, glFlush, glFrontFace, glGetBooleanv, - glGetDoublev, glGetError, glGetFloatv, glGetIntegerv, glGetString, glGetTexImage, glGetTexLevelParameterfv, - glGetTexLevelParameteriv, glGetTexParameterfv, glGetTexParameteriv, glHint, glIsEnabled, glLineWidth, glLogicOp, - glPixelStoref, glPixelStorei, glPointSize, glPolygonMode, glReadBuffer, glReadPixels, glScissor, glStencilFunc, - glStencilMask, glStencilOp, glTexImage1D, glTexImage2D, glTexParameterf, glTexParameterfv, glTexParameteri, - glTexParameteriv, glViewport; - /** - * OpenGL 1.0 compatibility method handles - */ - public MethodHandle glAccum, glAlphaFunc, glBegin, glBitmap, glCallList, glCallLists, glClearAccum, glClearIndex, - glClipPlane, glColor3b, glColor3bv, glColor3d, glColor3dv, glColor3f, glColor3fv, glColor3i, glColor3iv, glColor3s, - glColor3sv, glColor3ub, glColor3ubv, glColor3ui, glColor3uiv, glColor3us, glColor3usv, glColor4b, glColor4bv, - glColor4d, glColor4dv, glColor4f, glColor4fv, glColor4i, glColor4iv, glColor4s, glColor4sv, glColor4ub, glColor4ubv, - glColor4ui, glColor4uiv, glColor4us, glColor4usv, glColorMaterial, glCopyPixels, glDeleteLists, glDrawPixels, - glEdgeFlag, glEdgeFlagv, glEnd, glEndList, glEvalCoord1d, glEvalCoord1dv, glEvalCoord1f, glEvalCoord1fv, - glEvalCoord2d, glEvalCoord2dv, glEvalCoord2f, glEvalCoord2fv, glEvalMesh1, glEvalMesh2, glEvalPoint1, glEvalPoint2, - glFeedbackBuffer, glFogf, glFogfv, glFogi, glFogiv, glFrustum, glGenLists, glGetClipPlane, glGetLightfv, glGetLightiv, - glGetMapdv, glGetMapfv, glGetMapiv, glGetMaterialfv, glGetMaterialiv, glGetPixelMapfv, glGetPixelMapuiv, - glGetPixelMapusv, glGetPolygonStipple, glGetTexEnvfv, glGetTexEnviv, glGetTexGendv, glGetTexGenfv, glGetTexGeniv, - glIndexMask, glIndexd, glIndexdv, glIndexf, glIndexfv, glIndexi, glIndexiv, glIndexs, glIndexsv, glInitNames, - glIsList, glLightModelf, glLightModelfv, glLightModeli, glLightModeliv, glLightf, glLightfv, glLighti, glLightiv, - glLineStipple, glListBase, glLoadIdentity, glLoadMatrixd, glLoadMatrixf, glLoadName, glMap1d, glMap1f, glMap2d, - glMap2f, glMapGrid1d, glMapGrid1f, glMapGrid2d, glMapGrid2f, glMaterialf, glMaterialfv, glMateriali, glMaterialiv, - glMatrixMode, glMultMatrixd, glMultMatrixf, glNewList, glNormal3b, glNormal3bv, glNormal3d, glNormal3dv, glNormal3f, - glNormal3fv, glNormal3i, glNormal3iv, glNormal3s, glNormal3sv, glOrtho, glPassThrough, glPixelMapfv, glPixelMapuiv, - glPixelMapusv, glPixelTransferf, glPixelTransferi, glPixelZoom, glPolygonStipple, glPopAttrib, glPopMatrix, glPopName, - glPushAttrib, glPushMatrix, glPushName, glRasterPos2d, glRasterPos2dv, glRasterPos2f, glRasterPos2fv, glRasterPos2i, - glRasterPos2iv, glRasterPos2s, glRasterPos2sv, glRasterPos3d, glRasterPos3dv, glRasterPos3f, glRasterPos3fv, - glRasterPos3i, glRasterPos3iv, glRasterPos3s, glRasterPos3sv, glRasterPos4d, glRasterPos4dv, glRasterPos4f, - glRasterPos4fv, glRasterPos4i, glRasterPos4iv, glRasterPos4s, glRasterPos4sv, glRectd, glRectdv, glRectf, glRectfv, - glRecti, glRectiv, glRects, glRectsv, glRenderMode, glRotated, glRotatef, glScaled, glScalef, glSelectBuffer, - glShadeModel, glTexCoord1d, glTexCoord1dv, glTexCoord1f, glTexCoord1fv, glTexCoord1i, glTexCoord1iv, glTexCoord1s, - glTexCoord1sv, glTexCoord2d, glTexCoord2dv, glTexCoord2f, glTexCoord2fv, glTexCoord2i, glTexCoord2iv, glTexCoord2s, - glTexCoord2sv, glTexCoord3d, glTexCoord3dv, glTexCoord3f, glTexCoord3fv, glTexCoord3i, glTexCoord3iv, glTexCoord3s, - glTexCoord3sv, glTexCoord4d, glTexCoord4dv, glTexCoord4f, glTexCoord4fv, glTexCoord4i, glTexCoord4iv, glTexCoord4s, - glTexCoord4sv, glTexEnvf, glTexEnvfv, glTexEnvi, glTexEnviv, glTexGend, glTexGendv, glTexGenf, glTexGenfv, glTexGeni, - glTexGeniv, glTranslated, glTranslatef, glVertex2d, glVertex2dv, glVertex2f, glVertex2fv, glVertex2i, glVertex2iv, - glVertex2s, glVertex2sv, glVertex3d, glVertex3dv, glVertex3f, glVertex3fv, glVertex3i, glVertex3iv, glVertex3s, - glVertex3sv, glVertex4d, glVertex4dv, glVertex4f, glVertex4fv, glVertex4i, glVertex4iv, glVertex4s, glVertex4sv; - /** - * OpenGL 1.1 method handles - */ - public MethodHandle glBindTexture, glCopyTexImage1D, glCopyTexImage2D, glCopyTexSubImage1D, glCopyTexSubImage2D, glDeleteTextures, - glDrawArrays, glDrawElements, glGenTextures, glGetPointerv, glIsTexture, glPolygonOffset, glTexSubImage1D, glTexSubImage2D; - /** - * OpenGL 1.1 compatibility method handles - */ - public MethodHandle glAreTexturesResident, glArrayElement, glColorPointer, glDisableClientState, glEdgeFlagPointer, glEnableClientState, - glIndexPointer, glIndexub, glIndexubv, glInterleavedArrays, glNormalPointer, glPopClientAttrib, glPrioritizeTextures, - glPushClientAttrib, glTexCoordPointer, glVertexPointer; - /** - * OpenGL 1.2 method handles - */ - public MethodHandle glCopyTexSubImage3D, glDrawRangeElements, glTexImage3D, glTexSubImage3D; - /** - * OpenGL 1.3 method handles - */ - public MethodHandle glActiveTexture, glCompressedTexImage1D, glCompressedTexImage2D, glCompressedTexImage3D, glCompressedTexSubImage1D, - glCompressedTexSubImage2D, glCompressedTexSubImage3D, glGetCompressedTexImage, glSampleCoverage; - /** - * OpenGL 1.3 compatibility method handles - */ - public MethodHandle glClientActiveTexture, glLoadTransposeMatrixd, glLoadTransposeMatrixf, glMultTransposeMatrixd, glMultTransposeMatrixf, - glMultiTexCoord1d, glMultiTexCoord1dv, glMultiTexCoord1f, glMultiTexCoord1fv, glMultiTexCoord1i, glMultiTexCoord1iv, - glMultiTexCoord1s, glMultiTexCoord1sv, glMultiTexCoord2d, glMultiTexCoord2dv, glMultiTexCoord2f, glMultiTexCoord2fv, - glMultiTexCoord2i, glMultiTexCoord2iv, glMultiTexCoord2s, glMultiTexCoord2sv, glMultiTexCoord3d, glMultiTexCoord3dv, - glMultiTexCoord3f, glMultiTexCoord3fv, glMultiTexCoord3i, glMultiTexCoord3iv, glMultiTexCoord3s, glMultiTexCoord3sv, - glMultiTexCoord4d, glMultiTexCoord4dv, glMultiTexCoord4f, glMultiTexCoord4fv, glMultiTexCoord4i, glMultiTexCoord4iv, - glMultiTexCoord4s, glMultiTexCoord4sv; - /** - * OpenGL 1.4 method handles - */ - public MethodHandle glBlendColor, glBlendEquation, glBlendFuncSeparate, glMultiDrawArrays, glMultiDrawElements, glPointParameterf, - glPointParameterfv, glPointParameteri, glPointParameteriv; - /** - * OpenGL 1.4 compatibility method handles - */ - public MethodHandle glFogCoordPointer, glFogCoordd, glFogCoorddv, glFogCoordf, glFogCoordfv, glSecondaryColor3b, - glSecondaryColor3bv, glSecondaryColor3d, glSecondaryColor3dv, glSecondaryColor3f, glSecondaryColor3fv, glSecondaryColor3i, - glSecondaryColor3iv, glSecondaryColor3s, glSecondaryColor3sv, glSecondaryColor3ub, glSecondaryColor3ubv, glSecondaryColor3ui, - glSecondaryColor3uiv, glSecondaryColor3us, glSecondaryColor3usv, glSecondaryColorPointer, glWindowPos2d, glWindowPos2dv, - glWindowPos2f, glWindowPos2fv, glWindowPos2i, glWindowPos2iv, glWindowPos2s, glWindowPos2sv, glWindowPos3d, - glWindowPos3dv, glWindowPos3f, glWindowPos3fv, glWindowPos3i, glWindowPos3iv, glWindowPos3s, glWindowPos3sv; - /** - * OpenGL 1.5 method handles - */ - public MethodHandle glBeginQuery, glBindBuffer, glBufferData, glBufferSubData, glDeleteBuffers, glDeleteQueries, glEndQuery, - glGenBuffers, glGenQueries, glGetBufferParameteriv, glGetBufferPointerv, glGetBufferSubData, glGetQueryObjectiv, - glGetQueryObjectuiv, glGetQueryiv, glIsBuffer, glIsQuery, glMapBuffer, glUnmapBuffer; - /** - * OpenGL 2.0 method handles - */ - public MethodHandle glAttachShader, glBindAttribLocation, glBlendEquationSeparate, glCompileShader, glCreateProgram, glCreateShader, - glDeleteProgram, glDeleteShader, glDetachShader, glDisableVertexAttribArray, glDrawBuffers, glEnableVertexAttribArray, - glGetActiveAttrib, glGetActiveUniform, glGetAttachedShaders, glGetAttribLocation, glGetProgramInfoLog, glGetProgramiv, - glGetShaderInfoLog, glGetShaderSource, glGetShaderiv, glGetUniformLocation, glGetUniformfv, glGetUniformiv, - glGetVertexAttribPointerv, glGetVertexAttribdv, glGetVertexAttribfv, glGetVertexAttribiv, glIsProgram, glIsShader, - glLinkProgram, glShaderSource, glStencilFuncSeparate, glStencilMaskSeparate, glStencilOpSeparate, glUniform1f, - glUniform1fv, glUniform1i, glUniform1iv, glUniform2f, glUniform2fv, glUniform2i, glUniform2iv, glUniform3f, - glUniform3fv, glUniform3i, glUniform3iv, glUniform4f, glUniform4fv, glUniform4i, glUniform4iv, glUniformMatrix2fv, - glUniformMatrix3fv, glUniformMatrix4fv, glUseProgram, glValidateProgram, glVertexAttrib1d, glVertexAttrib1dv, - glVertexAttrib1f, glVertexAttrib1fv, glVertexAttrib1s, glVertexAttrib1sv, glVertexAttrib2d, glVertexAttrib2dv, - glVertexAttrib2f, glVertexAttrib2fv, glVertexAttrib2s, glVertexAttrib2sv, glVertexAttrib3d, glVertexAttrib3dv, - glVertexAttrib3f, glVertexAttrib3fv, glVertexAttrib3s, glVertexAttrib3sv, glVertexAttrib4Nbv, glVertexAttrib4Niv, - glVertexAttrib4Nsv, glVertexAttrib4Nub, glVertexAttrib4Nubv, glVertexAttrib4Nuiv, glVertexAttrib4Nusv, glVertexAttrib4bv, - glVertexAttrib4d, glVertexAttrib4dv, glVertexAttrib4f, glVertexAttrib4fv, glVertexAttrib4iv, glVertexAttrib4s, - glVertexAttrib4sv, glVertexAttrib4ubv, glVertexAttrib4uiv, glVertexAttrib4usv, glVertexAttribPointer; - /** - * OpenGL 2.1 method handles - */ - public MethodHandle glUniformMatrix2x3fv, glUniformMatrix2x4fv, glUniformMatrix3x2fv, glUniformMatrix3x4fv, glUniformMatrix4x2fv, glUniformMatrix4x3fv; - /** - * OpenGL 3.0 method handles - */ - public MethodHandle glBeginConditionalRender, glBeginTransformFeedback, glBindBufferBase, glBindBufferRange, glBindFragDataLocation, glBindFramebuffer, - glBindRenderbuffer, glBindVertexArray, glBlitFramebuffer, glCheckFramebufferStatus, glClampColor, glClearBufferfi, - glClearBufferfv, glClearBufferiv, glClearBufferuiv, glColorMaski, glDeleteFramebuffers, glDeleteRenderbuffers, - glDeleteVertexArrays, glDisablei, glEnablei, glEndConditionalRender, glEndTransformFeedback, glFlushMappedBufferRange, - glFramebufferRenderbuffer, glFramebufferTexture1D, glFramebufferTexture2D, glFramebufferTexture3D, glFramebufferTextureLayer, glGenFramebuffers, - glGenRenderbuffers, glGenVertexArrays, glGenerateMipmap, glGetBooleani_v, glGetFragDataLocation, glGetFramebufferAttachmentParameteriv, - glGetIntegeri_v, glGetRenderbufferParameteriv, glGetStringi, glGetTexParameterIiv, glGetTexParameterIuiv, glGetTransformFeedbackVarying, - glGetUniformuiv, glGetVertexAttribIiv, glGetVertexAttribIuiv, glIsEnabledi, glIsFramebuffer, glIsRenderbuffer, - glIsVertexArray, glMapBufferRange, glRenderbufferStorage, glRenderbufferStorageMultisample, glTexParameterIiv, glTexParameterIuiv, - glTransformFeedbackVaryings, glUniform1ui, glUniform1uiv, glUniform2ui, glUniform2uiv, glUniform3ui, glUniform3uiv, - glUniform4ui, glUniform4uiv, glVertexAttribI1i, glVertexAttribI1iv, glVertexAttribI1ui, glVertexAttribI1uiv, - glVertexAttribI2i, glVertexAttribI2iv, glVertexAttribI2ui, glVertexAttribI2uiv, glVertexAttribI3i, glVertexAttribI3iv, - glVertexAttribI3ui, glVertexAttribI3uiv, glVertexAttribI4bv, glVertexAttribI4i, glVertexAttribI4iv, glVertexAttribI4sv, - glVertexAttribI4ubv, glVertexAttribI4ui, glVertexAttribI4uiv, glVertexAttribI4usv, glVertexAttribIPointer; - /** - * OpenGL 3.1 method handles - */ - public MethodHandle glCopyBufferSubData, glDrawArraysInstanced, glDrawElementsInstanced, glGetActiveUniformBlockName, glGetActiveUniformBlockiv, - glGetActiveUniformName, glGetActiveUniformsiv, glGetUniformBlockIndex, glGetUniformIndices, glPrimitiveRestartIndex, glTexBuffer, glUniformBlockBinding; - /** - * OpenGL 3.2 method handles - */ - public MethodHandle glClientWaitSync, glDeleteSync, glDrawElementsBaseVertex, glDrawElementsInstancedBaseVertex, glDrawRangeElementsBaseVertex, - glFenceSync, glFramebufferTexture, glGetBufferParameteri64v, glGetInteger64i_v, glGetInteger64v, glGetMultisamplefv, glGetSynciv, - glIsSync, glMultiDrawElementsBaseVertex, glProvokingVertex, glSampleMaski, glTexImage2DMultisample, glTexImage3DMultisample, glWaitSync; - /** - * OpenGL 3.3 method handles - */ - public MethodHandle glBindFragDataLocationIndexed, glBindSampler, glDeleteSamplers, glGenSamplers, glGetFragDataIndex, glGetQueryObjecti64v, - glGetQueryObjectui64v, glGetSamplerParameterIiv, glGetSamplerParameterIuiv, glGetSamplerParameterfv, glGetSamplerParameteriv, glIsSampler, - glQueryCounter, glSamplerParameterIiv, glSamplerParameterIuiv, glSamplerParameterf, glSamplerParameterfv, glSamplerParameteri, - glSamplerParameteriv, glVertexAttribDivisor, glVertexAttribP1ui, glVertexAttribP1uiv, glVertexAttribP2ui, glVertexAttribP2uiv, - glVertexAttribP3ui, glVertexAttribP3uiv, glVertexAttribP4ui, glVertexAttribP4uiv; - /** - * OpenGL 4.0 method handles - */ - public MethodHandle glBeginQueryIndexed, glBindTransformFeedback, glBlendEquationSeparatei, glBlendEquationi, glBlendFuncSeparatei, glBlendFunci, - glDeleteTransformFeedbacks, glDrawArraysIndirect, glDrawElementsIndirect, glDrawTransformFeedback, glDrawTransformFeedbackStream, glEndQueryIndexed, - glGenTransformFeedbacks, glGetActiveSubroutineName, glGetActiveSubroutineUniformName, glGetActiveSubroutineUniformiv, glGetProgramStageiv, glGetQueryIndexediv, - glGetSubroutineIndex, glGetSubroutineUniformLocation, glGetUniformSubroutineuiv, glGetUniformdv, glIsTransformFeedback, glMinSampleShading, - glPatchParameterfv, glPatchParameteri, glPauseTransformFeedback, glResumeTransformFeedback, glUniform1d, glUniform1dv, - glUniform2d, glUniform2dv, glUniform3d, glUniform3dv, glUniform4d, glUniform4dv, glUniformMatrix2dv, glUniformMatrix2x3dv, - glUniformMatrix2x4dv, glUniformMatrix3dv, glUniformMatrix3x2dv, glUniformMatrix3x4dv, glUniformMatrix4dv, glUniformMatrix4x2dv, - glUniformMatrix4x3dv, glUniformSubroutinesuiv; - /** - * OpenGL 4.1 method handles - */ - public MethodHandle glActiveShaderProgram, glBindProgramPipeline, glClearDepthf, glCreateShaderProgramv, glDeleteProgramPipelines, glDepthRangeArrayv, - glDepthRangeIndexed, glDepthRangef, glGenProgramPipelines, glGetDoublei_v, glGetFloati_v, glGetProgramBinary, - glGetProgramPipelineInfoLog, glGetProgramPipelineiv, glGetShaderPrecisionFormat, glGetVertexAttribLdv, glIsProgramPipeline, glProgramBinary, - glProgramParameteri, glProgramUniform1d, glProgramUniform1dv, glProgramUniform1f, glProgramUniform1fv, glProgramUniform1i, - glProgramUniform1iv, glProgramUniform1ui, glProgramUniform1uiv, glProgramUniform2d, glProgramUniform2dv, glProgramUniform2f, - glProgramUniform2fv, glProgramUniform2i, glProgramUniform2iv, glProgramUniform2ui, glProgramUniform2uiv, glProgramUniform3d, - glProgramUniform3dv, glProgramUniform3f, glProgramUniform3fv, glProgramUniform3i, glProgramUniform3iv, glProgramUniform3ui, - glProgramUniform3uiv, glProgramUniform4d, glProgramUniform4dv, glProgramUniform4f, glProgramUniform4fv, glProgramUniform4i, - glProgramUniform4iv, glProgramUniform4ui, glProgramUniform4uiv, glProgramUniformMatrix2dv, glProgramUniformMatrix2fv, glProgramUniformMatrix2x3dv, - glProgramUniformMatrix2x3fv, glProgramUniformMatrix2x4dv, glProgramUniformMatrix2x4fv, glProgramUniformMatrix3dv, glProgramUniformMatrix3fv, glProgramUniformMatrix3x2dv, - glProgramUniformMatrix3x2fv, glProgramUniformMatrix3x4dv, glProgramUniformMatrix3x4fv, glProgramUniformMatrix4dv, glProgramUniformMatrix4fv, glProgramUniformMatrix4x2dv, - glProgramUniformMatrix4x2fv, glProgramUniformMatrix4x3dv, glProgramUniformMatrix4x3fv, glReleaseShaderCompiler, glScissorArrayv, glScissorIndexed, - glScissorIndexedv, glShaderBinary, glUseProgramStages, glValidateProgramPipeline, glVertexAttribL1d, glVertexAttribL1dv, - glVertexAttribL2d, glVertexAttribL2dv, glVertexAttribL3d, glVertexAttribL3dv, glVertexAttribL4d, glVertexAttribL4dv, - glVertexAttribLPointer, glViewportArrayv, glViewportIndexedf, glViewportIndexedfv; - /** - * OpenGL 4.2 method handles - */ - public MethodHandle glBindImageTexture, glDrawArraysInstancedBaseInstance, glDrawElementsInstancedBaseInstance, - glDrawElementsInstancedBaseVertexBaseInstance, glDrawTransformFeedbackInstanced, glDrawTransformFeedbackStreamInstanced, - glGetActiveAtomicCounterBufferiv, glGetInternalformativ, glMemoryBarrier, glTexStorage1D, glTexStorage2D, glTexStorage3D; - /** - * OpenGL 4.3 method handles - */ - public MethodHandle glBindVertexBuffer, glClearBufferData, glClearBufferSubData, glCopyImageSubData, glDebugMessageCallback, - glDebugMessageControl, glDebugMessageInsert, glDispatchCompute, glDispatchComputeIndirect, glFramebufferParameteri, - glGetDebugMessageLog, glGetFramebufferParameteriv, glGetInternalformati64v, glGetObjectLabel, glGetObjectPtrLabel, - glGetProgramInterfaceiv, glGetProgramResourceIndex, glGetProgramResourceLocation, glGetProgramResourceLocationIndex, - glGetProgramResourceName, glGetProgramResourceiv, glInvalidateBufferData, glInvalidateBufferSubData, glInvalidateFramebuffer, - glInvalidateSubFramebuffer, glInvalidateTexImage, glInvalidateTexSubImage, glMultiDrawArraysIndirect, glMultiDrawElementsIndirect, - glObjectLabel, glObjectPtrLabel, glPopDebugGroup, glPushDebugGroup, glShaderStorageBlockBinding, glTexBufferRange, - glTexStorage2DMultisample, glTexStorage3DMultisample, glTextureView, glVertexAttribBinding, glVertexAttribFormat, - glVertexAttribIFormat, glVertexAttribLFormat, glVertexBindingDivisor; - /** - * OpenGL 4.4 method handles - */ - public MethodHandle glBindBuffersBase, glBindBuffersRange, glBindImageTextures, glBindSamplers, glBindTextures, - glBindVertexBuffers, glBufferStorage, glClearTexImage, glClearTexSubImage; - /** - * OpenGL 4.5 method handles - */ - public MethodHandle glBindTextureUnit, glBlitNamedFramebuffer, glCheckNamedFramebufferStatus, glClearNamedBufferData, - glClearNamedBufferSubData, glClearNamedFramebufferfi, glClearNamedFramebufferfv, glClearNamedFramebufferiv, - glClearNamedFramebufferuiv, glClipControl, glCompressedTextureSubImage1D, glCompressedTextureSubImage2D, - glCompressedTextureSubImage3D, glCopyNamedBufferSubData, glCopyTextureSubImage1D, glCopyTextureSubImage2D, - glCopyTextureSubImage3D, glCreateBuffers, glCreateFramebuffers, glCreateProgramPipelines, glCreateQueries, - glCreateRenderbuffers, glCreateSamplers, glCreateTextures, glCreateTransformFeedbacks, glCreateVertexArrays, - glDisableVertexArrayAttrib, glEnableVertexArrayAttrib, glFlushMappedNamedBufferRange, glGenerateTextureMipmap, - glGetCompressedTextureImage, glGetCompressedTextureSubImage, glGetGraphicsResetStatus, glGetNamedBufferParameteri64v, - glGetNamedBufferParameteriv, glGetNamedBufferPointerv, glGetNamedBufferSubData, glGetNamedFramebufferAttachmentParameteriv, - glGetNamedFramebufferParameteriv, glGetNamedRenderbufferParameteriv, glGetQueryBufferObjecti64v, glGetQueryBufferObjectiv, - glGetQueryBufferObjectui64v, glGetQueryBufferObjectuiv, glGetTextureImage, glGetTextureLevelParameterfv, - glGetTextureLevelParameteriv, glGetTextureParameterIiv, glGetTextureParameterIuiv, glGetTextureParameterfv, - glGetTextureParameteriv, glGetTextureSubImage, glGetTransformFeedbacki64_v, glGetTransformFeedbacki_v, - glGetTransformFeedbackiv, glGetVertexArrayIndexed64iv, - glGetVertexArrayIndexediv, glGetVertexArrayiv, glGetnCompressedTexImage, glGetnTexImage, glGetnUniformdv, - glGetnUniformfv, glGetnUniformiv, glGetnUniformuiv, glInvalidateNamedFramebufferData, - glInvalidateNamedFramebufferSubData, glMapNamedBuffer, glMapNamedBufferRange, glMemoryBarrierByRegion, - glNamedBufferData, glNamedBufferStorage, glNamedBufferSubData, glNamedFramebufferDrawBuffer, - glNamedFramebufferDrawBuffers, glNamedFramebufferParameteri, glNamedFramebufferReadBuffer, - glNamedFramebufferRenderbuffer, glNamedFramebufferTexture, glNamedFramebufferTextureLayer, - glNamedRenderbufferStorage, glNamedRenderbufferStorageMultisample, glReadnPixels, glTextureBarrier, - glTextureBuffer, glTextureBufferRange, glTextureParameterIiv, glTextureParameterIuiv, glTextureParameterf, - glTextureParameterfv, glTextureParameteri, glTextureParameteriv, glTextureStorage1D, glTextureStorage2D, - glTextureStorage2DMultisample, glTextureStorage3D, glTextureStorage3DMultisample, glTextureSubImage1D, - glTextureSubImage2D, glTextureSubImage3D, glTransformFeedbackBufferBase, glTransformFeedbackBufferRange, - glUnmapNamedBuffer, glVertexArrayAttribBinding, glVertexArrayAttribFormat, glVertexArrayAttribIFormat, - glVertexArrayAttribLFormat, glVertexArrayBindingDivisor, glVertexArrayElementBuffer, glVertexArrayVertexBuffer, - glVertexArrayVertexBuffers; - /** - * OpenGL 4.6 method handles - */ - public MethodHandle glMultiDrawArraysIndirectCount, glMultiDrawElementsIndirectCount, glPolygonOffsetClamp, glSpecializeShader; - - /** - * The OpenGL context version flags. - */ - public boolean - Ver10, Ver11, Ver12, Ver13, Ver14, Ver15, - Ver20, Ver21, - Ver30, Ver31, Ver32, Ver33, - Ver40, Ver41, Ver42, Ver43, Ver44, Ver45, Ver46; - private int rawGLVersion; - private final boolean forwardCompatible; - private GLExtCaps ext; - - /** - * Constructs incomplete OpenGL capabilities. - * - * @param forwardCompatible If {@code true}, only loads core profile functions. - */ - public GLCapabilities(boolean forwardCompatible) { - this.forwardCompatible = forwardCompatible; - } - - /** - * Load OpenGL by the given load function. - * - * @param load the load function. - * @return the OpenGL version returned from the graphics driver, or {@code 0} if no OpenGL context found. - */ - public int load(GLLoadFunc load) { - glGetString = load.invoke("glGetString", FunctionDescriptors.Ip); - if (glGetString == null) return 0; - if (GL10C.getString(GL10C.VERSION) == null) return 0; - - GL10C.load(this, load); - GL11C.load(this, load); - GL12C.load(this, load); - GL13C.load(this, load); - GL14C.load(this, load); - GL15C.load(this, load); - GL20C.load(this, load); - GL21C.load(this, load); - GL30C.load(this, load); - GL31C.load(this, load); - GL32C.load(this, load); - GL33C.load(this, load); - GL40C.load(this, load); - GL41C.load(this, load); - GL42C.load(this, load); - GL43C.load(this, load); - GL44C.load(this, load); - GL45C.load(this, load); - GL46C.load(this, load); - - int version = findCoreGL(false); - if (!forwardCompatible) { - GL10.load(this, load); - GL11.load(this, load); - GL13.load(this, load); - GL14.load(this, load); - } - - ext = new GLExtCaps(this); - - try (var arena = Arena.ofConfined()) { - if (!ext.findExtensionsGL(version, arena)) return 0; - findCoreGL(true); - } - ext.load(load); - - rawGLVersion = version; - - return version; - } - - private boolean check(boolean checkAll, boolean b, Predicate checkFunc) { - return checkAll ? checkFunc.test(this) : (b || checkFunc.test(this)); - } - - private int findCoreGL(boolean checkAll) { - if (checkAll) { - boolean forceCheckAll = Configurations.GL_FORCE_CHECK_ALL.get(); - // Note: use Predicate to avoid side effects - Ver10 = check(forceCheckAll, Ver10, GL10C::isSupported); - Ver11 = check(forceCheckAll, Ver11, GL11C::isSupported); - Ver12 = check(forceCheckAll, Ver12, GL12C::isSupported); - Ver13 = check(forceCheckAll, Ver13, GL13C::isSupported); - Ver14 = check(forceCheckAll, Ver14, GL14C::isSupported); - Ver15 = check(forceCheckAll, Ver15, GL15C::isSupported); - Ver20 = check(forceCheckAll, Ver20, GL20C::isSupported); - Ver21 = check(forceCheckAll, Ver21, GL21C::isSupported); - Ver30 = check(forceCheckAll, Ver30, GL30C::isSupported); - Ver31 = check(forceCheckAll, Ver31, GL31C::isSupported); - Ver32 = check(forceCheckAll, Ver32, GL32C::isSupported); - Ver33 = check(forceCheckAll, Ver33, GL33C::isSupported); - Ver40 = check(forceCheckAll, Ver40, GL40C::isSupported); - Ver41 = check(forceCheckAll, Ver41, GL41C::isSupported); - Ver42 = check(forceCheckAll, Ver42, GL42C::isSupported); - Ver43 = check(forceCheckAll, Ver43, GL43C::isSupported); - Ver44 = check(forceCheckAll, Ver44, GL44C::isSupported); - Ver45 = check(forceCheckAll, Ver45, GL45C::isSupported); - Ver46 = check(forceCheckAll, Ver46, GL46C::isSupported); - return -1; - } - final String[] prefixes = { - "OpenGL ES-CM ", - "OpenGL ES-CL ", - "OpenGL ES ", - "OpenGL SC " - }; - var version = GL10C.getString(GL10C.VERSION); - if (version == null) return 0; - for (var prefix : prefixes) { - int len = prefix.length(); - if (version.startsWith(prefix)) { - version = version.substring(len); - break; - } - } - var matcher = VERSION_PATTERN.matcher(version); - int major, minor; - if (matcher.find()) { - major = Integer.parseInt(matcher.group(1)); - minor = Integer.parseInt(matcher.group(2)); - } else { - major = 0; - minor = 0; - } - Ver10 = (major == 1 && minor >= 0) || major > 1; - Ver11 = (major == 1 && minor >= 1) || major > 1; - Ver12 = (major == 1 && minor >= 2) || major > 1; - Ver13 = (major == 1 && minor >= 3) || major > 1; - Ver14 = (major == 1 && minor >= 4) || major > 1; - Ver15 = (major == 1 && minor >= 5) || major > 1; - Ver20 = (major == 2 && minor >= 0) || major > 2; - Ver21 = (major == 2 && minor >= 1) || major > 2; - Ver30 = (major == 3 && minor >= 0) || major > 3; - Ver31 = (major == 3 && minor >= 1) || major > 3; - Ver32 = (major == 3 && minor >= 2) || major > 3; - Ver33 = (major == 3 && minor >= 3) || major > 3; - Ver40 = (major == 4 && minor >= 0) || major > 4; - Ver41 = (major == 4 && minor >= 1) || major > 4; - Ver42 = (major == 4 && minor >= 2) || major > 4; - Ver43 = (major == 4 && minor >= 3) || major > 4; - Ver44 = (major == 4 && minor >= 4) || major > 4; - Ver45 = (major == 4 && minor >= 5) || major > 4; - Ver46 = (major == 4 && minor >= 6) || major > 4; - return GLLoader.makeVersion(major, minor); - } - - /** - * {@return the raw OpenGL version value} - */ - public int rawGLVersion() { - return rawGLVersion; - } - - /** - * Forward compatible flag. - * - * @return {@code false} for deprecated and removed function. - */ - public boolean forwardCompatible() { - return forwardCompatible; - } - - /** - * {@return the OpenGL extension capabilities} - */ - public GLExtCaps ext() { - return ext; - } -} diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLDebugProc.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLDebugProc.java index 0f054355..b5528570 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLDebugProc.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLDebugProc.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2022-2023 Overrun Organization + * Copyright (c) 2022-2024 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 @@ -16,16 +16,10 @@ package overrungl.opengl; -import overrungl.Callback; +import overrun.marshal.Upcall; -import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodHandles; -import java.lang.invoke.MethodType; - -import static java.lang.foreign.ValueLayout.ADDRESS; -import static java.lang.foreign.ValueLayout.JAVA_INT; /** * The OpenGL debug message callback. @@ -34,9 +28,11 @@ * @since 0.1.0 */ @FunctionalInterface -public interface GLDebugProc extends Callback { - FunctionDescriptor DESC = FunctionDescriptor.ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, ADDRESS); - MethodType MTYPE = DESC.toMethodType(); +public interface GLDebugProc extends Upcall { + /** + * The type. + */ + Type TYPE = Upcall.type(); /** * debug callback @@ -51,17 +47,13 @@ public interface GLDebugProc extends Callback { */ void invoke(int source, int type, int id, int severity, String message, MemorySegment userParam); + @Stub default void ninvoke(int source, int type, int id, int severity, int length, MemorySegment message, MemorySegment userParam) { - invoke(source, type, id, severity, message.reinterpret(length + 1).getString(0), userParam.reinterpret(Long.MAX_VALUE)); - } - - @Override - default FunctionDescriptor descriptor() { - return DESC; + invoke(source, type, id, severity, message.reinterpret(length + 1).getString(0), userParam); } @Override - default MethodHandle handle(MethodHandles.Lookup lookup) throws NoSuchMethodException, IllegalAccessException { - return lookup.findVirtual(GLDebugProc.class, "ninvoke", MTYPE); + default MemorySegment stub(Arena arena) { + return TYPE.of(arena, this); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLExtCaps.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLExtCaps.java deleted file mode 100644 index 700721e6..00000000 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLExtCaps.java +++ /dev/null @@ -1,1074 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2022-present 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. - */ - -// This file is auto-generated. DO NOT EDIT! -package overrungl.opengl; - -import overrungl.opengl.ext.*; -import overrungl.opengl.ext.arb.*; -import overrungl.opengl.ext.khr.*; -import overrungl.opengl.ext.oes.*; -import overrungl.opengl.ext.amd.*; -import overrungl.opengl.ext.apple.*; -import overrungl.opengl.ext.ati.*; -import overrungl.opengl.ext.ext.*; -import overrungl.opengl.ext.ibm.*; -import overrungl.opengl.ext.intel.*; -import overrungl.opengl.ext.mesa.*; -import overrungl.opengl.ext.nv.*; -import overrungl.opengl.ext.sgi.*; -import overrungl.opengl.ext.sun.*; - -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; -import java.lang.invoke.MethodHandle; - -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLExtFinder.*; - -/** - * The OpenGL extension capabilities. - * - * @since 0.1.0 - */ -public final class GLExtCaps { - /** The OpenGL extension flags. */ - public boolean GL_ARB_ES2_compatibility, GL_ARB_ES3_1_compatibility, GL_ARB_ES3_2_compatibility, GL_ARB_ES3_compatibility, GL_ARB_arrays_of_arrays, GL_ARB_base_instance, GL_ARB_bindless_texture, GL_ARB_blend_func_extended, GL_ARB_buffer_storage, GL_ARB_cl_event, GL_ARB_clear_buffer_object, GL_ARB_clear_texture, GL_ARB_clip_control, GL_ARB_color_buffer_float, GL_ARB_compatibility, GL_ARB_compressed_texture_pixel_storage, GL_ARB_compute_shader, GL_ARB_compute_variable_group_size, GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth, GL_ARB_copy_buffer, GL_ARB_copy_image, GL_ARB_cull_distance, GL_ARB_debug_output, GL_ARB_depth_buffer_float, GL_ARB_depth_clamp, GL_ARB_depth_texture, GL_ARB_derivative_control, GL_ARB_direct_state_access, GL_ARB_draw_buffers, GL_ARB_draw_buffers_blend, GL_ARB_draw_elements_base_vertex, GL_ARB_draw_indirect, GL_ARB_draw_instanced, GL_ARB_enhanced_layouts, GL_ARB_explicit_attrib_location, GL_ARB_explicit_uniform_location, GL_ARB_fragment_coord_conventions, GL_ARB_fragment_layer_viewport, GL_ARB_fragment_program, GL_ARB_fragment_program_shadow, GL_ARB_fragment_shader, GL_ARB_fragment_shader_interlock, GL_ARB_framebuffer_no_attachments, GL_ARB_framebuffer_object, GL_ARB_framebuffer_sRGB, GL_ARB_geometry_shader4, GL_ARB_get_program_binary, GL_ARB_get_texture_sub_image, GL_ARB_gl_spirv, GL_ARB_gpu_shader5, GL_ARB_gpu_shader_fp64, GL_ARB_gpu_shader_int64, GL_ARB_half_float_pixel, GL_ARB_half_float_vertex, GL_ARB_imaging, GL_ARB_indirect_parameters, GL_ARB_instanced_arrays, GL_ARB_internalformat_query, GL_ARB_internalformat_query2, GL_ARB_invalidate_subdata, GL_ARB_map_buffer_alignment, GL_ARB_map_buffer_range, GL_ARB_matrix_palette, GL_ARB_multi_bind, GL_ARB_multi_draw_indirect, GL_ARB_multisample, GL_ARB_multitexture, GL_ARB_occlusion_query, GL_ARB_occlusion_query2, GL_ARB_parallel_shader_compile, GL_ARB_pipeline_statistics_query, GL_ARB_pixel_buffer_object, GL_ARB_point_parameters, GL_ARB_point_sprite, GL_ARB_polygon_offset_clamp, GL_ARB_post_depth_coverage, GL_ARB_program_interface_query, GL_ARB_provoking_vertex, GL_ARB_query_buffer_object, GL_ARB_robust_buffer_access_behavior, GL_ARB_robustness, GL_ARB_robustness_isolation, GL_ARB_sample_locations, GL_ARB_sample_shading, GL_ARB_sampler_objects, GL_ARB_seamless_cube_map, GL_ARB_seamless_cubemap_per_texture, GL_ARB_separate_shader_objects, GL_ARB_shader_atomic_counter_ops, GL_ARB_shader_atomic_counters, GL_ARB_shader_ballot, GL_ARB_shader_bit_encoding, GL_ARB_shader_clock, GL_ARB_shader_draw_parameters, GL_ARB_shader_group_vote, GL_ARB_shader_image_load_store, GL_ARB_shader_image_size, GL_ARB_shader_objects, GL_ARB_shader_precision, GL_ARB_shader_stencil_export, GL_ARB_shader_storage_buffer_object, GL_ARB_shader_subroutine, GL_ARB_shader_texture_image_samples, GL_ARB_shader_texture_lod, GL_ARB_shader_viewport_layer_array, GL_ARB_shading_language_100, GL_ARB_shading_language_420pack, GL_ARB_shading_language_include, GL_ARB_shading_language_packing, GL_ARB_shadow, GL_ARB_shadow_ambient, GL_ARB_sparse_buffer, GL_ARB_sparse_texture, GL_ARB_sparse_texture2, GL_ARB_sparse_texture_clamp, GL_ARB_spirv_extensions, GL_ARB_stencil_texturing, GL_ARB_sync, GL_ARB_tessellation_shader, GL_ARB_texture_barrier, GL_ARB_texture_border_clamp, GL_ARB_texture_buffer_object, GL_ARB_texture_buffer_object_rgb32, GL_ARB_texture_buffer_range, GL_ARB_texture_compression, GL_ARB_texture_compression_bptc, GL_ARB_texture_compression_rgtc, GL_ARB_texture_cube_map, GL_ARB_texture_cube_map_array, GL_ARB_texture_env_add, GL_ARB_texture_env_combine, GL_ARB_texture_env_crossbar, GL_ARB_texture_env_dot3, GL_ARB_texture_filter_anisotropic, GL_ARB_texture_filter_minmax, GL_ARB_texture_float, GL_ARB_texture_gather, GL_ARB_texture_mirror_clamp_to_edge, GL_ARB_texture_mirrored_repeat, GL_ARB_texture_multisample, GL_ARB_texture_non_power_of_two, GL_ARB_texture_query_levels, GL_ARB_texture_query_lod, GL_ARB_texture_rectangle, GL_ARB_texture_rg, GL_ARB_texture_rgb10_a2ui, GL_ARB_texture_stencil8, GL_ARB_texture_storage, GL_ARB_texture_storage_multisample, GL_ARB_texture_swizzle, GL_ARB_texture_view, GL_ARB_timer_query, GL_ARB_transform_feedback2, GL_ARB_transform_feedback3, GL_ARB_transform_feedback_instanced, GL_ARB_transform_feedback_overflow_query, GL_ARB_transpose_matrix, GL_ARB_uniform_buffer_object, GL_ARB_vertex_array_bgra, GL_ARB_vertex_array_object, GL_ARB_vertex_attrib_64bit, GL_ARB_vertex_attrib_binding, GL_ARB_vertex_blend, GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, GL_ARB_vertex_shader, GL_ARB_vertex_type_10f_11f_11f_rev, GL_ARB_vertex_type_2_10_10_10_rev, GL_ARB_viewport_array, GL_ARB_window_pos, GL_KHR_blend_equation_advanced, GL_KHR_blend_equation_advanced_coherent, GL_KHR_context_flush_control, GL_KHR_debug, GL_KHR_no_error, GL_KHR_parallel_shader_compile, GL_KHR_robust_buffer_access_behavior, GL_KHR_robustness, GL_KHR_shader_subgroup, GL_KHR_texture_compression_astc_hdr, GL_KHR_texture_compression_astc_ldr, GL_KHR_texture_compression_astc_sliced_3d, GL_OES_byte_coordinates, GL_OES_compressed_paletted_texture, GL_OES_fixed_point, GL_OES_query_matrix, GL_OES_read_format, GL_OES_single_precision, GL_3DFX_multisample, GL_3DFX_tbuffer, GL_3DFX_texture_compression_FXT1, GL_AMD_blend_minmax_factor, GL_AMD_conservative_depth, GL_AMD_debug_output, GL_AMD_depth_clamp_separate, GL_AMD_draw_buffers_blend, GL_AMD_framebuffer_multisample_advanced, GL_AMD_framebuffer_sample_positions, GL_AMD_gcn_shader, GL_AMD_gpu_shader_half_float, GL_AMD_gpu_shader_int16, GL_AMD_gpu_shader_int64, GL_AMD_interleaved_elements, GL_AMD_multi_draw_indirect, GL_AMD_name_gen_delete, GL_AMD_occlusion_query_event, GL_AMD_performance_monitor, GL_AMD_pinned_memory, GL_AMD_query_buffer_object, GL_AMD_sample_positions, GL_AMD_seamless_cubemap_per_texture, GL_AMD_shader_atomic_counter_ops, GL_AMD_shader_ballot, GL_AMD_shader_explicit_vertex_parameter, GL_AMD_shader_gpu_shader_half_float_fetch, GL_AMD_shader_image_load_store_lod, GL_AMD_shader_stencil_export, GL_AMD_shader_trinary_minmax, GL_AMD_sparse_texture, GL_AMD_stencil_operation_extended, GL_AMD_texture_gather_bias_lod, GL_AMD_texture_texture4, GL_AMD_transform_feedback3_lines_triangles, GL_AMD_transform_feedback4, GL_AMD_vertex_shader_layer, GL_AMD_vertex_shader_tessellator, GL_AMD_vertex_shader_viewport_index, GL_APPLE_aux_depth_stencil, GL_APPLE_client_storage, GL_APPLE_element_array, GL_APPLE_fence, GL_APPLE_float_pixels, GL_APPLE_flush_buffer_range, GL_APPLE_object_purgeable, GL_APPLE_rgb_422, GL_APPLE_row_bytes, GL_APPLE_specular_vector, GL_APPLE_texture_range, GL_APPLE_transform_hint, GL_APPLE_vertex_array_object, GL_APPLE_vertex_array_range, GL_APPLE_vertex_program_evaluators, GL_APPLE_ycbcr_422, GL_ATI_draw_buffers, GL_ATI_element_array, GL_ATI_envmap_bumpmap, GL_ATI_fragment_shader, GL_ATI_map_object_buffer, GL_ATI_meminfo, GL_ATI_pixel_format_float, GL_ATI_pn_triangles, GL_ATI_separate_stencil, GL_ATI_text_fragment_shader, GL_ATI_texture_env_combine3, GL_ATI_texture_float, GL_ATI_texture_mirror_once, GL_ATI_vertex_array_object, GL_ATI_vertex_attrib_array_object, GL_ATI_vertex_streams, GL_EXT_422_pixels, GL_EXT_EGL_image_storage, GL_EXT_EGL_sync, GL_EXT_abgr, GL_EXT_bgra, GL_EXT_bindable_uniform, GL_EXT_blend_color, GL_EXT_blend_equation_separate, GL_EXT_blend_func_separate, GL_EXT_blend_logic_op, GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_clip_volume_hint, GL_EXT_cmyka, GL_EXT_color_subtable, GL_EXT_compiled_vertex_array, GL_EXT_convolution, GL_EXT_coordinate_frame, GL_EXT_copy_texture, GL_EXT_cull_vertex, GL_EXT_debug_label, GL_EXT_debug_marker, GL_EXT_depth_bounds_test, GL_EXT_direct_state_access, GL_EXT_draw_buffers2, GL_EXT_draw_instanced, GL_EXT_draw_range_elements, GL_EXT_external_buffer, GL_EXT_fog_coord, GL_EXT_framebuffer_blit, GL_EXT_framebuffer_blit_layers, GL_EXT_framebuffer_multisample, GL_EXT_framebuffer_multisample_blit_scaled, GL_EXT_framebuffer_object, GL_EXT_framebuffer_sRGB, GL_EXT_geometry_shader4, GL_EXT_gpu_program_parameters, GL_EXT_gpu_shader4, GL_EXT_histogram, GL_EXT_index_array_formats, GL_EXT_index_func, GL_EXT_index_material, GL_EXT_index_texture, GL_EXT_light_texture, GL_EXT_memory_object, GL_EXT_memory_object_fd, GL_EXT_memory_object_win32, GL_EXT_misc_attribute, GL_EXT_multi_draw_arrays, GL_EXT_multisample, GL_EXT_multiview_tessellation_geometry_shader, GL_EXT_multiview_texture_multisample, GL_EXT_multiview_timer_query, GL_EXT_packed_depth_stencil, GL_EXT_packed_float, GL_EXT_packed_pixels, GL_EXT_paletted_texture, GL_EXT_pixel_buffer_object, GL_EXT_pixel_transform, GL_EXT_pixel_transform_color_table, GL_EXT_point_parameters, GL_EXT_polygon_offset, GL_EXT_polygon_offset_clamp, GL_EXT_post_depth_coverage, GL_EXT_provoking_vertex, GL_EXT_raster_multisample, GL_EXT_rescale_normal, GL_EXT_secondary_color, GL_EXT_semaphore, GL_EXT_semaphore_fd, GL_EXT_semaphore_win32, GL_EXT_separate_shader_objects, GL_EXT_separate_specular_color, GL_EXT_shader_framebuffer_fetch, GL_EXT_shader_framebuffer_fetch_non_coherent, GL_EXT_shader_image_load_formatted, GL_EXT_shader_image_load_store, GL_EXT_shader_integer_mix, GL_EXT_shader_samples_identical, GL_EXT_shadow_funcs, GL_EXT_shared_texture_palette, GL_EXT_sparse_texture2, GL_EXT_stencil_clear_tag, GL_EXT_stencil_two_side, GL_EXT_stencil_wrap, GL_EXT_subtexture, GL_EXT_texture, GL_EXT_texture3D, GL_EXT_texture_array, GL_EXT_texture_buffer_object, GL_EXT_texture_compression_latc, GL_EXT_texture_compression_rgtc, GL_EXT_texture_compression_s3tc, GL_EXT_texture_cube_map, GL_EXT_texture_env_add, GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3, GL_EXT_texture_filter_anisotropic, GL_EXT_texture_filter_minmax, GL_EXT_texture_integer, GL_EXT_texture_lod_bias, GL_EXT_texture_mirror_clamp, GL_EXT_texture_object, GL_EXT_texture_perturb_normal, GL_EXT_texture_sRGB, GL_EXT_texture_sRGB_R8, GL_EXT_texture_sRGB_RG8, GL_EXT_texture_sRGB_decode, GL_EXT_texture_shadow_lod, GL_EXT_texture_shared_exponent, GL_EXT_texture_snorm, GL_EXT_texture_storage, GL_EXT_texture_swizzle, GL_EXT_timer_query, GL_EXT_transform_feedback, GL_EXT_vertex_array, GL_EXT_vertex_array_bgra, GL_EXT_vertex_attrib_64bit, GL_EXT_vertex_shader, GL_EXT_vertex_weighting, GL_EXT_win32_keyed_mutex, GL_EXT_window_rectangles, GL_EXT_x11_sync_object, GL_GREMEDY_frame_terminator, GL_GREMEDY_string_marker, GL_HP_convolution_border_modes, GL_HP_image_transform, GL_HP_occlusion_test, GL_HP_texture_lighting, GL_IBM_cull_vertex, GL_IBM_multimode_draw_arrays, GL_IBM_rasterpos_clip, GL_IBM_static_data, GL_IBM_texture_mirrored_repeat, GL_IBM_vertex_array_lists, GL_INGR_blend_func_separate, GL_INGR_color_clamp, GL_INGR_interlace_read, GL_INTEL_blackhole_render, GL_INTEL_conservative_rasterization, GL_INTEL_fragment_shader_ordering, GL_INTEL_framebuffer_CMAA, GL_INTEL_map_texture, GL_INTEL_parallel_arrays, GL_INTEL_performance_query, GL_MESAX_texture_stack, GL_MESA_framebuffer_flip_x, GL_MESA_framebuffer_flip_y, GL_MESA_framebuffer_swap_xy, GL_MESA_pack_invert, GL_MESA_program_binary_formats, GL_MESA_resize_buffers, GL_MESA_shader_integer_functions, GL_MESA_tile_raster_order, GL_MESA_window_pos, GL_MESA_ycbcr_texture, GL_NVX_blend_equation_advanced_multi_draw_buffers, GL_NVX_conditional_render, GL_NVX_gpu_memory_info, GL_NVX_gpu_multicast2, GL_NVX_linked_gpu_multicast, GL_NVX_progress_fence, GL_NV_alpha_to_coverage_dither_control, GL_NV_bindless_multi_draw_indirect, GL_NV_bindless_multi_draw_indirect_count, GL_NV_bindless_texture, GL_NV_blend_equation_advanced, GL_NV_blend_equation_advanced_coherent, GL_NV_blend_minmax_factor, GL_NV_blend_square, GL_NV_clip_space_w_scaling, GL_NV_command_list, GL_NV_compute_program5, GL_NV_compute_shader_derivatives, GL_NV_conditional_render, GL_NV_conservative_raster, GL_NV_conservative_raster_dilate, GL_NV_conservative_raster_pre_snap, GL_NV_conservative_raster_pre_snap_triangles, GL_NV_conservative_raster_underestimation, GL_NV_copy_depth_to_color, GL_NV_copy_image, GL_NV_deep_texture3D, GL_NV_depth_buffer_float, GL_NV_depth_clamp, GL_NV_draw_texture, GL_NV_draw_vulkan_image, GL_NV_evaluators, GL_NV_explicit_multisample, GL_NV_fence, GL_NV_fill_rectangle, GL_NV_float_buffer, GL_NV_fog_distance, GL_NV_fragment_coverage_to_color, GL_NV_fragment_program, GL_NV_fragment_program2, GL_NV_fragment_program4, GL_NV_fragment_program_option, GL_NV_fragment_shader_barycentric, GL_NV_fragment_shader_interlock, GL_NV_framebuffer_mixed_samples, GL_NV_framebuffer_multisample_coverage, GL_NV_geometry_program4, GL_NV_geometry_shader4, GL_NV_geometry_shader_passthrough, GL_NV_gpu_multicast, GL_NV_gpu_program4, GL_NV_gpu_program5, GL_NV_gpu_program5_mem_extended, GL_NV_gpu_shader5, GL_NV_half_float, GL_NV_internalformat_sample_query, GL_NV_light_max_exponent, GL_NV_memory_attachment, GL_NV_memory_object_sparse, GL_NV_mesh_shader, GL_NV_multisample_coverage, GL_NV_multisample_filter_hint, GL_NV_occlusion_query, GL_NV_packed_depth_stencil, GL_NV_parameter_buffer_object, GL_NV_parameter_buffer_object2, GL_NV_path_rendering, GL_NV_path_rendering_shared_edge, GL_NV_pixel_data_range, GL_NV_point_sprite, GL_NV_present_video, GL_NV_primitive_restart, GL_NV_primitive_shading_rate, GL_NV_query_resource, GL_NV_query_resource_tag, GL_NV_register_combiners, GL_NV_register_combiners2, GL_NV_representative_fragment_test, GL_NV_robustness_video_memory_purge, GL_NV_sample_locations, GL_NV_sample_mask_override_coverage, GL_NV_scissor_exclusive, GL_NV_shader_atomic_counters, GL_NV_shader_atomic_float, GL_NV_shader_atomic_float64, GL_NV_shader_atomic_fp16_vector, GL_NV_shader_atomic_int64, GL_NV_shader_buffer_load, GL_NV_shader_buffer_store, GL_NV_shader_storage_buffer_object, GL_NV_shader_subgroup_partitioned, GL_NV_shader_texture_footprint, GL_NV_shader_thread_group, GL_NV_shader_thread_shuffle, GL_NV_shading_rate_image, GL_NV_stereo_view_rendering, GL_NV_tessellation_program5, GL_NV_texgen_emboss, GL_NV_texgen_reflection, GL_NV_texture_barrier, GL_NV_texture_compression_vtc, GL_NV_texture_env_combine4, GL_NV_texture_expand_normal, GL_NV_texture_multisample, GL_NV_texture_rectangle, GL_NV_texture_rectangle_compressed, GL_NV_texture_shader, GL_NV_texture_shader2, GL_NV_texture_shader3, GL_NV_timeline_semaphore, GL_NV_transform_feedback, GL_NV_transform_feedback2, GL_NV_uniform_buffer_std430_layout, GL_NV_uniform_buffer_unified_memory, GL_NV_vdpau_interop, GL_NV_vdpau_interop2, GL_NV_vertex_array_range, GL_NV_vertex_array_range2, GL_NV_vertex_attrib_integer_64bit, GL_NV_vertex_buffer_unified_memory, GL_NV_vertex_program, GL_NV_vertex_program1_1, GL_NV_vertex_program2, GL_NV_vertex_program2_option, GL_NV_vertex_program3, GL_NV_vertex_program4, GL_NV_video_capture, GL_NV_viewport_array2, GL_NV_viewport_swizzle, GL_OML_interlace, GL_OML_resample, GL_OML_subsample, GL_OVR_multiview, GL_OVR_multiview2, GL_PGI_misc_hints, GL_PGI_vertex_hints, GL_REND_screen_coordinates, GL_S3_s3tc, GL_SGIS_detail_texture, GL_SGIS_fog_function, GL_SGIS_generate_mipmap, GL_SGIS_multisample, GL_SGIS_pixel_texture, GL_SGIS_point_line_texgen, GL_SGIS_point_parameters, GL_SGIS_sharpen_texture, GL_SGIS_texture4D, GL_SGIS_texture_border_clamp, GL_SGIS_texture_color_mask, GL_SGIS_texture_edge_clamp, GL_SGIS_texture_filter4, GL_SGIS_texture_lod, GL_SGIS_texture_select, GL_SGIX_async, GL_SGIX_async_histogram, GL_SGIX_async_pixel, GL_SGIX_blend_alpha_minmax, GL_SGIX_calligraphic_fragment, GL_SGIX_clipmap, GL_SGIX_convolution_accuracy, GL_SGIX_depth_pass_instrument, GL_SGIX_depth_texture, GL_SGIX_flush_raster, GL_SGIX_fog_offset, GL_SGIX_fragment_lighting, GL_SGIX_framezoom, GL_SGIX_igloo_interface, GL_SGIX_instruments, GL_SGIX_interlace, GL_SGIX_ir_instrument1, GL_SGIX_list_priority, GL_SGIX_pixel_texture, GL_SGIX_pixel_tiles, GL_SGIX_polynomial_ffd, GL_SGIX_reference_plane, GL_SGIX_resample, GL_SGIX_scalebias_hint, GL_SGIX_shadow, GL_SGIX_shadow_ambient, GL_SGIX_sprite, GL_SGIX_subsample, GL_SGIX_tag_sample_buffer, GL_SGIX_texture_add_env, GL_SGIX_texture_coordinate_clamp, GL_SGIX_texture_lod_bias, GL_SGIX_texture_multi_buffer, GL_SGIX_texture_scale_bias, GL_SGIX_vertex_preclip, GL_SGIX_ycrcb, GL_SGIX_ycrcb_subsample, GL_SGIX_ycrcba, GL_SGI_color_matrix, GL_SGI_color_table, GL_SGI_texture_color_table, GL_SUNX_constant_data, GL_SUN_convolution_border_modes, GL_SUN_global_alpha, GL_SUN_mesh_array, GL_SUN_slice_accum, GL_SUN_triangle_list, GL_SUN_vertex, GL_WIN_phong_shading, GL_WIN_specular_fog; - - /** GLCapabilities */ - public final GLCapabilities caps; - - /** - * Construct incomplete OpenGL extension capabilities. - * - * @param caps The parent capabilities. - */ - public GLExtCaps(GLCapabilities caps) { - this.caps = caps; - } - - /** Method handles. */ - public MethodHandle - glPrimitiveBoundingBoxARB, glGetTextureHandleARB, glGetTextureSamplerHandleARB, glMakeTextureHandleResidentARB, glMakeTextureHandleNonResidentARB, glGetImageHandleARB, glMakeImageHandleResidentARB, glMakeImageHandleNonResidentARB, glUniformHandleui64ARB, glUniformHandleui64vARB, glProgramUniformHandleui64ARB, glProgramUniformHandleui64vARB, glIsTextureHandleResidentARB, glIsImageHandleResidentARB, glVertexAttribL1ui64ARB, glVertexAttribL1ui64vARB, - glGetVertexAttribLui64vARB, glCreateSyncFromCLeventARB, glClampColorARB, glDispatchComputeGroupSizeARB, glDebugMessageControlARB, glDebugMessageInsertARB, glDebugMessageCallbackARB, glGetDebugMessageLogARB, glDrawBuffersARB, glBlendEquationiARB, glBlendEquationSeparateiARB, glBlendFunciARB, glBlendFuncSeparateiARB, glDrawArraysInstancedARB, glDrawElementsInstancedARB, glProgramStringARB, - glBindProgramARB, glDeleteProgramsARB, glGenProgramsARB, glProgramEnvParameter4dARB, glProgramEnvParameter4dvARB, glProgramEnvParameter4fARB, glProgramEnvParameter4fvARB, glProgramLocalParameter4dARB, glProgramLocalParameter4dvARB, glProgramLocalParameter4fARB, glProgramLocalParameter4fvARB, glGetProgramEnvParameterdvARB, glGetProgramEnvParameterfvARB, glGetProgramLocalParameterdvARB, glGetProgramLocalParameterfvARB, glGetProgramivARB, - glGetProgramStringARB, glIsProgramARB, glProgramParameteriARB, glFramebufferTextureARB, glFramebufferTextureLayerARB, glFramebufferTextureFaceARB, glSpecializeShaderARB, glUniform1i64ARB, glUniform2i64ARB, glUniform3i64ARB, glUniform4i64ARB, glUniform1i64vARB, glUniform2i64vARB, glUniform3i64vARB, glUniform4i64vARB, glUniform1ui64ARB, - glUniform2ui64ARB, glUniform3ui64ARB, glUniform4ui64ARB, glUniform1ui64vARB, glUniform2ui64vARB, glUniform3ui64vARB, glUniform4ui64vARB, glGetUniformi64vARB, glGetUniformui64vARB, glGetnUniformi64vARB, glGetnUniformui64vARB, glProgramUniform1i64ARB, glProgramUniform2i64ARB, glProgramUniform3i64ARB, glProgramUniform4i64ARB, glProgramUniform1i64vARB, - glProgramUniform2i64vARB, glProgramUniform3i64vARB, glProgramUniform4i64vARB, glProgramUniform1ui64ARB, glProgramUniform2ui64ARB, glProgramUniform3ui64ARB, glProgramUniform4ui64ARB, glProgramUniform1ui64vARB, glProgramUniform2ui64vARB, glProgramUniform3ui64vARB, glProgramUniform4ui64vARB, glColorTable, glColorTableParameterfv, glColorTableParameteriv, glCopyColorTable, glGetColorTable, - glGetColorTableParameterfv, glGetColorTableParameteriv, glColorSubTable, glCopyColorSubTable, glConvolutionFilter1D, glConvolutionFilter2D, glConvolutionParameterf, glConvolutionParameterfv, glConvolutionParameteri, glConvolutionParameteriv, glCopyConvolutionFilter1D, glCopyConvolutionFilter2D, glGetConvolutionFilter, glGetConvolutionParameterfv, glGetConvolutionParameteriv, glGetSeparableFilter, - glSeparableFilter2D, glGetHistogram, glGetHistogramParameterfv, glGetHistogramParameteriv, glGetMinmax, glGetMinmaxParameterfv, glGetMinmaxParameteriv, glHistogram, glMinmax, glResetHistogram, glResetMinmax, glMultiDrawArraysIndirectCountARB, glMultiDrawElementsIndirectCountARB, glVertexAttribDivisorARB, glCurrentPaletteMatrixARB, glMatrixIndexubvARB, - glMatrixIndexusvARB, glMatrixIndexuivARB, glMatrixIndexPointerARB, glSampleCoverageARB, glActiveTextureARB, glClientActiveTextureARB, glMultiTexCoord1dARB, glMultiTexCoord1dvARB, glMultiTexCoord1fARB, glMultiTexCoord1fvARB, glMultiTexCoord1iARB, glMultiTexCoord1ivARB, glMultiTexCoord1sARB, glMultiTexCoord1svARB, glMultiTexCoord2dARB, glMultiTexCoord2dvARB, - glMultiTexCoord2fARB, glMultiTexCoord2fvARB, glMultiTexCoord2iARB, glMultiTexCoord2ivARB, glMultiTexCoord2sARB, glMultiTexCoord2svARB, glMultiTexCoord3dARB, glMultiTexCoord3dvARB, glMultiTexCoord3fARB, glMultiTexCoord3fvARB, glMultiTexCoord3iARB, glMultiTexCoord3ivARB, glMultiTexCoord3sARB, glMultiTexCoord3svARB, glMultiTexCoord4dARB, glMultiTexCoord4dvARB, - glMultiTexCoord4fARB, glMultiTexCoord4fvARB, glMultiTexCoord4iARB, glMultiTexCoord4ivARB, glMultiTexCoord4sARB, glMultiTexCoord4svARB, glGenQueriesARB, glDeleteQueriesARB, glIsQueryARB, glBeginQueryARB, glEndQueryARB, glGetQueryivARB, glGetQueryObjectivARB, glGetQueryObjectuivARB, glMaxShaderCompilerThreadsARB, glPointParameterfARB, - glPointParameterfvARB, glGetGraphicsResetStatusARB, glGetnCompressedTexImageARB, glGetnTexImageARB, glGetnUniformdvARB, glGetnUniformfvARB, glGetnUniformivARB, glGetnUniformuivARB, glReadnPixelsARB, glEvaluateDepthValuesARB, glFramebufferSampleLocationsfvARB, glNamedFramebufferSampleLocationsfvARB, glMinSampleShadingARB, glDeleteObjectARB, glGetHandleARB, glDetachObjectARB, - glCreateShaderObjectARB, glShaderSourceARB, glCompileShaderARB, glCreateProgramObjectARB, glAttachObjectARB, glLinkProgramARB, glUseProgramObjectARB, glValidateProgramARB, glUniform1fARB, glUniform2fARB, glUniform3fARB, glUniform4fARB, glUniform1iARB, glUniform2iARB, glUniform3iARB, glUniform4iARB, - glUniform1fvARB, glUniform2fvARB, glUniform3fvARB, glUniform4fvARB, glUniform1ivARB, glUniform2ivARB, glUniform3ivARB, glUniform4ivARB, glUniformMatrix2fvARB, glUniformMatrix3fvARB, glUniformMatrix4fvARB, glGetObjectParameterfvARB, glGetObjectParameterivARB, glGetInfoLogARB, glGetAttachedObjectsARB, glGetUniformLocationARB, - glGetActiveUniformARB, glGetUniformfvARB, glGetUniformivARB, glGetShaderSourceARB, glNamedStringARB, glDeleteNamedStringARB, glCompileShaderIncludeARB, glIsNamedStringARB, glGetNamedStringARB, glGetNamedStringivARB, glBufferPageCommitmentARB, glNamedBufferPageCommitmentEXT, glNamedBufferPageCommitmentARB, glTexPageCommitmentARB, glTexBufferARB, glCompressedTexImage3DARB, - glCompressedTexImage2DARB, glCompressedTexImage1DARB, glCompressedTexSubImage3DARB, glCompressedTexSubImage2DARB, glCompressedTexSubImage1DARB, glGetCompressedTexImageARB, glLoadTransposeMatrixfARB, glLoadTransposeMatrixdARB, glMultTransposeMatrixfARB, glMultTransposeMatrixdARB, glWeightbvARB, glWeightsvARB, glWeightivARB, glWeightfvARB, glWeightdvARB, glWeightubvARB, - glWeightusvARB, glWeightuivARB, glWeightPointerARB, glVertexBlendARB, glBindBufferARB, glDeleteBuffersARB, glGenBuffersARB, glIsBufferARB, glBufferDataARB, glBufferSubDataARB, glGetBufferSubDataARB, glMapBufferARB, glUnmapBufferARB, glGetBufferParameterivARB, glGetBufferPointervARB, glVertexAttrib1dARB, - glVertexAttrib1dvARB, glVertexAttrib1fARB, glVertexAttrib1fvARB, glVertexAttrib1sARB, glVertexAttrib1svARB, glVertexAttrib2dARB, glVertexAttrib2dvARB, glVertexAttrib2fARB, glVertexAttrib2fvARB, glVertexAttrib2sARB, glVertexAttrib2svARB, glVertexAttrib3dARB, glVertexAttrib3dvARB, glVertexAttrib3fARB, glVertexAttrib3fvARB, glVertexAttrib3sARB, - glVertexAttrib3svARB, glVertexAttrib4NbvARB, glVertexAttrib4NivARB, glVertexAttrib4NsvARB, glVertexAttrib4NubARB, glVertexAttrib4NubvARB, glVertexAttrib4NuivARB, glVertexAttrib4NusvARB, glVertexAttrib4bvARB, glVertexAttrib4dARB, glVertexAttrib4dvARB, glVertexAttrib4fARB, glVertexAttrib4fvARB, glVertexAttrib4ivARB, glVertexAttrib4sARB, glVertexAttrib4svARB, - glVertexAttrib4ubvARB, glVertexAttrib4uivARB, glVertexAttrib4usvARB, glVertexAttribPointerARB, glEnableVertexAttribArrayARB, glDisableVertexAttribArrayARB, glGetVertexAttribdvARB, glGetVertexAttribfvARB, glGetVertexAttribivARB, glGetVertexAttribPointervARB, glBindAttribLocationARB, glGetActiveAttribARB, glGetAttribLocationARB, glDepthRangeArraydvNV, glDepthRangeIndexeddNV, glWindowPos2dARB, - glWindowPos2dvARB, glWindowPos2fARB, glWindowPos2fvARB, glWindowPos2iARB, glWindowPos2ivARB, glWindowPos2sARB, glWindowPos2svARB, glWindowPos3dARB, glWindowPos3dvARB, glWindowPos3fARB, glWindowPos3fvARB, glWindowPos3iARB, glWindowPos3ivARB, glWindowPos3sARB, glWindowPos3svARB, glBlendBarrierKHR, - glMaxShaderCompilerThreadsKHR, glMultiTexCoord1bOES, glMultiTexCoord1bvOES, glMultiTexCoord2bOES, glMultiTexCoord2bvOES, glMultiTexCoord3bOES, glMultiTexCoord3bvOES, glMultiTexCoord4bOES, glMultiTexCoord4bvOES, glTexCoord1bOES, glTexCoord1bvOES, glTexCoord2bOES, glTexCoord2bvOES, glTexCoord3bOES, glTexCoord3bvOES, glTexCoord4bOES, - glTexCoord4bvOES, glVertex2bOES, glVertex2bvOES, glVertex3bOES, glVertex3bvOES, glVertex4bOES, glVertex4bvOES, glAlphaFuncxOES, glClearColorxOES, glClearDepthxOES, glClipPlanexOES, glColor4xOES, glDepthRangexOES, glFogxOES, glFogxvOES, glFrustumxOES, - glGetClipPlanexOES, glGetFixedvOES, glGetTexEnvxvOES, glGetTexParameterxvOES, glLightModelxOES, glLightModelxvOES, glLightxOES, glLightxvOES, glLineWidthxOES, glLoadMatrixxOES, glMaterialxOES, glMaterialxvOES, glMultMatrixxOES, glMultiTexCoord4xOES, glNormal3xOES, glOrthoxOES, - glPointParameterxvOES, glPointSizexOES, glPolygonOffsetxOES, glRotatexOES, glScalexOES, glTexEnvxOES, glTexEnvxvOES, glTexParameterxOES, glTexParameterxvOES, glTranslatexOES, glAccumxOES, glBitmapxOES, glBlendColorxOES, glClearAccumxOES, glColor3xOES, glColor3xvOES, - glColor4xvOES, glConvolutionParameterxOES, glConvolutionParameterxvOES, glEvalCoord1xOES, glEvalCoord1xvOES, glEvalCoord2xOES, glEvalCoord2xvOES, glFeedbackBufferxOES, glGetConvolutionParameterxvOES, glGetHistogramParameterxvOES, glGetLightxOES, glGetMapxvOES, glGetMaterialxOES, glGetPixelMapxv, glGetTexGenxvOES, glGetTexLevelParameterxvOES, - glIndexxOES, glIndexxvOES, glLoadTransposeMatrixxOES, glMap1xOES, glMap2xOES, glMapGrid1xOES, glMapGrid2xOES, glMultTransposeMatrixxOES, glMultiTexCoord1xOES, glMultiTexCoord1xvOES, glMultiTexCoord2xOES, glMultiTexCoord2xvOES, glMultiTexCoord3xOES, glMultiTexCoord3xvOES, glMultiTexCoord4xvOES, glNormal3xvOES, - glPassThroughxOES, glPixelMapx, glPixelStorex, glPixelTransferxOES, glPixelZoomxOES, glPrioritizeTexturesxOES, glRasterPos2xOES, glRasterPos2xvOES, glRasterPos3xOES, glRasterPos3xvOES, glRasterPos4xOES, glRasterPos4xvOES, glRectxOES, glRectxvOES, glTexCoord1xOES, glTexCoord1xvOES, - glTexCoord2xOES, glTexCoord2xvOES, glTexCoord3xOES, glTexCoord3xvOES, glTexCoord4xOES, glTexCoord4xvOES, glTexGenxOES, glTexGenxvOES, glVertex2xOES, glVertex2xvOES, glVertex3xOES, glVertex3xvOES, glVertex4xOES, glVertex4xvOES, glQueryMatrixxOES, glClearDepthfOES, - glClipPlanefOES, glDepthRangefOES, glFrustumfOES, glGetClipPlanefOES, glOrthofOES, glTbufferMask3DFX, glDebugMessageEnableAMD, glDebugMessageInsertAMD, glDebugMessageCallbackAMD, glGetDebugMessageLogAMD, glBlendFuncIndexedAMD, glBlendFuncSeparateIndexedAMD, glBlendEquationIndexedAMD, glBlendEquationSeparateIndexedAMD, glRenderbufferStorageMultisampleAdvancedAMD, glNamedRenderbufferStorageMultisampleAdvancedAMD, - glFramebufferSamplePositionsfvAMD, glNamedFramebufferSamplePositionsfvAMD, glGetFramebufferParameterfvAMD, glGetNamedFramebufferParameterfvAMD, glUniform1i64NV, glUniform2i64NV, glUniform3i64NV, glUniform4i64NV, glUniform1i64vNV, glUniform2i64vNV, glUniform3i64vNV, glUniform4i64vNV, glUniform1ui64NV, glUniform2ui64NV, glUniform3ui64NV, glUniform4ui64NV, - glUniform1ui64vNV, glUniform2ui64vNV, glUniform3ui64vNV, glUniform4ui64vNV, glGetUniformi64vNV, glGetUniformui64vNV, glProgramUniform1i64NV, glProgramUniform2i64NV, glProgramUniform3i64NV, glProgramUniform4i64NV, glProgramUniform1i64vNV, glProgramUniform2i64vNV, glProgramUniform3i64vNV, glProgramUniform4i64vNV, glProgramUniform1ui64NV, glProgramUniform2ui64NV, - glProgramUniform3ui64NV, glProgramUniform4ui64NV, glProgramUniform1ui64vNV, glProgramUniform2ui64vNV, glProgramUniform3ui64vNV, glProgramUniform4ui64vNV, glVertexAttribParameteriAMD, glMultiDrawArraysIndirectAMD, glMultiDrawElementsIndirectAMD, glGenNamesAMD, glDeleteNamesAMD, glIsNameAMD, glQueryObjectParameteruiAMD, glGetPerfMonitorGroupsAMD, glGetPerfMonitorCountersAMD, glGetPerfMonitorGroupStringAMD, - glGetPerfMonitorCounterStringAMD, glGetPerfMonitorCounterInfoAMD, glGenPerfMonitorsAMD, glDeletePerfMonitorsAMD, glSelectPerfMonitorCountersAMD, glBeginPerfMonitorAMD, glEndPerfMonitorAMD, glGetPerfMonitorCounterDataAMD, glSetMultisamplefvAMD, glTexStorageSparseAMD, glTextureStorageSparseAMD, glStencilOpValueAMD, glTessellationFactorAMD, glTessellationModeAMD, glElementPointerAPPLE, glDrawElementArrayAPPLE, - glDrawRangeElementArrayAPPLE, glMultiDrawElementArrayAPPLE, glMultiDrawRangeElementArrayAPPLE, glGenFencesAPPLE, glDeleteFencesAPPLE, glSetFenceAPPLE, glIsFenceAPPLE, glTestFenceAPPLE, glFinishFenceAPPLE, glTestObjectAPPLE, glFinishObjectAPPLE, glBufferParameteriAPPLE, glFlushMappedBufferRangeAPPLE, glObjectPurgeableAPPLE, glObjectUnpurgeableAPPLE, glGetObjectParameterivAPPLE, - glTextureRangeAPPLE, glGetTexParameterPointervAPPLE, glBindVertexArrayAPPLE, glDeleteVertexArraysAPPLE, glGenVertexArraysAPPLE, glIsVertexArrayAPPLE, glVertexArrayRangeAPPLE, glFlushVertexArrayRangeAPPLE, glVertexArrayParameteriAPPLE, glEnableVertexAttribAPPLE, glDisableVertexAttribAPPLE, glIsVertexAttribEnabledAPPLE, glMapVertexAttrib1dAPPLE, glMapVertexAttrib1fAPPLE, glMapVertexAttrib2dAPPLE, glMapVertexAttrib2fAPPLE, - glDrawBuffersATI, glElementPointerATI, glDrawElementArrayATI, glDrawRangeElementArrayATI, glTexBumpParameterivATI, glTexBumpParameterfvATI, glGetTexBumpParameterivATI, glGetTexBumpParameterfvATI, glGenFragmentShadersATI, glBindFragmentShaderATI, glDeleteFragmentShaderATI, glBeginFragmentShaderATI, glEndFragmentShaderATI, glPassTexCoordATI, glSampleMapATI, glColorFragmentOp1ATI, - glColorFragmentOp2ATI, glColorFragmentOp3ATI, glAlphaFragmentOp1ATI, glAlphaFragmentOp2ATI, glAlphaFragmentOp3ATI, glSetFragmentShaderConstantATI, glMapObjectBufferATI, glUnmapObjectBufferATI, glPNTrianglesiATI, glPNTrianglesfATI, glStencilOpSeparateATI, glStencilFuncSeparateATI, glNewObjectBufferATI, glIsObjectBufferATI, glUpdateObjectBufferATI, glGetObjectBufferfvATI, - glGetObjectBufferivATI, glFreeObjectBufferATI, glArrayObjectATI, glGetArrayObjectfvATI, glGetArrayObjectivATI, glVariantArrayObjectATI, glGetVariantArrayObjectfvATI, glGetVariantArrayObjectivATI, glVertexAttribArrayObjectATI, glGetVertexAttribArrayObjectfvATI, glGetVertexAttribArrayObjectivATI, glVertexStream1sATI, glVertexStream1svATI, glVertexStream1iATI, glVertexStream1ivATI, glVertexStream1fATI, - glVertexStream1fvATI, glVertexStream1dATI, glVertexStream1dvATI, glVertexStream2sATI, glVertexStream2svATI, glVertexStream2iATI, glVertexStream2ivATI, glVertexStream2fATI, glVertexStream2fvATI, glVertexStream2dATI, glVertexStream2dvATI, glVertexStream3sATI, glVertexStream3svATI, glVertexStream3iATI, glVertexStream3ivATI, glVertexStream3fATI, - glVertexStream3fvATI, glVertexStream3dATI, glVertexStream3dvATI, glVertexStream4sATI, glVertexStream4svATI, glVertexStream4iATI, glVertexStream4ivATI, glVertexStream4fATI, glVertexStream4fvATI, glVertexStream4dATI, glVertexStream4dvATI, glNormalStream3bATI, glNormalStream3bvATI, glNormalStream3sATI, glNormalStream3svATI, glNormalStream3iATI, - glNormalStream3ivATI, glNormalStream3fATI, glNormalStream3fvATI, glNormalStream3dATI, glNormalStream3dvATI, glClientActiveVertexStreamATI, glVertexBlendEnviATI, glVertexBlendEnvfATI, glEGLImageTargetTexStorageEXT, glEGLImageTargetTextureStorageEXT, glUniformBufferEXT, glGetUniformBufferSizeEXT, glGetUniformOffsetEXT, glBlendColorEXT, glBlendEquationSeparateEXT, glBlendFuncSeparateEXT, - glBlendEquationEXT, glColorSubTableEXT, glCopyColorSubTableEXT, glLockArraysEXT, glUnlockArraysEXT, glConvolutionFilter1DEXT, glConvolutionFilter2DEXT, glConvolutionParameterfEXT, glConvolutionParameterfvEXT, glConvolutionParameteriEXT, glConvolutionParameterivEXT, glCopyConvolutionFilter1DEXT, glCopyConvolutionFilter2DEXT, glGetConvolutionFilterEXT, glGetConvolutionParameterfvEXT, glGetConvolutionParameterivEXT, - glGetSeparableFilterEXT, glSeparableFilter2DEXT, glTangent3bEXT, glTangent3bvEXT, glTangent3dEXT, glTangent3dvEXT, glTangent3fEXT, glTangent3fvEXT, glTangent3iEXT, glTangent3ivEXT, glTangent3sEXT, glTangent3svEXT, glBinormal3bEXT, glBinormal3bvEXT, glBinormal3dEXT, glBinormal3dvEXT, - glBinormal3fEXT, glBinormal3fvEXT, glBinormal3iEXT, glBinormal3ivEXT, glBinormal3sEXT, glBinormal3svEXT, glTangentPointerEXT, glBinormalPointerEXT, glCopyTexImage1DEXT, glCopyTexImage2DEXT, glCopyTexSubImage1DEXT, glCopyTexSubImage2DEXT, glCopyTexSubImage3DEXT, glCullParameterdvEXT, glCullParameterfvEXT, glLabelObjectEXT, - glGetObjectLabelEXT, glInsertEventMarkerEXT, glPushGroupMarkerEXT, glPopGroupMarkerEXT, glDepthBoundsEXT, glMatrixLoadfEXT, glMatrixLoaddEXT, glMatrixMultfEXT, glMatrixMultdEXT, glMatrixLoadIdentityEXT, glMatrixRotatefEXT, glMatrixRotatedEXT, glMatrixScalefEXT, glMatrixScaledEXT, glMatrixTranslatefEXT, glMatrixTranslatedEXT, - glMatrixFrustumEXT, glMatrixOrthoEXT, glMatrixPopEXT, glMatrixPushEXT, glClientAttribDefaultEXT, glPushClientAttribDefaultEXT, glTextureParameterfEXT, glTextureParameterfvEXT, glTextureParameteriEXT, glTextureParameterivEXT, glTextureImage1DEXT, glTextureImage2DEXT, glTextureSubImage1DEXT, glTextureSubImage2DEXT, glCopyTextureImage1DEXT, glCopyTextureImage2DEXT, - glCopyTextureSubImage1DEXT, glCopyTextureSubImage2DEXT, glGetTextureImageEXT, glGetTextureParameterfvEXT, glGetTextureParameterivEXT, glGetTextureLevelParameterfvEXT, glGetTextureLevelParameterivEXT, glTextureImage3DEXT, glTextureSubImage3DEXT, glCopyTextureSubImage3DEXT, glBindMultiTextureEXT, glMultiTexCoordPointerEXT, glMultiTexEnvfEXT, glMultiTexEnvfvEXT, glMultiTexEnviEXT, glMultiTexEnvivEXT, - glMultiTexGendEXT, glMultiTexGendvEXT, glMultiTexGenfEXT, glMultiTexGenfvEXT, glMultiTexGeniEXT, glMultiTexGenivEXT, glGetMultiTexEnvfvEXT, glGetMultiTexEnvivEXT, glGetMultiTexGendvEXT, glGetMultiTexGenfvEXT, glGetMultiTexGenivEXT, glMultiTexParameteriEXT, glMultiTexParameterivEXT, glMultiTexParameterfEXT, glMultiTexParameterfvEXT, glMultiTexImage1DEXT, - glMultiTexImage2DEXT, glMultiTexSubImage1DEXT, glMultiTexSubImage2DEXT, glCopyMultiTexImage1DEXT, glCopyMultiTexImage2DEXT, glCopyMultiTexSubImage1DEXT, glCopyMultiTexSubImage2DEXT, glGetMultiTexImageEXT, glGetMultiTexParameterfvEXT, glGetMultiTexParameterivEXT, glGetMultiTexLevelParameterfvEXT, glGetMultiTexLevelParameterivEXT, glMultiTexImage3DEXT, glMultiTexSubImage3DEXT, glCopyMultiTexSubImage3DEXT, glEnableClientStateIndexedEXT, - glDisableClientStateIndexedEXT, glGetFloatIndexedvEXT, glGetDoubleIndexedvEXT, glGetPointerIndexedvEXT, glEnableIndexedEXT, glDisableIndexedEXT, glIsEnabledIndexedEXT, glGetIntegerIndexedvEXT, glGetBooleanIndexedvEXT, glCompressedTextureImage3DEXT, glCompressedTextureImage2DEXT, glCompressedTextureImage1DEXT, glCompressedTextureSubImage3DEXT, glCompressedTextureSubImage2DEXT, glCompressedTextureSubImage1DEXT, glGetCompressedTextureImageEXT, - glCompressedMultiTexImage3DEXT, glCompressedMultiTexImage2DEXT, glCompressedMultiTexImage1DEXT, glCompressedMultiTexSubImage3DEXT, glCompressedMultiTexSubImage2DEXT, glCompressedMultiTexSubImage1DEXT, glGetCompressedMultiTexImageEXT, glMatrixLoadTransposefEXT, glMatrixLoadTransposedEXT, glMatrixMultTransposefEXT, glMatrixMultTransposedEXT, glNamedBufferDataEXT, glNamedBufferSubDataEXT, glMapNamedBufferEXT, glUnmapNamedBufferEXT, glGetNamedBufferParameterivEXT, - glGetNamedBufferPointervEXT, glGetNamedBufferSubDataEXT, glProgramUniform1fEXT, glProgramUniform2fEXT, glProgramUniform3fEXT, glProgramUniform4fEXT, glProgramUniform1iEXT, glProgramUniform2iEXT, glProgramUniform3iEXT, glProgramUniform4iEXT, glProgramUniform1fvEXT, glProgramUniform2fvEXT, glProgramUniform3fvEXT, glProgramUniform4fvEXT, glProgramUniform1ivEXT, glProgramUniform2ivEXT, - glProgramUniform3ivEXT, glProgramUniform4ivEXT, glProgramUniformMatrix2fvEXT, glProgramUniformMatrix3fvEXT, glProgramUniformMatrix4fvEXT, glProgramUniformMatrix2x3fvEXT, glProgramUniformMatrix3x2fvEXT, glProgramUniformMatrix2x4fvEXT, glProgramUniformMatrix4x2fvEXT, glProgramUniformMatrix3x4fvEXT, glProgramUniformMatrix4x3fvEXT, glTextureBufferEXT, glMultiTexBufferEXT, glTextureParameterIivEXT, glTextureParameterIuivEXT, glGetTextureParameterIivEXT, - glGetTextureParameterIuivEXT, glMultiTexParameterIivEXT, glMultiTexParameterIuivEXT, glGetMultiTexParameterIivEXT, glGetMultiTexParameterIuivEXT, glProgramUniform1uiEXT, glProgramUniform2uiEXT, glProgramUniform3uiEXT, glProgramUniform4uiEXT, glProgramUniform1uivEXT, glProgramUniform2uivEXT, glProgramUniform3uivEXT, glProgramUniform4uivEXT, glNamedProgramLocalParameters4fvEXT, glNamedProgramLocalParameterI4iEXT, glNamedProgramLocalParameterI4ivEXT, - glNamedProgramLocalParametersI4ivEXT, glNamedProgramLocalParameterI4uiEXT, glNamedProgramLocalParameterI4uivEXT, glNamedProgramLocalParametersI4uivEXT, glGetNamedProgramLocalParameterIivEXT, glGetNamedProgramLocalParameterIuivEXT, glEnableClientStateiEXT, glDisableClientStateiEXT, glGetFloati_vEXT, glGetDoublei_vEXT, glGetPointeri_vEXT, glNamedProgramStringEXT, glNamedProgramLocalParameter4dEXT, glNamedProgramLocalParameter4dvEXT, glNamedProgramLocalParameter4fEXT, glNamedProgramLocalParameter4fvEXT, - glGetNamedProgramLocalParameterdvEXT, glGetNamedProgramLocalParameterfvEXT, glGetNamedProgramivEXT, glGetNamedProgramStringEXT, glNamedRenderbufferStorageEXT, glGetNamedRenderbufferParameterivEXT, glNamedRenderbufferStorageMultisampleEXT, glNamedRenderbufferStorageMultisampleCoverageEXT, glCheckNamedFramebufferStatusEXT, glNamedFramebufferTexture1DEXT, glNamedFramebufferTexture2DEXT, glNamedFramebufferTexture3DEXT, glNamedFramebufferRenderbufferEXT, glGetNamedFramebufferAttachmentParameterivEXT, glGenerateTextureMipmapEXT, glGenerateMultiTexMipmapEXT, - glFramebufferDrawBufferEXT, glFramebufferDrawBuffersEXT, glFramebufferReadBufferEXT, glGetFramebufferParameterivEXT, glNamedCopyBufferSubDataEXT, glNamedFramebufferTextureEXT, glNamedFramebufferTextureLayerEXT, glNamedFramebufferTextureFaceEXT, glTextureRenderbufferEXT, glMultiTexRenderbufferEXT, glVertexArrayVertexOffsetEXT, glVertexArrayColorOffsetEXT, glVertexArrayEdgeFlagOffsetEXT, glVertexArrayIndexOffsetEXT, glVertexArrayNormalOffsetEXT, glVertexArrayTexCoordOffsetEXT, - glVertexArrayMultiTexCoordOffsetEXT, glVertexArrayFogCoordOffsetEXT, glVertexArraySecondaryColorOffsetEXT, glVertexArrayVertexAttribOffsetEXT, glVertexArrayVertexAttribIOffsetEXT, glEnableVertexArrayEXT, glDisableVertexArrayEXT, glEnableVertexArrayAttribEXT, glDisableVertexArrayAttribEXT, glGetVertexArrayIntegervEXT, glGetVertexArrayPointervEXT, glGetVertexArrayIntegeri_vEXT, glGetVertexArrayPointeri_vEXT, glMapNamedBufferRangeEXT, glFlushMappedNamedBufferRangeEXT, glNamedBufferStorageEXT, - glClearNamedBufferDataEXT, glClearNamedBufferSubDataEXT, glNamedFramebufferParameteriEXT, glGetNamedFramebufferParameterivEXT, glProgramUniform1dEXT, glProgramUniform2dEXT, glProgramUniform3dEXT, glProgramUniform4dEXT, glProgramUniform1dvEXT, glProgramUniform2dvEXT, glProgramUniform3dvEXT, glProgramUniform4dvEXT, glProgramUniformMatrix2dvEXT, glProgramUniformMatrix3dvEXT, glProgramUniformMatrix4dvEXT, glProgramUniformMatrix2x3dvEXT, - glProgramUniformMatrix2x4dvEXT, glProgramUniformMatrix3x2dvEXT, glProgramUniformMatrix3x4dvEXT, glProgramUniformMatrix4x2dvEXT, glProgramUniformMatrix4x3dvEXT, glTextureBufferRangeEXT, glTextureStorage1DEXT, glTextureStorage2DEXT, glTextureStorage3DEXT, glTextureStorage2DMultisampleEXT, glTextureStorage3DMultisampleEXT, glVertexArrayBindVertexBufferEXT, glVertexArrayVertexAttribFormatEXT, glVertexArrayVertexAttribIFormatEXT, glVertexArrayVertexAttribLFormatEXT, glVertexArrayVertexAttribBindingEXT, - glVertexArrayVertexBindingDivisorEXT, glVertexArrayVertexAttribLOffsetEXT, glTexturePageCommitmentEXT, glVertexArrayVertexAttribDivisorEXT, glColorMaskIndexedEXT, glDrawArraysInstancedEXT, glDrawElementsInstancedEXT, glDrawRangeElementsEXT, glBufferStorageExternalEXT, glNamedBufferStorageExternalEXT, glFogCoordfEXT, glFogCoordfvEXT, glFogCoorddEXT, glFogCoorddvEXT, glFogCoordPointerEXT, glBlitFramebufferEXT, - glBlitFramebufferLayersEXT, glBlitFramebufferLayerEXT, glRenderbufferStorageMultisampleEXT, glIsRenderbufferEXT, glBindRenderbufferEXT, glDeleteRenderbuffersEXT, glGenRenderbuffersEXT, glRenderbufferStorageEXT, glGetRenderbufferParameterivEXT, glIsFramebufferEXT, glBindFramebufferEXT, glDeleteFramebuffersEXT, glGenFramebuffersEXT, glCheckFramebufferStatusEXT, glFramebufferTexture1DEXT, glFramebufferTexture2DEXT, - glFramebufferTexture3DEXT, glFramebufferRenderbufferEXT, glGetFramebufferAttachmentParameterivEXT, glGenerateMipmapEXT, glProgramParameteriEXT, glProgramEnvParameters4fvEXT, glProgramLocalParameters4fvEXT, glGetUniformuivEXT, glBindFragDataLocationEXT, glGetFragDataLocationEXT, glUniform1uiEXT, glUniform2uiEXT, glUniform3uiEXT, glUniform4uiEXT, glUniform1uivEXT, glUniform2uivEXT, - glUniform3uivEXT, glUniform4uivEXT, glVertexAttribI1iEXT, glVertexAttribI2iEXT, glVertexAttribI3iEXT, glVertexAttribI4iEXT, glVertexAttribI1uiEXT, glVertexAttribI2uiEXT, glVertexAttribI3uiEXT, glVertexAttribI4uiEXT, glVertexAttribI1ivEXT, glVertexAttribI2ivEXT, glVertexAttribI3ivEXT, glVertexAttribI4ivEXT, glVertexAttribI1uivEXT, glVertexAttribI2uivEXT, - glVertexAttribI3uivEXT, glVertexAttribI4uivEXT, glVertexAttribI4bvEXT, glVertexAttribI4svEXT, glVertexAttribI4ubvEXT, glVertexAttribI4usvEXT, glVertexAttribIPointerEXT, glGetVertexAttribIivEXT, glGetVertexAttribIuivEXT, glGetHistogramEXT, glGetHistogramParameterfvEXT, glGetHistogramParameterivEXT, glGetMinmaxEXT, glGetMinmaxParameterfvEXT, glGetMinmaxParameterivEXT, glHistogramEXT, - glMinmaxEXT, glResetHistogramEXT, glResetMinmaxEXT, glIndexFuncEXT, glIndexMaterialEXT, glApplyTextureEXT, glTextureLightEXT, glTextureMaterialEXT, glGetUnsignedBytevEXT, glGetUnsignedBytei_vEXT, glDeleteMemoryObjectsEXT, glIsMemoryObjectEXT, glCreateMemoryObjectsEXT, glMemoryObjectParameterivEXT, glGetMemoryObjectParameterivEXT, glTexStorageMem2DEXT, - glTexStorageMem2DMultisampleEXT, glTexStorageMem3DEXT, glTexStorageMem3DMultisampleEXT, glBufferStorageMemEXT, glTextureStorageMem2DEXT, glTextureStorageMem2DMultisampleEXT, glTextureStorageMem3DEXT, glTextureStorageMem3DMultisampleEXT, glNamedBufferStorageMemEXT, glTexStorageMem1DEXT, glTextureStorageMem1DEXT, glImportMemoryFdEXT, glImportMemoryWin32HandleEXT, glImportMemoryWin32NameEXT, glMultiDrawArraysEXT, glMultiDrawElementsEXT, - glSampleMaskEXT, glSamplePatternEXT, glColorTableEXT, glGetColorTableEXT, glGetColorTableParameterivEXT, glGetColorTableParameterfvEXT, glPixelTransformParameteriEXT, glPixelTransformParameterfEXT, glPixelTransformParameterivEXT, glPixelTransformParameterfvEXT, glGetPixelTransformParameterivEXT, glGetPixelTransformParameterfvEXT, glPointParameterfEXT, glPointParameterfvEXT, glPolygonOffsetEXT, glPolygonOffsetClampEXT, - glProvokingVertexEXT, glRasterSamplesEXT, glSecondaryColor3bEXT, glSecondaryColor3bvEXT, glSecondaryColor3dEXT, glSecondaryColor3dvEXT, glSecondaryColor3fEXT, glSecondaryColor3fvEXT, glSecondaryColor3iEXT, glSecondaryColor3ivEXT, glSecondaryColor3sEXT, glSecondaryColor3svEXT, glSecondaryColor3ubEXT, glSecondaryColor3ubvEXT, glSecondaryColor3uiEXT, glSecondaryColor3uivEXT, - glSecondaryColor3usEXT, glSecondaryColor3usvEXT, glSecondaryColorPointerEXT, glGenSemaphoresEXT, glDeleteSemaphoresEXT, glIsSemaphoreEXT, glSemaphoreParameterui64vEXT, glGetSemaphoreParameterui64vEXT, glWaitSemaphoreEXT, glSignalSemaphoreEXT, glImportSemaphoreFdEXT, glImportSemaphoreWin32HandleEXT, glImportSemaphoreWin32NameEXT, glUseShaderProgramEXT, glActiveProgramEXT, glCreateShaderProgramEXT, - glFramebufferFetchBarrierEXT, glBindImageTextureEXT, glMemoryBarrierEXT, glStencilClearTagEXT, glActiveStencilFaceEXT, glTexSubImage1DEXT, glTexSubImage2DEXT, glTexImage3DEXT, glTexSubImage3DEXT, glFramebufferTextureLayerEXT, glTexBufferEXT, glTexParameterIivEXT, glTexParameterIuivEXT, glGetTexParameterIivEXT, glGetTexParameterIuivEXT, glClearColorIiEXT, - glClearColorIuiEXT, glAreTexturesResidentEXT, glBindTextureEXT, glDeleteTexturesEXT, glGenTexturesEXT, glIsTextureEXT, glPrioritizeTexturesEXT, glTextureNormalEXT, glTexStorage1DEXT, glTexStorage2DEXT, glTexStorage3DEXT, glGetQueryObjecti64vEXT, glGetQueryObjectui64vEXT, glBeginTransformFeedbackEXT, glEndTransformFeedbackEXT, glBindBufferRangeEXT, - glBindBufferOffsetEXT, glBindBufferBaseEXT, glTransformFeedbackVaryingsEXT, glGetTransformFeedbackVaryingEXT, glArrayElementEXT, glColorPointerEXT, glDrawArraysEXT, glEdgeFlagPointerEXT, glGetPointervEXT, glIndexPointerEXT, glNormalPointerEXT, glTexCoordPointerEXT, glVertexPointerEXT, glVertexAttribL1dEXT, glVertexAttribL2dEXT, glVertexAttribL3dEXT, - glVertexAttribL4dEXT, glVertexAttribL1dvEXT, glVertexAttribL2dvEXT, glVertexAttribL3dvEXT, glVertexAttribL4dvEXT, glVertexAttribLPointerEXT, glGetVertexAttribLdvEXT, glBeginVertexShaderEXT, glEndVertexShaderEXT, glBindVertexShaderEXT, glGenVertexShadersEXT, glDeleteVertexShaderEXT, glShaderOp1EXT, glShaderOp2EXT, glShaderOp3EXT, glSwizzleEXT, - glWriteMaskEXT, glInsertComponentEXT, glExtractComponentEXT, glGenSymbolsEXT, glSetInvariantEXT, glSetLocalConstantEXT, glVariantbvEXT, glVariantsvEXT, glVariantivEXT, glVariantfvEXT, glVariantdvEXT, glVariantubvEXT, glVariantusvEXT, glVariantuivEXT, glVariantPointerEXT, glEnableVariantClientStateEXT, - glDisableVariantClientStateEXT, glBindLightParameterEXT, glBindMaterialParameterEXT, glBindTexGenParameterEXT, glBindTextureUnitParameterEXT, glBindParameterEXT, glIsVariantEnabledEXT, glGetVariantBooleanvEXT, glGetVariantIntegervEXT, glGetVariantFloatvEXT, glGetVariantPointervEXT, glGetInvariantBooleanvEXT, glGetInvariantIntegervEXT, glGetInvariantFloatvEXT, glGetLocalConstantBooleanvEXT, glGetLocalConstantIntegervEXT, - glGetLocalConstantFloatvEXT, glVertexWeightfEXT, glVertexWeightfvEXT, glVertexWeightPointerEXT, glAcquireKeyedMutexWin32EXT, glReleaseKeyedMutexWin32EXT, glWindowRectanglesEXT, glImportSyncEXT, glFrameTerminatorGREMEDY, glStringMarkerGREMEDY, glImageTransformParameteriHP, glImageTransformParameterfHP, glImageTransformParameterivHP, glImageTransformParameterfvHP, glGetImageTransformParameterivHP, glGetImageTransformParameterfvHP, - glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, glFlushStaticDataIBM, glColorPointerListIBM, glSecondaryColorPointerListIBM, glEdgeFlagPointerListIBM, glFogCoordPointerListIBM, glIndexPointerListIBM, glNormalPointerListIBM, glTexCoordPointerListIBM, glVertexPointerListIBM, glBlendFuncSeparateINGR, glApplyFramebufferAttachmentCMAAINTEL, glSyncTextureINTEL, glUnmapTexture2DINTEL, glMapTexture2DINTEL, - glVertexPointervINTEL, glNormalPointervINTEL, glColorPointervINTEL, glTexCoordPointervINTEL, glBeginPerfQueryINTEL, glCreatePerfQueryINTEL, glDeletePerfQueryINTEL, glEndPerfQueryINTEL, glGetFirstPerfQueryIdINTEL, glGetNextPerfQueryIdINTEL, glGetPerfCounterInfoINTEL, glGetPerfQueryDataINTEL, glGetPerfQueryIdByNameINTEL, glGetPerfQueryInfoINTEL, glFramebufferParameteriMESA, glGetFramebufferParameterivMESA, - glResizeBuffersMESA, glWindowPos2dMESA, glWindowPos2dvMESA, glWindowPos2fMESA, glWindowPos2fvMESA, glWindowPos2iMESA, glWindowPos2ivMESA, glWindowPos2sMESA, glWindowPos2svMESA, glWindowPos3dMESA, glWindowPos3dvMESA, glWindowPos3fMESA, glWindowPos3fvMESA, glWindowPos3iMESA, glWindowPos3ivMESA, glWindowPos3sMESA, - glWindowPos3svMESA, glWindowPos4dMESA, glWindowPos4dvMESA, glWindowPos4fMESA, glWindowPos4fvMESA, glWindowPos4iMESA, glWindowPos4ivMESA, glWindowPos4sMESA, glWindowPos4svMESA, glBeginConditionalRenderNVX, glEndConditionalRenderNVX, glUploadGpuMaskNVX, glMulticastViewportArrayvNVX, glMulticastViewportPositionWScaleNVX, glMulticastScissorArrayvNVX, glAsyncCopyBufferSubDataNVX, - glAsyncCopyImageSubDataNVX, glLGPUNamedBufferSubDataNVX, glLGPUCopyImageSubDataNVX, glLGPUInterlockNVX, glCreateProgressFenceNVX, glSignalSemaphoreui64NVX, glWaitSemaphoreui64NVX, glClientWaitSemaphoreui64NVX, glAlphaToCoverageDitherControlNV, glMultiDrawArraysIndirectBindlessNV, glMultiDrawElementsIndirectBindlessNV, glMultiDrawArraysIndirectBindlessCountNV, glMultiDrawElementsIndirectBindlessCountNV, glGetTextureHandleNV, glGetTextureSamplerHandleNV, glMakeTextureHandleResidentNV, - glMakeTextureHandleNonResidentNV, glGetImageHandleNV, glMakeImageHandleResidentNV, glMakeImageHandleNonResidentNV, glUniformHandleui64NV, glUniformHandleui64vNV, glProgramUniformHandleui64NV, glProgramUniformHandleui64vNV, glIsTextureHandleResidentNV, glIsImageHandleResidentNV, glBlendParameteriNV, glBlendBarrierNV, glViewportPositionWScaleNV, glCreateStatesNV, glDeleteStatesNV, glIsStateNV, - glStateCaptureNV, glGetCommandHeaderNV, glGetStageIndexNV, glDrawCommandsNV, glDrawCommandsAddressNV, glDrawCommandsStatesNV, glDrawCommandsStatesAddressNV, glCreateCommandListsNV, glDeleteCommandListsNV, glIsCommandListNV, glListDrawCommandsStatesClientNV, glCommandListSegmentsNV, glCompileCommandListNV, glCallCommandListNV, glBeginConditionalRenderNV, glEndConditionalRenderNV, - glSubpixelPrecisionBiasNV, glConservativeRasterParameterfNV, glConservativeRasterParameteriNV, glCopyImageSubDataNV, glDepthRangedNV, glClearDepthdNV, glDepthBoundsdNV, glDrawTextureNV, glDrawVkImageNV, glGetVkProcAddrNV, glWaitVkSemaphoreNV, glSignalVkSemaphoreNV, glSignalVkFenceNV, glMapControlPointsNV, glMapParameterivNV, glMapParameterfvNV, - glGetMapControlPointsNV, glGetMapParameterivNV, glGetMapParameterfvNV, glGetMapAttribParameterivNV, glGetMapAttribParameterfvNV, glEvalMapsNV, glGetMultisamplefvNV, glSampleMaskIndexedNV, glTexRenderbufferNV, glDeleteFencesNV, glGenFencesNV, glIsFenceNV, glTestFenceNV, glGetFenceivNV, glFinishFenceNV, glSetFenceNV, - glFragmentCoverageColorNV, glProgramNamedParameter4fNV, glProgramNamedParameter4fvNV, glProgramNamedParameter4dNV, glProgramNamedParameter4dvNV, glGetProgramNamedParameterfvNV, glGetProgramNamedParameterdvNV, glCoverageModulationTableNV, glGetCoverageModulationTableNV, glCoverageModulationNV, glRenderbufferStorageMultisampleCoverageNV, glProgramVertexLimitNV, glFramebufferTextureEXT, glFramebufferTextureFaceEXT, glRenderGpuMaskNV, glMulticastBufferSubDataNV, - glMulticastCopyBufferSubDataNV, glMulticastCopyImageSubDataNV, glMulticastBlitFramebufferNV, glMulticastFramebufferSampleLocationsfvNV, glMulticastBarrierNV, glMulticastWaitSyncNV, glMulticastGetQueryObjectivNV, glMulticastGetQueryObjectuivNV, glMulticastGetQueryObjecti64vNV, glMulticastGetQueryObjectui64vNV, glProgramLocalParameterI4iNV, glProgramLocalParameterI4ivNV, glProgramLocalParametersI4ivNV, glProgramLocalParameterI4uiNV, glProgramLocalParameterI4uivNV, glProgramLocalParametersI4uivNV, - glProgramEnvParameterI4iNV, glProgramEnvParameterI4ivNV, glProgramEnvParametersI4ivNV, glProgramEnvParameterI4uiNV, glProgramEnvParameterI4uivNV, glProgramEnvParametersI4uivNV, glGetProgramLocalParameterIivNV, glGetProgramLocalParameterIuivNV, glGetProgramEnvParameterIivNV, glGetProgramEnvParameterIuivNV, glProgramSubroutineParametersuivNV, glGetProgramSubroutineParameteruivNV, glVertex2hNV, glVertex2hvNV, glVertex3hNV, glVertex3hvNV, - glVertex4hNV, glVertex4hvNV, glNormal3hNV, glNormal3hvNV, glColor3hNV, glColor3hvNV, glColor4hNV, glColor4hvNV, glTexCoord1hNV, glTexCoord1hvNV, glTexCoord2hNV, glTexCoord2hvNV, glTexCoord3hNV, glTexCoord3hvNV, glTexCoord4hNV, glTexCoord4hvNV, - glMultiTexCoord1hNV, glMultiTexCoord1hvNV, glMultiTexCoord2hNV, glMultiTexCoord2hvNV, glMultiTexCoord3hNV, glMultiTexCoord3hvNV, glMultiTexCoord4hNV, glMultiTexCoord4hvNV, glVertexAttrib1hNV, glVertexAttrib1hvNV, glVertexAttrib2hNV, glVertexAttrib2hvNV, glVertexAttrib3hNV, glVertexAttrib3hvNV, glVertexAttrib4hNV, glVertexAttrib4hvNV, - glVertexAttribs1hvNV, glVertexAttribs2hvNV, glVertexAttribs3hvNV, glVertexAttribs4hvNV, glFogCoordhNV, glFogCoordhvNV, glSecondaryColor3hNV, glSecondaryColor3hvNV, glVertexWeighthNV, glVertexWeighthvNV, glGetInternalformatSampleivNV, glGetMemoryObjectDetachedResourcesuivNV, glResetMemoryObjectParameterNV, glTexAttachMemoryNV, glBufferAttachMemoryNV, glTextureAttachMemoryNV, - glNamedBufferAttachMemoryNV, glBufferPageCommitmentMemNV, glTexPageCommitmentMemNV, glNamedBufferPageCommitmentMemNV, glTexturePageCommitmentMemNV, glDrawMeshTasksNV, glDrawMeshTasksIndirectNV, glMultiDrawMeshTasksIndirectNV, glMultiDrawMeshTasksIndirectCountNV, glGenOcclusionQueriesNV, glDeleteOcclusionQueriesNV, glIsOcclusionQueryNV, glBeginOcclusionQueryNV, glEndOcclusionQueryNV, glGetOcclusionQueryivNV, glGetOcclusionQueryuivNV, - glProgramBufferParametersfvNV, glProgramBufferParametersIivNV, glProgramBufferParametersIuivNV, glGenPathsNV, glDeletePathsNV, glIsPathNV, glPathCommandsNV, glPathCoordsNV, glPathSubCommandsNV, glPathSubCoordsNV, glPathStringNV, glPathGlyphsNV, glPathGlyphRangeNV, glWeightPathsNV, glCopyPathNV, glInterpolatePathsNV, - glTransformPathNV, glPathParameterivNV, glPathParameteriNV, glPathParameterfvNV, glPathParameterfNV, glPathDashArrayNV, glPathStencilFuncNV, glPathStencilDepthOffsetNV, glStencilFillPathNV, glStencilStrokePathNV, glStencilFillPathInstancedNV, glStencilStrokePathInstancedNV, glPathCoverDepthFuncNV, glCoverFillPathNV, glCoverStrokePathNV, glCoverFillPathInstancedNV, - glCoverStrokePathInstancedNV, glGetPathParameterivNV, glGetPathParameterfvNV, glGetPathCommandsNV, glGetPathCoordsNV, glGetPathDashArrayNV, glGetPathMetricsNV, glGetPathMetricRangeNV, glGetPathSpacingNV, glIsPointInFillPathNV, glIsPointInStrokePathNV, glGetPathLengthNV, glPointAlongPathNV, glMatrixLoad3x2fNV, glMatrixLoad3x3fNV, glMatrixLoadTranspose3x3fNV, - glMatrixMult3x2fNV, glMatrixMult3x3fNV, glMatrixMultTranspose3x3fNV, glStencilThenCoverFillPathNV, glStencilThenCoverStrokePathNV, glStencilThenCoverFillPathInstancedNV, glStencilThenCoverStrokePathInstancedNV, glPathGlyphIndexRangeNV, glPathGlyphIndexArrayNV, glPathMemoryGlyphIndexArrayNV, glProgramPathFragmentInputGenNV, glGetProgramResourcefvNV, glPathColorGenNV, glPathTexGenNV, glPathFogGenNV, glGetPathColorGenivNV, - glGetPathColorGenfvNV, glGetPathTexGenivNV, glGetPathTexGenfvNV, glPixelDataRangeNV, glFlushPixelDataRangeNV, glPointParameteriNV, glPointParameterivNV, glPresentFrameKeyedNV, glPresentFrameDualFillNV, glGetVideoivNV, glGetVideouivNV, glGetVideoi64vNV, glGetVideoui64vNV, glPrimitiveRestartNV, glPrimitiveRestartIndexNV, glQueryResourceNV, - glGenQueryResourceTagNV, glDeleteQueryResourceTagNV, glQueryResourceTagNV, glCombinerParameterfvNV, glCombinerParameterfNV, glCombinerParameterivNV, glCombinerParameteriNV, glCombinerInputNV, glCombinerOutputNV, glFinalCombinerInputNV, glGetCombinerInputParameterfvNV, glGetCombinerInputParameterivNV, glGetCombinerOutputParameterfvNV, glGetCombinerOutputParameterivNV, glGetFinalCombinerInputParameterfvNV, glGetFinalCombinerInputParameterivNV, - glCombinerStageParameterfvNV, glGetCombinerStageParameterfvNV, glFramebufferSampleLocationsfvNV, glNamedFramebufferSampleLocationsfvNV, glResolveDepthValuesNV, glScissorExclusiveNV, glScissorExclusiveArrayvNV, glMakeBufferResidentNV, glMakeBufferNonResidentNV, glIsBufferResidentNV, glMakeNamedBufferResidentNV, glMakeNamedBufferNonResidentNV, glIsNamedBufferResidentNV, glGetBufferParameterui64vNV, glGetNamedBufferParameterui64vNV, glGetIntegerui64vNV, - glUniformui64NV, glUniformui64vNV, glProgramUniformui64NV, glProgramUniformui64vNV, glBindShadingRateImageNV, glGetShadingRateImagePaletteNV, glGetShadingRateSampleLocationivNV, glShadingRateImageBarrierNV, glShadingRateImagePaletteNV, glShadingRateSampleOrderNV, glShadingRateSampleOrderCustomNV, glTextureBarrierNV, glTexImage2DMultisampleCoverageNV, glTexImage3DMultisampleCoverageNV, glTextureImage2DMultisampleNV, glTextureImage3DMultisampleNV, - glTextureImage2DMultisampleCoverageNV, glTextureImage3DMultisampleCoverageNV, glCreateSemaphoresNV, glSemaphoreParameterivNV, glGetSemaphoreParameterivNV, glBeginTransformFeedbackNV, glEndTransformFeedbackNV, glTransformFeedbackAttribsNV, glBindBufferRangeNV, glBindBufferOffsetNV, glBindBufferBaseNV, glTransformFeedbackVaryingsNV, glActiveVaryingNV, glGetVaryingLocationNV, glGetActiveVaryingNV, glGetTransformFeedbackVaryingNV, - glTransformFeedbackStreamAttribsNV, glBindTransformFeedbackNV, glDeleteTransformFeedbacksNV, glGenTransformFeedbacksNV, glIsTransformFeedbackNV, glPauseTransformFeedbackNV, glResumeTransformFeedbackNV, glDrawTransformFeedbackNV, glVDPAUInitNV, glVDPAUFiniNV, glVDPAURegisterVideoSurfaceNV, glVDPAURegisterOutputSurfaceNV, glVDPAUIsSurfaceNV, glVDPAUUnregisterSurfaceNV, glVDPAUGetSurfaceivNV, glVDPAUSurfaceAccessNV, - glVDPAUMapSurfacesNV, glVDPAUUnmapSurfacesNV, glVDPAURegisterVideoSurfaceWithPictureStructureNV, glFlushVertexArrayRangeNV, glVertexArrayRangeNV, glVertexAttribL1i64NV, glVertexAttribL2i64NV, glVertexAttribL3i64NV, glVertexAttribL4i64NV, glVertexAttribL1i64vNV, glVertexAttribL2i64vNV, glVertexAttribL3i64vNV, glVertexAttribL4i64vNV, glVertexAttribL1ui64NV, glVertexAttribL2ui64NV, glVertexAttribL3ui64NV, - glVertexAttribL4ui64NV, glVertexAttribL1ui64vNV, glVertexAttribL2ui64vNV, glVertexAttribL3ui64vNV, glVertexAttribL4ui64vNV, glGetVertexAttribLi64vNV, glGetVertexAttribLui64vNV, glVertexAttribLFormatNV, glBufferAddressRangeNV, glVertexFormatNV, glNormalFormatNV, glColorFormatNV, glIndexFormatNV, glTexCoordFormatNV, glEdgeFlagFormatNV, glSecondaryColorFormatNV, - glFogCoordFormatNV, glVertexAttribFormatNV, glVertexAttribIFormatNV, glGetIntegerui64i_vNV, glAreProgramsResidentNV, glBindProgramNV, glDeleteProgramsNV, glExecuteProgramNV, glGenProgramsNV, glGetProgramParameterdvNV, glGetProgramParameterfvNV, glGetProgramivNV, glGetProgramStringNV, glGetTrackMatrixivNV, glGetVertexAttribdvNV, glGetVertexAttribfvNV, - glGetVertexAttribivNV, glGetVertexAttribPointervNV, glIsProgramNV, glLoadProgramNV, glProgramParameter4dNV, glProgramParameter4dvNV, glProgramParameter4fNV, glProgramParameter4fvNV, glProgramParameters4dvNV, glProgramParameters4fvNV, glRequestResidentProgramsNV, glTrackMatrixNV, glVertexAttribPointerNV, glVertexAttrib1dNV, glVertexAttrib1dvNV, glVertexAttrib1fNV, - glVertexAttrib1fvNV, glVertexAttrib1sNV, glVertexAttrib1svNV, glVertexAttrib2dNV, glVertexAttrib2dvNV, glVertexAttrib2fNV, glVertexAttrib2fvNV, glVertexAttrib2sNV, glVertexAttrib2svNV, glVertexAttrib3dNV, glVertexAttrib3dvNV, glVertexAttrib3fNV, glVertexAttrib3fvNV, glVertexAttrib3sNV, glVertexAttrib3svNV, glVertexAttrib4dNV, - glVertexAttrib4dvNV, glVertexAttrib4fNV, glVertexAttrib4fvNV, glVertexAttrib4sNV, glVertexAttrib4svNV, glVertexAttrib4ubNV, glVertexAttrib4ubvNV, glVertexAttribs1dvNV, glVertexAttribs1fvNV, glVertexAttribs1svNV, glVertexAttribs2dvNV, glVertexAttribs2fvNV, glVertexAttribs2svNV, glVertexAttribs3dvNV, glVertexAttribs3fvNV, glVertexAttribs3svNV, - glVertexAttribs4dvNV, glVertexAttribs4fvNV, glVertexAttribs4svNV, glVertexAttribs4ubvNV, glBeginVideoCaptureNV, glBindVideoCaptureStreamBufferNV, glBindVideoCaptureStreamTextureNV, glEndVideoCaptureNV, glGetVideoCaptureivNV, glGetVideoCaptureStreamivNV, glGetVideoCaptureStreamfvNV, glGetVideoCaptureStreamdvNV, glVideoCaptureNV, glVideoCaptureStreamParameterivNV, glVideoCaptureStreamParameterfvNV, glVideoCaptureStreamParameterdvNV, - glViewportSwizzleNV, glFramebufferTextureMultiviewOVR, glHintPGI, glDetailTexFuncSGIS, glGetDetailTexFuncSGIS, glFogFuncSGIS, glGetFogFuncSGIS, glSampleMaskSGIS, glSamplePatternSGIS, glPixelTexGenParameteriSGIS, glPixelTexGenParameterivSGIS, glPixelTexGenParameterfSGIS, glPixelTexGenParameterfvSGIS, glGetPixelTexGenParameterivSGIS, glGetPixelTexGenParameterfvSGIS, glPointParameterfSGIS, - glPointParameterfvSGIS, glSharpenTexFuncSGIS, glGetSharpenTexFuncSGIS, glTexImage4DSGIS, glTexSubImage4DSGIS, glTextureColorMaskSGIS, glGetTexFilterFuncSGIS, glTexFilterFuncSGIS, glAsyncMarkerSGIX, glFinishAsyncSGIX, glPollAsyncSGIX, glGenAsyncMarkersSGIX, glDeleteAsyncMarkersSGIX, glIsAsyncMarkerSGIX, glFlushRasterSGIX, glFragmentColorMaterialSGIX, - glFragmentLightfSGIX, glFragmentLightfvSGIX, glFragmentLightiSGIX, glFragmentLightivSGIX, glFragmentLightModelfSGIX, glFragmentLightModelfvSGIX, glFragmentLightModeliSGIX, glFragmentLightModelivSGIX, glFragmentMaterialfSGIX, glFragmentMaterialfvSGIX, glFragmentMaterialiSGIX, glFragmentMaterialivSGIX, glGetFragmentLightfvSGIX, glGetFragmentLightivSGIX, glGetFragmentMaterialfvSGIX, glGetFragmentMaterialivSGIX, - glLightEnviSGIX, glFrameZoomSGIX, glIglooInterfaceSGIX, glGetInstrumentsSGIX, glInstrumentsBufferSGIX, glPollInstrumentsSGIX, glReadInstrumentsSGIX, glStartInstrumentsSGIX, glStopInstrumentsSGIX, glGetListParameterfvSGIX, glGetListParameterivSGIX, glListParameterfSGIX, glListParameterfvSGIX, glListParameteriSGIX, glListParameterivSGIX, glPixelTexGenSGIX, - glDeformationMap3dSGIX, glDeformationMap3fSGIX, glDeformSGIX, glLoadIdentityDeformationMapSGIX, glReferencePlaneSGIX, glSpriteParameterfSGIX, glSpriteParameterfvSGIX, glSpriteParameteriSGIX, glSpriteParameterivSGIX, glTagSampleBufferSGIX, glColorTableSGI, glColorTableParameterfvSGI, glColorTableParameterivSGI, glCopyColorTableSGI, glGetColorTableSGI, glGetColorTableParameterfvSGI, - glGetColorTableParameterivSGI, glFinishTextureSUNX, glGlobalAlphaFactorbSUN, glGlobalAlphaFactorsSUN, glGlobalAlphaFactoriSUN, glGlobalAlphaFactorfSUN, glGlobalAlphaFactordSUN, glGlobalAlphaFactorubSUN, glGlobalAlphaFactorusSUN, glGlobalAlphaFactoruiSUN, glDrawMeshArraysSUN, glReplacementCodeuiSUN, glReplacementCodeusSUN, glReplacementCodeubSUN, glReplacementCodeuivSUN, glReplacementCodeusvSUN, - glReplacementCodeubvSUN, glReplacementCodePointerSUN, glColor4ubVertex2fSUN, glColor4ubVertex2fvSUN, glColor4ubVertex3fSUN, glColor4ubVertex3fvSUN, glColor3fVertex3fSUN, glColor3fVertex3fvSUN, glNormal3fVertex3fSUN, glNormal3fVertex3fvSUN, glColor4fNormal3fVertex3fSUN, glColor4fNormal3fVertex3fvSUN, glTexCoord2fVertex3fSUN, glTexCoord2fVertex3fvSUN, glTexCoord4fVertex4fSUN, glTexCoord4fVertex4fvSUN, - glTexCoord2fColor4ubVertex3fSUN, glTexCoord2fColor4ubVertex3fvSUN, glTexCoord2fColor3fVertex3fSUN, glTexCoord2fColor3fVertex3fvSUN, glTexCoord2fNormal3fVertex3fSUN, glTexCoord2fNormal3fVertex3fvSUN, glTexCoord2fColor4fNormal3fVertex3fSUN, glTexCoord2fColor4fNormal3fVertex3fvSUN, glTexCoord4fColor4fNormal3fVertex4fSUN, glTexCoord4fColor4fNormal3fVertex4fvSUN, glReplacementCodeuiVertex3fSUN, glReplacementCodeuiVertex3fvSUN, glReplacementCodeuiColor4ubVertex3fSUN, glReplacementCodeuiColor4ubVertex3fvSUN, glReplacementCodeuiColor3fVertex3fSUN, glReplacementCodeuiColor3fVertex3fvSUN, - glReplacementCodeuiNormal3fVertex3fSUN, glReplacementCodeuiNormal3fVertex3fvSUN, glReplacementCodeuiColor4fNormal3fVertex3fSUN, glReplacementCodeuiColor4fNormal3fVertex3fvSUN, glReplacementCodeuiTexCoord2fVertex3fSUN, glReplacementCodeuiTexCoord2fVertex3fvSUN, glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN, glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN, glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN, glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; - - void load(GLLoadFunc load) { - GLARBES32Compatibility.load(this, load); - GLARBBindlessTexture.load(this, load); - GLARBCLEvent.load(this, load); - GLARBColorBufferFloat.load(this, load); - GLARBComputeVariableGroupSize.load(this, load); - GLARBDebugOutput.load(this, load); - GLARBDrawBuffers.load(this, load); - GLARBDrawBuffersBlend.load(this, load); - GLARBDrawInstanced.load(this, load); - GLARBFragmentProgram.load(this, load); - GLARBGeometryShader4.load(this, load); - GLARBGLSpirv.load(this, load); - GLARBGpuShaderInt64.load(this, load); - GLARBImaging.load(this, load); - GLARBIndirectParameters.load(this, load); - GLARBInstancedArrays.load(this, load); - GLARBMatrixPalette.load(this, load); - GLARBMultisample.load(this, load); - GLARBMultitexture.load(this, load); - GLARBOcclusionQuery.load(this, load); - GLARBParallelShaderCompile.load(this, load); - GLARBPointParameters.load(this, load); - GLARBRobustness.load(this, load); - GLARBSampleLocations.load(this, load); - GLARBSampleShading.load(this, load); - GLARBShaderObjects.load(this, load); - GLARBShadingLanguageInclude.load(this, load); - GLARBSparseBuffer.load(this, load); - GLARBSparseTexture.load(this, load); - GLARBTextureBufferObject.load(this, load); - GLARBTextureCompression.load(this, load); - GLARBTransposeMatrix.load(this, load); - GLARBVertexBlend.load(this, load); - GLARBVertexBufferObject.load(this, load); - GLARBVertexProgram.load(this, load); - GLARBVertexShader.load(this, load); - GLARBViewportArray.load(this, load); - GLARBWindowPos.load(this, load); - GLKHRBlendEquationAdvanced.load(this, load); - GLKHRParallelShaderCompile.load(this, load); - GLOESByteCoordinates.load(this, load); - GLOESFixedPoint.load(this, load); - GLOESQueryMatrix.load(this, load); - GLOESSinglePrecision.load(this, load); - GL3DFXTbuffer.load(this, load); - GLAMDDebugOutput.load(this, load); - GLAMDDrawBuffersBlend.load(this, load); - GLAMDFramebufferMultisampleAdvanced.load(this, load); - GLAMDFramebufferSamplePositions.load(this, load); - GLAMDGpuShaderInt64.load(this, load); - GLAMDInterleavedElements.load(this, load); - GLAMDMultiDrawIndirect.load(this, load); - GLAMDNameGenDelete.load(this, load); - GLAMDOcclusionQueryEvent.load(this, load); - GLAMDPerformanceMonitor.load(this, load); - GLAMDSamplePositions.load(this, load); - GLAMDSparseTexture.load(this, load); - GLAMDStencilOperationExtended.load(this, load); - GLAMDVertexShaderTessellator.load(this, load); - GLAPPLEElementArray.load(this, load); - GLAPPLEFence.load(this, load); - GLAPPLEFlushBufferRange.load(this, load); - GLAPPLEObjectPurgeable.load(this, load); - GLAPPLETextureRange.load(this, load); - GLAPPLEVertexArrayObject.load(this, load); - GLAPPLEVertexArrayRange.load(this, load); - GLAPPLEVertexProgramEvaluators.load(this, load); - GLATIDrawBuffers.load(this, load); - GLATIElementArray.load(this, load); - GLATIEnvmapBumpmap.load(this, load); - GLATIFragmentShader.load(this, load); - GLATIMapObjectBuffer.load(this, load); - GLATIPnTriangles.load(this, load); - GLATISeparateStencil.load(this, load); - GLATIVertexArrayObject.load(this, load); - GLATIVertexAttribArrayObject.load(this, load); - GLATIVertexStreams.load(this, load); - GLEXTEGLImageStorage.load(this, load); - GLEXTBindableUniform.load(this, load); - GLEXTBlendColor.load(this, load); - GLEXTBlendEquationSeparate.load(this, load); - GLEXTBlendFuncSeparate.load(this, load); - GLEXTBlendMinmax.load(this, load); - GLEXTColorSubtable.load(this, load); - GLEXTCompiledVertexArray.load(this, load); - GLEXTConvolution.load(this, load); - GLEXTCoordinateFrame.load(this, load); - GLEXTCopyTexture.load(this, load); - GLEXTCullVertex.load(this, load); - GLEXTDebugLabel.load(this, load); - GLEXTDebugMarker.load(this, load); - GLEXTDepthBoundsTest.load(this, load); - GLEXTDirectStateAccess.load(this, load); - GLEXTDrawBuffers2.load(this, load); - GLEXTDrawInstanced.load(this, load); - GLEXTDrawRangedElements.load(this, load); - GLEXTExternalBuffer.load(this, load); - GLEXTFogCoord.load(this, load); - GLEXTFramebufferBlit.load(this, load); - GLEXTFramebufferBlitLayers.load(this, load); - GLEXTFramebufferMultisample.load(this, load); - GLEXTFramebufferObject.load(this, load); - GLEXTGeometryShader4.load(this, load); - GLEXTGpuProgramParameters.load(this, load); - GLEXTGpuShader4.load(this, load); - GLEXTHistogram.load(this, load); - GLEXTIndexFunc.load(this, load); - GLEXTIndexMaterial.load(this, load); - GLEXTLightTexture.load(this, load); - GLEXTMemoryObject.load(this, load); - GLEXTMemoryObjectFd.load(this, load); - GLEXTMemoryObjectWin32.load(this, load); - GLEXTMultiDrawArrays.load(this, load); - GLEXTMultisample.load(this, load); - GLEXTPalettedTexture.load(this, load); - GLEXTPixelTransform.load(this, load); - GLEXTPointParameters.load(this, load); - GLEXTPolygonOffset.load(this, load); - GLEXTPolygonOffsetClamp.load(this, load); - GLEXTProvokingVertex.load(this, load); - GLEXTRasterMultisample.load(this, load); - GLEXTSecondaryColor.load(this, load); - GLEXTSemaphore.load(this, load); - GLEXTSemaphoreFd.load(this, load); - GLEXTSemaphoreWin32.load(this, load); - GLEXTSeparateShaderObjects.load(this, load); - GLEXTShaderFramebufferFetchNonCoherent.load(this, load); - GLEXTShaderImageLoadStore.load(this, load); - GLEXTStencilClearTag.load(this, load); - GLEXTStencilTwoSide.load(this, load); - GLEXTSubtexture.load(this, load); - GLEXTTexture3D.load(this, load); - GLEXTTextureArray.load(this, load); - GLEXTTextureBufferObject.load(this, load); - GLEXTTextureInteger.load(this, load); - GLEXTTextureObject.load(this, load); - GLEXTTexturePerturbNormal.load(this, load); - GLEXTTextureStorage.load(this, load); - GLEXTTimerQuery.load(this, load); - GLEXTTransformFeedback.load(this, load); - GLEXTVertexArray.load(this, load); - GLEXTVertexAttrib64bit.load(this, load); - GLEXTVertexShader.load(this, load); - GLEXTVertexWeighting.load(this, load); - GLEXTWin32KeyedMutex.load(this, load); - GLEXTWindowRectangles.load(this, load); - GLEXTX11SyncObject.load(this, load); - GLGREMEDYFrameTerminator.load(this, load); - GLGREMEDYStringMarker.load(this, load); - GLHPImageTransform.load(this, load); - GLIBMMultimodeDrawArrays.load(this, load); - GLIBMStaticData.load(this, load); - GLIBMVertexArrayLists.load(this, load); - GLINGRBlendFuncSeparate.load(this, load); - GLINTELFramebufferCMAA.load(this, load); - GLINTELMapTexture.load(this, load); - GLINTELParallelArrays.load(this, load); - GLINTELPerformanceQuery.load(this, load); - GLMESAFramebufferFlipY.load(this, load); - GLMESAResizeBuffers.load(this, load); - GLMESAWindowPos.load(this, load); - GLNVXConditionalRender.load(this, load); - GLNVXGpuMulticast2.load(this, load); - GLNVXLinkedGpuMulticast.load(this, load); - GLNVXProgressFence.load(this, load); - GLNVAlphaToCoverageDitherControl.load(this, load); - GLNVBindlessMultiDrawIndirect.load(this, load); - GLNVBindlessMultiDrawIndirectCount.load(this, load); - GLNVBindlessTexture.load(this, load); - GLNVBlendEquationAdvanced.load(this, load); - GLNVClipSpaceWScaling.load(this, load); - GLNVCommandList.load(this, load); - GLNVConditionalRender.load(this, load); - GLNVConservativeRaster.load(this, load); - GLNVConservativeRasterDilate.load(this, load); - GLNVConservativeRasterPreSnapTriangles.load(this, load); - GLNVCopyImage.load(this, load); - GLNVDepthBufferFloat.load(this, load); - GLNVDrawTexture.load(this, load); - GLNVDrawVulkanImage.load(this, load); - GLNVEvaluators.load(this, load); - GLNVExplicitMultisample.load(this, load); - GLNVFence.load(this, load); - GLNVFragmentCoverageToColor.load(this, load); - GLNVFragmentProgram.load(this, load); - GLNVFramebufferMixedSamples.load(this, load); - GLNVFramebufferMultisampleCoverage.load(this, load); - GLNVGeometryProgram4.load(this, load); - GLNVGpuMulticast.load(this, load); - GLNVGpuProgram4.load(this, load); - GLNVGpuProgram5.load(this, load); - GLNVHalfFloat.load(this, load); - GLNVInternalformatSampleQuery.load(this, load); - GLNVMemoryAttachment.load(this, load); - GLNVMemoryObjectSparse.load(this, load); - GLNVMeshShader.load(this, load); - GLNVOcculusionQuery.load(this, load); - GLNVParameterBufferObject.load(this, load); - GLNVPathRendering.load(this, load); - GLNVPixelDataRange.load(this, load); - GLNVPointSprite.load(this, load); - GLNVPresentVideo.load(this, load); - GLNVPrimitiveRestart.load(this, load); - GLNVQueryResource.load(this, load); - GLNVQueryResourceTag.load(this, load); - GLNVRegisterCombiners.load(this, load); - GLNVRegisterCombiners2.load(this, load); - GLNVSampleLocations.load(this, load); - GLNVScissorExclusive.load(this, load); - GLNVShaderBufferLoad.load(this, load); - GLNVShadingRateImage.load(this, load); - GLNVTextureBarrier.load(this, load); - GLNVTextureMultisample.load(this, load); - GLNVTimelineSemaphore.load(this, load); - GLNVTransformFeedback.load(this, load); - GLNVTransformFeedback2.load(this, load); - GLNVVDPAUInterop.load(this, load); - GLNVVDPAUInterop2.load(this, load); - GLNVVertexArrayRange.load(this, load); - GLNVVertexAttribInteger64bit.load(this, load); - GLNVVertexBufferUnifiedMemory.load(this, load); - GLNVVertexProgram.load(this, load); - GLNVVideoCapture.load(this, load); - GLNVViewportSwizzle.load(this, load); - GLOVRMultiview.load(this, load); - GLPGIMiscHints.load(this, load); - GLSGISDetailTexture.load(this, load); - GLSGISFogFunction.load(this, load); - GLSGISMultisample.load(this, load); - GLSGISPixelTexture.load(this, load); - GLSGISPointParameters.load(this, load); - GLSGISSharpenTexture.load(this, load); - GLSGISTexture4D.load(this, load); - GLSGISTextureColorMask.load(this, load); - GLSGISTextureFilter4.load(this, load); - GLSGIXAsync.load(this, load); - GLSGIXFlushRaster.load(this, load); - GLSGIXFragmentLighting.load(this, load); - GLSGIXFramezoom.load(this, load); - GLSGIXIglooInterface.load(this, load); - GLSGIXInstruments.load(this, load); - GLSGIXListPriority.load(this, load); - GLSGIXPixelTexture.load(this, load); - GLSGIXPolynomialFFD.load(this, load); - GLSGIXReferencePlane.load(this, load); - GLSGIXSprite.load(this, load); - GLSGIXTagSampleBuffer.load(this, load); - GLSGIColorTable.load(this, load); - GLSUNXConstantData.load(this, load); - GLSUNGlobalAlpha.load(this, load); - GLSUNMeshArray.load(this, load); - GLSUNTriangleList.load(this, load); - GLSUNVertex.load(this, load); - } - - boolean findExtensionsGL(int version, SegmentAllocator allocator) { - var pExts = allocator.allocate(ADDRESS); - var pNumExtsI = allocator.allocate(JAVA_INT); - var pExtsI = new MemorySegment[1]; - if (!getExtensions(allocator, version, pExts, pNumExtsI, pExtsI, caps)) return false; - - String exts = pExts.getString(0); - int numExtsI = pNumExtsI.get(JAVA_INT, 0); - var extsI = pExtsI[0]; - - this.GL_ARB_ES2_compatibility = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_ES2_compatibility"); - this.GL_ARB_ES3_1_compatibility = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_ES3_1_compatibility"); - this.GL_ARB_ES3_2_compatibility = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_ES3_2_compatibility"); - this.GL_ARB_ES3_compatibility = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_ES3_compatibility"); - this.GL_ARB_arrays_of_arrays = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_arrays_of_arrays"); - this.GL_ARB_base_instance = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_base_instance"); - this.GL_ARB_bindless_texture = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_bindless_texture"); - this.GL_ARB_blend_func_extended = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_blend_func_extended"); - this.GL_ARB_buffer_storage = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_buffer_storage"); - this.GL_ARB_cl_event = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_cl_event"); - this.GL_ARB_clear_buffer_object = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_clear_buffer_object"); - this.GL_ARB_clear_texture = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_clear_texture"); - this.GL_ARB_clip_control = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_clip_control"); - this.GL_ARB_color_buffer_float = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_color_buffer_float"); - this.GL_ARB_compatibility = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_compatibility"); - this.GL_ARB_compressed_texture_pixel_storage = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_compressed_texture_pixel_storage"); - this.GL_ARB_compute_shader = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_compute_shader"); - this.GL_ARB_compute_variable_group_size = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_compute_variable_group_size"); - this.GL_ARB_conditional_render_inverted = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_conditional_render_inverted"); - this.GL_ARB_conservative_depth = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_conservative_depth"); - this.GL_ARB_copy_buffer = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_copy_buffer"); - this.GL_ARB_copy_image = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_copy_image"); - this.GL_ARB_cull_distance = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_cull_distance"); - this.GL_ARB_debug_output = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_debug_output"); - this.GL_ARB_depth_buffer_float = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_depth_buffer_float"); - this.GL_ARB_depth_clamp = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_depth_clamp"); - this.GL_ARB_depth_texture = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_depth_texture"); - this.GL_ARB_derivative_control = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_derivative_control"); - this.GL_ARB_direct_state_access = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_direct_state_access"); - this.GL_ARB_draw_buffers = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_draw_buffers"); - this.GL_ARB_draw_buffers_blend = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_draw_buffers_blend"); - this.GL_ARB_draw_elements_base_vertex = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_draw_elements_base_vertex"); - this.GL_ARB_draw_indirect = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_draw_indirect"); - this.GL_ARB_draw_instanced = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_draw_instanced"); - this.GL_ARB_enhanced_layouts = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_enhanced_layouts"); - this.GL_ARB_explicit_attrib_location = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_explicit_attrib_location"); - this.GL_ARB_explicit_uniform_location = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_explicit_uniform_location"); - this.GL_ARB_fragment_coord_conventions = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_fragment_coord_conventions"); - this.GL_ARB_fragment_layer_viewport = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_fragment_layer_viewport"); - this.GL_ARB_fragment_program = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_fragment_program"); - this.GL_ARB_fragment_program_shadow = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_fragment_program_shadow"); - this.GL_ARB_fragment_shader = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_fragment_shader"); - this.GL_ARB_fragment_shader_interlock = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_fragment_shader_interlock"); - this.GL_ARB_framebuffer_no_attachments = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_framebuffer_no_attachments"); - this.GL_ARB_framebuffer_object = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_framebuffer_object"); - this.GL_ARB_framebuffer_sRGB = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_framebuffer_sRGB"); - this.GL_ARB_geometry_shader4 = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_geometry_shader4"); - this.GL_ARB_get_program_binary = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_get_program_binary"); - this.GL_ARB_get_texture_sub_image = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_get_texture_sub_image"); - this.GL_ARB_gl_spirv = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_gl_spirv"); - this.GL_ARB_gpu_shader5 = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_gpu_shader5"); - this.GL_ARB_gpu_shader_fp64 = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_gpu_shader_fp64"); - this.GL_ARB_gpu_shader_int64 = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_gpu_shader_int64"); - this.GL_ARB_half_float_pixel = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_half_float_pixel"); - this.GL_ARB_half_float_vertex = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_half_float_vertex"); - this.GL_ARB_imaging = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_imaging"); - this.GL_ARB_indirect_parameters = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_indirect_parameters"); - this.GL_ARB_instanced_arrays = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_instanced_arrays"); - this.GL_ARB_internalformat_query = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_internalformat_query"); - this.GL_ARB_internalformat_query2 = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_internalformat_query2"); - this.GL_ARB_invalidate_subdata = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_invalidate_subdata"); - this.GL_ARB_map_buffer_alignment = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_map_buffer_alignment"); - this.GL_ARB_map_buffer_range = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_map_buffer_range"); - this.GL_ARB_matrix_palette = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_matrix_palette"); - this.GL_ARB_multi_bind = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_multi_bind"); - this.GL_ARB_multi_draw_indirect = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_multi_draw_indirect"); - this.GL_ARB_multisample = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_multisample"); - this.GL_ARB_multitexture = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_multitexture"); - this.GL_ARB_occlusion_query = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_occlusion_query"); - this.GL_ARB_occlusion_query2 = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_occlusion_query2"); - this.GL_ARB_parallel_shader_compile = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_parallel_shader_compile"); - this.GL_ARB_pipeline_statistics_query = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_pipeline_statistics_query"); - this.GL_ARB_pixel_buffer_object = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_pixel_buffer_object"); - this.GL_ARB_point_parameters = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_point_parameters"); - this.GL_ARB_point_sprite = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_point_sprite"); - this.GL_ARB_polygon_offset_clamp = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_polygon_offset_clamp"); - this.GL_ARB_post_depth_coverage = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_post_depth_coverage"); - this.GL_ARB_program_interface_query = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_program_interface_query"); - this.GL_ARB_provoking_vertex = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_provoking_vertex"); - this.GL_ARB_query_buffer_object = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_query_buffer_object"); - this.GL_ARB_robust_buffer_access_behavior = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_robust_buffer_access_behavior"); - this.GL_ARB_robustness = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_robustness"); - this.GL_ARB_robustness_isolation = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_robustness_isolation"); - this.GL_ARB_sample_locations = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_sample_locations"); - this.GL_ARB_sample_shading = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_sample_shading"); - this.GL_ARB_sampler_objects = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_sampler_objects"); - this.GL_ARB_seamless_cube_map = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_seamless_cube_map"); - this.GL_ARB_seamless_cubemap_per_texture = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_seamless_cubemap_per_texture"); - this.GL_ARB_separate_shader_objects = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_separate_shader_objects"); - this.GL_ARB_shader_atomic_counter_ops = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shader_atomic_counter_ops"); - this.GL_ARB_shader_atomic_counters = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shader_atomic_counters"); - this.GL_ARB_shader_ballot = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shader_ballot"); - this.GL_ARB_shader_bit_encoding = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shader_bit_encoding"); - this.GL_ARB_shader_clock = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shader_clock"); - this.GL_ARB_shader_draw_parameters = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shader_draw_parameters"); - this.GL_ARB_shader_group_vote = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shader_group_vote"); - this.GL_ARB_shader_image_load_store = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shader_image_load_store"); - this.GL_ARB_shader_image_size = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shader_image_size"); - this.GL_ARB_shader_objects = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shader_objects"); - this.GL_ARB_shader_precision = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shader_precision"); - this.GL_ARB_shader_stencil_export = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shader_stencil_export"); - this.GL_ARB_shader_storage_buffer_object = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shader_storage_buffer_object"); - this.GL_ARB_shader_subroutine = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shader_subroutine"); - this.GL_ARB_shader_texture_image_samples = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shader_texture_image_samples"); - this.GL_ARB_shader_texture_lod = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shader_texture_lod"); - this.GL_ARB_shader_viewport_layer_array = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shader_viewport_layer_array"); - this.GL_ARB_shading_language_100 = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shading_language_100"); - this.GL_ARB_shading_language_420pack = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shading_language_420pack"); - this.GL_ARB_shading_language_include = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shading_language_include"); - this.GL_ARB_shading_language_packing = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shading_language_packing"); - this.GL_ARB_shadow = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shadow"); - this.GL_ARB_shadow_ambient = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_shadow_ambient"); - this.GL_ARB_sparse_buffer = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_sparse_buffer"); - this.GL_ARB_sparse_texture = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_sparse_texture"); - this.GL_ARB_sparse_texture2 = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_sparse_texture2"); - this.GL_ARB_sparse_texture_clamp = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_sparse_texture_clamp"); - this.GL_ARB_spirv_extensions = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_spirv_extensions"); - this.GL_ARB_stencil_texturing = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_stencil_texturing"); - this.GL_ARB_sync = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_sync"); - this.GL_ARB_tessellation_shader = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_tessellation_shader"); - this.GL_ARB_texture_barrier = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_barrier"); - this.GL_ARB_texture_border_clamp = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_border_clamp"); - this.GL_ARB_texture_buffer_object = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_buffer_object"); - this.GL_ARB_texture_buffer_object_rgb32 = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_buffer_object_rgb32"); - this.GL_ARB_texture_buffer_range = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_buffer_range"); - this.GL_ARB_texture_compression = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_compression"); - this.GL_ARB_texture_compression_bptc = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_compression_bptc"); - this.GL_ARB_texture_compression_rgtc = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_compression_rgtc"); - this.GL_ARB_texture_cube_map = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_cube_map"); - this.GL_ARB_texture_cube_map_array = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_cube_map_array"); - this.GL_ARB_texture_env_add = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_env_add"); - this.GL_ARB_texture_env_combine = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_env_combine"); - this.GL_ARB_texture_env_crossbar = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_env_crossbar"); - this.GL_ARB_texture_env_dot3 = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_env_dot3"); - this.GL_ARB_texture_filter_anisotropic = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_filter_anisotropic"); - this.GL_ARB_texture_filter_minmax = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_filter_minmax"); - this.GL_ARB_texture_float = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_float"); - this.GL_ARB_texture_gather = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_gather"); - this.GL_ARB_texture_mirror_clamp_to_edge = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_mirror_clamp_to_edge"); - this.GL_ARB_texture_mirrored_repeat = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_mirrored_repeat"); - this.GL_ARB_texture_multisample = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_multisample"); - this.GL_ARB_texture_non_power_of_two = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_non_power_of_two"); - this.GL_ARB_texture_query_levels = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_query_levels"); - this.GL_ARB_texture_query_lod = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_query_lod"); - this.GL_ARB_texture_rectangle = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_rectangle"); - this.GL_ARB_texture_rg = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_rg"); - this.GL_ARB_texture_rgb10_a2ui = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_rgb10_a2ui"); - this.GL_ARB_texture_stencil8 = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_stencil8"); - this.GL_ARB_texture_storage = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_storage"); - this.GL_ARB_texture_storage_multisample = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_storage_multisample"); - this.GL_ARB_texture_swizzle = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_swizzle"); - this.GL_ARB_texture_view = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_texture_view"); - this.GL_ARB_timer_query = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_timer_query"); - this.GL_ARB_transform_feedback2 = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_transform_feedback2"); - this.GL_ARB_transform_feedback3 = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_transform_feedback3"); - this.GL_ARB_transform_feedback_instanced = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_transform_feedback_instanced"); - this.GL_ARB_transform_feedback_overflow_query = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_transform_feedback_overflow_query"); - this.GL_ARB_transpose_matrix = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_transpose_matrix"); - this.GL_ARB_uniform_buffer_object = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_uniform_buffer_object"); - this.GL_ARB_vertex_array_bgra = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_vertex_array_bgra"); - this.GL_ARB_vertex_array_object = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_vertex_array_object"); - this.GL_ARB_vertex_attrib_64bit = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_vertex_attrib_64bit"); - this.GL_ARB_vertex_attrib_binding = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_vertex_attrib_binding"); - this.GL_ARB_vertex_blend = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_vertex_blend"); - this.GL_ARB_vertex_buffer_object = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_vertex_buffer_object"); - this.GL_ARB_vertex_program = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_vertex_program"); - this.GL_ARB_vertex_shader = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_vertex_shader"); - this.GL_ARB_vertex_type_10f_11f_11f_rev = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_vertex_type_10f_11f_11f_rev"); - this.GL_ARB_vertex_type_2_10_10_10_rev = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_vertex_type_2_10_10_10_rev"); - this.GL_ARB_viewport_array = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_viewport_array"); - this.GL_ARB_window_pos = hasExtension(version, exts, numExtsI, extsI, "GL_ARB_window_pos"); - this.GL_KHR_blend_equation_advanced = hasExtension(version, exts, numExtsI, extsI, "GL_KHR_blend_equation_advanced"); - this.GL_KHR_blend_equation_advanced_coherent = hasExtension(version, exts, numExtsI, extsI, "GL_KHR_blend_equation_advanced_coherent"); - this.GL_KHR_context_flush_control = hasExtension(version, exts, numExtsI, extsI, "GL_KHR_context_flush_control"); - this.GL_KHR_debug = hasExtension(version, exts, numExtsI, extsI, "GL_KHR_debug"); - this.GL_KHR_no_error = hasExtension(version, exts, numExtsI, extsI, "GL_KHR_no_error"); - this.GL_KHR_parallel_shader_compile = hasExtension(version, exts, numExtsI, extsI, "GL_KHR_parallel_shader_compile"); - this.GL_KHR_robust_buffer_access_behavior = hasExtension(version, exts, numExtsI, extsI, "GL_KHR_robust_buffer_access_behavior"); - this.GL_KHR_robustness = hasExtension(version, exts, numExtsI, extsI, "GL_KHR_robustness"); - this.GL_KHR_shader_subgroup = hasExtension(version, exts, numExtsI, extsI, "GL_KHR_shader_subgroup"); - this.GL_KHR_texture_compression_astc_hdr = hasExtension(version, exts, numExtsI, extsI, "GL_KHR_texture_compression_astc_hdr"); - this.GL_KHR_texture_compression_astc_ldr = hasExtension(version, exts, numExtsI, extsI, "GL_KHR_texture_compression_astc_ldr"); - this.GL_KHR_texture_compression_astc_sliced_3d = hasExtension(version, exts, numExtsI, extsI, "GL_KHR_texture_compression_astc_sliced_3d"); - this.GL_OES_byte_coordinates = hasExtension(version, exts, numExtsI, extsI, "GL_OES_byte_coordinates"); - this.GL_OES_compressed_paletted_texture = hasExtension(version, exts, numExtsI, extsI, "GL_OES_compressed_paletted_texture"); - this.GL_OES_fixed_point = hasExtension(version, exts, numExtsI, extsI, "GL_OES_fixed_point"); - this.GL_OES_query_matrix = hasExtension(version, exts, numExtsI, extsI, "GL_OES_query_matrix"); - this.GL_OES_read_format = hasExtension(version, exts, numExtsI, extsI, "GL_OES_read_format"); - this.GL_OES_single_precision = hasExtension(version, exts, numExtsI, extsI, "GL_OES_single_precision"); - this.GL_3DFX_multisample = hasExtension(version, exts, numExtsI, extsI, "GL_3DFX_multisample"); - this.GL_3DFX_tbuffer = hasExtension(version, exts, numExtsI, extsI, "GL_3DFX_tbuffer"); - this.GL_3DFX_texture_compression_FXT1 = hasExtension(version, exts, numExtsI, extsI, "GL_3DFX_texture_compression_FXT1"); - this.GL_AMD_blend_minmax_factor = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_blend_minmax_factor"); - this.GL_AMD_conservative_depth = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_conservative_depth"); - this.GL_AMD_debug_output = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_debug_output"); - this.GL_AMD_depth_clamp_separate = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_depth_clamp_separate"); - this.GL_AMD_draw_buffers_blend = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_draw_buffers_blend"); - this.GL_AMD_framebuffer_multisample_advanced = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_framebuffer_multisample_advanced"); - this.GL_AMD_framebuffer_sample_positions = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_framebuffer_sample_positions"); - this.GL_AMD_gcn_shader = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_gcn_shader"); - this.GL_AMD_gpu_shader_half_float = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_gpu_shader_half_float"); - this.GL_AMD_gpu_shader_int16 = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_gpu_shader_int16"); - this.GL_AMD_gpu_shader_int64 = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_gpu_shader_int64"); - this.GL_AMD_interleaved_elements = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_interleaved_elements"); - this.GL_AMD_multi_draw_indirect = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_multi_draw_indirect"); - this.GL_AMD_name_gen_delete = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_name_gen_delete"); - this.GL_AMD_occlusion_query_event = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_occlusion_query_event"); - this.GL_AMD_performance_monitor = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_performance_monitor"); - this.GL_AMD_pinned_memory = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_pinned_memory"); - this.GL_AMD_query_buffer_object = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_query_buffer_object"); - this.GL_AMD_sample_positions = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_sample_positions"); - this.GL_AMD_seamless_cubemap_per_texture = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_seamless_cubemap_per_texture"); - this.GL_AMD_shader_atomic_counter_ops = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_shader_atomic_counter_ops"); - this.GL_AMD_shader_ballot = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_shader_ballot"); - this.GL_AMD_shader_explicit_vertex_parameter = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_shader_explicit_vertex_parameter"); - this.GL_AMD_shader_gpu_shader_half_float_fetch = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_shader_gpu_shader_half_float_fetch"); - this.GL_AMD_shader_image_load_store_lod = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_shader_image_load_store_lod"); - this.GL_AMD_shader_stencil_export = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_shader_stencil_export"); - this.GL_AMD_shader_trinary_minmax = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_shader_trinary_minmax"); - this.GL_AMD_sparse_texture = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_sparse_texture"); - this.GL_AMD_stencil_operation_extended = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_stencil_operation_extended"); - this.GL_AMD_texture_gather_bias_lod = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_texture_gather_bias_lod"); - this.GL_AMD_texture_texture4 = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_texture_texture4"); - this.GL_AMD_transform_feedback3_lines_triangles = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_transform_feedback3_lines_triangles"); - this.GL_AMD_transform_feedback4 = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_transform_feedback4"); - this.GL_AMD_vertex_shader_layer = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_vertex_shader_layer"); - this.GL_AMD_vertex_shader_tessellator = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_vertex_shader_tessellator"); - this.GL_AMD_vertex_shader_viewport_index = hasExtension(version, exts, numExtsI, extsI, "GL_AMD_vertex_shader_viewport_index"); - this.GL_APPLE_aux_depth_stencil = hasExtension(version, exts, numExtsI, extsI, "GL_APPLE_aux_depth_stencil"); - this.GL_APPLE_client_storage = hasExtension(version, exts, numExtsI, extsI, "GL_APPLE_client_storage"); - this.GL_APPLE_element_array = hasExtension(version, exts, numExtsI, extsI, "GL_APPLE_element_array"); - this.GL_APPLE_fence = hasExtension(version, exts, numExtsI, extsI, "GL_APPLE_fence"); - this.GL_APPLE_float_pixels = hasExtension(version, exts, numExtsI, extsI, "GL_APPLE_float_pixels"); - this.GL_APPLE_flush_buffer_range = hasExtension(version, exts, numExtsI, extsI, "GL_APPLE_flush_buffer_range"); - this.GL_APPLE_object_purgeable = hasExtension(version, exts, numExtsI, extsI, "GL_APPLE_object_purgeable"); - this.GL_APPLE_rgb_422 = hasExtension(version, exts, numExtsI, extsI, "GL_APPLE_rgb_422"); - this.GL_APPLE_row_bytes = hasExtension(version, exts, numExtsI, extsI, "GL_APPLE_row_bytes"); - this.GL_APPLE_specular_vector = hasExtension(version, exts, numExtsI, extsI, "GL_APPLE_specular_vector"); - this.GL_APPLE_texture_range = hasExtension(version, exts, numExtsI, extsI, "GL_APPLE_texture_range"); - this.GL_APPLE_transform_hint = hasExtension(version, exts, numExtsI, extsI, "GL_APPLE_transform_hint"); - this.GL_APPLE_vertex_array_object = hasExtension(version, exts, numExtsI, extsI, "GL_APPLE_vertex_array_object"); - this.GL_APPLE_vertex_array_range = hasExtension(version, exts, numExtsI, extsI, "GL_APPLE_vertex_array_range"); - this.GL_APPLE_vertex_program_evaluators = hasExtension(version, exts, numExtsI, extsI, "GL_APPLE_vertex_program_evaluators"); - this.GL_APPLE_ycbcr_422 = hasExtension(version, exts, numExtsI, extsI, "GL_APPLE_ycbcr_422"); - this.GL_ATI_draw_buffers = hasExtension(version, exts, numExtsI, extsI, "GL_ATI_draw_buffers"); - this.GL_ATI_element_array = hasExtension(version, exts, numExtsI, extsI, "GL_ATI_element_array"); - this.GL_ATI_envmap_bumpmap = hasExtension(version, exts, numExtsI, extsI, "GL_ATI_envmap_bumpmap"); - this.GL_ATI_fragment_shader = hasExtension(version, exts, numExtsI, extsI, "GL_ATI_fragment_shader"); - this.GL_ATI_map_object_buffer = hasExtension(version, exts, numExtsI, extsI, "GL_ATI_map_object_buffer"); - this.GL_ATI_meminfo = hasExtension(version, exts, numExtsI, extsI, "GL_ATI_meminfo"); - this.GL_ATI_pixel_format_float = hasExtension(version, exts, numExtsI, extsI, "GL_ATI_pixel_format_float"); - this.GL_ATI_pn_triangles = hasExtension(version, exts, numExtsI, extsI, "GL_ATI_pn_triangles"); - this.GL_ATI_separate_stencil = hasExtension(version, exts, numExtsI, extsI, "GL_ATI_separate_stencil"); - this.GL_ATI_text_fragment_shader = hasExtension(version, exts, numExtsI, extsI, "GL_ATI_text_fragment_shader"); - this.GL_ATI_texture_env_combine3 = hasExtension(version, exts, numExtsI, extsI, "GL_ATI_texture_env_combine3"); - this.GL_ATI_texture_float = hasExtension(version, exts, numExtsI, extsI, "GL_ATI_texture_float"); - this.GL_ATI_texture_mirror_once = hasExtension(version, exts, numExtsI, extsI, "GL_ATI_texture_mirror_once"); - this.GL_ATI_vertex_array_object = hasExtension(version, exts, numExtsI, extsI, "GL_ATI_vertex_array_object"); - this.GL_ATI_vertex_attrib_array_object = hasExtension(version, exts, numExtsI, extsI, "GL_ATI_vertex_attrib_array_object"); - this.GL_ATI_vertex_streams = hasExtension(version, exts, numExtsI, extsI, "GL_ATI_vertex_streams"); - this.GL_EXT_422_pixels = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_422_pixels"); - this.GL_EXT_EGL_image_storage = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_EGL_image_storage"); - this.GL_EXT_EGL_sync = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_EGL_sync"); - this.GL_EXT_abgr = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_abgr"); - this.GL_EXT_bgra = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_bgra"); - this.GL_EXT_bindable_uniform = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_bindable_uniform"); - this.GL_EXT_blend_color = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_blend_color"); - this.GL_EXT_blend_equation_separate = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_blend_equation_separate"); - this.GL_EXT_blend_func_separate = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_blend_func_separate"); - this.GL_EXT_blend_logic_op = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_blend_logic_op"); - this.GL_EXT_blend_minmax = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_blend_minmax"); - this.GL_EXT_blend_subtract = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_blend_subtract"); - this.GL_EXT_clip_volume_hint = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_clip_volume_hint"); - this.GL_EXT_cmyka = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_cmyka"); - this.GL_EXT_color_subtable = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_color_subtable"); - this.GL_EXT_compiled_vertex_array = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_compiled_vertex_array"); - this.GL_EXT_convolution = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_convolution"); - this.GL_EXT_coordinate_frame = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_coordinate_frame"); - this.GL_EXT_copy_texture = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_copy_texture"); - this.GL_EXT_cull_vertex = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_cull_vertex"); - this.GL_EXT_debug_label = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_debug_label"); - this.GL_EXT_debug_marker = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_debug_marker"); - this.GL_EXT_depth_bounds_test = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_depth_bounds_test"); - this.GL_EXT_direct_state_access = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_direct_state_access"); - this.GL_EXT_draw_buffers2 = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_draw_buffers2"); - this.GL_EXT_draw_instanced = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_draw_instanced"); - this.GL_EXT_draw_range_elements = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_draw_range_elements"); - this.GL_EXT_external_buffer = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_external_buffer"); - this.GL_EXT_fog_coord = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_fog_coord"); - this.GL_EXT_framebuffer_blit = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_framebuffer_blit"); - this.GL_EXT_framebuffer_blit_layers = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_framebuffer_blit_layers"); - this.GL_EXT_framebuffer_multisample = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_framebuffer_multisample"); - this.GL_EXT_framebuffer_multisample_blit_scaled = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_framebuffer_multisample_blit_scaled"); - this.GL_EXT_framebuffer_object = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_framebuffer_object"); - this.GL_EXT_framebuffer_sRGB = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_framebuffer_sRGB"); - this.GL_EXT_geometry_shader4 = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_geometry_shader4"); - this.GL_EXT_gpu_program_parameters = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_gpu_program_parameters"); - this.GL_EXT_gpu_shader4 = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_gpu_shader4"); - this.GL_EXT_histogram = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_histogram"); - this.GL_EXT_index_array_formats = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_index_array_formats"); - this.GL_EXT_index_func = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_index_func"); - this.GL_EXT_index_material = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_index_material"); - this.GL_EXT_index_texture = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_index_texture"); - this.GL_EXT_light_texture = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_light_texture"); - this.GL_EXT_memory_object = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_memory_object"); - this.GL_EXT_memory_object_fd = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_memory_object_fd"); - this.GL_EXT_memory_object_win32 = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_memory_object_win32"); - this.GL_EXT_misc_attribute = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_misc_attribute"); - this.GL_EXT_multi_draw_arrays = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_multi_draw_arrays"); - this.GL_EXT_multisample = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_multisample"); - this.GL_EXT_multiview_tessellation_geometry_shader = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_multiview_tessellation_geometry_shader"); - this.GL_EXT_multiview_texture_multisample = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_multiview_texture_multisample"); - this.GL_EXT_multiview_timer_query = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_multiview_timer_query"); - this.GL_EXT_packed_depth_stencil = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_packed_depth_stencil"); - this.GL_EXT_packed_float = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_packed_float"); - this.GL_EXT_packed_pixels = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_packed_pixels"); - this.GL_EXT_paletted_texture = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_paletted_texture"); - this.GL_EXT_pixel_buffer_object = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_pixel_buffer_object"); - this.GL_EXT_pixel_transform = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_pixel_transform"); - this.GL_EXT_pixel_transform_color_table = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_pixel_transform_color_table"); - this.GL_EXT_point_parameters = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_point_parameters"); - this.GL_EXT_polygon_offset = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_polygon_offset"); - this.GL_EXT_polygon_offset_clamp = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_polygon_offset_clamp"); - this.GL_EXT_post_depth_coverage = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_post_depth_coverage"); - this.GL_EXT_provoking_vertex = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_provoking_vertex"); - this.GL_EXT_raster_multisample = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_raster_multisample"); - this.GL_EXT_rescale_normal = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_rescale_normal"); - this.GL_EXT_secondary_color = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_secondary_color"); - this.GL_EXT_semaphore = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_semaphore"); - this.GL_EXT_semaphore_fd = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_semaphore_fd"); - this.GL_EXT_semaphore_win32 = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_semaphore_win32"); - this.GL_EXT_separate_shader_objects = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_separate_shader_objects"); - this.GL_EXT_separate_specular_color = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_separate_specular_color"); - this.GL_EXT_shader_framebuffer_fetch = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_shader_framebuffer_fetch"); - this.GL_EXT_shader_framebuffer_fetch_non_coherent = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_shader_framebuffer_fetch_non_coherent"); - this.GL_EXT_shader_image_load_formatted = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_shader_image_load_formatted"); - this.GL_EXT_shader_image_load_store = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_shader_image_load_store"); - this.GL_EXT_shader_integer_mix = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_shader_integer_mix"); - this.GL_EXT_shader_samples_identical = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_shader_samples_identical"); - this.GL_EXT_shadow_funcs = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_shadow_funcs"); - this.GL_EXT_shared_texture_palette = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_shared_texture_palette"); - this.GL_EXT_sparse_texture2 = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_sparse_texture2"); - this.GL_EXT_stencil_clear_tag = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_stencil_clear_tag"); - this.GL_EXT_stencil_two_side = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_stencil_two_side"); - this.GL_EXT_stencil_wrap = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_stencil_wrap"); - this.GL_EXT_subtexture = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_subtexture"); - this.GL_EXT_texture = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture"); - this.GL_EXT_texture3D = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture3D"); - this.GL_EXT_texture_array = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_array"); - this.GL_EXT_texture_buffer_object = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_buffer_object"); - this.GL_EXT_texture_compression_latc = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_compression_latc"); - this.GL_EXT_texture_compression_rgtc = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_compression_rgtc"); - this.GL_EXT_texture_compression_s3tc = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_compression_s3tc"); - this.GL_EXT_texture_cube_map = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_cube_map"); - this.GL_EXT_texture_env_add = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_env_add"); - this.GL_EXT_texture_env_combine = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_env_combine"); - this.GL_EXT_texture_env_dot3 = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_env_dot3"); - this.GL_EXT_texture_filter_anisotropic = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_filter_anisotropic"); - this.GL_EXT_texture_filter_minmax = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_filter_minmax"); - this.GL_EXT_texture_integer = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_integer"); - this.GL_EXT_texture_lod_bias = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_lod_bias"); - this.GL_EXT_texture_mirror_clamp = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_mirror_clamp"); - this.GL_EXT_texture_object = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_object"); - this.GL_EXT_texture_perturb_normal = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_perturb_normal"); - this.GL_EXT_texture_sRGB = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_sRGB"); - this.GL_EXT_texture_sRGB_R8 = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_sRGB_R8"); - this.GL_EXT_texture_sRGB_RG8 = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_sRGB_RG8"); - this.GL_EXT_texture_sRGB_decode = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_sRGB_decode"); - this.GL_EXT_texture_shadow_lod = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_shadow_lod"); - this.GL_EXT_texture_shared_exponent = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_shared_exponent"); - this.GL_EXT_texture_snorm = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_snorm"); - this.GL_EXT_texture_storage = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_storage"); - this.GL_EXT_texture_swizzle = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_texture_swizzle"); - this.GL_EXT_timer_query = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_timer_query"); - this.GL_EXT_transform_feedback = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_transform_feedback"); - this.GL_EXT_vertex_array = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_vertex_array"); - this.GL_EXT_vertex_array_bgra = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_vertex_array_bgra"); - this.GL_EXT_vertex_attrib_64bit = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_vertex_attrib_64bit"); - this.GL_EXT_vertex_shader = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_vertex_shader"); - this.GL_EXT_vertex_weighting = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_vertex_weighting"); - this.GL_EXT_win32_keyed_mutex = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_win32_keyed_mutex"); - this.GL_EXT_window_rectangles = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_window_rectangles"); - this.GL_EXT_x11_sync_object = hasExtension(version, exts, numExtsI, extsI, "GL_EXT_x11_sync_object"); - this.GL_GREMEDY_frame_terminator = hasExtension(version, exts, numExtsI, extsI, "GL_GREMEDY_frame_terminator"); - this.GL_GREMEDY_string_marker = hasExtension(version, exts, numExtsI, extsI, "GL_GREMEDY_string_marker"); - this.GL_HP_convolution_border_modes = hasExtension(version, exts, numExtsI, extsI, "GL_HP_convolution_border_modes"); - this.GL_HP_image_transform = hasExtension(version, exts, numExtsI, extsI, "GL_HP_image_transform"); - this.GL_HP_occlusion_test = hasExtension(version, exts, numExtsI, extsI, "GL_HP_occlusion_test"); - this.GL_HP_texture_lighting = hasExtension(version, exts, numExtsI, extsI, "GL_HP_texture_lighting"); - this.GL_IBM_cull_vertex = hasExtension(version, exts, numExtsI, extsI, "GL_IBM_cull_vertex"); - this.GL_IBM_multimode_draw_arrays = hasExtension(version, exts, numExtsI, extsI, "GL_IBM_multimode_draw_arrays"); - this.GL_IBM_rasterpos_clip = hasExtension(version, exts, numExtsI, extsI, "GL_IBM_rasterpos_clip"); - this.GL_IBM_static_data = hasExtension(version, exts, numExtsI, extsI, "GL_IBM_static_data"); - this.GL_IBM_texture_mirrored_repeat = hasExtension(version, exts, numExtsI, extsI, "GL_IBM_texture_mirrored_repeat"); - this.GL_IBM_vertex_array_lists = hasExtension(version, exts, numExtsI, extsI, "GL_IBM_vertex_array_lists"); - this.GL_INGR_blend_func_separate = hasExtension(version, exts, numExtsI, extsI, "GL_INGR_blend_func_separate"); - this.GL_INGR_color_clamp = hasExtension(version, exts, numExtsI, extsI, "GL_INGR_color_clamp"); - this.GL_INGR_interlace_read = hasExtension(version, exts, numExtsI, extsI, "GL_INGR_interlace_read"); - this.GL_INTEL_blackhole_render = hasExtension(version, exts, numExtsI, extsI, "GL_INTEL_blackhole_render"); - this.GL_INTEL_conservative_rasterization = hasExtension(version, exts, numExtsI, extsI, "GL_INTEL_conservative_rasterization"); - this.GL_INTEL_fragment_shader_ordering = hasExtension(version, exts, numExtsI, extsI, "GL_INTEL_fragment_shader_ordering"); - this.GL_INTEL_framebuffer_CMAA = hasExtension(version, exts, numExtsI, extsI, "GL_INTEL_framebuffer_CMAA"); - this.GL_INTEL_map_texture = hasExtension(version, exts, numExtsI, extsI, "GL_INTEL_map_texture"); - this.GL_INTEL_parallel_arrays = hasExtension(version, exts, numExtsI, extsI, "GL_INTEL_parallel_arrays"); - this.GL_INTEL_performance_query = hasExtension(version, exts, numExtsI, extsI, "GL_INTEL_performance_query"); - this.GL_MESAX_texture_stack = hasExtension(version, exts, numExtsI, extsI, "GL_MESAX_texture_stack"); - this.GL_MESA_framebuffer_flip_x = hasExtension(version, exts, numExtsI, extsI, "GL_MESA_framebuffer_flip_x"); - this.GL_MESA_framebuffer_flip_y = hasExtension(version, exts, numExtsI, extsI, "GL_MESA_framebuffer_flip_y"); - this.GL_MESA_framebuffer_swap_xy = hasExtension(version, exts, numExtsI, extsI, "GL_MESA_framebuffer_swap_xy"); - this.GL_MESA_pack_invert = hasExtension(version, exts, numExtsI, extsI, "GL_MESA_pack_invert"); - this.GL_MESA_program_binary_formats = hasExtension(version, exts, numExtsI, extsI, "GL_MESA_program_binary_formats"); - this.GL_MESA_resize_buffers = hasExtension(version, exts, numExtsI, extsI, "GL_MESA_resize_buffers"); - this.GL_MESA_shader_integer_functions = hasExtension(version, exts, numExtsI, extsI, "GL_MESA_shader_integer_functions"); - this.GL_MESA_tile_raster_order = hasExtension(version, exts, numExtsI, extsI, "GL_MESA_tile_raster_order"); - this.GL_MESA_window_pos = hasExtension(version, exts, numExtsI, extsI, "GL_MESA_window_pos"); - this.GL_MESA_ycbcr_texture = hasExtension(version, exts, numExtsI, extsI, "GL_MESA_ycbcr_texture"); - this.GL_NVX_blend_equation_advanced_multi_draw_buffers = hasExtension(version, exts, numExtsI, extsI, "GL_NVX_blend_equation_advanced_multi_draw_buffers"); - this.GL_NVX_conditional_render = hasExtension(version, exts, numExtsI, extsI, "GL_NVX_conditional_render"); - this.GL_NVX_gpu_memory_info = hasExtension(version, exts, numExtsI, extsI, "GL_NVX_gpu_memory_info"); - this.GL_NVX_gpu_multicast2 = hasExtension(version, exts, numExtsI, extsI, "GL_NVX_gpu_multicast2"); - this.GL_NVX_linked_gpu_multicast = hasExtension(version, exts, numExtsI, extsI, "GL_NVX_linked_gpu_multicast"); - this.GL_NVX_progress_fence = hasExtension(version, exts, numExtsI, extsI, "GL_NVX_progress_fence"); - this.GL_NV_alpha_to_coverage_dither_control = hasExtension(version, exts, numExtsI, extsI, "GL_NV_alpha_to_coverage_dither_control"); - this.GL_NV_bindless_multi_draw_indirect = hasExtension(version, exts, numExtsI, extsI, "GL_NV_bindless_multi_draw_indirect"); - this.GL_NV_bindless_multi_draw_indirect_count = hasExtension(version, exts, numExtsI, extsI, "GL_NV_bindless_multi_draw_indirect_count"); - this.GL_NV_bindless_texture = hasExtension(version, exts, numExtsI, extsI, "GL_NV_bindless_texture"); - this.GL_NV_blend_equation_advanced = hasExtension(version, exts, numExtsI, extsI, "GL_NV_blend_equation_advanced"); - this.GL_NV_blend_equation_advanced_coherent = hasExtension(version, exts, numExtsI, extsI, "GL_NV_blend_equation_advanced_coherent"); - this.GL_NV_blend_minmax_factor = hasExtension(version, exts, numExtsI, extsI, "GL_NV_blend_minmax_factor"); - this.GL_NV_blend_square = hasExtension(version, exts, numExtsI, extsI, "GL_NV_blend_square"); - this.GL_NV_clip_space_w_scaling = hasExtension(version, exts, numExtsI, extsI, "GL_NV_clip_space_w_scaling"); - this.GL_NV_command_list = hasExtension(version, exts, numExtsI, extsI, "GL_NV_command_list"); - this.GL_NV_compute_program5 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_compute_program5"); - this.GL_NV_compute_shader_derivatives = hasExtension(version, exts, numExtsI, extsI, "GL_NV_compute_shader_derivatives"); - this.GL_NV_conditional_render = hasExtension(version, exts, numExtsI, extsI, "GL_NV_conditional_render"); - this.GL_NV_conservative_raster = hasExtension(version, exts, numExtsI, extsI, "GL_NV_conservative_raster"); - this.GL_NV_conservative_raster_dilate = hasExtension(version, exts, numExtsI, extsI, "GL_NV_conservative_raster_dilate"); - this.GL_NV_conservative_raster_pre_snap = hasExtension(version, exts, numExtsI, extsI, "GL_NV_conservative_raster_pre_snap"); - this.GL_NV_conservative_raster_pre_snap_triangles = hasExtension(version, exts, numExtsI, extsI, "GL_NV_conservative_raster_pre_snap_triangles"); - this.GL_NV_conservative_raster_underestimation = hasExtension(version, exts, numExtsI, extsI, "GL_NV_conservative_raster_underestimation"); - this.GL_NV_copy_depth_to_color = hasExtension(version, exts, numExtsI, extsI, "GL_NV_copy_depth_to_color"); - this.GL_NV_copy_image = hasExtension(version, exts, numExtsI, extsI, "GL_NV_copy_image"); - this.GL_NV_deep_texture3D = hasExtension(version, exts, numExtsI, extsI, "GL_NV_deep_texture3D"); - this.GL_NV_depth_buffer_float = hasExtension(version, exts, numExtsI, extsI, "GL_NV_depth_buffer_float"); - this.GL_NV_depth_clamp = hasExtension(version, exts, numExtsI, extsI, "GL_NV_depth_clamp"); - this.GL_NV_draw_texture = hasExtension(version, exts, numExtsI, extsI, "GL_NV_draw_texture"); - this.GL_NV_draw_vulkan_image = hasExtension(version, exts, numExtsI, extsI, "GL_NV_draw_vulkan_image"); - this.GL_NV_evaluators = hasExtension(version, exts, numExtsI, extsI, "GL_NV_evaluators"); - this.GL_NV_explicit_multisample = hasExtension(version, exts, numExtsI, extsI, "GL_NV_explicit_multisample"); - this.GL_NV_fence = hasExtension(version, exts, numExtsI, extsI, "GL_NV_fence"); - this.GL_NV_fill_rectangle = hasExtension(version, exts, numExtsI, extsI, "GL_NV_fill_rectangle"); - this.GL_NV_float_buffer = hasExtension(version, exts, numExtsI, extsI, "GL_NV_float_buffer"); - this.GL_NV_fog_distance = hasExtension(version, exts, numExtsI, extsI, "GL_NV_fog_distance"); - this.GL_NV_fragment_coverage_to_color = hasExtension(version, exts, numExtsI, extsI, "GL_NV_fragment_coverage_to_color"); - this.GL_NV_fragment_program = hasExtension(version, exts, numExtsI, extsI, "GL_NV_fragment_program"); - this.GL_NV_fragment_program2 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_fragment_program2"); - this.GL_NV_fragment_program4 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_fragment_program4"); - this.GL_NV_fragment_program_option = hasExtension(version, exts, numExtsI, extsI, "GL_NV_fragment_program_option"); - this.GL_NV_fragment_shader_barycentric = hasExtension(version, exts, numExtsI, extsI, "GL_NV_fragment_shader_barycentric"); - this.GL_NV_fragment_shader_interlock = hasExtension(version, exts, numExtsI, extsI, "GL_NV_fragment_shader_interlock"); - this.GL_NV_framebuffer_mixed_samples = hasExtension(version, exts, numExtsI, extsI, "GL_NV_framebuffer_mixed_samples"); - this.GL_NV_framebuffer_multisample_coverage = hasExtension(version, exts, numExtsI, extsI, "GL_NV_framebuffer_multisample_coverage"); - this.GL_NV_geometry_program4 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_geometry_program4"); - this.GL_NV_geometry_shader4 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_geometry_shader4"); - this.GL_NV_geometry_shader_passthrough = hasExtension(version, exts, numExtsI, extsI, "GL_NV_geometry_shader_passthrough"); - this.GL_NV_gpu_multicast = hasExtension(version, exts, numExtsI, extsI, "GL_NV_gpu_multicast"); - this.GL_NV_gpu_program4 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_gpu_program4"); - this.GL_NV_gpu_program5 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_gpu_program5"); - this.GL_NV_gpu_program5_mem_extended = hasExtension(version, exts, numExtsI, extsI, "GL_NV_gpu_program5_mem_extended"); - this.GL_NV_gpu_shader5 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_gpu_shader5"); - this.GL_NV_half_float = hasExtension(version, exts, numExtsI, extsI, "GL_NV_half_float"); - this.GL_NV_internalformat_sample_query = hasExtension(version, exts, numExtsI, extsI, "GL_NV_internalformat_sample_query"); - this.GL_NV_light_max_exponent = hasExtension(version, exts, numExtsI, extsI, "GL_NV_light_max_exponent"); - this.GL_NV_memory_attachment = hasExtension(version, exts, numExtsI, extsI, "GL_NV_memory_attachment"); - this.GL_NV_memory_object_sparse = hasExtension(version, exts, numExtsI, extsI, "GL_NV_memory_object_sparse"); - this.GL_NV_mesh_shader = hasExtension(version, exts, numExtsI, extsI, "GL_NV_mesh_shader"); - this.GL_NV_multisample_coverage = hasExtension(version, exts, numExtsI, extsI, "GL_NV_multisample_coverage"); - this.GL_NV_multisample_filter_hint = hasExtension(version, exts, numExtsI, extsI, "GL_NV_multisample_filter_hint"); - this.GL_NV_occlusion_query = hasExtension(version, exts, numExtsI, extsI, "GL_NV_occlusion_query"); - this.GL_NV_packed_depth_stencil = hasExtension(version, exts, numExtsI, extsI, "GL_NV_packed_depth_stencil"); - this.GL_NV_parameter_buffer_object = hasExtension(version, exts, numExtsI, extsI, "GL_NV_parameter_buffer_object"); - this.GL_NV_parameter_buffer_object2 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_parameter_buffer_object2"); - this.GL_NV_path_rendering = hasExtension(version, exts, numExtsI, extsI, "GL_NV_path_rendering"); - this.GL_NV_path_rendering_shared_edge = hasExtension(version, exts, numExtsI, extsI, "GL_NV_path_rendering_shared_edge"); - this.GL_NV_pixel_data_range = hasExtension(version, exts, numExtsI, extsI, "GL_NV_pixel_data_range"); - this.GL_NV_point_sprite = hasExtension(version, exts, numExtsI, extsI, "GL_NV_point_sprite"); - this.GL_NV_present_video = hasExtension(version, exts, numExtsI, extsI, "GL_NV_present_video"); - this.GL_NV_primitive_restart = hasExtension(version, exts, numExtsI, extsI, "GL_NV_primitive_restart"); - this.GL_NV_primitive_shading_rate = hasExtension(version, exts, numExtsI, extsI, "GL_NV_primitive_shading_rate"); - this.GL_NV_query_resource = hasExtension(version, exts, numExtsI, extsI, "GL_NV_query_resource"); - this.GL_NV_query_resource_tag = hasExtension(version, exts, numExtsI, extsI, "GL_NV_query_resource_tag"); - this.GL_NV_register_combiners = hasExtension(version, exts, numExtsI, extsI, "GL_NV_register_combiners"); - this.GL_NV_register_combiners2 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_register_combiners2"); - this.GL_NV_representative_fragment_test = hasExtension(version, exts, numExtsI, extsI, "GL_NV_representative_fragment_test"); - this.GL_NV_robustness_video_memory_purge = hasExtension(version, exts, numExtsI, extsI, "GL_NV_robustness_video_memory_purge"); - this.GL_NV_sample_locations = hasExtension(version, exts, numExtsI, extsI, "GL_NV_sample_locations"); - this.GL_NV_sample_mask_override_coverage = hasExtension(version, exts, numExtsI, extsI, "GL_NV_sample_mask_override_coverage"); - this.GL_NV_scissor_exclusive = hasExtension(version, exts, numExtsI, extsI, "GL_NV_scissor_exclusive"); - this.GL_NV_shader_atomic_counters = hasExtension(version, exts, numExtsI, extsI, "GL_NV_shader_atomic_counters"); - this.GL_NV_shader_atomic_float = hasExtension(version, exts, numExtsI, extsI, "GL_NV_shader_atomic_float"); - this.GL_NV_shader_atomic_float64 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_shader_atomic_float64"); - this.GL_NV_shader_atomic_fp16_vector = hasExtension(version, exts, numExtsI, extsI, "GL_NV_shader_atomic_fp16_vector"); - this.GL_NV_shader_atomic_int64 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_shader_atomic_int64"); - this.GL_NV_shader_buffer_load = hasExtension(version, exts, numExtsI, extsI, "GL_NV_shader_buffer_load"); - this.GL_NV_shader_buffer_store = hasExtension(version, exts, numExtsI, extsI, "GL_NV_shader_buffer_store"); - this.GL_NV_shader_storage_buffer_object = hasExtension(version, exts, numExtsI, extsI, "GL_NV_shader_storage_buffer_object"); - this.GL_NV_shader_subgroup_partitioned = hasExtension(version, exts, numExtsI, extsI, "GL_NV_shader_subgroup_partitioned"); - this.GL_NV_shader_texture_footprint = hasExtension(version, exts, numExtsI, extsI, "GL_NV_shader_texture_footprint"); - this.GL_NV_shader_thread_group = hasExtension(version, exts, numExtsI, extsI, "GL_NV_shader_thread_group"); - this.GL_NV_shader_thread_shuffle = hasExtension(version, exts, numExtsI, extsI, "GL_NV_shader_thread_shuffle"); - this.GL_NV_shading_rate_image = hasExtension(version, exts, numExtsI, extsI, "GL_NV_shading_rate_image"); - this.GL_NV_stereo_view_rendering = hasExtension(version, exts, numExtsI, extsI, "GL_NV_stereo_view_rendering"); - this.GL_NV_tessellation_program5 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_tessellation_program5"); - this.GL_NV_texgen_emboss = hasExtension(version, exts, numExtsI, extsI, "GL_NV_texgen_emboss"); - this.GL_NV_texgen_reflection = hasExtension(version, exts, numExtsI, extsI, "GL_NV_texgen_reflection"); - this.GL_NV_texture_barrier = hasExtension(version, exts, numExtsI, extsI, "GL_NV_texture_barrier"); - this.GL_NV_texture_compression_vtc = hasExtension(version, exts, numExtsI, extsI, "GL_NV_texture_compression_vtc"); - this.GL_NV_texture_env_combine4 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_texture_env_combine4"); - this.GL_NV_texture_expand_normal = hasExtension(version, exts, numExtsI, extsI, "GL_NV_texture_expand_normal"); - this.GL_NV_texture_multisample = hasExtension(version, exts, numExtsI, extsI, "GL_NV_texture_multisample"); - this.GL_NV_texture_rectangle = hasExtension(version, exts, numExtsI, extsI, "GL_NV_texture_rectangle"); - this.GL_NV_texture_rectangle_compressed = hasExtension(version, exts, numExtsI, extsI, "GL_NV_texture_rectangle_compressed"); - this.GL_NV_texture_shader = hasExtension(version, exts, numExtsI, extsI, "GL_NV_texture_shader"); - this.GL_NV_texture_shader2 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_texture_shader2"); - this.GL_NV_texture_shader3 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_texture_shader3"); - this.GL_NV_timeline_semaphore = hasExtension(version, exts, numExtsI, extsI, "GL_NV_timeline_semaphore"); - this.GL_NV_transform_feedback = hasExtension(version, exts, numExtsI, extsI, "GL_NV_transform_feedback"); - this.GL_NV_transform_feedback2 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_transform_feedback2"); - this.GL_NV_uniform_buffer_std430_layout = hasExtension(version, exts, numExtsI, extsI, "GL_NV_uniform_buffer_std430_layout"); - this.GL_NV_uniform_buffer_unified_memory = hasExtension(version, exts, numExtsI, extsI, "GL_NV_uniform_buffer_unified_memory"); - this.GL_NV_vdpau_interop = hasExtension(version, exts, numExtsI, extsI, "GL_NV_vdpau_interop"); - this.GL_NV_vdpau_interop2 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_vdpau_interop2"); - this.GL_NV_vertex_array_range = hasExtension(version, exts, numExtsI, extsI, "GL_NV_vertex_array_range"); - this.GL_NV_vertex_array_range2 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_vertex_array_range2"); - this.GL_NV_vertex_attrib_integer_64bit = hasExtension(version, exts, numExtsI, extsI, "GL_NV_vertex_attrib_integer_64bit"); - this.GL_NV_vertex_buffer_unified_memory = hasExtension(version, exts, numExtsI, extsI, "GL_NV_vertex_buffer_unified_memory"); - this.GL_NV_vertex_program = hasExtension(version, exts, numExtsI, extsI, "GL_NV_vertex_program"); - this.GL_NV_vertex_program1_1 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_vertex_program1_1"); - this.GL_NV_vertex_program2 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_vertex_program2"); - this.GL_NV_vertex_program2_option = hasExtension(version, exts, numExtsI, extsI, "GL_NV_vertex_program2_option"); - this.GL_NV_vertex_program3 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_vertex_program3"); - this.GL_NV_vertex_program4 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_vertex_program4"); - this.GL_NV_video_capture = hasExtension(version, exts, numExtsI, extsI, "GL_NV_video_capture"); - this.GL_NV_viewport_array2 = hasExtension(version, exts, numExtsI, extsI, "GL_NV_viewport_array2"); - this.GL_NV_viewport_swizzle = hasExtension(version, exts, numExtsI, extsI, "GL_NV_viewport_swizzle"); - this.GL_OML_interlace = hasExtension(version, exts, numExtsI, extsI, "GL_OML_interlace"); - this.GL_OML_resample = hasExtension(version, exts, numExtsI, extsI, "GL_OML_resample"); - this.GL_OML_subsample = hasExtension(version, exts, numExtsI, extsI, "GL_OML_subsample"); - this.GL_OVR_multiview = hasExtension(version, exts, numExtsI, extsI, "GL_OVR_multiview"); - this.GL_OVR_multiview2 = hasExtension(version, exts, numExtsI, extsI, "GL_OVR_multiview2"); - this.GL_PGI_misc_hints = hasExtension(version, exts, numExtsI, extsI, "GL_PGI_misc_hints"); - this.GL_PGI_vertex_hints = hasExtension(version, exts, numExtsI, extsI, "GL_PGI_vertex_hints"); - this.GL_REND_screen_coordinates = hasExtension(version, exts, numExtsI, extsI, "GL_REND_screen_coordinates"); - this.GL_S3_s3tc = hasExtension(version, exts, numExtsI, extsI, "GL_S3_s3tc"); - this.GL_SGIS_detail_texture = hasExtension(version, exts, numExtsI, extsI, "GL_SGIS_detail_texture"); - this.GL_SGIS_fog_function = hasExtension(version, exts, numExtsI, extsI, "GL_SGIS_fog_function"); - this.GL_SGIS_generate_mipmap = hasExtension(version, exts, numExtsI, extsI, "GL_SGIS_generate_mipmap"); - this.GL_SGIS_multisample = hasExtension(version, exts, numExtsI, extsI, "GL_SGIS_multisample"); - this.GL_SGIS_pixel_texture = hasExtension(version, exts, numExtsI, extsI, "GL_SGIS_pixel_texture"); - this.GL_SGIS_point_line_texgen = hasExtension(version, exts, numExtsI, extsI, "GL_SGIS_point_line_texgen"); - this.GL_SGIS_point_parameters = hasExtension(version, exts, numExtsI, extsI, "GL_SGIS_point_parameters"); - this.GL_SGIS_sharpen_texture = hasExtension(version, exts, numExtsI, extsI, "GL_SGIS_sharpen_texture"); - this.GL_SGIS_texture4D = hasExtension(version, exts, numExtsI, extsI, "GL_SGIS_texture4D"); - this.GL_SGIS_texture_border_clamp = hasExtension(version, exts, numExtsI, extsI, "GL_SGIS_texture_border_clamp"); - this.GL_SGIS_texture_color_mask = hasExtension(version, exts, numExtsI, extsI, "GL_SGIS_texture_color_mask"); - this.GL_SGIS_texture_edge_clamp = hasExtension(version, exts, numExtsI, extsI, "GL_SGIS_texture_edge_clamp"); - this.GL_SGIS_texture_filter4 = hasExtension(version, exts, numExtsI, extsI, "GL_SGIS_texture_filter4"); - this.GL_SGIS_texture_lod = hasExtension(version, exts, numExtsI, extsI, "GL_SGIS_texture_lod"); - this.GL_SGIS_texture_select = hasExtension(version, exts, numExtsI, extsI, "GL_SGIS_texture_select"); - this.GL_SGIX_async = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_async"); - this.GL_SGIX_async_histogram = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_async_histogram"); - this.GL_SGIX_async_pixel = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_async_pixel"); - this.GL_SGIX_blend_alpha_minmax = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_blend_alpha_minmax"); - this.GL_SGIX_calligraphic_fragment = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_calligraphic_fragment"); - this.GL_SGIX_clipmap = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_clipmap"); - this.GL_SGIX_convolution_accuracy = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_convolution_accuracy"); - this.GL_SGIX_depth_pass_instrument = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_depth_pass_instrument"); - this.GL_SGIX_depth_texture = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_depth_texture"); - this.GL_SGIX_flush_raster = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_flush_raster"); - this.GL_SGIX_fog_offset = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_fog_offset"); - this.GL_SGIX_fragment_lighting = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_fragment_lighting"); - this.GL_SGIX_framezoom = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_framezoom"); - this.GL_SGIX_igloo_interface = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_igloo_interface"); - this.GL_SGIX_instruments = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_instruments"); - this.GL_SGIX_interlace = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_interlace"); - this.GL_SGIX_ir_instrument1 = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_ir_instrument1"); - this.GL_SGIX_list_priority = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_list_priority"); - this.GL_SGIX_pixel_texture = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_pixel_texture"); - this.GL_SGIX_pixel_tiles = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_pixel_tiles"); - this.GL_SGIX_polynomial_ffd = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_polynomial_ffd"); - this.GL_SGIX_reference_plane = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_reference_plane"); - this.GL_SGIX_resample = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_resample"); - this.GL_SGIX_scalebias_hint = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_scalebias_hint"); - this.GL_SGIX_shadow = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_shadow"); - this.GL_SGIX_shadow_ambient = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_shadow_ambient"); - this.GL_SGIX_sprite = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_sprite"); - this.GL_SGIX_subsample = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_subsample"); - this.GL_SGIX_tag_sample_buffer = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_tag_sample_buffer"); - this.GL_SGIX_texture_add_env = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_texture_add_env"); - this.GL_SGIX_texture_coordinate_clamp = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_texture_coordinate_clamp"); - this.GL_SGIX_texture_lod_bias = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_texture_lod_bias"); - this.GL_SGIX_texture_multi_buffer = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_texture_multi_buffer"); - this.GL_SGIX_texture_scale_bias = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_texture_scale_bias"); - this.GL_SGIX_vertex_preclip = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_vertex_preclip"); - this.GL_SGIX_ycrcb = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_ycrcb"); - this.GL_SGIX_ycrcb_subsample = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_ycrcb_subsample"); - this.GL_SGIX_ycrcba = hasExtension(version, exts, numExtsI, extsI, "GL_SGIX_ycrcba"); - this.GL_SGI_color_matrix = hasExtension(version, exts, numExtsI, extsI, "GL_SGI_color_matrix"); - this.GL_SGI_color_table = hasExtension(version, exts, numExtsI, extsI, "GL_SGI_color_table"); - this.GL_SGI_texture_color_table = hasExtension(version, exts, numExtsI, extsI, "GL_SGI_texture_color_table"); - this.GL_SUNX_constant_data = hasExtension(version, exts, numExtsI, extsI, "GL_SUNX_constant_data"); - this.GL_SUN_convolution_border_modes = hasExtension(version, exts, numExtsI, extsI, "GL_SUN_convolution_border_modes"); - this.GL_SUN_global_alpha = hasExtension(version, exts, numExtsI, extsI, "GL_SUN_global_alpha"); - this.GL_SUN_mesh_array = hasExtension(version, exts, numExtsI, extsI, "GL_SUN_mesh_array"); - this.GL_SUN_slice_accum = hasExtension(version, exts, numExtsI, extsI, "GL_SUN_slice_accum"); - this.GL_SUN_triangle_list = hasExtension(version, exts, numExtsI, extsI, "GL_SUN_triangle_list"); - this.GL_SUN_vertex = hasExtension(version, exts, numExtsI, extsI, "GL_SUN_vertex"); - this.GL_WIN_phong_shading = hasExtension(version, exts, numExtsI, extsI, "GL_WIN_phong_shading"); - this.GL_WIN_specular_fog = hasExtension(version, exts, numExtsI, extsI, "GL_WIN_specular_fog"); - - return true; - } -} diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLExtFinder.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLExtFinder.java deleted file mode 100644 index 7a66c34e..00000000 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLExtFinder.java +++ /dev/null @@ -1,82 +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.opengl; - -import overrungl.internal.RuntimeHelper; - -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; - -import static java.lang.foreign.ValueLayout.ADDRESS; -import static java.lang.foreign.ValueLayout.JAVA_INT; - -/** - * Utilities - * - * @author squid233 - * @since 0.1.0 - */ -final class GLExtFinder { - static boolean getExtensions(SegmentAllocator allocator, - int version, - MemorySegment outExts, - MemorySegment outNumExtsI, - MemorySegment[] outExtsI, - GLCapabilities caps) { - if (GLLoader.versionMajor(version) < 3) { - if (caps.glGetString == null) { - return false; - } - outExts.set(ADDRESS, 0, GL10C.ngetString(GL10C.EXTENSIONS)); - } else { - if (caps.glGetStringi == null || caps.glGetIntegerv == null) { - return false; - } - int numExtsI = GL10C.getInteger(GL30C.NUM_EXTENSIONS); - var extsI = MemorySegment.NULL; - if (numExtsI > 0) { - extsI = allocator.allocate(ADDRESS, numExtsI); - } - if (RuntimeHelper.isNullptr(extsI)) { - return false; - } - for (int index = 0; index < numExtsI; index++) { - var glStrTmp = GL30C.getStringi(GL10C.EXTENSIONS, index); - extsI.setAtIndex(ADDRESS, index, allocator.allocateFrom(glStrTmp)); - } - outNumExtsI.set(JAVA_INT, 0, numExtsI); - outExtsI[0] = extsI; - } - - return true; - } - - static boolean hasExtension(int version, String exts, int numExtsI, MemorySegment extsI, String ext) { - if (GLLoader.versionMajor(version) < 3) { - if (exts == null || ext == null) { - return false; - } - return exts.contains(ext); - } - for (int index = 0; index < numExtsI; index++) { - if (RuntimeHelper.unboundPointerString(extsI, index).equals(ext)) { - return true; - } - } - return false; - } -} diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLFinder.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLFinder.java new file mode 100644 index 00000000..4c96a83a --- /dev/null +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLFinder.java @@ -0,0 +1,144 @@ +/* + * MIT License + * + * Copyright (c) 2023-2024 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.opengl; + +import overrun.marshal.MemoryStack; +import overrun.marshal.Unmarshal; +import overrungl.util.value.Pair; + +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.Linker; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.util.Collections; +import java.util.List; +import java.util.regex.Pattern; + +/** + * Utilities + * + * @author squid233 + * @since 0.1.0 + */ +final class GLFinder { + private static final Linker LINKER = Linker.nativeLinker(); + private static final FunctionDescriptor + fd_glGetString = FunctionDescriptor.of(Unmarshal.STR_LAYOUT, ValueLayout.JAVA_INT), + fd_glGetStringi = FunctionDescriptor.of(Unmarshal.STR_LAYOUT, ValueLayout.JAVA_INT, ValueLayout.JAVA_INT), + fd_glGetIntegerv = FunctionDescriptor.ofVoid(ValueLayout.JAVA_INT, ValueLayout.ADDRESS); + private static final Pattern VERSION_PATTERN = Pattern.compile("^(\\d+)\\.(\\d+).*$"); + private static final String[] PREFIXES = { + "OpenGL ES-CM ", + "OpenGL ES-CL ", + "OpenGL ES ", + "OpenGL SC " + }; + private static final Pair.OfInt NO_CORE_GL = new Pair.OfInt(0, 0); + + static Pair.OfInt findCoreGL(GLLoadFunc load) { + final MethodHandle glGetString = toHandle(load, "glGetString", fd_glGetString); + if (glGetString == null) return NO_CORE_GL; + + String version; + try { + version = ((MemorySegment) glGetString.invokeExact(GL.VERSION)).getString(0L); + } catch (Throwable e) { + throw new RuntimeException(e); + } + if (version == null) return NO_CORE_GL; + + for (var prefix : PREFIXES) { + if (version.startsWith(prefix)) { + version = version.substring(prefix.length()); + break; + } + } + + var matcher = VERSION_PATTERN.matcher(version); + if (matcher.find()) { + return new Pair.OfInt(Integer.parseInt(matcher.group(1)), + Integer.parseInt(matcher.group(2))); + } + return NO_CORE_GL; + } + + static boolean getExtensions(GLLoadFunc load, + int major, + List list) { + // < 3.0 + if (major < 3) { + final MethodHandle glGetString = toHandle(load, "glGetString", fd_glGetString); + if (glGetString == null) { + return false; + } + try { + Collections.addAll(list, ((MemorySegment) glGetString.invokeExact(GL.EXTENSIONS)).getString(0L).split("\\s+")); + return true; + } catch (Throwable e) { + throw new RuntimeException(e); + } + } + + // 3.0 + // method handles + final MethodHandle glGetStringi = toHandle(load, "glGetStringi", fd_glGetStringi); + if (glGetStringi == null) { + return false; + } + final MethodHandle glGetIntegerv = toHandle(load, "glGetIntegerv", fd_glGetIntegerv); + if (glGetIntegerv == null) { + return false; + } + + // extension count + int numExtsI; + try (MemoryStack stack = MemoryStack.stackPush()) { + final MemorySegment pNumExtsI = stack.allocate(ValueLayout.JAVA_INT); + try { + glGetIntegerv.invokeExact(GL.NUM_EXTENSIONS, pNumExtsI); + } catch (Throwable e) { + throw new RuntimeException(e); + } + numExtsI = pNumExtsI.get(ValueLayout.JAVA_INT, 0L); + if (numExtsI <= 0) { + return false; + } + } + + // write to the extension array + for (int index = 0; index < numExtsI; index++) { + MemorySegment glStrTmp; + try { + glStrTmp = (MemorySegment) glGetStringi.invokeExact(GL.EXTENSIONS, index); + } catch (Throwable e) { + throw new RuntimeException(e); + } + list.add(glStrTmp.getString(0L)); + } + + return true; + } + + private static MethodHandle toHandle(GLLoadFunc load, String name, FunctionDescriptor descriptor) { + final MemorySegment segment = load.invoke(name); + if (Unmarshal.isNullPointer(segment)) { + return null; + } + return LINKER.downcallHandle(segment, descriptor); + } +} diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLFlags.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLFlags.java new file mode 100644 index 00000000..e20a3d5e --- /dev/null +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLFlags.java @@ -0,0 +1,687 @@ +/* + * MIT License + * + * Copyright (c) 2022-present 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. + */ + +// This file is auto-generated. DO NOT EDIT! +package overrungl.opengl; + +/** + * The OpenGL flags. + * + * @since 0.1.0 + */ +public final class GLFlags { + final GLLoadFunc load; + final boolean foundExtension; + /** The OpenGL core flags. */ + public final boolean GL10, GL11, GL12, GL13, GL14, GL15, + GL20, GL21, + GL30, GL31, GL32, GL33, + GL40, GL41, GL42, GL43, GL44, GL45, GL46; + /** The OpenGL extension flags. */ + public final boolean GL_ARB_ES2_compatibility, GL_ARB_ES3_1_compatibility, GL_ARB_ES3_2_compatibility, GL_ARB_ES3_compatibility, GL_ARB_arrays_of_arrays, GL_ARB_base_instance, GL_ARB_bindless_texture, GL_ARB_blend_func_extended, GL_ARB_buffer_storage, GL_ARB_cl_event, GL_ARB_clear_buffer_object, GL_ARB_clear_texture, GL_ARB_clip_control, GL_ARB_color_buffer_float, GL_ARB_compatibility, GL_ARB_compressed_texture_pixel_storage, GL_ARB_compute_shader, GL_ARB_compute_variable_group_size, GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth, GL_ARB_copy_buffer, GL_ARB_copy_image, GL_ARB_cull_distance, GL_ARB_debug_output, GL_ARB_depth_buffer_float, GL_ARB_depth_clamp, GL_ARB_depth_texture, GL_ARB_derivative_control, GL_ARB_direct_state_access, GL_ARB_draw_buffers, GL_ARB_draw_buffers_blend, GL_ARB_draw_elements_base_vertex, GL_ARB_draw_indirect, GL_ARB_draw_instanced, GL_ARB_enhanced_layouts, GL_ARB_explicit_attrib_location, GL_ARB_explicit_uniform_location, GL_ARB_fragment_coord_conventions, GL_ARB_fragment_layer_viewport, GL_ARB_fragment_program, GL_ARB_fragment_program_shadow, GL_ARB_fragment_shader, GL_ARB_fragment_shader_interlock, GL_ARB_framebuffer_no_attachments, GL_ARB_framebuffer_object, GL_ARB_framebuffer_sRGB, GL_ARB_geometry_shader4, GL_ARB_get_program_binary, GL_ARB_get_texture_sub_image, GL_ARB_gl_spirv, GL_ARB_gpu_shader5, GL_ARB_gpu_shader_fp64, GL_ARB_gpu_shader_int64, GL_ARB_half_float_pixel, GL_ARB_half_float_vertex, GL_ARB_imaging, GL_ARB_indirect_parameters, GL_ARB_instanced_arrays, GL_ARB_internalformat_query, GL_ARB_internalformat_query2, GL_ARB_invalidate_subdata, GL_ARB_map_buffer_alignment, GL_ARB_map_buffer_range, GL_ARB_matrix_palette, GL_ARB_multi_bind, GL_ARB_multi_draw_indirect, GL_ARB_multisample, GL_ARB_multitexture, GL_ARB_occlusion_query, GL_ARB_occlusion_query2, GL_ARB_parallel_shader_compile, GL_ARB_pipeline_statistics_query, GL_ARB_pixel_buffer_object, GL_ARB_point_parameters, GL_ARB_point_sprite, GL_ARB_polygon_offset_clamp, GL_ARB_post_depth_coverage, GL_ARB_program_interface_query, GL_ARB_provoking_vertex, GL_ARB_query_buffer_object, GL_ARB_robust_buffer_access_behavior, GL_ARB_robustness, GL_ARB_robustness_isolation, GL_ARB_sample_locations, GL_ARB_sample_shading, GL_ARB_sampler_objects, GL_ARB_seamless_cube_map, GL_ARB_seamless_cubemap_per_texture, GL_ARB_separate_shader_objects, GL_ARB_shader_atomic_counter_ops, GL_ARB_shader_atomic_counters, GL_ARB_shader_ballot, GL_ARB_shader_bit_encoding, GL_ARB_shader_clock, GL_ARB_shader_draw_parameters, GL_ARB_shader_group_vote, GL_ARB_shader_image_load_store, GL_ARB_shader_image_size, GL_ARB_shader_objects, GL_ARB_shader_precision, GL_ARB_shader_stencil_export, GL_ARB_shader_storage_buffer_object, GL_ARB_shader_subroutine, GL_ARB_shader_texture_image_samples, GL_ARB_shader_texture_lod, GL_ARB_shader_viewport_layer_array, GL_ARB_shading_language_100, GL_ARB_shading_language_420pack, GL_ARB_shading_language_include, GL_ARB_shading_language_packing, GL_ARB_shadow, GL_ARB_shadow_ambient, GL_ARB_sparse_buffer, GL_ARB_sparse_texture, GL_ARB_sparse_texture2, GL_ARB_sparse_texture_clamp, GL_ARB_spirv_extensions, GL_ARB_stencil_texturing, GL_ARB_sync, GL_ARB_tessellation_shader, GL_ARB_texture_barrier, GL_ARB_texture_border_clamp, GL_ARB_texture_buffer_object, GL_ARB_texture_buffer_object_rgb32, GL_ARB_texture_buffer_range, GL_ARB_texture_compression, GL_ARB_texture_compression_bptc, GL_ARB_texture_compression_rgtc, GL_ARB_texture_cube_map, GL_ARB_texture_cube_map_array, GL_ARB_texture_env_add, GL_ARB_texture_env_combine, GL_ARB_texture_env_crossbar, GL_ARB_texture_env_dot3, GL_ARB_texture_filter_anisotropic, GL_ARB_texture_filter_minmax, GL_ARB_texture_float, GL_ARB_texture_gather, GL_ARB_texture_mirror_clamp_to_edge, GL_ARB_texture_mirrored_repeat, GL_ARB_texture_multisample, GL_ARB_texture_non_power_of_two, GL_ARB_texture_query_levels, GL_ARB_texture_query_lod, GL_ARB_texture_rectangle, GL_ARB_texture_rg, GL_ARB_texture_rgb10_a2ui, GL_ARB_texture_stencil8, GL_ARB_texture_storage, GL_ARB_texture_storage_multisample, GL_ARB_texture_swizzle, GL_ARB_texture_view, GL_ARB_timer_query, GL_ARB_transform_feedback2, GL_ARB_transform_feedback3, GL_ARB_transform_feedback_instanced, GL_ARB_transform_feedback_overflow_query, GL_ARB_transpose_matrix, GL_ARB_uniform_buffer_object, GL_ARB_vertex_array_bgra, GL_ARB_vertex_array_object, GL_ARB_vertex_attrib_64bit, GL_ARB_vertex_attrib_binding, GL_ARB_vertex_blend, GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, GL_ARB_vertex_shader, GL_ARB_vertex_type_10f_11f_11f_rev, GL_ARB_vertex_type_2_10_10_10_rev, GL_ARB_viewport_array, GL_ARB_window_pos, GL_KHR_blend_equation_advanced, GL_KHR_blend_equation_advanced_coherent, GL_KHR_context_flush_control, GL_KHR_debug, GL_KHR_no_error, GL_KHR_parallel_shader_compile, GL_KHR_robust_buffer_access_behavior, GL_KHR_robustness, GL_KHR_shader_subgroup, GL_KHR_texture_compression_astc_hdr, GL_KHR_texture_compression_astc_ldr, GL_KHR_texture_compression_astc_sliced_3d, GL_OES_byte_coordinates, GL_OES_compressed_paletted_texture, GL_OES_fixed_point, GL_OES_query_matrix, GL_OES_read_format, GL_OES_single_precision, GL_3DFX_multisample, GL_3DFX_tbuffer, GL_3DFX_texture_compression_FXT1, GL_AMD_blend_minmax_factor, GL_AMD_conservative_depth, GL_AMD_debug_output, GL_AMD_depth_clamp_separate, GL_AMD_draw_buffers_blend, GL_AMD_framebuffer_multisample_advanced, GL_AMD_framebuffer_sample_positions, GL_AMD_gcn_shader, GL_AMD_gpu_shader_half_float, GL_AMD_gpu_shader_int16, GL_AMD_gpu_shader_int64, GL_AMD_interleaved_elements, GL_AMD_multi_draw_indirect, GL_AMD_name_gen_delete, GL_AMD_occlusion_query_event, GL_AMD_performance_monitor, GL_AMD_pinned_memory, GL_AMD_query_buffer_object, GL_AMD_sample_positions, GL_AMD_seamless_cubemap_per_texture, GL_AMD_shader_atomic_counter_ops, GL_AMD_shader_ballot, GL_AMD_shader_explicit_vertex_parameter, GL_AMD_shader_gpu_shader_half_float_fetch, GL_AMD_shader_image_load_store_lod, GL_AMD_shader_stencil_export, GL_AMD_shader_trinary_minmax, GL_AMD_sparse_texture, GL_AMD_stencil_operation_extended, GL_AMD_texture_gather_bias_lod, GL_AMD_texture_texture4, GL_AMD_transform_feedback3_lines_triangles, GL_AMD_transform_feedback4, GL_AMD_vertex_shader_layer, GL_AMD_vertex_shader_tessellator, GL_AMD_vertex_shader_viewport_index, GL_APPLE_aux_depth_stencil, GL_APPLE_client_storage, GL_APPLE_element_array, GL_APPLE_fence, GL_APPLE_float_pixels, GL_APPLE_flush_buffer_range, GL_APPLE_object_purgeable, GL_APPLE_rgb_422, GL_APPLE_row_bytes, GL_APPLE_specular_vector, GL_APPLE_texture_range, GL_APPLE_transform_hint, GL_APPLE_vertex_array_object, GL_APPLE_vertex_array_range, GL_APPLE_vertex_program_evaluators, GL_APPLE_ycbcr_422, GL_ATI_draw_buffers, GL_ATI_element_array, GL_ATI_envmap_bumpmap, GL_ATI_fragment_shader, GL_ATI_map_object_buffer, GL_ATI_meminfo, GL_ATI_pixel_format_float, GL_ATI_pn_triangles, GL_ATI_separate_stencil, GL_ATI_text_fragment_shader, GL_ATI_texture_env_combine3, GL_ATI_texture_float, GL_ATI_texture_mirror_once, GL_ATI_vertex_array_object, GL_ATI_vertex_attrib_array_object, GL_ATI_vertex_streams, GL_EXT_422_pixels, GL_EXT_EGL_image_storage, GL_EXT_EGL_sync, GL_EXT_abgr, GL_EXT_bgra, GL_EXT_bindable_uniform, GL_EXT_blend_color, GL_EXT_blend_equation_separate, GL_EXT_blend_func_separate, GL_EXT_blend_logic_op, GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_clip_volume_hint, GL_EXT_cmyka, GL_EXT_color_subtable, GL_EXT_compiled_vertex_array, GL_EXT_convolution, GL_EXT_coordinate_frame, GL_EXT_copy_texture, GL_EXT_cull_vertex, GL_EXT_debug_label, GL_EXT_debug_marker, GL_EXT_depth_bounds_test, GL_EXT_direct_state_access, GL_EXT_draw_buffers2, GL_EXT_draw_instanced, GL_EXT_draw_range_elements, GL_EXT_external_buffer, GL_EXT_fog_coord, GL_EXT_framebuffer_blit, GL_EXT_framebuffer_blit_layers, GL_EXT_framebuffer_multisample, GL_EXT_framebuffer_multisample_blit_scaled, GL_EXT_framebuffer_object, GL_EXT_framebuffer_sRGB, GL_EXT_geometry_shader4, GL_EXT_gpu_program_parameters, GL_EXT_gpu_shader4, GL_EXT_histogram, GL_EXT_index_array_formats, GL_EXT_index_func, GL_EXT_index_material, GL_EXT_index_texture, GL_EXT_light_texture, GL_EXT_memory_object, GL_EXT_memory_object_fd, GL_EXT_memory_object_win32, GL_EXT_misc_attribute, GL_EXT_multi_draw_arrays, GL_EXT_multisample, GL_EXT_multiview_tessellation_geometry_shader, GL_EXT_multiview_texture_multisample, GL_EXT_multiview_timer_query, GL_EXT_packed_depth_stencil, GL_EXT_packed_float, GL_EXT_packed_pixels, GL_EXT_paletted_texture, GL_EXT_pixel_buffer_object, GL_EXT_pixel_transform, GL_EXT_pixel_transform_color_table, GL_EXT_point_parameters, GL_EXT_polygon_offset, GL_EXT_polygon_offset_clamp, GL_EXT_post_depth_coverage, GL_EXT_provoking_vertex, GL_EXT_raster_multisample, GL_EXT_rescale_normal, GL_EXT_secondary_color, GL_EXT_semaphore, GL_EXT_semaphore_fd, GL_EXT_semaphore_win32, GL_EXT_separate_shader_objects, GL_EXT_separate_specular_color, GL_EXT_shader_framebuffer_fetch, GL_EXT_shader_framebuffer_fetch_non_coherent, GL_EXT_shader_image_load_formatted, GL_EXT_shader_image_load_store, GL_EXT_shader_integer_mix, GL_EXT_shader_samples_identical, GL_EXT_shadow_funcs, GL_EXT_shared_texture_palette, GL_EXT_sparse_texture2, GL_EXT_stencil_clear_tag, GL_EXT_stencil_two_side, GL_EXT_stencil_wrap, GL_EXT_subtexture, GL_EXT_texture, GL_EXT_texture3D, GL_EXT_texture_array, GL_EXT_texture_buffer_object, GL_EXT_texture_compression_latc, GL_EXT_texture_compression_rgtc, GL_EXT_texture_compression_s3tc, GL_EXT_texture_cube_map, GL_EXT_texture_env_add, GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3, GL_EXT_texture_filter_anisotropic, GL_EXT_texture_filter_minmax, GL_EXT_texture_integer, GL_EXT_texture_lod_bias, GL_EXT_texture_mirror_clamp, GL_EXT_texture_object, GL_EXT_texture_perturb_normal, GL_EXT_texture_sRGB, GL_EXT_texture_sRGB_R8, GL_EXT_texture_sRGB_RG8, GL_EXT_texture_sRGB_decode, GL_EXT_texture_shadow_lod, GL_EXT_texture_shared_exponent, GL_EXT_texture_snorm, GL_EXT_texture_storage, GL_EXT_texture_swizzle, GL_EXT_timer_query, GL_EXT_transform_feedback, GL_EXT_vertex_array, GL_EXT_vertex_array_bgra, GL_EXT_vertex_attrib_64bit, GL_EXT_vertex_shader, GL_EXT_vertex_weighting, GL_EXT_win32_keyed_mutex, GL_EXT_window_rectangles, GL_EXT_x11_sync_object, GL_GREMEDY_frame_terminator, GL_GREMEDY_string_marker, GL_HP_convolution_border_modes, GL_HP_image_transform, GL_HP_occlusion_test, GL_HP_texture_lighting, GL_IBM_cull_vertex, GL_IBM_multimode_draw_arrays, GL_IBM_rasterpos_clip, GL_IBM_static_data, GL_IBM_texture_mirrored_repeat, GL_IBM_vertex_array_lists, GL_INGR_blend_func_separate, GL_INGR_color_clamp, GL_INGR_interlace_read, GL_INTEL_blackhole_render, GL_INTEL_conservative_rasterization, GL_INTEL_fragment_shader_ordering, GL_INTEL_framebuffer_CMAA, GL_INTEL_map_texture, GL_INTEL_parallel_arrays, GL_INTEL_performance_query, GL_MESAX_texture_stack, GL_MESA_framebuffer_flip_x, GL_MESA_framebuffer_flip_y, GL_MESA_framebuffer_swap_xy, GL_MESA_pack_invert, GL_MESA_program_binary_formats, GL_MESA_resize_buffers, GL_MESA_shader_integer_functions, GL_MESA_tile_raster_order, GL_MESA_window_pos, GL_MESA_ycbcr_texture, GL_NVX_blend_equation_advanced_multi_draw_buffers, GL_NVX_conditional_render, GL_NVX_gpu_memory_info, GL_NVX_gpu_multicast2, GL_NVX_linked_gpu_multicast, GL_NVX_progress_fence, GL_NV_alpha_to_coverage_dither_control, GL_NV_bindless_multi_draw_indirect, GL_NV_bindless_multi_draw_indirect_count, GL_NV_bindless_texture, GL_NV_blend_equation_advanced, GL_NV_blend_equation_advanced_coherent, GL_NV_blend_minmax_factor, GL_NV_blend_square, GL_NV_clip_space_w_scaling, GL_NV_command_list, GL_NV_compute_program5, GL_NV_compute_shader_derivatives, GL_NV_conditional_render, GL_NV_conservative_raster, GL_NV_conservative_raster_dilate, GL_NV_conservative_raster_pre_snap, GL_NV_conservative_raster_pre_snap_triangles, GL_NV_conservative_raster_underestimation, GL_NV_copy_depth_to_color, GL_NV_copy_image, GL_NV_deep_texture3D, GL_NV_depth_buffer_float, GL_NV_depth_clamp, GL_NV_draw_texture, GL_NV_draw_vulkan_image, GL_NV_evaluators, GL_NV_explicit_multisample, GL_NV_fence, GL_NV_fill_rectangle, GL_NV_float_buffer, GL_NV_fog_distance, GL_NV_fragment_coverage_to_color, GL_NV_fragment_program, GL_NV_fragment_program2, GL_NV_fragment_program4, GL_NV_fragment_program_option, GL_NV_fragment_shader_barycentric, GL_NV_fragment_shader_interlock, GL_NV_framebuffer_mixed_samples, GL_NV_framebuffer_multisample_coverage, GL_NV_geometry_program4, GL_NV_geometry_shader4, GL_NV_geometry_shader_passthrough, GL_NV_gpu_multicast, GL_NV_gpu_program4, GL_NV_gpu_program5, GL_NV_gpu_program5_mem_extended, GL_NV_gpu_shader5, GL_NV_half_float, GL_NV_internalformat_sample_query, GL_NV_light_max_exponent, GL_NV_memory_attachment, GL_NV_memory_object_sparse, GL_NV_mesh_shader, GL_NV_multisample_coverage, GL_NV_multisample_filter_hint, GL_NV_occlusion_query, GL_NV_packed_depth_stencil, GL_NV_parameter_buffer_object, GL_NV_parameter_buffer_object2, GL_NV_path_rendering, GL_NV_path_rendering_shared_edge, GL_NV_pixel_data_range, GL_NV_point_sprite, GL_NV_present_video, GL_NV_primitive_restart, GL_NV_primitive_shading_rate, GL_NV_query_resource, GL_NV_query_resource_tag, GL_NV_register_combiners, GL_NV_register_combiners2, GL_NV_representative_fragment_test, GL_NV_robustness_video_memory_purge, GL_NV_sample_locations, GL_NV_sample_mask_override_coverage, GL_NV_scissor_exclusive, GL_NV_shader_atomic_counters, GL_NV_shader_atomic_float, GL_NV_shader_atomic_float64, GL_NV_shader_atomic_fp16_vector, GL_NV_shader_atomic_int64, GL_NV_shader_buffer_load, GL_NV_shader_buffer_store, GL_NV_shader_storage_buffer_object, GL_NV_shader_subgroup_partitioned, GL_NV_shader_texture_footprint, GL_NV_shader_thread_group, GL_NV_shader_thread_shuffle, GL_NV_shading_rate_image, GL_NV_stereo_view_rendering, GL_NV_tessellation_program5, GL_NV_texgen_emboss, GL_NV_texgen_reflection, GL_NV_texture_barrier, GL_NV_texture_compression_vtc, GL_NV_texture_env_combine4, GL_NV_texture_expand_normal, GL_NV_texture_multisample, GL_NV_texture_rectangle, GL_NV_texture_rectangle_compressed, GL_NV_texture_shader, GL_NV_texture_shader2, GL_NV_texture_shader3, GL_NV_timeline_semaphore, GL_NV_transform_feedback, GL_NV_transform_feedback2, GL_NV_uniform_buffer_std430_layout, GL_NV_uniform_buffer_unified_memory, GL_NV_vdpau_interop, GL_NV_vdpau_interop2, GL_NV_vertex_array_range, GL_NV_vertex_array_range2, GL_NV_vertex_attrib_integer_64bit, GL_NV_vertex_buffer_unified_memory, GL_NV_vertex_program, GL_NV_vertex_program1_1, GL_NV_vertex_program2, GL_NV_vertex_program2_option, GL_NV_vertex_program3, GL_NV_vertex_program4, GL_NV_video_capture, GL_NV_viewport_array2, GL_NV_viewport_swizzle, GL_OML_interlace, GL_OML_resample, GL_OML_subsample, GL_OVR_multiview, GL_OVR_multiview2, GL_PGI_misc_hints, GL_PGI_vertex_hints, GL_REND_screen_coordinates, GL_S3_s3tc, GL_SGIS_detail_texture, GL_SGIS_fog_function, GL_SGIS_generate_mipmap, GL_SGIS_multisample, GL_SGIS_pixel_texture, GL_SGIS_point_line_texgen, GL_SGIS_point_parameters, GL_SGIS_sharpen_texture, GL_SGIS_texture4D, GL_SGIS_texture_border_clamp, GL_SGIS_texture_color_mask, GL_SGIS_texture_edge_clamp, GL_SGIS_texture_filter4, GL_SGIS_texture_lod, GL_SGIS_texture_select, GL_SGIX_async, GL_SGIX_async_histogram, GL_SGIX_async_pixel, GL_SGIX_blend_alpha_minmax, GL_SGIX_calligraphic_fragment, GL_SGIX_clipmap, GL_SGIX_convolution_accuracy, GL_SGIX_depth_pass_instrument, GL_SGIX_depth_texture, GL_SGIX_flush_raster, GL_SGIX_fog_offset, GL_SGIX_fragment_lighting, GL_SGIX_framezoom, GL_SGIX_igloo_interface, GL_SGIX_instruments, GL_SGIX_interlace, GL_SGIX_ir_instrument1, GL_SGIX_list_priority, GL_SGIX_pixel_texture, GL_SGIX_pixel_tiles, GL_SGIX_polynomial_ffd, GL_SGIX_reference_plane, GL_SGIX_resample, GL_SGIX_scalebias_hint, GL_SGIX_shadow, GL_SGIX_shadow_ambient, GL_SGIX_sprite, GL_SGIX_subsample, GL_SGIX_tag_sample_buffer, GL_SGIX_texture_add_env, GL_SGIX_texture_coordinate_clamp, GL_SGIX_texture_lod_bias, GL_SGIX_texture_multi_buffer, GL_SGIX_texture_scale_bias, GL_SGIX_vertex_preclip, GL_SGIX_ycrcb, GL_SGIX_ycrcb_subsample, GL_SGIX_ycrcba, GL_SGI_color_matrix, GL_SGI_color_table, GL_SGI_texture_color_table, GL_SUNX_constant_data, GL_SUN_convolution_border_modes, GL_SUN_global_alpha, GL_SUN_mesh_array, GL_SUN_slice_accum, GL_SUN_triangle_list, GL_SUN_vertex, GL_WIN_phong_shading, GL_WIN_specular_fog; + + /** + * Construct OpenGL flags. + * + * @param load the function where to find OpenGL functions. + */ + GLFlags(GLLoadFunc load) { + this.load = load; + var core = GLFinder.findCoreGL(load); + int major = core.x(); + int minor = core.y(); + this.GL10 = (major == 1 && minor >= 0) || major > 1; + this.GL11 = (major == 1 && minor >= 1) || major > 1; + this.GL12 = (major == 1 && minor >= 2) || major > 1; + this.GL13 = (major == 1 && minor >= 3) || major > 1; + this.GL14 = (major == 1 && minor >= 4) || major > 1; + this.GL15 = (major == 1 && minor >= 5) || major > 1; + this.GL20 = (major == 2 && minor >= 0) || major > 2; + this.GL21 = (major == 2 && minor >= 1) || major > 2; + this.GL30 = (major == 3 && minor >= 0) || major > 3; + this.GL31 = (major == 3 && minor >= 1) || major > 3; + this.GL32 = (major == 3 && minor >= 2) || major > 3; + this.GL33 = (major == 3 && minor >= 3) || major > 3; + this.GL40 = (major == 4 && minor >= 0) || major > 4; + this.GL41 = (major == 4 && minor >= 1) || major > 4; + this.GL42 = (major == 4 && minor >= 2) || major > 4; + this.GL43 = (major == 4 && minor >= 3) || major > 4; + this.GL44 = (major == 4 && minor >= 4) || major > 4; + this.GL45 = (major == 4 && minor >= 5) || major > 4; + this.GL46 = (major == 4 && minor >= 6) || major > 4; + var list = new java.util.ArrayList(700); + this.foundExtension = GLFinder.getExtensions(load, major, list); + this.GL_ARB_ES2_compatibility = this.foundExtension && list.contains("GL_ARB_ES2_compatibility"); + this.GL_ARB_ES3_1_compatibility = this.foundExtension && list.contains("GL_ARB_ES3_1_compatibility"); + this.GL_ARB_ES3_2_compatibility = this.foundExtension && list.contains("GL_ARB_ES3_2_compatibility"); + this.GL_ARB_ES3_compatibility = this.foundExtension && list.contains("GL_ARB_ES3_compatibility"); + this.GL_ARB_arrays_of_arrays = this.foundExtension && list.contains("GL_ARB_arrays_of_arrays"); + this.GL_ARB_base_instance = this.foundExtension && list.contains("GL_ARB_base_instance"); + this.GL_ARB_bindless_texture = this.foundExtension && list.contains("GL_ARB_bindless_texture"); + this.GL_ARB_blend_func_extended = this.foundExtension && list.contains("GL_ARB_blend_func_extended"); + this.GL_ARB_buffer_storage = this.foundExtension && list.contains("GL_ARB_buffer_storage"); + this.GL_ARB_cl_event = this.foundExtension && list.contains("GL_ARB_cl_event"); + this.GL_ARB_clear_buffer_object = this.foundExtension && list.contains("GL_ARB_clear_buffer_object"); + this.GL_ARB_clear_texture = this.foundExtension && list.contains("GL_ARB_clear_texture"); + this.GL_ARB_clip_control = this.foundExtension && list.contains("GL_ARB_clip_control"); + this.GL_ARB_color_buffer_float = this.foundExtension && list.contains("GL_ARB_color_buffer_float"); + this.GL_ARB_compatibility = this.foundExtension && list.contains("GL_ARB_compatibility"); + this.GL_ARB_compressed_texture_pixel_storage = this.foundExtension && list.contains("GL_ARB_compressed_texture_pixel_storage"); + this.GL_ARB_compute_shader = this.foundExtension && list.contains("GL_ARB_compute_shader"); + this.GL_ARB_compute_variable_group_size = this.foundExtension && list.contains("GL_ARB_compute_variable_group_size"); + this.GL_ARB_conditional_render_inverted = this.foundExtension && list.contains("GL_ARB_conditional_render_inverted"); + this.GL_ARB_conservative_depth = this.foundExtension && list.contains("GL_ARB_conservative_depth"); + this.GL_ARB_copy_buffer = this.foundExtension && list.contains("GL_ARB_copy_buffer"); + this.GL_ARB_copy_image = this.foundExtension && list.contains("GL_ARB_copy_image"); + this.GL_ARB_cull_distance = this.foundExtension && list.contains("GL_ARB_cull_distance"); + this.GL_ARB_debug_output = this.foundExtension && list.contains("GL_ARB_debug_output"); + this.GL_ARB_depth_buffer_float = this.foundExtension && list.contains("GL_ARB_depth_buffer_float"); + this.GL_ARB_depth_clamp = this.foundExtension && list.contains("GL_ARB_depth_clamp"); + this.GL_ARB_depth_texture = this.foundExtension && list.contains("GL_ARB_depth_texture"); + this.GL_ARB_derivative_control = this.foundExtension && list.contains("GL_ARB_derivative_control"); + this.GL_ARB_direct_state_access = this.foundExtension && list.contains("GL_ARB_direct_state_access"); + this.GL_ARB_draw_buffers = this.foundExtension && list.contains("GL_ARB_draw_buffers"); + this.GL_ARB_draw_buffers_blend = this.foundExtension && list.contains("GL_ARB_draw_buffers_blend"); + this.GL_ARB_draw_elements_base_vertex = this.foundExtension && list.contains("GL_ARB_draw_elements_base_vertex"); + this.GL_ARB_draw_indirect = this.foundExtension && list.contains("GL_ARB_draw_indirect"); + this.GL_ARB_draw_instanced = this.foundExtension && list.contains("GL_ARB_draw_instanced"); + this.GL_ARB_enhanced_layouts = this.foundExtension && list.contains("GL_ARB_enhanced_layouts"); + this.GL_ARB_explicit_attrib_location = this.foundExtension && list.contains("GL_ARB_explicit_attrib_location"); + this.GL_ARB_explicit_uniform_location = this.foundExtension && list.contains("GL_ARB_explicit_uniform_location"); + this.GL_ARB_fragment_coord_conventions = this.foundExtension && list.contains("GL_ARB_fragment_coord_conventions"); + this.GL_ARB_fragment_layer_viewport = this.foundExtension && list.contains("GL_ARB_fragment_layer_viewport"); + this.GL_ARB_fragment_program = this.foundExtension && list.contains("GL_ARB_fragment_program"); + this.GL_ARB_fragment_program_shadow = this.foundExtension && list.contains("GL_ARB_fragment_program_shadow"); + this.GL_ARB_fragment_shader = this.foundExtension && list.contains("GL_ARB_fragment_shader"); + this.GL_ARB_fragment_shader_interlock = this.foundExtension && list.contains("GL_ARB_fragment_shader_interlock"); + this.GL_ARB_framebuffer_no_attachments = this.foundExtension && list.contains("GL_ARB_framebuffer_no_attachments"); + this.GL_ARB_framebuffer_object = this.foundExtension && list.contains("GL_ARB_framebuffer_object"); + this.GL_ARB_framebuffer_sRGB = this.foundExtension && list.contains("GL_ARB_framebuffer_sRGB"); + this.GL_ARB_geometry_shader4 = this.foundExtension && list.contains("GL_ARB_geometry_shader4"); + this.GL_ARB_get_program_binary = this.foundExtension && list.contains("GL_ARB_get_program_binary"); + this.GL_ARB_get_texture_sub_image = this.foundExtension && list.contains("GL_ARB_get_texture_sub_image"); + this.GL_ARB_gl_spirv = this.foundExtension && list.contains("GL_ARB_gl_spirv"); + this.GL_ARB_gpu_shader5 = this.foundExtension && list.contains("GL_ARB_gpu_shader5"); + this.GL_ARB_gpu_shader_fp64 = this.foundExtension && list.contains("GL_ARB_gpu_shader_fp64"); + this.GL_ARB_gpu_shader_int64 = this.foundExtension && list.contains("GL_ARB_gpu_shader_int64"); + this.GL_ARB_half_float_pixel = this.foundExtension && list.contains("GL_ARB_half_float_pixel"); + this.GL_ARB_half_float_vertex = this.foundExtension && list.contains("GL_ARB_half_float_vertex"); + this.GL_ARB_imaging = this.foundExtension && list.contains("GL_ARB_imaging"); + this.GL_ARB_indirect_parameters = this.foundExtension && list.contains("GL_ARB_indirect_parameters"); + this.GL_ARB_instanced_arrays = this.foundExtension && list.contains("GL_ARB_instanced_arrays"); + this.GL_ARB_internalformat_query = this.foundExtension && list.contains("GL_ARB_internalformat_query"); + this.GL_ARB_internalformat_query2 = this.foundExtension && list.contains("GL_ARB_internalformat_query2"); + this.GL_ARB_invalidate_subdata = this.foundExtension && list.contains("GL_ARB_invalidate_subdata"); + this.GL_ARB_map_buffer_alignment = this.foundExtension && list.contains("GL_ARB_map_buffer_alignment"); + this.GL_ARB_map_buffer_range = this.foundExtension && list.contains("GL_ARB_map_buffer_range"); + this.GL_ARB_matrix_palette = this.foundExtension && list.contains("GL_ARB_matrix_palette"); + this.GL_ARB_multi_bind = this.foundExtension && list.contains("GL_ARB_multi_bind"); + this.GL_ARB_multi_draw_indirect = this.foundExtension && list.contains("GL_ARB_multi_draw_indirect"); + this.GL_ARB_multisample = this.foundExtension && list.contains("GL_ARB_multisample"); + this.GL_ARB_multitexture = this.foundExtension && list.contains("GL_ARB_multitexture"); + this.GL_ARB_occlusion_query = this.foundExtension && list.contains("GL_ARB_occlusion_query"); + this.GL_ARB_occlusion_query2 = this.foundExtension && list.contains("GL_ARB_occlusion_query2"); + this.GL_ARB_parallel_shader_compile = this.foundExtension && list.contains("GL_ARB_parallel_shader_compile"); + this.GL_ARB_pipeline_statistics_query = this.foundExtension && list.contains("GL_ARB_pipeline_statistics_query"); + this.GL_ARB_pixel_buffer_object = this.foundExtension && list.contains("GL_ARB_pixel_buffer_object"); + this.GL_ARB_point_parameters = this.foundExtension && list.contains("GL_ARB_point_parameters"); + this.GL_ARB_point_sprite = this.foundExtension && list.contains("GL_ARB_point_sprite"); + this.GL_ARB_polygon_offset_clamp = this.foundExtension && list.contains("GL_ARB_polygon_offset_clamp"); + this.GL_ARB_post_depth_coverage = this.foundExtension && list.contains("GL_ARB_post_depth_coverage"); + this.GL_ARB_program_interface_query = this.foundExtension && list.contains("GL_ARB_program_interface_query"); + this.GL_ARB_provoking_vertex = this.foundExtension && list.contains("GL_ARB_provoking_vertex"); + this.GL_ARB_query_buffer_object = this.foundExtension && list.contains("GL_ARB_query_buffer_object"); + this.GL_ARB_robust_buffer_access_behavior = this.foundExtension && list.contains("GL_ARB_robust_buffer_access_behavior"); + this.GL_ARB_robustness = this.foundExtension && list.contains("GL_ARB_robustness"); + this.GL_ARB_robustness_isolation = this.foundExtension && list.contains("GL_ARB_robustness_isolation"); + this.GL_ARB_sample_locations = this.foundExtension && list.contains("GL_ARB_sample_locations"); + this.GL_ARB_sample_shading = this.foundExtension && list.contains("GL_ARB_sample_shading"); + this.GL_ARB_sampler_objects = this.foundExtension && list.contains("GL_ARB_sampler_objects"); + this.GL_ARB_seamless_cube_map = this.foundExtension && list.contains("GL_ARB_seamless_cube_map"); + this.GL_ARB_seamless_cubemap_per_texture = this.foundExtension && list.contains("GL_ARB_seamless_cubemap_per_texture"); + this.GL_ARB_separate_shader_objects = this.foundExtension && list.contains("GL_ARB_separate_shader_objects"); + this.GL_ARB_shader_atomic_counter_ops = this.foundExtension && list.contains("GL_ARB_shader_atomic_counter_ops"); + this.GL_ARB_shader_atomic_counters = this.foundExtension && list.contains("GL_ARB_shader_atomic_counters"); + this.GL_ARB_shader_ballot = this.foundExtension && list.contains("GL_ARB_shader_ballot"); + this.GL_ARB_shader_bit_encoding = this.foundExtension && list.contains("GL_ARB_shader_bit_encoding"); + this.GL_ARB_shader_clock = this.foundExtension && list.contains("GL_ARB_shader_clock"); + this.GL_ARB_shader_draw_parameters = this.foundExtension && list.contains("GL_ARB_shader_draw_parameters"); + this.GL_ARB_shader_group_vote = this.foundExtension && list.contains("GL_ARB_shader_group_vote"); + this.GL_ARB_shader_image_load_store = this.foundExtension && list.contains("GL_ARB_shader_image_load_store"); + this.GL_ARB_shader_image_size = this.foundExtension && list.contains("GL_ARB_shader_image_size"); + this.GL_ARB_shader_objects = this.foundExtension && list.contains("GL_ARB_shader_objects"); + this.GL_ARB_shader_precision = this.foundExtension && list.contains("GL_ARB_shader_precision"); + this.GL_ARB_shader_stencil_export = this.foundExtension && list.contains("GL_ARB_shader_stencil_export"); + this.GL_ARB_shader_storage_buffer_object = this.foundExtension && list.contains("GL_ARB_shader_storage_buffer_object"); + this.GL_ARB_shader_subroutine = this.foundExtension && list.contains("GL_ARB_shader_subroutine"); + this.GL_ARB_shader_texture_image_samples = this.foundExtension && list.contains("GL_ARB_shader_texture_image_samples"); + this.GL_ARB_shader_texture_lod = this.foundExtension && list.contains("GL_ARB_shader_texture_lod"); + this.GL_ARB_shader_viewport_layer_array = this.foundExtension && list.contains("GL_ARB_shader_viewport_layer_array"); + this.GL_ARB_shading_language_100 = this.foundExtension && list.contains("GL_ARB_shading_language_100"); + this.GL_ARB_shading_language_420pack = this.foundExtension && list.contains("GL_ARB_shading_language_420pack"); + this.GL_ARB_shading_language_include = this.foundExtension && list.contains("GL_ARB_shading_language_include"); + this.GL_ARB_shading_language_packing = this.foundExtension && list.contains("GL_ARB_shading_language_packing"); + this.GL_ARB_shadow = this.foundExtension && list.contains("GL_ARB_shadow"); + this.GL_ARB_shadow_ambient = this.foundExtension && list.contains("GL_ARB_shadow_ambient"); + this.GL_ARB_sparse_buffer = this.foundExtension && list.contains("GL_ARB_sparse_buffer"); + this.GL_ARB_sparse_texture = this.foundExtension && list.contains("GL_ARB_sparse_texture"); + this.GL_ARB_sparse_texture2 = this.foundExtension && list.contains("GL_ARB_sparse_texture2"); + this.GL_ARB_sparse_texture_clamp = this.foundExtension && list.contains("GL_ARB_sparse_texture_clamp"); + this.GL_ARB_spirv_extensions = this.foundExtension && list.contains("GL_ARB_spirv_extensions"); + this.GL_ARB_stencil_texturing = this.foundExtension && list.contains("GL_ARB_stencil_texturing"); + this.GL_ARB_sync = this.foundExtension && list.contains("GL_ARB_sync"); + this.GL_ARB_tessellation_shader = this.foundExtension && list.contains("GL_ARB_tessellation_shader"); + this.GL_ARB_texture_barrier = this.foundExtension && list.contains("GL_ARB_texture_barrier"); + this.GL_ARB_texture_border_clamp = this.foundExtension && list.contains("GL_ARB_texture_border_clamp"); + this.GL_ARB_texture_buffer_object = this.foundExtension && list.contains("GL_ARB_texture_buffer_object"); + this.GL_ARB_texture_buffer_object_rgb32 = this.foundExtension && list.contains("GL_ARB_texture_buffer_object_rgb32"); + this.GL_ARB_texture_buffer_range = this.foundExtension && list.contains("GL_ARB_texture_buffer_range"); + this.GL_ARB_texture_compression = this.foundExtension && list.contains("GL_ARB_texture_compression"); + this.GL_ARB_texture_compression_bptc = this.foundExtension && list.contains("GL_ARB_texture_compression_bptc"); + this.GL_ARB_texture_compression_rgtc = this.foundExtension && list.contains("GL_ARB_texture_compression_rgtc"); + this.GL_ARB_texture_cube_map = this.foundExtension && list.contains("GL_ARB_texture_cube_map"); + this.GL_ARB_texture_cube_map_array = this.foundExtension && list.contains("GL_ARB_texture_cube_map_array"); + this.GL_ARB_texture_env_add = this.foundExtension && list.contains("GL_ARB_texture_env_add"); + this.GL_ARB_texture_env_combine = this.foundExtension && list.contains("GL_ARB_texture_env_combine"); + this.GL_ARB_texture_env_crossbar = this.foundExtension && list.contains("GL_ARB_texture_env_crossbar"); + this.GL_ARB_texture_env_dot3 = this.foundExtension && list.contains("GL_ARB_texture_env_dot3"); + this.GL_ARB_texture_filter_anisotropic = this.foundExtension && list.contains("GL_ARB_texture_filter_anisotropic"); + this.GL_ARB_texture_filter_minmax = this.foundExtension && list.contains("GL_ARB_texture_filter_minmax"); + this.GL_ARB_texture_float = this.foundExtension && list.contains("GL_ARB_texture_float"); + this.GL_ARB_texture_gather = this.foundExtension && list.contains("GL_ARB_texture_gather"); + this.GL_ARB_texture_mirror_clamp_to_edge = this.foundExtension && list.contains("GL_ARB_texture_mirror_clamp_to_edge"); + this.GL_ARB_texture_mirrored_repeat = this.foundExtension && list.contains("GL_ARB_texture_mirrored_repeat"); + this.GL_ARB_texture_multisample = this.foundExtension && list.contains("GL_ARB_texture_multisample"); + this.GL_ARB_texture_non_power_of_two = this.foundExtension && list.contains("GL_ARB_texture_non_power_of_two"); + this.GL_ARB_texture_query_levels = this.foundExtension && list.contains("GL_ARB_texture_query_levels"); + this.GL_ARB_texture_query_lod = this.foundExtension && list.contains("GL_ARB_texture_query_lod"); + this.GL_ARB_texture_rectangle = this.foundExtension && list.contains("GL_ARB_texture_rectangle"); + this.GL_ARB_texture_rg = this.foundExtension && list.contains("GL_ARB_texture_rg"); + this.GL_ARB_texture_rgb10_a2ui = this.foundExtension && list.contains("GL_ARB_texture_rgb10_a2ui"); + this.GL_ARB_texture_stencil8 = this.foundExtension && list.contains("GL_ARB_texture_stencil8"); + this.GL_ARB_texture_storage = this.foundExtension && list.contains("GL_ARB_texture_storage"); + this.GL_ARB_texture_storage_multisample = this.foundExtension && list.contains("GL_ARB_texture_storage_multisample"); + this.GL_ARB_texture_swizzle = this.foundExtension && list.contains("GL_ARB_texture_swizzle"); + this.GL_ARB_texture_view = this.foundExtension && list.contains("GL_ARB_texture_view"); + this.GL_ARB_timer_query = this.foundExtension && list.contains("GL_ARB_timer_query"); + this.GL_ARB_transform_feedback2 = this.foundExtension && list.contains("GL_ARB_transform_feedback2"); + this.GL_ARB_transform_feedback3 = this.foundExtension && list.contains("GL_ARB_transform_feedback3"); + this.GL_ARB_transform_feedback_instanced = this.foundExtension && list.contains("GL_ARB_transform_feedback_instanced"); + this.GL_ARB_transform_feedback_overflow_query = this.foundExtension && list.contains("GL_ARB_transform_feedback_overflow_query"); + this.GL_ARB_transpose_matrix = this.foundExtension && list.contains("GL_ARB_transpose_matrix"); + this.GL_ARB_uniform_buffer_object = this.foundExtension && list.contains("GL_ARB_uniform_buffer_object"); + this.GL_ARB_vertex_array_bgra = this.foundExtension && list.contains("GL_ARB_vertex_array_bgra"); + this.GL_ARB_vertex_array_object = this.foundExtension && list.contains("GL_ARB_vertex_array_object"); + this.GL_ARB_vertex_attrib_64bit = this.foundExtension && list.contains("GL_ARB_vertex_attrib_64bit"); + this.GL_ARB_vertex_attrib_binding = this.foundExtension && list.contains("GL_ARB_vertex_attrib_binding"); + this.GL_ARB_vertex_blend = this.foundExtension && list.contains("GL_ARB_vertex_blend"); + this.GL_ARB_vertex_buffer_object = this.foundExtension && list.contains("GL_ARB_vertex_buffer_object"); + this.GL_ARB_vertex_program = this.foundExtension && list.contains("GL_ARB_vertex_program"); + this.GL_ARB_vertex_shader = this.foundExtension && list.contains("GL_ARB_vertex_shader"); + this.GL_ARB_vertex_type_10f_11f_11f_rev = this.foundExtension && list.contains("GL_ARB_vertex_type_10f_11f_11f_rev"); + this.GL_ARB_vertex_type_2_10_10_10_rev = this.foundExtension && list.contains("GL_ARB_vertex_type_2_10_10_10_rev"); + this.GL_ARB_viewport_array = this.foundExtension && list.contains("GL_ARB_viewport_array"); + this.GL_ARB_window_pos = this.foundExtension && list.contains("GL_ARB_window_pos"); + this.GL_KHR_blend_equation_advanced = this.foundExtension && list.contains("GL_KHR_blend_equation_advanced"); + this.GL_KHR_blend_equation_advanced_coherent = this.foundExtension && list.contains("GL_KHR_blend_equation_advanced_coherent"); + this.GL_KHR_context_flush_control = this.foundExtension && list.contains("GL_KHR_context_flush_control"); + this.GL_KHR_debug = this.foundExtension && list.contains("GL_KHR_debug"); + this.GL_KHR_no_error = this.foundExtension && list.contains("GL_KHR_no_error"); + this.GL_KHR_parallel_shader_compile = this.foundExtension && list.contains("GL_KHR_parallel_shader_compile"); + this.GL_KHR_robust_buffer_access_behavior = this.foundExtension && list.contains("GL_KHR_robust_buffer_access_behavior"); + this.GL_KHR_robustness = this.foundExtension && list.contains("GL_KHR_robustness"); + this.GL_KHR_shader_subgroup = this.foundExtension && list.contains("GL_KHR_shader_subgroup"); + this.GL_KHR_texture_compression_astc_hdr = this.foundExtension && list.contains("GL_KHR_texture_compression_astc_hdr"); + this.GL_KHR_texture_compression_astc_ldr = this.foundExtension && list.contains("GL_KHR_texture_compression_astc_ldr"); + this.GL_KHR_texture_compression_astc_sliced_3d = this.foundExtension && list.contains("GL_KHR_texture_compression_astc_sliced_3d"); + this.GL_OES_byte_coordinates = this.foundExtension && list.contains("GL_OES_byte_coordinates"); + this.GL_OES_compressed_paletted_texture = this.foundExtension && list.contains("GL_OES_compressed_paletted_texture"); + this.GL_OES_fixed_point = this.foundExtension && list.contains("GL_OES_fixed_point"); + this.GL_OES_query_matrix = this.foundExtension && list.contains("GL_OES_query_matrix"); + this.GL_OES_read_format = this.foundExtension && list.contains("GL_OES_read_format"); + this.GL_OES_single_precision = this.foundExtension && list.contains("GL_OES_single_precision"); + this.GL_3DFX_multisample = this.foundExtension && list.contains("GL_3DFX_multisample"); + this.GL_3DFX_tbuffer = this.foundExtension && list.contains("GL_3DFX_tbuffer"); + this.GL_3DFX_texture_compression_FXT1 = this.foundExtension && list.contains("GL_3DFX_texture_compression_FXT1"); + this.GL_AMD_blend_minmax_factor = this.foundExtension && list.contains("GL_AMD_blend_minmax_factor"); + this.GL_AMD_conservative_depth = this.foundExtension && list.contains("GL_AMD_conservative_depth"); + this.GL_AMD_debug_output = this.foundExtension && list.contains("GL_AMD_debug_output"); + this.GL_AMD_depth_clamp_separate = this.foundExtension && list.contains("GL_AMD_depth_clamp_separate"); + this.GL_AMD_draw_buffers_blend = this.foundExtension && list.contains("GL_AMD_draw_buffers_blend"); + this.GL_AMD_framebuffer_multisample_advanced = this.foundExtension && list.contains("GL_AMD_framebuffer_multisample_advanced"); + this.GL_AMD_framebuffer_sample_positions = this.foundExtension && list.contains("GL_AMD_framebuffer_sample_positions"); + this.GL_AMD_gcn_shader = this.foundExtension && list.contains("GL_AMD_gcn_shader"); + this.GL_AMD_gpu_shader_half_float = this.foundExtension && list.contains("GL_AMD_gpu_shader_half_float"); + this.GL_AMD_gpu_shader_int16 = this.foundExtension && list.contains("GL_AMD_gpu_shader_int16"); + this.GL_AMD_gpu_shader_int64 = this.foundExtension && list.contains("GL_AMD_gpu_shader_int64"); + this.GL_AMD_interleaved_elements = this.foundExtension && list.contains("GL_AMD_interleaved_elements"); + this.GL_AMD_multi_draw_indirect = this.foundExtension && list.contains("GL_AMD_multi_draw_indirect"); + this.GL_AMD_name_gen_delete = this.foundExtension && list.contains("GL_AMD_name_gen_delete"); + this.GL_AMD_occlusion_query_event = this.foundExtension && list.contains("GL_AMD_occlusion_query_event"); + this.GL_AMD_performance_monitor = this.foundExtension && list.contains("GL_AMD_performance_monitor"); + this.GL_AMD_pinned_memory = this.foundExtension && list.contains("GL_AMD_pinned_memory"); + this.GL_AMD_query_buffer_object = this.foundExtension && list.contains("GL_AMD_query_buffer_object"); + this.GL_AMD_sample_positions = this.foundExtension && list.contains("GL_AMD_sample_positions"); + this.GL_AMD_seamless_cubemap_per_texture = this.foundExtension && list.contains("GL_AMD_seamless_cubemap_per_texture"); + this.GL_AMD_shader_atomic_counter_ops = this.foundExtension && list.contains("GL_AMD_shader_atomic_counter_ops"); + this.GL_AMD_shader_ballot = this.foundExtension && list.contains("GL_AMD_shader_ballot"); + this.GL_AMD_shader_explicit_vertex_parameter = this.foundExtension && list.contains("GL_AMD_shader_explicit_vertex_parameter"); + this.GL_AMD_shader_gpu_shader_half_float_fetch = this.foundExtension && list.contains("GL_AMD_shader_gpu_shader_half_float_fetch"); + this.GL_AMD_shader_image_load_store_lod = this.foundExtension && list.contains("GL_AMD_shader_image_load_store_lod"); + this.GL_AMD_shader_stencil_export = this.foundExtension && list.contains("GL_AMD_shader_stencil_export"); + this.GL_AMD_shader_trinary_minmax = this.foundExtension && list.contains("GL_AMD_shader_trinary_minmax"); + this.GL_AMD_sparse_texture = this.foundExtension && list.contains("GL_AMD_sparse_texture"); + this.GL_AMD_stencil_operation_extended = this.foundExtension && list.contains("GL_AMD_stencil_operation_extended"); + this.GL_AMD_texture_gather_bias_lod = this.foundExtension && list.contains("GL_AMD_texture_gather_bias_lod"); + this.GL_AMD_texture_texture4 = this.foundExtension && list.contains("GL_AMD_texture_texture4"); + this.GL_AMD_transform_feedback3_lines_triangles = this.foundExtension && list.contains("GL_AMD_transform_feedback3_lines_triangles"); + this.GL_AMD_transform_feedback4 = this.foundExtension && list.contains("GL_AMD_transform_feedback4"); + this.GL_AMD_vertex_shader_layer = this.foundExtension && list.contains("GL_AMD_vertex_shader_layer"); + this.GL_AMD_vertex_shader_tessellator = this.foundExtension && list.contains("GL_AMD_vertex_shader_tessellator"); + this.GL_AMD_vertex_shader_viewport_index = this.foundExtension && list.contains("GL_AMD_vertex_shader_viewport_index"); + this.GL_APPLE_aux_depth_stencil = this.foundExtension && list.contains("GL_APPLE_aux_depth_stencil"); + this.GL_APPLE_client_storage = this.foundExtension && list.contains("GL_APPLE_client_storage"); + this.GL_APPLE_element_array = this.foundExtension && list.contains("GL_APPLE_element_array"); + this.GL_APPLE_fence = this.foundExtension && list.contains("GL_APPLE_fence"); + this.GL_APPLE_float_pixels = this.foundExtension && list.contains("GL_APPLE_float_pixels"); + this.GL_APPLE_flush_buffer_range = this.foundExtension && list.contains("GL_APPLE_flush_buffer_range"); + this.GL_APPLE_object_purgeable = this.foundExtension && list.contains("GL_APPLE_object_purgeable"); + this.GL_APPLE_rgb_422 = this.foundExtension && list.contains("GL_APPLE_rgb_422"); + this.GL_APPLE_row_bytes = this.foundExtension && list.contains("GL_APPLE_row_bytes"); + this.GL_APPLE_specular_vector = this.foundExtension && list.contains("GL_APPLE_specular_vector"); + this.GL_APPLE_texture_range = this.foundExtension && list.contains("GL_APPLE_texture_range"); + this.GL_APPLE_transform_hint = this.foundExtension && list.contains("GL_APPLE_transform_hint"); + this.GL_APPLE_vertex_array_object = this.foundExtension && list.contains("GL_APPLE_vertex_array_object"); + this.GL_APPLE_vertex_array_range = this.foundExtension && list.contains("GL_APPLE_vertex_array_range"); + this.GL_APPLE_vertex_program_evaluators = this.foundExtension && list.contains("GL_APPLE_vertex_program_evaluators"); + this.GL_APPLE_ycbcr_422 = this.foundExtension && list.contains("GL_APPLE_ycbcr_422"); + this.GL_ATI_draw_buffers = this.foundExtension && list.contains("GL_ATI_draw_buffers"); + this.GL_ATI_element_array = this.foundExtension && list.contains("GL_ATI_element_array"); + this.GL_ATI_envmap_bumpmap = this.foundExtension && list.contains("GL_ATI_envmap_bumpmap"); + this.GL_ATI_fragment_shader = this.foundExtension && list.contains("GL_ATI_fragment_shader"); + this.GL_ATI_map_object_buffer = this.foundExtension && list.contains("GL_ATI_map_object_buffer"); + this.GL_ATI_meminfo = this.foundExtension && list.contains("GL_ATI_meminfo"); + this.GL_ATI_pixel_format_float = this.foundExtension && list.contains("GL_ATI_pixel_format_float"); + this.GL_ATI_pn_triangles = this.foundExtension && list.contains("GL_ATI_pn_triangles"); + this.GL_ATI_separate_stencil = this.foundExtension && list.contains("GL_ATI_separate_stencil"); + this.GL_ATI_text_fragment_shader = this.foundExtension && list.contains("GL_ATI_text_fragment_shader"); + this.GL_ATI_texture_env_combine3 = this.foundExtension && list.contains("GL_ATI_texture_env_combine3"); + this.GL_ATI_texture_float = this.foundExtension && list.contains("GL_ATI_texture_float"); + this.GL_ATI_texture_mirror_once = this.foundExtension && list.contains("GL_ATI_texture_mirror_once"); + this.GL_ATI_vertex_array_object = this.foundExtension && list.contains("GL_ATI_vertex_array_object"); + this.GL_ATI_vertex_attrib_array_object = this.foundExtension && list.contains("GL_ATI_vertex_attrib_array_object"); + this.GL_ATI_vertex_streams = this.foundExtension && list.contains("GL_ATI_vertex_streams"); + this.GL_EXT_422_pixels = this.foundExtension && list.contains("GL_EXT_422_pixels"); + this.GL_EXT_EGL_image_storage = this.foundExtension && list.contains("GL_EXT_EGL_image_storage"); + this.GL_EXT_EGL_sync = this.foundExtension && list.contains("GL_EXT_EGL_sync"); + this.GL_EXT_abgr = this.foundExtension && list.contains("GL_EXT_abgr"); + this.GL_EXT_bgra = this.foundExtension && list.contains("GL_EXT_bgra"); + this.GL_EXT_bindable_uniform = this.foundExtension && list.contains("GL_EXT_bindable_uniform"); + this.GL_EXT_blend_color = this.foundExtension && list.contains("GL_EXT_blend_color"); + this.GL_EXT_blend_equation_separate = this.foundExtension && list.contains("GL_EXT_blend_equation_separate"); + this.GL_EXT_blend_func_separate = this.foundExtension && list.contains("GL_EXT_blend_func_separate"); + this.GL_EXT_blend_logic_op = this.foundExtension && list.contains("GL_EXT_blend_logic_op"); + this.GL_EXT_blend_minmax = this.foundExtension && list.contains("GL_EXT_blend_minmax"); + this.GL_EXT_blend_subtract = this.foundExtension && list.contains("GL_EXT_blend_subtract"); + this.GL_EXT_clip_volume_hint = this.foundExtension && list.contains("GL_EXT_clip_volume_hint"); + this.GL_EXT_cmyka = this.foundExtension && list.contains("GL_EXT_cmyka"); + this.GL_EXT_color_subtable = this.foundExtension && list.contains("GL_EXT_color_subtable"); + this.GL_EXT_compiled_vertex_array = this.foundExtension && list.contains("GL_EXT_compiled_vertex_array"); + this.GL_EXT_convolution = this.foundExtension && list.contains("GL_EXT_convolution"); + this.GL_EXT_coordinate_frame = this.foundExtension && list.contains("GL_EXT_coordinate_frame"); + this.GL_EXT_copy_texture = this.foundExtension && list.contains("GL_EXT_copy_texture"); + this.GL_EXT_cull_vertex = this.foundExtension && list.contains("GL_EXT_cull_vertex"); + this.GL_EXT_debug_label = this.foundExtension && list.contains("GL_EXT_debug_label"); + this.GL_EXT_debug_marker = this.foundExtension && list.contains("GL_EXT_debug_marker"); + this.GL_EXT_depth_bounds_test = this.foundExtension && list.contains("GL_EXT_depth_bounds_test"); + this.GL_EXT_direct_state_access = this.foundExtension && list.contains("GL_EXT_direct_state_access"); + this.GL_EXT_draw_buffers2 = this.foundExtension && list.contains("GL_EXT_draw_buffers2"); + this.GL_EXT_draw_instanced = this.foundExtension && list.contains("GL_EXT_draw_instanced"); + this.GL_EXT_draw_range_elements = this.foundExtension && list.contains("GL_EXT_draw_range_elements"); + this.GL_EXT_external_buffer = this.foundExtension && list.contains("GL_EXT_external_buffer"); + this.GL_EXT_fog_coord = this.foundExtension && list.contains("GL_EXT_fog_coord"); + this.GL_EXT_framebuffer_blit = this.foundExtension && list.contains("GL_EXT_framebuffer_blit"); + this.GL_EXT_framebuffer_blit_layers = this.foundExtension && list.contains("GL_EXT_framebuffer_blit_layers"); + this.GL_EXT_framebuffer_multisample = this.foundExtension && list.contains("GL_EXT_framebuffer_multisample"); + this.GL_EXT_framebuffer_multisample_blit_scaled = this.foundExtension && list.contains("GL_EXT_framebuffer_multisample_blit_scaled"); + this.GL_EXT_framebuffer_object = this.foundExtension && list.contains("GL_EXT_framebuffer_object"); + this.GL_EXT_framebuffer_sRGB = this.foundExtension && list.contains("GL_EXT_framebuffer_sRGB"); + this.GL_EXT_geometry_shader4 = this.foundExtension && list.contains("GL_EXT_geometry_shader4"); + this.GL_EXT_gpu_program_parameters = this.foundExtension && list.contains("GL_EXT_gpu_program_parameters"); + this.GL_EXT_gpu_shader4 = this.foundExtension && list.contains("GL_EXT_gpu_shader4"); + this.GL_EXT_histogram = this.foundExtension && list.contains("GL_EXT_histogram"); + this.GL_EXT_index_array_formats = this.foundExtension && list.contains("GL_EXT_index_array_formats"); + this.GL_EXT_index_func = this.foundExtension && list.contains("GL_EXT_index_func"); + this.GL_EXT_index_material = this.foundExtension && list.contains("GL_EXT_index_material"); + this.GL_EXT_index_texture = this.foundExtension && list.contains("GL_EXT_index_texture"); + this.GL_EXT_light_texture = this.foundExtension && list.contains("GL_EXT_light_texture"); + this.GL_EXT_memory_object = this.foundExtension && list.contains("GL_EXT_memory_object"); + this.GL_EXT_memory_object_fd = this.foundExtension && list.contains("GL_EXT_memory_object_fd"); + this.GL_EXT_memory_object_win32 = this.foundExtension && list.contains("GL_EXT_memory_object_win32"); + this.GL_EXT_misc_attribute = this.foundExtension && list.contains("GL_EXT_misc_attribute"); + this.GL_EXT_multi_draw_arrays = this.foundExtension && list.contains("GL_EXT_multi_draw_arrays"); + this.GL_EXT_multisample = this.foundExtension && list.contains("GL_EXT_multisample"); + this.GL_EXT_multiview_tessellation_geometry_shader = this.foundExtension && list.contains("GL_EXT_multiview_tessellation_geometry_shader"); + this.GL_EXT_multiview_texture_multisample = this.foundExtension && list.contains("GL_EXT_multiview_texture_multisample"); + this.GL_EXT_multiview_timer_query = this.foundExtension && list.contains("GL_EXT_multiview_timer_query"); + this.GL_EXT_packed_depth_stencil = this.foundExtension && list.contains("GL_EXT_packed_depth_stencil"); + this.GL_EXT_packed_float = this.foundExtension && list.contains("GL_EXT_packed_float"); + this.GL_EXT_packed_pixels = this.foundExtension && list.contains("GL_EXT_packed_pixels"); + this.GL_EXT_paletted_texture = this.foundExtension && list.contains("GL_EXT_paletted_texture"); + this.GL_EXT_pixel_buffer_object = this.foundExtension && list.contains("GL_EXT_pixel_buffer_object"); + this.GL_EXT_pixel_transform = this.foundExtension && list.contains("GL_EXT_pixel_transform"); + this.GL_EXT_pixel_transform_color_table = this.foundExtension && list.contains("GL_EXT_pixel_transform_color_table"); + this.GL_EXT_point_parameters = this.foundExtension && list.contains("GL_EXT_point_parameters"); + this.GL_EXT_polygon_offset = this.foundExtension && list.contains("GL_EXT_polygon_offset"); + this.GL_EXT_polygon_offset_clamp = this.foundExtension && list.contains("GL_EXT_polygon_offset_clamp"); + this.GL_EXT_post_depth_coverage = this.foundExtension && list.contains("GL_EXT_post_depth_coverage"); + this.GL_EXT_provoking_vertex = this.foundExtension && list.contains("GL_EXT_provoking_vertex"); + this.GL_EXT_raster_multisample = this.foundExtension && list.contains("GL_EXT_raster_multisample"); + this.GL_EXT_rescale_normal = this.foundExtension && list.contains("GL_EXT_rescale_normal"); + this.GL_EXT_secondary_color = this.foundExtension && list.contains("GL_EXT_secondary_color"); + this.GL_EXT_semaphore = this.foundExtension && list.contains("GL_EXT_semaphore"); + this.GL_EXT_semaphore_fd = this.foundExtension && list.contains("GL_EXT_semaphore_fd"); + this.GL_EXT_semaphore_win32 = this.foundExtension && list.contains("GL_EXT_semaphore_win32"); + this.GL_EXT_separate_shader_objects = this.foundExtension && list.contains("GL_EXT_separate_shader_objects"); + this.GL_EXT_separate_specular_color = this.foundExtension && list.contains("GL_EXT_separate_specular_color"); + this.GL_EXT_shader_framebuffer_fetch = this.foundExtension && list.contains("GL_EXT_shader_framebuffer_fetch"); + this.GL_EXT_shader_framebuffer_fetch_non_coherent = this.foundExtension && list.contains("GL_EXT_shader_framebuffer_fetch_non_coherent"); + this.GL_EXT_shader_image_load_formatted = this.foundExtension && list.contains("GL_EXT_shader_image_load_formatted"); + this.GL_EXT_shader_image_load_store = this.foundExtension && list.contains("GL_EXT_shader_image_load_store"); + this.GL_EXT_shader_integer_mix = this.foundExtension && list.contains("GL_EXT_shader_integer_mix"); + this.GL_EXT_shader_samples_identical = this.foundExtension && list.contains("GL_EXT_shader_samples_identical"); + this.GL_EXT_shadow_funcs = this.foundExtension && list.contains("GL_EXT_shadow_funcs"); + this.GL_EXT_shared_texture_palette = this.foundExtension && list.contains("GL_EXT_shared_texture_palette"); + this.GL_EXT_sparse_texture2 = this.foundExtension && list.contains("GL_EXT_sparse_texture2"); + this.GL_EXT_stencil_clear_tag = this.foundExtension && list.contains("GL_EXT_stencil_clear_tag"); + this.GL_EXT_stencil_two_side = this.foundExtension && list.contains("GL_EXT_stencil_two_side"); + this.GL_EXT_stencil_wrap = this.foundExtension && list.contains("GL_EXT_stencil_wrap"); + this.GL_EXT_subtexture = this.foundExtension && list.contains("GL_EXT_subtexture"); + this.GL_EXT_texture = this.foundExtension && list.contains("GL_EXT_texture"); + this.GL_EXT_texture3D = this.foundExtension && list.contains("GL_EXT_texture3D"); + this.GL_EXT_texture_array = this.foundExtension && list.contains("GL_EXT_texture_array"); + this.GL_EXT_texture_buffer_object = this.foundExtension && list.contains("GL_EXT_texture_buffer_object"); + this.GL_EXT_texture_compression_latc = this.foundExtension && list.contains("GL_EXT_texture_compression_latc"); + this.GL_EXT_texture_compression_rgtc = this.foundExtension && list.contains("GL_EXT_texture_compression_rgtc"); + this.GL_EXT_texture_compression_s3tc = this.foundExtension && list.contains("GL_EXT_texture_compression_s3tc"); + this.GL_EXT_texture_cube_map = this.foundExtension && list.contains("GL_EXT_texture_cube_map"); + this.GL_EXT_texture_env_add = this.foundExtension && list.contains("GL_EXT_texture_env_add"); + this.GL_EXT_texture_env_combine = this.foundExtension && list.contains("GL_EXT_texture_env_combine"); + this.GL_EXT_texture_env_dot3 = this.foundExtension && list.contains("GL_EXT_texture_env_dot3"); + this.GL_EXT_texture_filter_anisotropic = this.foundExtension && list.contains("GL_EXT_texture_filter_anisotropic"); + this.GL_EXT_texture_filter_minmax = this.foundExtension && list.contains("GL_EXT_texture_filter_minmax"); + this.GL_EXT_texture_integer = this.foundExtension && list.contains("GL_EXT_texture_integer"); + this.GL_EXT_texture_lod_bias = this.foundExtension && list.contains("GL_EXT_texture_lod_bias"); + this.GL_EXT_texture_mirror_clamp = this.foundExtension && list.contains("GL_EXT_texture_mirror_clamp"); + this.GL_EXT_texture_object = this.foundExtension && list.contains("GL_EXT_texture_object"); + this.GL_EXT_texture_perturb_normal = this.foundExtension && list.contains("GL_EXT_texture_perturb_normal"); + this.GL_EXT_texture_sRGB = this.foundExtension && list.contains("GL_EXT_texture_sRGB"); + this.GL_EXT_texture_sRGB_R8 = this.foundExtension && list.contains("GL_EXT_texture_sRGB_R8"); + this.GL_EXT_texture_sRGB_RG8 = this.foundExtension && list.contains("GL_EXT_texture_sRGB_RG8"); + this.GL_EXT_texture_sRGB_decode = this.foundExtension && list.contains("GL_EXT_texture_sRGB_decode"); + this.GL_EXT_texture_shadow_lod = this.foundExtension && list.contains("GL_EXT_texture_shadow_lod"); + this.GL_EXT_texture_shared_exponent = this.foundExtension && list.contains("GL_EXT_texture_shared_exponent"); + this.GL_EXT_texture_snorm = this.foundExtension && list.contains("GL_EXT_texture_snorm"); + this.GL_EXT_texture_storage = this.foundExtension && list.contains("GL_EXT_texture_storage"); + this.GL_EXT_texture_swizzle = this.foundExtension && list.contains("GL_EXT_texture_swizzle"); + this.GL_EXT_timer_query = this.foundExtension && list.contains("GL_EXT_timer_query"); + this.GL_EXT_transform_feedback = this.foundExtension && list.contains("GL_EXT_transform_feedback"); + this.GL_EXT_vertex_array = this.foundExtension && list.contains("GL_EXT_vertex_array"); + this.GL_EXT_vertex_array_bgra = this.foundExtension && list.contains("GL_EXT_vertex_array_bgra"); + this.GL_EXT_vertex_attrib_64bit = this.foundExtension && list.contains("GL_EXT_vertex_attrib_64bit"); + this.GL_EXT_vertex_shader = this.foundExtension && list.contains("GL_EXT_vertex_shader"); + this.GL_EXT_vertex_weighting = this.foundExtension && list.contains("GL_EXT_vertex_weighting"); + this.GL_EXT_win32_keyed_mutex = this.foundExtension && list.contains("GL_EXT_win32_keyed_mutex"); + this.GL_EXT_window_rectangles = this.foundExtension && list.contains("GL_EXT_window_rectangles"); + this.GL_EXT_x11_sync_object = this.foundExtension && list.contains("GL_EXT_x11_sync_object"); + this.GL_GREMEDY_frame_terminator = this.foundExtension && list.contains("GL_GREMEDY_frame_terminator"); + this.GL_GREMEDY_string_marker = this.foundExtension && list.contains("GL_GREMEDY_string_marker"); + this.GL_HP_convolution_border_modes = this.foundExtension && list.contains("GL_HP_convolution_border_modes"); + this.GL_HP_image_transform = this.foundExtension && list.contains("GL_HP_image_transform"); + this.GL_HP_occlusion_test = this.foundExtension && list.contains("GL_HP_occlusion_test"); + this.GL_HP_texture_lighting = this.foundExtension && list.contains("GL_HP_texture_lighting"); + this.GL_IBM_cull_vertex = this.foundExtension && list.contains("GL_IBM_cull_vertex"); + this.GL_IBM_multimode_draw_arrays = this.foundExtension && list.contains("GL_IBM_multimode_draw_arrays"); + this.GL_IBM_rasterpos_clip = this.foundExtension && list.contains("GL_IBM_rasterpos_clip"); + this.GL_IBM_static_data = this.foundExtension && list.contains("GL_IBM_static_data"); + this.GL_IBM_texture_mirrored_repeat = this.foundExtension && list.contains("GL_IBM_texture_mirrored_repeat"); + this.GL_IBM_vertex_array_lists = this.foundExtension && list.contains("GL_IBM_vertex_array_lists"); + this.GL_INGR_blend_func_separate = this.foundExtension && list.contains("GL_INGR_blend_func_separate"); + this.GL_INGR_color_clamp = this.foundExtension && list.contains("GL_INGR_color_clamp"); + this.GL_INGR_interlace_read = this.foundExtension && list.contains("GL_INGR_interlace_read"); + this.GL_INTEL_blackhole_render = this.foundExtension && list.contains("GL_INTEL_blackhole_render"); + this.GL_INTEL_conservative_rasterization = this.foundExtension && list.contains("GL_INTEL_conservative_rasterization"); + this.GL_INTEL_fragment_shader_ordering = this.foundExtension && list.contains("GL_INTEL_fragment_shader_ordering"); + this.GL_INTEL_framebuffer_CMAA = this.foundExtension && list.contains("GL_INTEL_framebuffer_CMAA"); + this.GL_INTEL_map_texture = this.foundExtension && list.contains("GL_INTEL_map_texture"); + this.GL_INTEL_parallel_arrays = this.foundExtension && list.contains("GL_INTEL_parallel_arrays"); + this.GL_INTEL_performance_query = this.foundExtension && list.contains("GL_INTEL_performance_query"); + this.GL_MESAX_texture_stack = this.foundExtension && list.contains("GL_MESAX_texture_stack"); + this.GL_MESA_framebuffer_flip_x = this.foundExtension && list.contains("GL_MESA_framebuffer_flip_x"); + this.GL_MESA_framebuffer_flip_y = this.foundExtension && list.contains("GL_MESA_framebuffer_flip_y"); + this.GL_MESA_framebuffer_swap_xy = this.foundExtension && list.contains("GL_MESA_framebuffer_swap_xy"); + this.GL_MESA_pack_invert = this.foundExtension && list.contains("GL_MESA_pack_invert"); + this.GL_MESA_program_binary_formats = this.foundExtension && list.contains("GL_MESA_program_binary_formats"); + this.GL_MESA_resize_buffers = this.foundExtension && list.contains("GL_MESA_resize_buffers"); + this.GL_MESA_shader_integer_functions = this.foundExtension && list.contains("GL_MESA_shader_integer_functions"); + this.GL_MESA_tile_raster_order = this.foundExtension && list.contains("GL_MESA_tile_raster_order"); + this.GL_MESA_window_pos = this.foundExtension && list.contains("GL_MESA_window_pos"); + this.GL_MESA_ycbcr_texture = this.foundExtension && list.contains("GL_MESA_ycbcr_texture"); + this.GL_NVX_blend_equation_advanced_multi_draw_buffers = this.foundExtension && list.contains("GL_NVX_blend_equation_advanced_multi_draw_buffers"); + this.GL_NVX_conditional_render = this.foundExtension && list.contains("GL_NVX_conditional_render"); + this.GL_NVX_gpu_memory_info = this.foundExtension && list.contains("GL_NVX_gpu_memory_info"); + this.GL_NVX_gpu_multicast2 = this.foundExtension && list.contains("GL_NVX_gpu_multicast2"); + this.GL_NVX_linked_gpu_multicast = this.foundExtension && list.contains("GL_NVX_linked_gpu_multicast"); + this.GL_NVX_progress_fence = this.foundExtension && list.contains("GL_NVX_progress_fence"); + this.GL_NV_alpha_to_coverage_dither_control = this.foundExtension && list.contains("GL_NV_alpha_to_coverage_dither_control"); + this.GL_NV_bindless_multi_draw_indirect = this.foundExtension && list.contains("GL_NV_bindless_multi_draw_indirect"); + this.GL_NV_bindless_multi_draw_indirect_count = this.foundExtension && list.contains("GL_NV_bindless_multi_draw_indirect_count"); + this.GL_NV_bindless_texture = this.foundExtension && list.contains("GL_NV_bindless_texture"); + this.GL_NV_blend_equation_advanced = this.foundExtension && list.contains("GL_NV_blend_equation_advanced"); + this.GL_NV_blend_equation_advanced_coherent = this.foundExtension && list.contains("GL_NV_blend_equation_advanced_coherent"); + this.GL_NV_blend_minmax_factor = this.foundExtension && list.contains("GL_NV_blend_minmax_factor"); + this.GL_NV_blend_square = this.foundExtension && list.contains("GL_NV_blend_square"); + this.GL_NV_clip_space_w_scaling = this.foundExtension && list.contains("GL_NV_clip_space_w_scaling"); + this.GL_NV_command_list = this.foundExtension && list.contains("GL_NV_command_list"); + this.GL_NV_compute_program5 = this.foundExtension && list.contains("GL_NV_compute_program5"); + this.GL_NV_compute_shader_derivatives = this.foundExtension && list.contains("GL_NV_compute_shader_derivatives"); + this.GL_NV_conditional_render = this.foundExtension && list.contains("GL_NV_conditional_render"); + this.GL_NV_conservative_raster = this.foundExtension && list.contains("GL_NV_conservative_raster"); + this.GL_NV_conservative_raster_dilate = this.foundExtension && list.contains("GL_NV_conservative_raster_dilate"); + this.GL_NV_conservative_raster_pre_snap = this.foundExtension && list.contains("GL_NV_conservative_raster_pre_snap"); + this.GL_NV_conservative_raster_pre_snap_triangles = this.foundExtension && list.contains("GL_NV_conservative_raster_pre_snap_triangles"); + this.GL_NV_conservative_raster_underestimation = this.foundExtension && list.contains("GL_NV_conservative_raster_underestimation"); + this.GL_NV_copy_depth_to_color = this.foundExtension && list.contains("GL_NV_copy_depth_to_color"); + this.GL_NV_copy_image = this.foundExtension && list.contains("GL_NV_copy_image"); + this.GL_NV_deep_texture3D = this.foundExtension && list.contains("GL_NV_deep_texture3D"); + this.GL_NV_depth_buffer_float = this.foundExtension && list.contains("GL_NV_depth_buffer_float"); + this.GL_NV_depth_clamp = this.foundExtension && list.contains("GL_NV_depth_clamp"); + this.GL_NV_draw_texture = this.foundExtension && list.contains("GL_NV_draw_texture"); + this.GL_NV_draw_vulkan_image = this.foundExtension && list.contains("GL_NV_draw_vulkan_image"); + this.GL_NV_evaluators = this.foundExtension && list.contains("GL_NV_evaluators"); + this.GL_NV_explicit_multisample = this.foundExtension && list.contains("GL_NV_explicit_multisample"); + this.GL_NV_fence = this.foundExtension && list.contains("GL_NV_fence"); + this.GL_NV_fill_rectangle = this.foundExtension && list.contains("GL_NV_fill_rectangle"); + this.GL_NV_float_buffer = this.foundExtension && list.contains("GL_NV_float_buffer"); + this.GL_NV_fog_distance = this.foundExtension && list.contains("GL_NV_fog_distance"); + this.GL_NV_fragment_coverage_to_color = this.foundExtension && list.contains("GL_NV_fragment_coverage_to_color"); + this.GL_NV_fragment_program = this.foundExtension && list.contains("GL_NV_fragment_program"); + this.GL_NV_fragment_program2 = this.foundExtension && list.contains("GL_NV_fragment_program2"); + this.GL_NV_fragment_program4 = this.foundExtension && list.contains("GL_NV_fragment_program4"); + this.GL_NV_fragment_program_option = this.foundExtension && list.contains("GL_NV_fragment_program_option"); + this.GL_NV_fragment_shader_barycentric = this.foundExtension && list.contains("GL_NV_fragment_shader_barycentric"); + this.GL_NV_fragment_shader_interlock = this.foundExtension && list.contains("GL_NV_fragment_shader_interlock"); + this.GL_NV_framebuffer_mixed_samples = this.foundExtension && list.contains("GL_NV_framebuffer_mixed_samples"); + this.GL_NV_framebuffer_multisample_coverage = this.foundExtension && list.contains("GL_NV_framebuffer_multisample_coverage"); + this.GL_NV_geometry_program4 = this.foundExtension && list.contains("GL_NV_geometry_program4"); + this.GL_NV_geometry_shader4 = this.foundExtension && list.contains("GL_NV_geometry_shader4"); + this.GL_NV_geometry_shader_passthrough = this.foundExtension && list.contains("GL_NV_geometry_shader_passthrough"); + this.GL_NV_gpu_multicast = this.foundExtension && list.contains("GL_NV_gpu_multicast"); + this.GL_NV_gpu_program4 = this.foundExtension && list.contains("GL_NV_gpu_program4"); + this.GL_NV_gpu_program5 = this.foundExtension && list.contains("GL_NV_gpu_program5"); + this.GL_NV_gpu_program5_mem_extended = this.foundExtension && list.contains("GL_NV_gpu_program5_mem_extended"); + this.GL_NV_gpu_shader5 = this.foundExtension && list.contains("GL_NV_gpu_shader5"); + this.GL_NV_half_float = this.foundExtension && list.contains("GL_NV_half_float"); + this.GL_NV_internalformat_sample_query = this.foundExtension && list.contains("GL_NV_internalformat_sample_query"); + this.GL_NV_light_max_exponent = this.foundExtension && list.contains("GL_NV_light_max_exponent"); + this.GL_NV_memory_attachment = this.foundExtension && list.contains("GL_NV_memory_attachment"); + this.GL_NV_memory_object_sparse = this.foundExtension && list.contains("GL_NV_memory_object_sparse"); + this.GL_NV_mesh_shader = this.foundExtension && list.contains("GL_NV_mesh_shader"); + this.GL_NV_multisample_coverage = this.foundExtension && list.contains("GL_NV_multisample_coverage"); + this.GL_NV_multisample_filter_hint = this.foundExtension && list.contains("GL_NV_multisample_filter_hint"); + this.GL_NV_occlusion_query = this.foundExtension && list.contains("GL_NV_occlusion_query"); + this.GL_NV_packed_depth_stencil = this.foundExtension && list.contains("GL_NV_packed_depth_stencil"); + this.GL_NV_parameter_buffer_object = this.foundExtension && list.contains("GL_NV_parameter_buffer_object"); + this.GL_NV_parameter_buffer_object2 = this.foundExtension && list.contains("GL_NV_parameter_buffer_object2"); + this.GL_NV_path_rendering = this.foundExtension && list.contains("GL_NV_path_rendering"); + this.GL_NV_path_rendering_shared_edge = this.foundExtension && list.contains("GL_NV_path_rendering_shared_edge"); + this.GL_NV_pixel_data_range = this.foundExtension && list.contains("GL_NV_pixel_data_range"); + this.GL_NV_point_sprite = this.foundExtension && list.contains("GL_NV_point_sprite"); + this.GL_NV_present_video = this.foundExtension && list.contains("GL_NV_present_video"); + this.GL_NV_primitive_restart = this.foundExtension && list.contains("GL_NV_primitive_restart"); + this.GL_NV_primitive_shading_rate = this.foundExtension && list.contains("GL_NV_primitive_shading_rate"); + this.GL_NV_query_resource = this.foundExtension && list.contains("GL_NV_query_resource"); + this.GL_NV_query_resource_tag = this.foundExtension && list.contains("GL_NV_query_resource_tag"); + this.GL_NV_register_combiners = this.foundExtension && list.contains("GL_NV_register_combiners"); + this.GL_NV_register_combiners2 = this.foundExtension && list.contains("GL_NV_register_combiners2"); + this.GL_NV_representative_fragment_test = this.foundExtension && list.contains("GL_NV_representative_fragment_test"); + this.GL_NV_robustness_video_memory_purge = this.foundExtension && list.contains("GL_NV_robustness_video_memory_purge"); + this.GL_NV_sample_locations = this.foundExtension && list.contains("GL_NV_sample_locations"); + this.GL_NV_sample_mask_override_coverage = this.foundExtension && list.contains("GL_NV_sample_mask_override_coverage"); + this.GL_NV_scissor_exclusive = this.foundExtension && list.contains("GL_NV_scissor_exclusive"); + this.GL_NV_shader_atomic_counters = this.foundExtension && list.contains("GL_NV_shader_atomic_counters"); + this.GL_NV_shader_atomic_float = this.foundExtension && list.contains("GL_NV_shader_atomic_float"); + this.GL_NV_shader_atomic_float64 = this.foundExtension && list.contains("GL_NV_shader_atomic_float64"); + this.GL_NV_shader_atomic_fp16_vector = this.foundExtension && list.contains("GL_NV_shader_atomic_fp16_vector"); + this.GL_NV_shader_atomic_int64 = this.foundExtension && list.contains("GL_NV_shader_atomic_int64"); + this.GL_NV_shader_buffer_load = this.foundExtension && list.contains("GL_NV_shader_buffer_load"); + this.GL_NV_shader_buffer_store = this.foundExtension && list.contains("GL_NV_shader_buffer_store"); + this.GL_NV_shader_storage_buffer_object = this.foundExtension && list.contains("GL_NV_shader_storage_buffer_object"); + this.GL_NV_shader_subgroup_partitioned = this.foundExtension && list.contains("GL_NV_shader_subgroup_partitioned"); + this.GL_NV_shader_texture_footprint = this.foundExtension && list.contains("GL_NV_shader_texture_footprint"); + this.GL_NV_shader_thread_group = this.foundExtension && list.contains("GL_NV_shader_thread_group"); + this.GL_NV_shader_thread_shuffle = this.foundExtension && list.contains("GL_NV_shader_thread_shuffle"); + this.GL_NV_shading_rate_image = this.foundExtension && list.contains("GL_NV_shading_rate_image"); + this.GL_NV_stereo_view_rendering = this.foundExtension && list.contains("GL_NV_stereo_view_rendering"); + this.GL_NV_tessellation_program5 = this.foundExtension && list.contains("GL_NV_tessellation_program5"); + this.GL_NV_texgen_emboss = this.foundExtension && list.contains("GL_NV_texgen_emboss"); + this.GL_NV_texgen_reflection = this.foundExtension && list.contains("GL_NV_texgen_reflection"); + this.GL_NV_texture_barrier = this.foundExtension && list.contains("GL_NV_texture_barrier"); + this.GL_NV_texture_compression_vtc = this.foundExtension && list.contains("GL_NV_texture_compression_vtc"); + this.GL_NV_texture_env_combine4 = this.foundExtension && list.contains("GL_NV_texture_env_combine4"); + this.GL_NV_texture_expand_normal = this.foundExtension && list.contains("GL_NV_texture_expand_normal"); + this.GL_NV_texture_multisample = this.foundExtension && list.contains("GL_NV_texture_multisample"); + this.GL_NV_texture_rectangle = this.foundExtension && list.contains("GL_NV_texture_rectangle"); + this.GL_NV_texture_rectangle_compressed = this.foundExtension && list.contains("GL_NV_texture_rectangle_compressed"); + this.GL_NV_texture_shader = this.foundExtension && list.contains("GL_NV_texture_shader"); + this.GL_NV_texture_shader2 = this.foundExtension && list.contains("GL_NV_texture_shader2"); + this.GL_NV_texture_shader3 = this.foundExtension && list.contains("GL_NV_texture_shader3"); + this.GL_NV_timeline_semaphore = this.foundExtension && list.contains("GL_NV_timeline_semaphore"); + this.GL_NV_transform_feedback = this.foundExtension && list.contains("GL_NV_transform_feedback"); + this.GL_NV_transform_feedback2 = this.foundExtension && list.contains("GL_NV_transform_feedback2"); + this.GL_NV_uniform_buffer_std430_layout = this.foundExtension && list.contains("GL_NV_uniform_buffer_std430_layout"); + this.GL_NV_uniform_buffer_unified_memory = this.foundExtension && list.contains("GL_NV_uniform_buffer_unified_memory"); + this.GL_NV_vdpau_interop = this.foundExtension && list.contains("GL_NV_vdpau_interop"); + this.GL_NV_vdpau_interop2 = this.foundExtension && list.contains("GL_NV_vdpau_interop2"); + this.GL_NV_vertex_array_range = this.foundExtension && list.contains("GL_NV_vertex_array_range"); + this.GL_NV_vertex_array_range2 = this.foundExtension && list.contains("GL_NV_vertex_array_range2"); + this.GL_NV_vertex_attrib_integer_64bit = this.foundExtension && list.contains("GL_NV_vertex_attrib_integer_64bit"); + this.GL_NV_vertex_buffer_unified_memory = this.foundExtension && list.contains("GL_NV_vertex_buffer_unified_memory"); + this.GL_NV_vertex_program = this.foundExtension && list.contains("GL_NV_vertex_program"); + this.GL_NV_vertex_program1_1 = this.foundExtension && list.contains("GL_NV_vertex_program1_1"); + this.GL_NV_vertex_program2 = this.foundExtension && list.contains("GL_NV_vertex_program2"); + this.GL_NV_vertex_program2_option = this.foundExtension && list.contains("GL_NV_vertex_program2_option"); + this.GL_NV_vertex_program3 = this.foundExtension && list.contains("GL_NV_vertex_program3"); + this.GL_NV_vertex_program4 = this.foundExtension && list.contains("GL_NV_vertex_program4"); + this.GL_NV_video_capture = this.foundExtension && list.contains("GL_NV_video_capture"); + this.GL_NV_viewport_array2 = this.foundExtension && list.contains("GL_NV_viewport_array2"); + this.GL_NV_viewport_swizzle = this.foundExtension && list.contains("GL_NV_viewport_swizzle"); + this.GL_OML_interlace = this.foundExtension && list.contains("GL_OML_interlace"); + this.GL_OML_resample = this.foundExtension && list.contains("GL_OML_resample"); + this.GL_OML_subsample = this.foundExtension && list.contains("GL_OML_subsample"); + this.GL_OVR_multiview = this.foundExtension && list.contains("GL_OVR_multiview"); + this.GL_OVR_multiview2 = this.foundExtension && list.contains("GL_OVR_multiview2"); + this.GL_PGI_misc_hints = this.foundExtension && list.contains("GL_PGI_misc_hints"); + this.GL_PGI_vertex_hints = this.foundExtension && list.contains("GL_PGI_vertex_hints"); + this.GL_REND_screen_coordinates = this.foundExtension && list.contains("GL_REND_screen_coordinates"); + this.GL_S3_s3tc = this.foundExtension && list.contains("GL_S3_s3tc"); + this.GL_SGIS_detail_texture = this.foundExtension && list.contains("GL_SGIS_detail_texture"); + this.GL_SGIS_fog_function = this.foundExtension && list.contains("GL_SGIS_fog_function"); + this.GL_SGIS_generate_mipmap = this.foundExtension && list.contains("GL_SGIS_generate_mipmap"); + this.GL_SGIS_multisample = this.foundExtension && list.contains("GL_SGIS_multisample"); + this.GL_SGIS_pixel_texture = this.foundExtension && list.contains("GL_SGIS_pixel_texture"); + this.GL_SGIS_point_line_texgen = this.foundExtension && list.contains("GL_SGIS_point_line_texgen"); + this.GL_SGIS_point_parameters = this.foundExtension && list.contains("GL_SGIS_point_parameters"); + this.GL_SGIS_sharpen_texture = this.foundExtension && list.contains("GL_SGIS_sharpen_texture"); + this.GL_SGIS_texture4D = this.foundExtension && list.contains("GL_SGIS_texture4D"); + this.GL_SGIS_texture_border_clamp = this.foundExtension && list.contains("GL_SGIS_texture_border_clamp"); + this.GL_SGIS_texture_color_mask = this.foundExtension && list.contains("GL_SGIS_texture_color_mask"); + this.GL_SGIS_texture_edge_clamp = this.foundExtension && list.contains("GL_SGIS_texture_edge_clamp"); + this.GL_SGIS_texture_filter4 = this.foundExtension && list.contains("GL_SGIS_texture_filter4"); + this.GL_SGIS_texture_lod = this.foundExtension && list.contains("GL_SGIS_texture_lod"); + this.GL_SGIS_texture_select = this.foundExtension && list.contains("GL_SGIS_texture_select"); + this.GL_SGIX_async = this.foundExtension && list.contains("GL_SGIX_async"); + this.GL_SGIX_async_histogram = this.foundExtension && list.contains("GL_SGIX_async_histogram"); + this.GL_SGIX_async_pixel = this.foundExtension && list.contains("GL_SGIX_async_pixel"); + this.GL_SGIX_blend_alpha_minmax = this.foundExtension && list.contains("GL_SGIX_blend_alpha_minmax"); + this.GL_SGIX_calligraphic_fragment = this.foundExtension && list.contains("GL_SGIX_calligraphic_fragment"); + this.GL_SGIX_clipmap = this.foundExtension && list.contains("GL_SGIX_clipmap"); + this.GL_SGIX_convolution_accuracy = this.foundExtension && list.contains("GL_SGIX_convolution_accuracy"); + this.GL_SGIX_depth_pass_instrument = this.foundExtension && list.contains("GL_SGIX_depth_pass_instrument"); + this.GL_SGIX_depth_texture = this.foundExtension && list.contains("GL_SGIX_depth_texture"); + this.GL_SGIX_flush_raster = this.foundExtension && list.contains("GL_SGIX_flush_raster"); + this.GL_SGIX_fog_offset = this.foundExtension && list.contains("GL_SGIX_fog_offset"); + this.GL_SGIX_fragment_lighting = this.foundExtension && list.contains("GL_SGIX_fragment_lighting"); + this.GL_SGIX_framezoom = this.foundExtension && list.contains("GL_SGIX_framezoom"); + this.GL_SGIX_igloo_interface = this.foundExtension && list.contains("GL_SGIX_igloo_interface"); + this.GL_SGIX_instruments = this.foundExtension && list.contains("GL_SGIX_instruments"); + this.GL_SGIX_interlace = this.foundExtension && list.contains("GL_SGIX_interlace"); + this.GL_SGIX_ir_instrument1 = this.foundExtension && list.contains("GL_SGIX_ir_instrument1"); + this.GL_SGIX_list_priority = this.foundExtension && list.contains("GL_SGIX_list_priority"); + this.GL_SGIX_pixel_texture = this.foundExtension && list.contains("GL_SGIX_pixel_texture"); + this.GL_SGIX_pixel_tiles = this.foundExtension && list.contains("GL_SGIX_pixel_tiles"); + this.GL_SGIX_polynomial_ffd = this.foundExtension && list.contains("GL_SGIX_polynomial_ffd"); + this.GL_SGIX_reference_plane = this.foundExtension && list.contains("GL_SGIX_reference_plane"); + this.GL_SGIX_resample = this.foundExtension && list.contains("GL_SGIX_resample"); + this.GL_SGIX_scalebias_hint = this.foundExtension && list.contains("GL_SGIX_scalebias_hint"); + this.GL_SGIX_shadow = this.foundExtension && list.contains("GL_SGIX_shadow"); + this.GL_SGIX_shadow_ambient = this.foundExtension && list.contains("GL_SGIX_shadow_ambient"); + this.GL_SGIX_sprite = this.foundExtension && list.contains("GL_SGIX_sprite"); + this.GL_SGIX_subsample = this.foundExtension && list.contains("GL_SGIX_subsample"); + this.GL_SGIX_tag_sample_buffer = this.foundExtension && list.contains("GL_SGIX_tag_sample_buffer"); + this.GL_SGIX_texture_add_env = this.foundExtension && list.contains("GL_SGIX_texture_add_env"); + this.GL_SGIX_texture_coordinate_clamp = this.foundExtension && list.contains("GL_SGIX_texture_coordinate_clamp"); + this.GL_SGIX_texture_lod_bias = this.foundExtension && list.contains("GL_SGIX_texture_lod_bias"); + this.GL_SGIX_texture_multi_buffer = this.foundExtension && list.contains("GL_SGIX_texture_multi_buffer"); + this.GL_SGIX_texture_scale_bias = this.foundExtension && list.contains("GL_SGIX_texture_scale_bias"); + this.GL_SGIX_vertex_preclip = this.foundExtension && list.contains("GL_SGIX_vertex_preclip"); + this.GL_SGIX_ycrcb = this.foundExtension && list.contains("GL_SGIX_ycrcb"); + this.GL_SGIX_ycrcb_subsample = this.foundExtension && list.contains("GL_SGIX_ycrcb_subsample"); + this.GL_SGIX_ycrcba = this.foundExtension && list.contains("GL_SGIX_ycrcba"); + this.GL_SGI_color_matrix = this.foundExtension && list.contains("GL_SGI_color_matrix"); + this.GL_SGI_color_table = this.foundExtension && list.contains("GL_SGI_color_table"); + this.GL_SGI_texture_color_table = this.foundExtension && list.contains("GL_SGI_texture_color_table"); + this.GL_SUNX_constant_data = this.foundExtension && list.contains("GL_SUNX_constant_data"); + this.GL_SUN_convolution_border_modes = this.foundExtension && list.contains("GL_SUN_convolution_border_modes"); + this.GL_SUN_global_alpha = this.foundExtension && list.contains("GL_SUN_global_alpha"); + this.GL_SUN_mesh_array = this.foundExtension && list.contains("GL_SUN_mesh_array"); + this.GL_SUN_slice_accum = this.foundExtension && list.contains("GL_SUN_slice_accum"); + this.GL_SUN_triangle_list = this.foundExtension && list.contains("GL_SUN_triangle_list"); + this.GL_SUN_vertex = this.foundExtension && list.contains("GL_SUN_vertex"); + this.GL_WIN_phong_shading = this.foundExtension && list.contains("GL_WIN_phong_shading"); + this.GL_WIN_specular_fog = this.foundExtension && list.contains("GL_WIN_specular_fog"); + } +} diff --git a/modules/overrungl.core/src/main/java/overrungl/Addressable.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLLegacy.java similarity index 67% rename from modules/overrungl.core/src/main/java/overrungl/Addressable.java rename to modules/overrungl.opengl/src/main/java/overrungl/opengl/GLLegacy.java index 587fdd00..930e347a 100644 --- a/modules/overrungl.core/src/main/java/overrungl/Addressable.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLLegacy.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2022-2023 Overrun Organization + * Copyright (c) 2024 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 @@ -14,21 +14,13 @@ * copies or substantial portions of the Software. */ -package overrungl; - -import java.lang.foreign.MemorySegment; +package overrungl.opengl; /** - * An object that has a {@link MemorySegment} value. + * The latest OpenGL functions, with legacy. * * @author squid233 * @since 0.1.0 */ -@Deprecated(since = "0.1.0") -@FunctionalInterface -public interface Addressable { - /** - * {@return the raw address value} - */ - MemorySegment address(); +public non-sealed interface GLLegacy extends GL, GL10, GL11, GL12, GL13, GL14, GL15, GL20, GL21, GL30 { } 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 659da47f..b37146aa 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLLoadFunc.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLLoadFunc.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2022-2023 Overrun Organization + * Copyright (c) 2022-2024 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 @@ -16,14 +16,11 @@ package overrungl.opengl; -import org.jetbrains.annotations.Nullable; -import overrungl.FunctionDescriptors; -import overrungl.internal.RuntimeHelper; +import overrun.marshal.Unmarshal; -import java.lang.foreign.FunctionDescriptor; -import java.lang.foreign.Linker; import java.lang.foreign.MemorySegment; -import java.lang.invoke.MethodHandle; +import java.lang.foreign.SymbolLookup; +import java.util.Optional; /** * The OpenGL loading function. @@ -31,7 +28,7 @@ * {@snippet lang = java: * // loads OpenGL forward-compatible profile * import java.util.Objects; - * Objects.requireNonNull(GLLoader.load(GLFW::getProcAddress, true), "Failed to load OpenGL"); + * Objects.requireNonNull(GLLoader.load(glfw::getProcAddress), "Failed to load OpenGL"); * } * * @author squid233 @@ -48,28 +45,12 @@ public interface GLLoadFunc { MemorySegment invoke(String string); /** - * Load a 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. - * @param options the linker options associated with this linkage request. - * @return a downcall method handle, or {@code null} if the symbol is {@link MemorySegment#NULL} - */ - @Nullable - default MethodHandle invoke(String procName, FunctionDescriptor function, Linker.Option... options) { - return RuntimeHelper.downcallSafe(invoke(procName), function, options); - } - - /** - * Load a 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. - * @param options the linker options associated with this linkage request. - * @return a downcall method handle, or {@code null} if the symbol is {@link MemorySegment#NULL} + * {@return a symbol lookup of this} */ - @Nullable - default MethodHandle invoke(String procName, FunctionDescriptors function, Linker.Option... options) { - return RuntimeHelper.downcallSafe(invoke(procName), function, options); + default SymbolLookup lookup() { + return name -> { + final MemorySegment segment = invoke(name); + return Unmarshal.isNullPointer(segment) ? Optional.empty() : Optional.of(segment); + }; } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLLoader.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLLoader.java index 6f424a3b..3c24525c 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLLoader.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLLoader.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2022-2023 Overrun Organization + * Copyright (c) 2022-2024 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 @@ -16,176 +16,80 @@ package overrungl.opengl; -import org.jetbrains.annotations.Contract; -import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import overrungl.internal.RuntimeHelper; -import overrungl.util.CheckUtil; +import overrun.marshal.Downcall; +import overrungl.opengl.ext.GLExtension; -import java.lang.invoke.MethodHandle; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.ValueLayout; +import java.util.Map; /** * This class must be used before any OpenGL function is called. It has the following responsibilities: *

    *
  • Loads the OpenGL native library into the JVM process.
  • - *
  • Creates instances of {@link GLCapabilities} classes. A {@code GLCapabilities} instance contains flags for functionality that is available in an OpenGL - * context. Internally, it also contains function pointers that are only valid in that specific OpenGL context.
  • - *
  • Maintains thread-local state for {@code GLCapabilities} instances, corresponding to OpenGL contexts that are current in those threads.
  • + *
  • Creates instances of {@link GLFlags} classes. A {@code GLFlags} instance contains flags for functionality that is available in an OpenGL + * context.
  • + *
  • Creates instances of {@link GL} instances, corresponding to OpenGL contexts that are current in those threads. + * Internally, it also contains function pointers that are only valid in that specific OpenGL context.
  • *
- *

GLCapabilities creation

- *

Instances of {@code GLCapabilities} can be created with the {@link #load(GLLoadFunc, boolean) load} method. An OpenGL context must be current in the current thread - * before it is called. Calling this method is expensive, so the {@code GLCapabilities} instance should be associated with the OpenGL context and reused as + *

OpenGL Context Creation

+ *

Instances of {@code GL} can be created with the {@link #load(GLFlags) load} method. An OpenGL context must be current in the current thread + * before it is called. Calling this method is expensive, so the {@code GL} instance should be associated with the OpenGL context and reused as * necessary.

- *

Thread-local state

- *

Before a function for a given OpenGL context can be called, the corresponding {@code GLCapabilities} instance must be passed to the - * {@link #setCapabilities} method. The user is also responsible for clearing the current {@code GLCapabilities} instance when the context is destroyed or made - * current in another thread.

- * - *

Note that the {@link #load(GLLoadFunc, boolean) load} method implicitly calls {@link #setCapabilities} with the newly created instance.

* * @author squid233 * @see GLLoadFunc * @since 0.1.0 */ public final class GLLoader { - private static final boolean DEFAULT_COMPATIBLE = false; - private static final ThreadLocal capabilitiesTLS = new ThreadLocal<>(); - - /** - * Sets the {@link GLCapabilities} of the OpenGL context that is current in the current thread. - * - *

This {@code GLCapabilities} instance will be used by any OpenGL call in the current thread, until {@code setCapabilities} is called again with a - * different value.

- */ - public static void setCapabilities(@Nullable GLCapabilities caps) { - capabilitiesTLS.set(caps); - } - - /** - * {@return the {@link GLCapabilities} of the OpenGL context that is current in the current thread} - *

- * This method doesn't throw an exception when the capabilities are null. - * - * @see #getCapabilities() - */ - public static GLCapabilities getCapabilitiesSafe() { - return capabilitiesTLS.get(); - } - - /** - * {@return the {@link GLCapabilities} of the OpenGL context that is current in the current thread} - * - * @throws IllegalStateException if {@link #setCapabilities} has never been called in the current thread or was last called with a {@code null} value - * @see #getCapabilitiesSafe() - */ - public static GLCapabilities getCapabilities() { - return checkCapabilities(capabilitiesTLS.get()); - } - - /** - * {@return the current {@link GLExtCaps} of the OpenGL context in the current thread} - *

- * This is equivalent to the following code: - *


-     * {@link #getCapabilities()}.{@link GLCapabilities#ext() ext()}
-     * 
- * - * @throws IllegalStateException if {@link #setCapabilities} has never been called in the current thread or was last called with a {@code null} value - */ - public static GLExtCaps getExtCapabilities() { - return getCapabilities().ext(); - } - - private static GLCapabilities checkCapabilities(@Nullable GLCapabilities caps) { - if (RuntimeHelper.CHECKS) - CheckUtil.check(caps != null, """ - No GLCapabilities instance set for the current thread. Possible solutions: - \ta) Call GLLoader.load() after making a context current in the current thread. - \tb) Call GLLoader.setCapabilities() if a GLCapabilities instance already exists for the current context."""); - return caps; - } + private static final Map DESCRIPTOR_MAP = Map.of( + "glMapBuffer", FunctionDescriptor.of(ValueLayout.ADDRESS, ValueLayout.JAVA_INT, ValueLayout.JAVA_INT), + "glMapBufferRange", FunctionDescriptor.of(ValueLayout.ADDRESS, ValueLayout.JAVA_INT, ValueLayout.JAVA_LONG, ValueLayout.JAVA_LONG, ValueLayout.JAVA_INT), + "glMapNamedBuffer", FunctionDescriptor.of(ValueLayout.ADDRESS, ValueLayout.JAVA_INT, ValueLayout.JAVA_INT), + "glMapNamedBufferRange", FunctionDescriptor.of(ValueLayout.ADDRESS, ValueLayout.JAVA_INT, ValueLayout.JAVA_LONG, ValueLayout.JAVA_LONG, ValueLayout.JAVA_INT) + ); /** - * Loads OpenGL compatibility profile with the given load function. + * Loads OpenGL flags. * * @param load the load function - * @return the OpenGL capabilities, or {@code null} if no OpenGL context found. + * @return the OpenGL flags */ - @Nullable - public static GLCapabilities load(GLLoadFunc load) { - return load(load, DEFAULT_COMPATIBLE); + public static GLFlags loadFlags(GLLoadFunc load) { + return new GLFlags(load); } /** - * Loads OpenGL with the given load function. + * Loads OpenGL core profile with the given flags. * - * @param load the load function - * @param forwardCompatible If {@code true}, only loads core profile functions. - * @return the OpenGL capabilities, or {@code null} if no OpenGL context found. + * @param flags the OpenGL flags + * @return the OpenGL context, or {@code null} if no OpenGL context found. */ @Nullable - public static GLCapabilities load(GLLoadFunc load, boolean forwardCompatible) { - var caps = new GLCapabilities(forwardCompatible); - // set the global capabilities first - setCapabilities(caps); - if (caps.load(load) != 0) { - return caps; - } - // reset if failed to load - setCapabilities(null); - return null; + public static GL load(GLFlags flags) { + return flags.GL10 ? Downcall.load(GL.class, flags.load.lookup(), DESCRIPTOR_MAP) : null; } /** - * Checks whether the given GL function is available in this context. - * This method raises an {@link IllegalStateException} rather than a {@link NullPointerException}. + * Loads OpenGL compatibility profile with the given flags. * - * @param handle the method handle to be checked. - * @return {@code handle} - * @throws IllegalStateException if {@code handle} is {@code null}. + * @param flags the OpenGL flags + * @return the OpenGL context, or {@code null} if no OpenGL context found. */ - @NotNull - @Contract(value = "null -> fail; !null -> param1", pure = true) - public static MethodHandle check(@Nullable MethodHandle handle) throws IllegalStateException { - CheckUtil.check(handle != null, "handle is null; maybe no context or function exists."); - return handle; - } - - static boolean checkAll(MethodHandle... handles) { - for (var handle : handles) { - if (handle == null) { - return false; - } - } - return true; - } - - /** - * Pack the version into an integer. - * - * @param major the major version - * @param minor the minor version - * @return the packed version - */ - public static int makeVersion(int major, int minor) { - return major * 10000 + minor; - } - - /** - * {@return the major version} - * - * @param version the packed version - */ - public static int versionMajor(int version) { - return version / 10000; + @Nullable + public static GLLegacy loadLegacy(GLFlags flags) { + return flags.GL10 ? Downcall.load(GLLegacy.class, flags.load.lookup(), DESCRIPTOR_MAP) : null; } /** - * {@return the minor version} + * Loads OpenGL extensions with the given flags. * - * @param version the packed version + * @param flags the OpenGL flags + * @return the OpenGL extensions context, or {@code null} if no OpenGL context found. */ - public static int versionMinor(int version) { - return version % 10000; + @Nullable + public static GLExtension loadExtension(GLFlags flags) { + return flags.foundExtension ? Downcall.load(GLExtension.class, flags.load.lookup(), DESCRIPTOR_MAP) : null; } } 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 ca34423a..61ec7a9b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLUtil.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLUtil.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2022-2023 Overrun Organization + * Copyright (c) 2022-2024 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 @@ -18,11 +18,13 @@ import org.jetbrains.annotations.Nullable; import overrungl.OverrunGL; +import overrungl.opengl.ext.GLExtension; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.util.Locale; import java.util.function.Consumer; +import java.util.function.Supplier; import static overrungl.OverrunGL.apiLog; import static overrungl.internal.RuntimeHelper.unknownToken; @@ -43,94 +45,97 @@ private GLUtil() { * Detects the best debug output functionality to use and creates a callback that prints information to * {@link OverrunGL#apiLogger() API Logger}. *

- * The callback function is returned as an {@link Arena}, - * that should reset to NULL and be {@link Arena#close() freed} when no longer needed, which is often after - * destroying GL context. + * The callback function is returned as a {@link Arena}, that should be reset to NULL and + * {@link Arena#close() closed} when no longer needed, which is often after destroying GL context. * + * @param gl the OpenGL context. + * @param flags the OpenGL flags. + * @param ext the OpenGL extension context, which is supplied when OpenGL debug function is not found in core. * @return the arena. */ @Nullable - public static Arena setupDebugMessageCallback() { - return setupDebugMessageCallback(OverrunGL.apiLogger()); + public static Arena setupDebugMessageCallback(GL43C gl, GLFlags flags, Supplier ext) { + return setupDebugMessageCallback(gl, flags, ext, OverrunGL.apiLogger()); } /** * Detects the best debug output functionality to use and creates a callback that prints information to the specified * logger. *

- * The callback function is returned as a {@link Arena}, that should reset to NULL and be - * {@link Arena#close() freed} when no longer needed, which is often after destroy GL context. + * The callback function is returned as a {@link Arena}, that should be reset to NULL and + * {@link Arena#close() closed} when no longer needed, which is often after destroying GL context. * + * @param gl the OpenGL context. + * @param flags the OpenGL flags. + * @param ext the OpenGL extension context, which is supplied when OpenGL debug function is not found in core. * @param logger the output logger. * @return the arena. */ @Nullable - public static Arena setupDebugMessageCallback(Consumer logger) { - var caps = GLLoader.getCapabilities(); - - if (caps.Ver43 || caps.ext().GL_KHR_debug) { - if (caps.Ver43) { + public static Arena setupDebugMessageCallback(GL43C gl, GLFlags flags, Supplier ext, Consumer logger) { + if (flags.GL43 || flags.GL_KHR_debug) { + if (flags.GL43) { apiLog("[GL] Using OpenGL 4.3 for error logging."); } else { apiLog("[GL] Using KHR_debug for error logging."); } var arena = Arena.ofConfined(); - GL.debugMessageCallback(arena, (source, type, id, severity, message, userParam) -> { + gl.debugMessageCallback(arena, (source, type, id, severity, message, _) -> { 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(STR. " at \{ stack[i] }\n" ); + sb.append(STR." at \{stack[i]}\n"); } logger.accept(sb.toString()); }, MemorySegment.NULL); // no need GL_KHR_debug - if ((caps.Ver43 || caps.Ver30) && - (GL.getInteger(GL.CONTEXT_FLAGS) & GL.CONTEXT_FLAG_DEBUG_BIT) == 0) { + if ((flags.GL43 || flags.GL30) && + (gl.getIntegerv(GL.CONTEXT_FLAGS) & GL.CONTEXT_FLAG_DEBUG_BIT) == 0) { apiLog("[GL] Warning: A non-debug context may not produce any debug output."); - GL.enable(GL.DEBUG_OUTPUT); + gl.enable(GL.DEBUG_OUTPUT); } return arena; } - if (caps.ext().GL_ARB_debug_output) { + if (flags.GL_ARB_debug_output) { apiLog("[GL] Using ARB_debug_output for error logging."); var arena = Arena.ofConfined(); - glDebugMessageCallbackARB(arena, (source, type, id, severity, message, userParam) -> { + ext.get().glDebugMessageCallbackARB(arena, (source, type, id, severity, message, _) -> { 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(STR. " at \{ stack[i] }\n" ); + sb.append(STR." at \{stack[i]}\n"); } logger.accept(sb.toString()); }, MemorySegment.NULL); return arena; } - if (caps.ext().GL_AMD_debug_output) { + if (flags.GL_AMD_debug_output) { apiLog("[GL] Using AMD_debug_output for error logging."); var arena = Arena.ofConfined(); - glDebugMessageCallbackAMD(arena, (id, category, severity, message, userParam) -> { + ext.get().glDebugMessageCallbackAMD(arena, (id, category, severity, message, _) -> { 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(STR. " at \{ stack[i] }\n" ); + sb.append(STR." at \{stack[i]}\n"); } logger.accept(sb.toString()); }, MemorySegment.NULL); @@ -142,7 +147,7 @@ public static Arena setupDebugMessageCallback(Consumer logger) { } private static void printDetail(StringBuilder sb, String type, String message) { - sb.append(STR. " \{ type }: \{ message }\n" ); + sb.append(STR." \{type}: \{message}\n"); } private static String getDebugSource(int source) { diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GL3DFXMultisample.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GL3DFXMultisample.java index ef813701..d31c61ba 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GL3DFXMultisample.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GL3DFXMultisample.java @@ -16,20 +16,16 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_3DFX_multisample} */ -public final class GL3DFXMultisample { - public static final int GL_MULTISAMPLE_3DFX = 0x86B2; - public static final int GL_SAMPLE_BUFFERS_3DFX = 0x86B3; - public static final int GL_SAMPLES_3DFX = 0x86B4; - public static final int GL_MULTISAMPLE_BIT_3DFX = 0x20000000; +public interface GL3DFXMultisample { + int GL_MULTISAMPLE_3DFX = 0x86B2; + int GL_SAMPLE_BUFFERS_3DFX = 0x86B3; + int GL_SAMPLES_3DFX = 0x86B4; + int GL_MULTISAMPLE_BIT_3DFX = 0x20000000; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GL3DFXTbuffer.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GL3DFXTbuffer.java index c3123958..25502120 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GL3DFXTbuffer.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GL3DFXTbuffer.java @@ -16,28 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_3DFX_tbuffer} */ -public final class GL3DFXTbuffer { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_3DFX_tbuffer) return; - ext.glTbufferMask3DFX = load.invoke("glTbufferMask3DFX", ofVoid(JAVA_INT)); - } +public interface GL3DFXTbuffer { - public static void glTbufferMask3DFX(int mask) { - final var ext = getExtCapabilities(); - try { - check(ext.glTbufferMask3DFX).invokeExact(mask); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTbufferMask3DFX(int mask) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GL3DFXTextureCompressionFXT1.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GL3DFXTextureCompressionFXT1.java index 2f62e9e7..32e3520d 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GL3DFXTextureCompressionFXT1.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GL3DFXTextureCompressionFXT1.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_3DFX_texture_compression_FXT1} */ -public final class GL3DFXTextureCompressionFXT1 { - public static final int GL_COMPRESSED_RGB_FXT1_3DFX = 0x86B0; - public static final int GL_COMPRESSED_RGBA_FXT1_3DFX = 0x86B1; +public interface GL3DFXTextureCompressionFXT1 { + int GL_COMPRESSED_RGB_FXT1_3DFX = 0x86B0; + int GL_COMPRESSED_RGBA_FXT1_3DFX = 0x86B1; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLExtension.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLExtension.java new file mode 100644 index 00000000..68e452dc --- /dev/null +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLExtension.java @@ -0,0 +1,470 @@ +/* + * MIT License + * + * Copyright (c) 2022-present 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. + */ + +// This file is auto-generated. DO NOT EDIT! +package overrungl.opengl.ext; +import overrungl.opengl.ext.arb.*; +import overrungl.opengl.ext.khr.*; +import overrungl.opengl.ext.oes.*; +import overrungl.opengl.ext.amd.*; +import overrungl.opengl.ext.apple.*; +import overrungl.opengl.ext.ati.*; +import overrungl.opengl.ext.ext.*; +import overrungl.opengl.ext.ibm.*; +import overrungl.opengl.ext.intel.*; +import overrungl.opengl.ext.mesa.*; +import overrungl.opengl.ext.nv.*; +import overrungl.opengl.ext.sgi.*; +import overrungl.opengl.ext.sun.*; + +/** + * The OpenGL extension functions. + * + * @since 0.1.0 + */ +public interface GLExtension extends + GLARBES32Compatibility, + GLARBBindlessTexture, + GLARBCLEvent, + GLARBColorBufferFloat, + GLARBComputeVariableGroupSize, + GLARBDebugOutput, + GLARBDepthTexture, + GLARBDrawBuffers, + GLARBDrawBuffersBlend, + GLARBDrawInstanced, + GLARBFragmentProgram, + GLARBFragmentShader, + GLARBGeometryShader4, + GLARBGLSpirv, + GLARBGpuShaderInt64, + GLARBHalfFloatPixel, + GLARBImaging, + GLARBIndirectParameters, + GLARBInstancedArrays, + GLARBInternalformatQuery2, + GLARBMatrixPalette, + GLARBMultisample, + GLARBMultitexture, + GLARBOcclusionQuery, + GLARBParallelShaderCompile, + GLARBPipelineStatisticsQuery, + GLARBPixelBufferObject, + GLARBPointParameters, + GLARBPointSprite, + GLARBRobustness, + GLARBSampleLocations, + GLARBSampleShading, + GLARBShaderObjects, + GLARBShadingLanguageInclude, + GLARBShadow, + GLARBShadowAmbient, + GLARBSparseBuffer, + GLARBSparseTexture, + GLARBTextureBorderClamp, + GLARBTextureBufferObject, + GLARBTextureCompression, + GLARBTextureCompressionBptc, + GLARBTextureCubeMap, + GLARBTextureCubeMapArray, + GLARBTextureEnvCombine, + GLARBTextureEnvDot3, + GLARBTextureFilterMinmax, + GLARBTextureFloat, + GLARBTextureGather, + GLARBTextureMirroredRepeat, + GLARBTextureRectangle, + GLARBTransformFeedbackOverflowQuery, + GLARBTransposeMatrix, + GLARBVertexBlend, + GLARBVertexBufferObject, + GLARBVertexProgram, + GLARBVertexShader, + GLARBViewportArray, + GLARBWindowPos, + GLKHRBlendEquationAdvanced, + GLKHRBlendEquationAdvancedCoherent, + GLKHRNoError, + GLKHRParallelShaderCompile, + GLKHRRobustness, + GLKHRShaderSubgroup, + GLKHRTextureCompressionAstcHdr, + GLOESByteCoordinates, + GLOESCompressedPalettedTexture, + GLOESFixedPoint, + GLOESQueryMatrix, + GLOESReadFormat, + GLOESSinglePrecision, + GL3DFXMultisample, + GL3DFXTbuffer, + GL3DFXTextureCompressionFXT1, + GLAMDBlendMinmaxFactor, + GLAMDDebugOutput, + GLAMDDepthClampSeparate, + GLAMDDrawBuffersBlend, + GLAMDFramebufferMultisampleAdvanced, + GLAMDFramebufferSamplePositions, + GLAMDGpuShaderHalfFloat, + GLAMDGpuShaderInt64, + GLAMDInterleavedElements, + GLAMDMultiDrawIndirect, + GLAMDNameGenDelete, + GLAMDOcclusionQueryEvent, + GLAMDPerformanceMonitor, + GLAMDPinnedMemory, + GLAMDQueryBufferObject, + GLAMDSamplePositions, + GLAMDSparseTexture, + GLAMDStencilOperationExtended, + GLAMDTransformFeedback4, + GLAMDVertexShaderTessellator, + GLAPPLEAuxDepthStencil, + GLAPPLEClientStorage, + GLAPPLEElementArray, + GLAPPLEFence, + GLAPPLEFloatPixels, + GLAPPLEFlushBufferRange, + GLAPPLEObjectPurgeable, + GLAPPLERgb422, + GLAPPLERowBytes, + GLAPPLESpecularVector, + GLAPPLETextureRange, + GLAPPLETransformHint, + GLAPPLEVertexArrayObject, + GLAPPLEVertexArrayRange, + GLAPPLEVertexProgramEvaluators, + GLAPPLEYcbcr422, + GLATIDrawBuffers, + GLATIElementArray, + GLATIEnvmapBumpmap, + GLATIFragmentShader, + GLATIMapObjectBuffer, + GLATIMeminfo, + GLATIPixelFormatFloat, + GLATIPnTriangles, + GLATISeparateStencil, + GLATITextFragmentShader, + GLATITextureEnvCombine3, + GLATITextureFloat, + GLATITextureMirrorOnce, + GLATIVertexArrayObject, + GLATIVertexAttribArrayObject, + GLATIVertexStreams, + GLEXT422Pixels, + GLEXTEGLImageStorage, + GLEXTAbgr, + GLEXTBgra, + GLEXTBindableUniform, + GLEXTBlendColor, + GLEXTBlendEquationSeparate, + GLEXTBlendFuncSeparate, + GLEXTBlendMinmax, + GLEXTBlendSubtract, + GLEXTClipVolumeHint, + GLEXTCmyka, + GLEXTColorSubtable, + GLEXTCompiledVertexArray, + GLEXTConvolution, + GLEXTCoordinateFrame, + GLEXTCopyTexture, + GLEXTCullVertex, + GLEXTDebugLabel, + GLEXTDebugMarker, + GLEXTDepthBoundsTest, + GLEXTDirectStateAccess, + GLEXTDrawBuffers2, + GLEXTDrawInstanced, + GLEXTDrawRangedElements, + GLEXTExternalBuffer, + GLEXTFogCoord, + GLEXTFramebufferBlit, + GLEXTFramebufferBlitLayers, + GLEXTFramebufferMultisample, + GLEXTFramebufferMultisampleBlitScaled, + GLEXTFramebufferObject, + GLEXTSrgb, + GLEXTGeometryShader4, + GLEXTGpuProgramParameters, + GLEXTGpuShader4, + GLEXTHistogram, + GLEXTIndexArrayFormats, + GLEXTIndexFunc, + GLEXTIndexMaterial, + GLEXTLightTexture, + GLEXTMemoryObject, + GLEXTMemoryObjectFd, + GLEXTMemoryObjectWin32, + GLEXTMultiDrawArrays, + GLEXTMultisample, + GLEXTPackedDepthStencil, + GLEXTPackedFloat, + GLEXTPackedPixels, + GLEXTPalettedTexture, + GLEXTPixelBufferObject, + GLEXTPixelTransform, + GLEXTPointParameters, + GLEXTPolygonOffset, + GLEXTPolygonOffsetClamp, + GLEXTProvokingVertex, + GLEXTRasterMultisample, + GLEXTRescaleNormal, + GLEXTSecondaryColor, + GLEXTSemaphore, + GLEXTSemaphoreFd, + GLEXTSemaphoreWin32, + GLEXTSeparateShaderObjects, + GLEXTSeparateSpecularColor, + GLEXTShaderFramebufferFetch, + GLEXTShaderFramebufferFetchNonCoherent, + GLEXTShaderImageLoadStore, + GLEXTSharedTexturePalette, + GLEXTStencilClearTag, + GLEXTStencilTwoSide, + GLEXTStencilWrap, + GLEXTSubtexture, + GLEXTTexture, + GLEXTTexture3D, + GLEXTTextureArray, + GLEXTTextureBufferObject, + GLEXTTextureCompressionLatc, + GLEXTTextureCompressionRgtc, + GLEXTTextureCompressionS3tc, + GLEXTTextureCubeMap, + GLEXTTextureEnvCombine, + GLEXTTextureEnvDot3, + GLEXTTextureFilterAnisotropic, + GLEXTTextureFilterMinmax, + GLEXTTextureInteger, + GLEXTTextureLodBias, + GLEXTTextureMirrorClamp, + GLEXTTextureObject, + GLEXTTexturePerturbNormal, + GLEXTTextureSrgb, + GLEXTTextureSrgbR8, + GLEXTTextureSrgbRGB, + GLEXTTextureSrgbDecode, + GLEXTTextureSharedExponent, + GLEXTTextureSnorm, + GLEXTTextureStorage, + GLEXTTextureSwizzle, + GLEXTTimerQuery, + GLEXTTransformFeedback, + GLEXTVertexArray, + GLEXTVertexAttrib64bit, + GLEXTVertexShader, + GLEXTVertexWeighting, + GLEXTWin32KeyedMutex, + GLEXTWindowRectangles, + GLEXTX11SyncObject, + GLGREMEDYFrameTerminator, + GLGREMEDYStringMarker, + GLHPConvolutionBorderModes, + GLHPImageTransform, + GLHPOcclusionTest, + GLHPTextureLighting, + GLIBMCullVertex, + GLIBMMultimodeDrawArrays, + GLIBMRasterposClip, + GLIBMStaticData, + GLIBMTextureMirroredRepeat, + GLIBMVertexArrayLists, + GLINGRBlendFuncSeparate, + GLINGRColorClamp, + GLINGRInterlaceRead, + GLINTELBlackholeRender, + GLINTELConservativeRasterization, + GLINTELFramebufferCMAA, + GLINTELMapTexture, + GLINTELParallelArrays, + GLINTELPerformanceQuery, + GLMESAXTextureStack, + GLMESAFramebufferFlipX, + GLMESAFramebufferFlipY, + GLMESAFramebufferSwapXY, + GLMESAPackInvert, + GLMESAProgramBinaryFormats, + GLMESAResizeBuffers, + GLMESATileRasterOrder, + GLMESAWindowPos, + GLMESAYcbcrTexture, + GLNVXConditionalRender, + GLNVXGpuMemoryInfo, + GLNVXGpuMulticast2, + GLNVXLinkedGpuMulticast, + GLNVXProgressFence, + GLNVAlphaToCoverageDitherControl, + GLNVBindlessMultiDrawIndirect, + GLNVBindlessMultiDrawIndirectCount, + GLNVBindlessTexture, + GLNVBlendEquationAdvanced, + GLNVBlendEquationAdvancedCoherent, + GLNVClipSpaceWScaling, + GLNVCommandList, + GLNVComputeProgram5, + GLNVConditionalRender, + GLNVConservativeRaster, + GLNVConservativeRasterDilate, + GLNVConservativeRasterPreSnap, + GLNVConservativeRasterPreSnapTriangles, + GLNVCopyDepthToColor, + GLNVCopyImage, + GLNVDeepTexture3D, + GLNVDepthBufferFloat, + GLNVDepthClamp, + GLNVDrawTexture, + GLNVDrawVulkanImage, + GLNVEvaluators, + GLNVExplicitMultisample, + GLNVFence, + GLNVFillRectangle, + GLNVFloatBuffer, + GLNVFogDistance, + GLNVFragmentCoverageToColor, + GLNVFragmentProgram, + GLNVFragmentProgram2, + GLNVFramebufferMixedSamples, + GLNVFramebufferMultisampleCoverage, + GLNVGeometryProgram4, + GLNVGpuMulticast, + GLNVGpuProgram4, + GLNVGpuProgram5, + GLNVHalfFloat, + GLNVInternalformatSampleQuery, + GLNVLightMaxExponent, + GLNVMemoryAttachment, + GLNVMemoryObjectSparse, + GLNVMeshShader, + GLNVMultisampleFilterHint, + GLNVOcculusionQuery, + GLNVPackedDepthStencil, + GLNVParameterBufferObject, + GLNVPathRendering, + GLNVPathRenderingSharedEdge, + GLNVPixelDataRange, + GLNVPointSprite, + GLNVPresentVideo, + GLNVPrimitiveRestart, + GLNVPrimitiveShadingRate, + GLNVQueryResource, + GLNVQueryResourceTag, + GLNVRegisterCombiners, + GLNVRegisterCombiners2, + GLNVRepresentativeFragmentTest, + GLNVRobustnessVideoMemoryPurge, + GLNVSampleLocations, + GLNVScissorExclusive, + GLNVShaderBufferLoad, + GLNVShaderBufferStore, + GLNVShaderSubgroupPartitioned, + GLNVShaderThreadGroup, + GLNVShadingRateImage, + GLNVTessellationProgram5, + GLNVTexgenEmboss, + GLNVTexgenReflection, + GLNVTextureBarrier, + GLNVTextureEnvCombine4, + GLNVTextureExpandNormal, + GLNVTextureMultisample, + GLNVTextureRectangle, + GLNVTextureShader, + GLNVTextureShader2, + GLNVTextureShader3, + GLNVTimelineSemaphore, + GLNVTransformFeedback, + GLNVTransformFeedback2, + GLNVUniformBufferUnifiedMemory, + GLNVVDPAUInterop, + GLNVVDPAUInterop2, + GLNVVertexArrayRange, + GLNVVertexArrayRange2, + GLNVVertexAttribInteger64bit, + GLNVVertexBufferUnifiedMemory, + GLNVVertexProgram, + GLNVVertexProgram4, + GLNVVideoCapture, + GLNVViewportSwizzle, + GLOMLInterlace, + GLOMLResample, + GLOMLSubsample, + GLOVRMultiview, + GLPGIMiscHints, + GLPGIVertexHints, + GLRENDScreenCoordinates, + GLS3S3tc, + GLSGISDetailTexture, + GLSGISFogFunction, + GLSGISGenerateMipmap, + GLSGISMultisample, + GLSGISPixelTexture, + GLSGISPointLineTexgen, + GLSGISPointParameters, + GLSGISSharpenTexture, + GLSGISTexture4D, + GLSGISTextureBorderClamp, + GLSGISTextureColorMask, + GLSGISTextureEdgeClamp, + GLSGISTextureFilter4, + GLSGISTextureLod, + GLSGISTextureSelect, + GLSGIXAsync, + GLSGIXAsyncHistogram, + GLSGIXAsyncPixel, + GLSGIXBlendAlphaMinmax, + GLSGIXCalligraphicFragment, + GLSGIXClipmap, + GLSGIXConvolutionAccuracy, + GLSGIXDepthTexture, + GLSGIXFlushRaster, + GLSGIXFogOffset, + GLSGIXFragmentLighting, + GLSGIXFramezoom, + GLSGIXIglooInterface, + GLSGIXInstruments, + GLSGIXInterlace, + GLSGIXIrInstrument1, + GLSGIXListPriority, + GLSGIXPixelTexture, + GLSGIXPixelTiles, + GLSGIXPolynomialFFD, + GLSGIXReferencePlane, + GLSGIXResample, + GLSGIXScalebiasHint, + GLSGIXShadow, + GLSGIXShadowAmbient, + GLSGIXSprite, + GLSGIXSubsample, + GLSGIXTagSampleBuffer, + GLSGIXTextureAddEnv, + GLSGIXTextureCoordinateClamp, + GLSGIXTextureLodBias, + GLSGIXTextureMultiBuffer, + GLSGIXTextureScaleBias, + GLSGIXVertexPreclip, + GLSGIXYcrcb, + GLSGIXYcrcba, + GLSGIColorMatrix, + GLSGIColorTable, + GLSGITextureColorTable, + GLSUNXConstantData, + GLSUNConvolutionBorderModes, + GLSUNGlobalAlpha, + GLSUNMeshArray, + GLSUNSliceAccum, + GLSUNTriangleList, + GLSUNVertex, + GLWINPhongShading, + GLWINSpecularFog { +} diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLGREMEDYFrameTerminator.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLGREMEDYFrameTerminator.java index 6436ad60..7bd884a1 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLGREMEDYFrameTerminator.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLGREMEDYFrameTerminator.java @@ -16,28 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_GREMEDY_frame_terminator} */ -public final class GLGREMEDYFrameTerminator { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_GREMEDY_frame_terminator) return; - ext.glFrameTerminatorGREMEDY = load.invoke("glFrameTerminatorGREMEDY", ofVoid()); - } +public interface GLGREMEDYFrameTerminator { - public static void glFrameTerminatorGREMEDY() { - final var ext = getExtCapabilities(); - try { - check(ext.glFrameTerminatorGREMEDY).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFrameTerminatorGREMEDY() { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLGREMEDYStringMarker.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLGREMEDYStringMarker.java index bfc93ef2..a144be39 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLGREMEDYStringMarker.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLGREMEDYStringMarker.java @@ -16,28 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_GREMEDY_string_marker} */ -public final class GLGREMEDYStringMarker { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_GREMEDY_string_marker) return; - ext.glStringMarkerGREMEDY = load.invoke("glStringMarkerGREMEDY", ofVoid(JAVA_INT, ADDRESS)); - } +public interface GLGREMEDYStringMarker { - public static void glStringMarkerGREMEDY(int len, @NativeType("const void *") MemorySegment string) { - final var ext = getExtCapabilities(); - try { - check(ext.glStringMarkerGREMEDY).invokeExact(len, string); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glStringMarkerGREMEDY(int len, @NativeType("const void *") MemorySegment string) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLHPConvolutionBorderModes.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLHPConvolutionBorderModes.java index 0f526eff..19e59eda 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLHPConvolutionBorderModes.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLHPConvolutionBorderModes.java @@ -16,20 +16,16 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_HP_convolution_border_modes} */ -public final class GLHPConvolutionBorderModes { - public static final int GL_IGNORE_BORDER_HP = 0x8150; - public static final int GL_CONSTANT_BORDER_HP = 0x8151; - public static final int GL_REPLICATE_BORDER_HP = 0x8153; - public static final int GL_CONVOLUTION_BORDER_COLOR_HP = 0x8154; +public interface GLHPConvolutionBorderModes { + int GL_IGNORE_BORDER_HP = 0x8150; + int GL_CONSTANT_BORDER_HP = 0x8151; + int GL_REPLICATE_BORDER_HP = 0x8153; + int GL_CONVOLUTION_BORDER_COLOR_HP = 0x8154; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLHPImageTransform.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLHPImageTransform.java index 14ba70c6..eb8bafd4 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLHPImageTransform.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLHPImageTransform.java @@ -16,83 +16,52 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_HP_image_transform} */ -public final class GLHPImageTransform { - public static final int GL_IMAGE_SCALE_X_HP = 0x8155; - public static final int GL_IMAGE_SCALE_Y_HP = 0x8156; - public static final int GL_IMAGE_TRANSLATE_X_HP = 0x8157; - public static final int GL_IMAGE_TRANSLATE_Y_HP = 0x8158; - public static final int GL_IMAGE_ROTATE_ANGLE_HP = 0x8159; - public static final int GL_IMAGE_ROTATE_ORIGIN_X_HP = 0x815A; - public static final int GL_IMAGE_ROTATE_ORIGIN_Y_HP = 0x815B; - public static final int GL_IMAGE_MAG_FILTER_HP = 0x815C; - public static final int GL_IMAGE_MIN_FILTER_HP = 0x815D; - public static final int GL_IMAGE_CUBIC_WEIGHT_HP = 0x815E; - public static final int GL_CUBIC_HP = 0x815F; - public static final int GL_AVERAGE_HP = 0x8160; - public static final int GL_IMAGE_TRANSFORM_2D_HP = 0x8161; - public static final int GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP = 0x8162; - public static final int GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP = 0x8163; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_HP_image_transform) return; - ext.glImageTransformParameteriHP = load.invoke("glImageTransformParameteriHP", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glImageTransformParameterfHP = load.invoke("glImageTransformParameterfHP", ofVoid(JAVA_INT, JAVA_INT, JAVA_FLOAT)); - ext.glImageTransformParameterivHP = load.invoke("glImageTransformParameterivHP", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glImageTransformParameterfvHP = load.invoke("glImageTransformParameterfvHP", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetImageTransformParameterivHP = load.invoke("glGetImageTransformParameterivHP", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetImageTransformParameterfvHP = load.invoke("glGetImageTransformParameterfvHP", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLHPImageTransform { + int GL_IMAGE_SCALE_X_HP = 0x8155; + int GL_IMAGE_SCALE_Y_HP = 0x8156; + int GL_IMAGE_TRANSLATE_X_HP = 0x8157; + int GL_IMAGE_TRANSLATE_Y_HP = 0x8158; + int GL_IMAGE_ROTATE_ANGLE_HP = 0x8159; + int GL_IMAGE_ROTATE_ORIGIN_X_HP = 0x815A; + int GL_IMAGE_ROTATE_ORIGIN_Y_HP = 0x815B; + int GL_IMAGE_MAG_FILTER_HP = 0x815C; + int GL_IMAGE_MIN_FILTER_HP = 0x815D; + int GL_IMAGE_CUBIC_WEIGHT_HP = 0x815E; + int GL_CUBIC_HP = 0x815F; + int GL_AVERAGE_HP = 0x8160; + int GL_IMAGE_TRANSFORM_2D_HP = 0x8161; + int GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP = 0x8162; + int GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP = 0x8163; - public static void glImageTransformParameteriHP(int target, int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glImageTransformParameteriHP).invokeExact(target, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glImageTransformParameteriHP(int target, int pname, int param) { + throw new ContextException(); } - public static void glImageTransformParameterfHP(int target, int pname, float param) { - final var ext = getExtCapabilities(); - try { - check(ext.glImageTransformParameterfHP).invokeExact(target, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glImageTransformParameterfHP(int target, int pname, float param) { + throw new ContextException(); } - public static void glImageTransformParameterivHP(int target, int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glImageTransformParameterivHP).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glImageTransformParameterivHP(int target, int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glImageTransformParameterfvHP(int target, int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glImageTransformParameterfvHP).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glImageTransformParameterfvHP(int target, int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetImageTransformParameterivHP(int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetImageTransformParameterivHP).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetImageTransformParameterivHP(int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetImageTransformParameterfvHP(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetImageTransformParameterfvHP).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetImageTransformParameterfvHP(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLHPOcclusionTest.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLHPOcclusionTest.java index 8d28586d..28bdec7b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLHPOcclusionTest.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLHPOcclusionTest.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_HP_occlusion_test} */ -public final class GLHPOcclusionTest { - public static final int GL_OCCLUSION_TEST_HP = 0x8165; - public static final int GL_OCCLUSION_TEST_RESULT_HP = 0x8166; +public interface GLHPOcclusionTest { + int GL_OCCLUSION_TEST_HP = 0x8165; + int GL_OCCLUSION_TEST_RESULT_HP = 0x8166; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLHPTextureLighting.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLHPTextureLighting.java index 66cab388..1738004b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLHPTextureLighting.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLHPTextureLighting.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_HP_texture_lighting} */ -public final class GLHPTextureLighting { - public static final int GL_TEXTURE_LIGHTING_MODE_HP = 0x8167; - public static final int GL_TEXTURE_POST_SPECULAR_HP = 0x8168; - public static final int GL_TEXTURE_PRE_SPECULAR_HP = 0x8169; +public interface GLHPTextureLighting { + int GL_TEXTURE_LIGHTING_MODE_HP = 0x8167; + int GL_TEXTURE_POST_SPECULAR_HP = 0x8168; + int GL_TEXTURE_PRE_SPECULAR_HP = 0x8169; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLINGRBlendFuncSeparate.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLINGRBlendFuncSeparate.java index 16fc5f31..f8a3f30b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLINGRBlendFuncSeparate.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLINGRBlendFuncSeparate.java @@ -16,28 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_INGR_blend_func_separate} */ -public final class GLINGRBlendFuncSeparate { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_INGR_blend_func_separate) return; - ext.glBlendFuncSeparateINGR = load.invoke("glBlendFuncSeparateINGR", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLINGRBlendFuncSeparate { - public static void glBlendFuncSeparateINGR(int sfactorRGB, int dfactorRGB, int sfactorAlpha, int dfactorAlpha) { - final var ext = getExtCapabilities(); - try { - check(ext.glBlendFuncSeparateINGR).invokeExact(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBlendFuncSeparateINGR(int sfactorRGB, int dfactorRGB, int sfactorAlpha, int dfactorAlpha) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLINGRColorClamp.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLINGRColorClamp.java index d78c29a7..67db05f2 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLINGRColorClamp.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLINGRColorClamp.java @@ -16,24 +16,20 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_INGR_color_clamp} */ -public final class GLINGRColorClamp { - public static final int GL_RED_MIN_CLAMP_INGR = 0x8560; - public static final int GL_GREEN_MIN_CLAMP_INGR = 0x8561; - public static final int GL_BLUE_MIN_CLAMP_INGR = 0x8562; - public static final int GL_ALPHA_MIN_CLAMP_INGR = 0x8563; - public static final int GL_RED_MAX_CLAMP_INGR = 0x8564; - public static final int GL_GREEN_MAX_CLAMP_INGR = 0x8565; - public static final int GL_BLUE_MAX_CLAMP_INGR = 0x8566; - public static final int GL_ALPHA_MAX_CLAMP_INGR = 0x8567; +public interface GLINGRColorClamp { + int GL_RED_MIN_CLAMP_INGR = 0x8560; + int GL_GREEN_MIN_CLAMP_INGR = 0x8561; + int GL_BLUE_MIN_CLAMP_INGR = 0x8562; + int GL_ALPHA_MIN_CLAMP_INGR = 0x8563; + int GL_RED_MAX_CLAMP_INGR = 0x8564; + int GL_GREEN_MAX_CLAMP_INGR = 0x8565; + int GL_BLUE_MAX_CLAMP_INGR = 0x8566; + int GL_ALPHA_MAX_CLAMP_INGR = 0x8567; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLINGRInterlaceRead.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLINGRInterlaceRead.java index 60809496..75f26d08 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLINGRInterlaceRead.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLINGRInterlaceRead.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_INGR_interlace_read} */ -public final class GLINGRInterlaceRead { - public static final int GL_INTERLACE_READ_INGR = 0x8568; +public interface GLINGRInterlaceRead { + int GL_INTERLACE_READ_INGR = 0x8568; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLOMLInterlace.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLOMLInterlace.java index 4f3e93fb..a130cfe5 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLOMLInterlace.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLOMLInterlace.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_OML_interlace} */ -public final class GLOMLInterlace { - public static final int GL_INTERLACE_OML = 0x8980; - public static final int GL_INTERLACE_READ_OML = 0x8981; +public interface GLOMLInterlace { + int GL_INTERLACE_OML = 0x8980; + int GL_INTERLACE_READ_OML = 0x8981; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLOMLResample.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLOMLResample.java index 3cd9ed74..0c7dded0 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLOMLResample.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLOMLResample.java @@ -16,22 +16,18 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_OML_resample} */ -public final class GLOMLResample { - public static final int GL_PACK_RESAMPLE_OML = 0x8984; - public static final int GL_UNPACK_RESAMPLE_OML = 0x8985; - public static final int GL_RESAMPLE_REPLICATE_OML = 0x8986; - public static final int GL_RESAMPLE_ZERO_FILL_OML = 0x8987; - public static final int GL_RESAMPLE_AVERAGE_OML = 0x8988; - public static final int GL_RESAMPLE_DECIMATE_OML = 0x8989; +public interface GLOMLResample { + int GL_PACK_RESAMPLE_OML = 0x8984; + int GL_UNPACK_RESAMPLE_OML = 0x8985; + int GL_RESAMPLE_REPLICATE_OML = 0x8986; + int GL_RESAMPLE_ZERO_FILL_OML = 0x8987; + int GL_RESAMPLE_AVERAGE_OML = 0x8988; + int GL_RESAMPLE_DECIMATE_OML = 0x8989; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLOMLSubsample.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLOMLSubsample.java index b2bc03fa..123eaea9 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLOMLSubsample.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLOMLSubsample.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_OML_subsample} */ -public final class GLOMLSubsample { - public static final int GL_FORMAT_SUBSAMPLE_24_24_OML = 0x8982; - public static final int GL_FORMAT_SUBSAMPLE_244_244_OML = 0x8983; +public interface GLOMLSubsample { + int GL_FORMAT_SUBSAMPLE_24_24_OML = 0x8982; + int GL_FORMAT_SUBSAMPLE_244_244_OML = 0x8983; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLOVRMultiview.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLOVRMultiview.java index fdd955da..ac6cbaac 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLOVRMultiview.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLOVRMultiview.java @@ -16,32 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_OVR_multiview} */ -public final class GLOVRMultiview { - public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR = 0x9630; - public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR = 0x9632; - public static final int GL_MAX_VIEWS_OVR = 0x9631; - public static final int GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR = 0x9633; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_OVR_multiview) return; - ext.glFramebufferTextureMultiviewOVR = load.invoke("glFramebufferTextureMultiviewOVR", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLOVRMultiview { + int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR = 0x9630; + int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR = 0x9632; + int GL_MAX_VIEWS_OVR = 0x9631; + int GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR = 0x9633; - public static void glFramebufferTextureMultiviewOVR(int target, int attachment, int texture, int level, int baseViewIndex, int numViews) { - final var ext = getExtCapabilities(); - try { - check(ext.glFramebufferTextureMultiviewOVR).invokeExact(target, attachment, texture, level, baseViewIndex, numViews); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFramebufferTextureMultiviewOVR(int target, int attachment, int texture, int level, int baseViewIndex, int numViews) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLPGIMiscHints.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLPGIMiscHints.java index a0a1e546..bb0a9f37 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLPGIMiscHints.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLPGIMiscHints.java @@ -16,48 +16,37 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_PGI_misc_hints} */ -public final class GLPGIMiscHints { - public static final int GL_PREFER_DOUBLEBUFFER_HINT_PGI = 0x1A1F8; - public static final int GL_CONSERVE_MEMORY_HINT_PGI = 0x1A1FD; - public static final int GL_RECLAIM_MEMORY_HINT_PGI = 0x1A1FE; - public static final int GL_NATIVE_GRAPHICS_HANDLE_PGI = 0x1A202; - public static final int GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI = 0x1A203; - public static final int GL_NATIVE_GRAPHICS_END_HINT_PGI = 0x1A204; - public static final int GL_ALWAYS_FAST_HINT_PGI = 0x1A20C; - public static final int GL_ALWAYS_SOFT_HINT_PGI = 0x1A20D; - public static final int GL_ALLOW_DRAW_OBJ_HINT_PGI = 0x1A20E; - public static final int GL_ALLOW_DRAW_WIN_HINT_PGI = 0x1A20F; - public static final int GL_ALLOW_DRAW_FRG_HINT_PGI = 0x1A210; - public static final int GL_ALLOW_DRAW_MEM_HINT_PGI = 0x1A211; - public static final int GL_STRICT_DEPTHFUNC_HINT_PGI = 0x1A216; - public static final int GL_STRICT_LIGHTING_HINT_PGI = 0x1A217; - public static final int GL_STRICT_SCISSOR_HINT_PGI = 0x1A218; - public static final int GL_FULL_STIPPLE_HINT_PGI = 0x1A219; - public static final int GL_CLIP_NEAR_HINT_PGI = 0x1A220; - public static final int GL_CLIP_FAR_HINT_PGI = 0x1A221; - public static final int GL_WIDE_LINE_HINT_PGI = 0x1A222; - public static final int GL_BACK_NORMALS_HINT_PGI = 0x1A223; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_PGI_misc_hints) return; - ext.glHintPGI = load.invoke("glHintPGI", ofVoid(JAVA_INT, JAVA_INT)); - } +public interface GLPGIMiscHints { + int GL_PREFER_DOUBLEBUFFER_HINT_PGI = 0x1A1F8; + int GL_CONSERVE_MEMORY_HINT_PGI = 0x1A1FD; + int GL_RECLAIM_MEMORY_HINT_PGI = 0x1A1FE; + int GL_NATIVE_GRAPHICS_HANDLE_PGI = 0x1A202; + int GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI = 0x1A203; + int GL_NATIVE_GRAPHICS_END_HINT_PGI = 0x1A204; + int GL_ALWAYS_FAST_HINT_PGI = 0x1A20C; + int GL_ALWAYS_SOFT_HINT_PGI = 0x1A20D; + int GL_ALLOW_DRAW_OBJ_HINT_PGI = 0x1A20E; + int GL_ALLOW_DRAW_WIN_HINT_PGI = 0x1A20F; + int GL_ALLOW_DRAW_FRG_HINT_PGI = 0x1A210; + int GL_ALLOW_DRAW_MEM_HINT_PGI = 0x1A211; + int GL_STRICT_DEPTHFUNC_HINT_PGI = 0x1A216; + int GL_STRICT_LIGHTING_HINT_PGI = 0x1A217; + int GL_STRICT_SCISSOR_HINT_PGI = 0x1A218; + int GL_FULL_STIPPLE_HINT_PGI = 0x1A219; + int GL_CLIP_NEAR_HINT_PGI = 0x1A220; + int GL_CLIP_FAR_HINT_PGI = 0x1A221; + int GL_WIDE_LINE_HINT_PGI = 0x1A222; + int GL_BACK_NORMALS_HINT_PGI = 0x1A223; - public static void glHintPGI(int target, int mode) { - final var ext = getExtCapabilities(); - try { - check(ext.glHintPGI).invokeExact(target, mode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glHintPGI(int target, int mode) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLPGIVertexHints.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLPGIVertexHints.java index 9c81af95..3e83b639 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLPGIVertexHints.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLPGIVertexHints.java @@ -16,38 +16,34 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_PGI_vertex_hints} */ -public final class GLPGIVertexHints { - public static final int GL_VERTEX_DATA_HINT_PGI = 0x1A22A; - public static final int GL_VERTEX_CONSISTENT_HINT_PGI = 0x1A22B; - public static final int GL_MATERIAL_SIDE_HINT_PGI = 0x1A22C; - public static final int GL_MAX_VERTEX_HINT_PGI = 0x1A22D; - public static final int GL_COLOR3_BIT_PGI = 0x00010000; - public static final int GL_COLOR4_BIT_PGI = 0x00020000; - public static final int GL_EDGEFLAG_BIT_PGI = 0x00040000; - public static final int GL_INDEX_BIT_PGI = 0x00080000; - public static final int GL_MAT_AMBIENT_BIT_PGI = 0x00100000; - public static final int GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI = 0x00200000; - public static final int GL_MAT_DIFFUSE_BIT_PGI = 0x00400000; - public static final int GL_MAT_EMISSION_BIT_PGI = 0x00800000; - public static final int GL_MAT_COLOR_INDEXES_BIT_PGI = 0x01000000; - public static final int GL_MAT_SHININESS_BIT_PGI = 0x02000000; - public static final int GL_MAT_SPECULAR_BIT_PGI = 0x04000000; - public static final int GL_NORMAL_BIT_PGI = 0x08000000; - public static final int GL_TEXCOORD1_BIT_PGI = 0x10000000; - public static final int GL_TEXCOORD2_BIT_PGI = 0x20000000; - public static final int GL_TEXCOORD3_BIT_PGI = 0x40000000; - public static final int GL_TEXCOORD4_BIT_PGI = 0x80000000; - public static final int GL_VERTEX23_BIT_PGI = 0x00000004; - public static final int GL_VERTEX4_BIT_PGI = 0x00000008; +public interface GLPGIVertexHints { + int GL_VERTEX_DATA_HINT_PGI = 0x1A22A; + int GL_VERTEX_CONSISTENT_HINT_PGI = 0x1A22B; + int GL_MATERIAL_SIDE_HINT_PGI = 0x1A22C; + int GL_MAX_VERTEX_HINT_PGI = 0x1A22D; + int GL_COLOR3_BIT_PGI = 0x00010000; + int GL_COLOR4_BIT_PGI = 0x00020000; + int GL_EDGEFLAG_BIT_PGI = 0x00040000; + int GL_INDEX_BIT_PGI = 0x00080000; + int GL_MAT_AMBIENT_BIT_PGI = 0x00100000; + int GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI = 0x00200000; + int GL_MAT_DIFFUSE_BIT_PGI = 0x00400000; + int GL_MAT_EMISSION_BIT_PGI = 0x00800000; + int GL_MAT_COLOR_INDEXES_BIT_PGI = 0x01000000; + int GL_MAT_SHININESS_BIT_PGI = 0x02000000; + int GL_MAT_SPECULAR_BIT_PGI = 0x04000000; + int GL_NORMAL_BIT_PGI = 0x08000000; + int GL_TEXCOORD1_BIT_PGI = 0x10000000; + int GL_TEXCOORD2_BIT_PGI = 0x20000000; + int GL_TEXCOORD3_BIT_PGI = 0x40000000; + int GL_TEXCOORD4_BIT_PGI = 0x80000000; + int GL_VERTEX23_BIT_PGI = 0x00000004; + int GL_VERTEX4_BIT_PGI = 0x00000008; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLRENDScreenCoordinates.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLRENDScreenCoordinates.java index 44b57f5b..53c76546 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLRENDScreenCoordinates.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLRENDScreenCoordinates.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_REND_screen_coordinates} */ -public final class GLRENDScreenCoordinates { - public static final int GL_SCREEN_COORDINATES_REND = 0x8490; - public static final int GL_INVERTED_SCREEN_W_REND = 0x8491; +public interface GLRENDScreenCoordinates { + int GL_SCREEN_COORDINATES_REND = 0x8490; + int GL_INVERTED_SCREEN_W_REND = 0x8491; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLS3S3tc.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLS3S3tc.java index 97c17d24..163e4b36 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLS3S3tc.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLS3S3tc.java @@ -16,22 +16,18 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_S3_s3tc} */ -public final class GLS3S3tc { - public static final int GL_RGB_S3TC = 0x83A0; - public static final int GL_RGB4_S3TC = 0x83A1; - public static final int GL_RGBA_S3TC = 0x83A2; - public static final int GL_RGBA4_S3TC = 0x83A3; - public static final int GL_RGBA_DXT5_S3TC = 0x83A4; - public static final int GL_RGBA4_DXT5_S3TC = 0x83A5; +public interface GLS3S3tc { + int GL_RGB_S3TC = 0x83A0; + int GL_RGB4_S3TC = 0x83A1; + int GL_RGBA_S3TC = 0x83A2; + int GL_RGBA4_S3TC = 0x83A3; + int GL_RGBA_DXT5_S3TC = 0x83A4; + int GL_RGBA4_DXT5_S3TC = 0x83A5; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLWINPhongShading.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLWINPhongShading.java index ab07d951..1bf61c08 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLWINPhongShading.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLWINPhongShading.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_WIN_phong_shading} */ -public final class GLWINPhongShading { - public static final int GL_PHONG_WIN = 0x80EA; - public static final int GL_PHONG_HINT_WIN = 0x80EB; +public interface GLWINPhongShading { + int GL_PHONG_WIN = 0x80EA; + int GL_PHONG_HINT_WIN = 0x80EB; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLWINSpecularFog.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLWINSpecularFog.java index 3bd09627..26c7a6d1 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLWINSpecularFog.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/GLWINSpecularFog.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_WIN_specular_fog} */ -public final class GLWINSpecularFog { - public static final int GL_FOG_SPECULAR_TEXTURE_WIN = 0x80EC; +public interface GLWINSpecularFog { + int GL_FOG_SPECULAR_TEXTURE_WIN = 0x80EC; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDBlendMinmaxFactor.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDBlendMinmaxFactor.java index d5377d2e..9f5d4802 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDBlendMinmaxFactor.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDBlendMinmaxFactor.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.amd; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_AMD_blend_minmax_factor} */ -public final class GLAMDBlendMinmaxFactor { - public static final int GL_FACTOR_MIN_AMD = 0x901C; - public static final int GL_FACTOR_MAX_AMD = 0x901D; +public interface GLAMDBlendMinmaxFactor { + int GL_FACTOR_MIN_AMD = 0x901C; + int GL_FACTOR_MAX_AMD = 0x901D; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDDebugOutput.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDDebugOutput.java index 09043b58..0f9f589f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDDebugOutput.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDDebugOutput.java @@ -16,71 +16,48 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.amd; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_AMD_debug_output} */ -public final class GLAMDDebugOutput { - public static final int GL_MAX_DEBUG_MESSAGE_LENGTH_AMD = 0x9143; - public static final int GL_MAX_DEBUG_LOGGED_MESSAGES_AMD = 0x9144; - public static final int GL_DEBUG_LOGGED_MESSAGES_AMD = 0x9145; - public static final int GL_DEBUG_SEVERITY_HIGH_AMD = 0x9146; - public static final int GL_DEBUG_SEVERITY_MEDIUM_AMD = 0x9147; - public static final int GL_DEBUG_SEVERITY_LOW_AMD = 0x9148; - public static final int GL_DEBUG_CATEGORY_API_ERROR_AMD = 0x9149; - public static final int GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD = 0x914A; - public static final int GL_DEBUG_CATEGORY_DEPRECATION_AMD = 0x914B; - public static final int GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD = 0x914C; - public static final int GL_DEBUG_CATEGORY_PERFORMANCE_AMD = 0x914D; - public static final int GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD = 0x914E; - public static final int GL_DEBUG_CATEGORY_APPLICATION_AMD = 0x914F; - public static final int GL_DEBUG_CATEGORY_OTHER_AMD = 0x9150; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_AMD_debug_output) return; - ext.glDebugMessageEnableAMD = load.invoke("glDebugMessageEnableAMD", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, JAVA_BYTE)); - ext.glDebugMessageInsertAMD = load.invoke("glDebugMessageInsertAMD", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glDebugMessageCallbackAMD = load.invoke("glDebugMessageCallbackAMD", ofVoid(ADDRESS, ADDRESS)); - ext.glGetDebugMessageLogAMD = load.invoke("glGetDebugMessageLogAMD", of(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS)); - } - - public static void glDebugMessageEnableAMD(int category, int severity, int count, @NativeType("const GLuint *") MemorySegment ids, boolean enabled) { - final var ext = getExtCapabilities(); - try { - check(ext.glDebugMessageEnableAMD).invokeExact(category, severity, count, ids, enabled); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLAMDDebugOutput { + int GL_MAX_DEBUG_MESSAGE_LENGTH_AMD = 0x9143; + int GL_MAX_DEBUG_LOGGED_MESSAGES_AMD = 0x9144; + int GL_DEBUG_LOGGED_MESSAGES_AMD = 0x9145; + int GL_DEBUG_SEVERITY_HIGH_AMD = 0x9146; + int GL_DEBUG_SEVERITY_MEDIUM_AMD = 0x9147; + int GL_DEBUG_SEVERITY_LOW_AMD = 0x9148; + int GL_DEBUG_CATEGORY_API_ERROR_AMD = 0x9149; + int GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD = 0x914A; + int GL_DEBUG_CATEGORY_DEPRECATION_AMD = 0x914B; + int GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD = 0x914C; + int GL_DEBUG_CATEGORY_PERFORMANCE_AMD = 0x914D; + int GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD = 0x914E; + int GL_DEBUG_CATEGORY_APPLICATION_AMD = 0x914F; + int GL_DEBUG_CATEGORY_OTHER_AMD = 0x9150; + + default void glDebugMessageEnableAMD(int category, int severity, int count, @NativeType("const GLuint *") MemorySegment ids, boolean enabled) { + throw new ContextException(); } - public static void glDebugMessageInsertAMD(int category, int severity, int id, int length, @NativeType("const GLchar *") MemorySegment buf) { - final var ext = getExtCapabilities(); - try { - check(ext.glDebugMessageInsertAMD).invokeExact(category, severity, id, length, buf); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDebugMessageInsertAMD(int category, int severity, int id, int length, @NativeType("const GLchar *") MemorySegment buf) { + throw new ContextException(); } - public static void glDebugMessageCallbackAMD(@NativeType("GLDEBUGPROCAMD") MemorySegment callback, @NativeType("void *") MemorySegment userParam) { - final var ext = getExtCapabilities(); - try { - check(ext.glDebugMessageCallbackAMD).invokeExact(callback, userParam); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDebugMessageCallbackAMD(@NativeType("GLDEBUGPROCAMD") MemorySegment callback, @NativeType("void *") MemorySegment userParam) { + throw new ContextException(); } - public static void glDebugMessageCallbackAMD(Arena arena, GLDebugProcAMD callback, @NativeType("void *") MemorySegment userParam) { - glDebugMessageCallbackAMD(callback.address(arena), userParam); + @overrun.marshal.gen.Skip + default void glDebugMessageCallbackAMD(Arena arena, GLDebugProcAMD callback, @NativeType("void *") MemorySegment userParam) { + glDebugMessageCallbackAMD(callback.stub(arena), userParam); } - public static int glGetDebugMessageLogAMD(int count, int bufSize, @NativeType("GLenum *") MemorySegment categories, @NativeType("GLenum *") MemorySegment severities, @NativeType("GLuint *") MemorySegment ids, @NativeType("GLsizei *") MemorySegment lengths, @NativeType("GLchar *") MemorySegment message) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glGetDebugMessageLogAMD).invokeExact(count, bufSize, categories, severities, ids, lengths, message); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glGetDebugMessageLogAMD(int count, int bufSize, @NativeType("GLenum *") MemorySegment categories, @NativeType("GLenum *") MemorySegment severities, @NativeType("GLuint *") MemorySegment ids, @NativeType("GLsizei *") MemorySegment lengths, @NativeType("GLchar *") MemorySegment message) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDDepthClampSeparate.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDDepthClampSeparate.java index fca5854b..92751a08 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDDepthClampSeparate.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDDepthClampSeparate.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.amd; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_AMD_depth_clamp_separate} */ -public final class GLAMDDepthClampSeparate { - public static final int GL_DEPTH_CLAMP_NEAR_AMD = 0x901E; - public static final int GL_DEPTH_CLAMP_FAR_AMD = 0x901F; +public interface GLAMDDepthClampSeparate { + int GL_DEPTH_CLAMP_NEAR_AMD = 0x901E; + int GL_DEPTH_CLAMP_FAR_AMD = 0x901F; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDDrawBuffersBlend.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDDrawBuffersBlend.java index 7718cea1..1f9b0b04 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDDrawBuffersBlend.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDDrawBuffersBlend.java @@ -16,52 +16,29 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.amd; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_AMD_draw_buffers_blend} */ -public final class GLAMDDrawBuffersBlend { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_AMD_draw_buffers_blend) return; - ext.glBlendFuncIndexedAMD = load.invoke("glBlendFuncIndexedAMD", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glBlendFuncSeparateIndexedAMD = load.invoke("glBlendFuncSeparateIndexedAMD", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glBlendEquationIndexedAMD = load.invoke("glBlendEquationIndexedAMD", ofVoid(JAVA_INT, JAVA_INT)); - ext.glBlendEquationSeparateIndexedAMD = load.invoke("glBlendEquationSeparateIndexedAMD", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLAMDDrawBuffersBlend { - public static void glBlendFuncIndexedAMD(int buf, int src, int dst) { - final var ext = getExtCapabilities(); - try { - check(ext.glBlendFuncIndexedAMD).invokeExact(buf, src, dst); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBlendFuncIndexedAMD(int buf, int src, int dst) { + throw new ContextException(); } - public static void glBlendFuncSeparateIndexedAMD(int buf, int srcRGB, int dstRGB, int srcAlpha, int dstAlpha) { - final var ext = getExtCapabilities(); - try { - check(ext.glBlendFuncSeparateIndexedAMD).invokeExact(buf, srcRGB, dstRGB, srcAlpha, dstAlpha); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBlendFuncSeparateIndexedAMD(int buf, int srcRGB, int dstRGB, int srcAlpha, int dstAlpha) { + throw new ContextException(); } - public static void glBlendEquationIndexedAMD(int buf, int mode) { - final var ext = getExtCapabilities(); - try { - check(ext.glBlendEquationIndexedAMD).invokeExact(buf, mode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBlendEquationIndexedAMD(int buf, int mode) { + throw new ContextException(); } - public static void glBlendEquationSeparateIndexedAMD(int buf, int modeRGB, int modeAlpha) { - final var ext = getExtCapabilities(); - try { - check(ext.glBlendEquationSeparateIndexedAMD).invokeExact(buf, modeRGB, modeAlpha); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBlendEquationSeparateIndexedAMD(int buf, int modeRGB, int modeAlpha) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDFramebufferMultisampleAdvanced.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDFramebufferMultisampleAdvanced.java index 715f9287..04dcd618 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDFramebufferMultisampleAdvanced.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDFramebufferMultisampleAdvanced.java @@ -16,42 +16,27 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.amd; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_AMD_framebuffer_multisample_advanced} */ -public final class GLAMDFramebufferMultisampleAdvanced { - public static final int GL_RENDERBUFFER_STORAGE_SAMPLES_AMD = 0x91B2; - public static final int GL_MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD = 0x91B3; - public static final int GL_MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD = 0x91B4; - public static final int GL_MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD = 0x91B5; - public static final int GL_NUM_SUPPORTED_MULTISAMPLE_MODES_AMD = 0x91B6; - public static final int GL_SUPPORTED_MULTISAMPLE_MODES_AMD = 0x91B7; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_AMD_framebuffer_multisample_advanced) return; - ext.glRenderbufferStorageMultisampleAdvancedAMD = load.invoke("glRenderbufferStorageMultisampleAdvancedAMD", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glNamedRenderbufferStorageMultisampleAdvancedAMD = load.invoke("glNamedRenderbufferStorageMultisampleAdvancedAMD", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLAMDFramebufferMultisampleAdvanced { + int GL_RENDERBUFFER_STORAGE_SAMPLES_AMD = 0x91B2; + int GL_MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD = 0x91B3; + int GL_MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD = 0x91B4; + int GL_MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD = 0x91B5; + int GL_NUM_SUPPORTED_MULTISAMPLE_MODES_AMD = 0x91B6; + int GL_SUPPORTED_MULTISAMPLE_MODES_AMD = 0x91B7; - public static void glRenderbufferStorageMultisampleAdvancedAMD(int target, int samples, int storageSamples, int internalformat, int width, int height) { - final var ext = getExtCapabilities(); - try { - check(ext.glRenderbufferStorageMultisampleAdvancedAMD).invokeExact(target, samples, storageSamples, internalformat, width, height); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glRenderbufferStorageMultisampleAdvancedAMD(int target, int samples, int storageSamples, int internalformat, int width, int height) { + throw new ContextException(); } - public static void glNamedRenderbufferStorageMultisampleAdvancedAMD(int renderbuffer, int samples, int storageSamples, int internalformat, int width, int height) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedRenderbufferStorageMultisampleAdvancedAMD).invokeExact(renderbuffer, samples, storageSamples, internalformat, width, height); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedRenderbufferStorageMultisampleAdvancedAMD(int renderbuffer, int samples, int storageSamples, int internalformat, int width, int height) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDFramebufferSamplePositions.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDFramebufferSamplePositions.java index a4ba41ac..4bf3e035 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDFramebufferSamplePositions.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDFramebufferSamplePositions.java @@ -16,56 +16,33 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.amd; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_AMD_framebuffer_sample_positions} */ -public final class GLAMDFramebufferSamplePositions { - public static final int GL_SUBSAMPLE_DISTANCE_AMD = 0x883F; - public static final int GL_PIXELS_PER_SAMPLE_PATTERN_X_AMD = 0x91AE; - public static final int GL_PIXELS_PER_SAMPLE_PATTERN_Y_AMD = 0x91AF; - public static final int GL_ALL_PIXELS_AMD = 0xFFFFFFFF; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_AMD_framebuffer_sample_positions) return; - ext.glFramebufferSamplePositionsfvAMD = load.invoke("glFramebufferSamplePositionsfvAMD", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glNamedFramebufferSamplePositionsfvAMD = load.invoke("glNamedFramebufferSamplePositionsfvAMD", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetFramebufferParameterfvAMD = load.invoke("glGetFramebufferParameterfvAMD", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetNamedFramebufferParameterfvAMD = load.invoke("glGetNamedFramebufferParameterfvAMD", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static void glFramebufferSamplePositionsfvAMD(int target, int numsamples, int pixelindex, @NativeType("const GLfloat *") MemorySegment values) { - final var ext = getExtCapabilities(); - try { - check(ext.glFramebufferSamplePositionsfvAMD).invokeExact(target, numsamples, pixelindex, values); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLAMDFramebufferSamplePositions { + int GL_SUBSAMPLE_DISTANCE_AMD = 0x883F; + int GL_PIXELS_PER_SAMPLE_PATTERN_X_AMD = 0x91AE; + int GL_PIXELS_PER_SAMPLE_PATTERN_Y_AMD = 0x91AF; + int GL_ALL_PIXELS_AMD = 0xFFFFFFFF; + + default void glFramebufferSamplePositionsfvAMD(int target, int numsamples, int pixelindex, @NativeType("const GLfloat *") MemorySegment values) { + throw new ContextException(); } - public static void glNamedFramebufferSamplePositionsfvAMD(int framebuffer, int numsamples, int pixelindex, @NativeType("const GLfloat *") MemorySegment values) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedFramebufferSamplePositionsfvAMD).invokeExact(framebuffer, numsamples, pixelindex, values); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedFramebufferSamplePositionsfvAMD(int framebuffer, int numsamples, int pixelindex, @NativeType("const GLfloat *") MemorySegment values) { + throw new ContextException(); } - public static void glGetFramebufferParameterfvAMD(int target, int pname, int numsamples, int pixelindex, int size, @NativeType("GLfloat *") MemorySegment values) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetFramebufferParameterfvAMD).invokeExact(target, pname, numsamples, pixelindex, size, values); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetFramebufferParameterfvAMD(int target, int pname, int numsamples, int pixelindex, int size, @NativeType("GLfloat *") MemorySegment values) { + throw new ContextException(); } - public static void glGetNamedFramebufferParameterfvAMD(int framebuffer, int pname, int numsamples, int pixelindex, int size, @NativeType("GLfloat *") MemorySegment values) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetNamedFramebufferParameterfvAMD).invokeExact(framebuffer, pname, numsamples, pixelindex, size, values); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetNamedFramebufferParameterfvAMD(int framebuffer, int pname, int numsamples, int pixelindex, int size, @NativeType("GLfloat *") MemorySegment values) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDGpuShaderHalfFloat.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDGpuShaderHalfFloat.java index 415aad7a..6a54d3ad 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDGpuShaderHalfFloat.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDGpuShaderHalfFloat.java @@ -16,29 +16,25 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.amd; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_AMD_gpu_shader_half_float} */ -public final class GLAMDGpuShaderHalfFloat { - public static final int GL_FLOAT16_NV = 0x8FF8; - public static final int GL_FLOAT16_VEC2_NV = 0x8FF9; - public static final int GL_FLOAT16_VEC3_NV = 0x8FFA; - public static final int GL_FLOAT16_VEC4_NV = 0x8FFB; - public static final int GL_FLOAT16_MAT2_AMD = 0x91C5; - public static final int GL_FLOAT16_MAT3_AMD = 0x91C6; - public static final int GL_FLOAT16_MAT4_AMD = 0x91C7; - public static final int GL_FLOAT16_MAT2x3_AMD = 0x91C8; - public static final int GL_FLOAT16_MAT2x4_AMD = 0x91C9; - public static final int GL_FLOAT16_MAT3x2_AMD = 0x91CA; - public static final int GL_FLOAT16_MAT3x4_AMD = 0x91CB; - public static final int GL_FLOAT16_MAT4x2_AMD = 0x91CC; - public static final int GL_FLOAT16_MAT4x3_AMD = 0x91CD; +public interface GLAMDGpuShaderHalfFloat { + int GL_FLOAT16_NV = 0x8FF8; + int GL_FLOAT16_VEC2_NV = 0x8FF9; + int GL_FLOAT16_VEC3_NV = 0x8FFA; + int GL_FLOAT16_VEC4_NV = 0x8FFB; + int GL_FLOAT16_MAT2_AMD = 0x91C5; + int GL_FLOAT16_MAT3_AMD = 0x91C6; + int GL_FLOAT16_MAT4_AMD = 0x91C7; + int GL_FLOAT16_MAT2x3_AMD = 0x91C8; + int GL_FLOAT16_MAT2x4_AMD = 0x91C9; + int GL_FLOAT16_MAT3x2_AMD = 0x91CA; + int GL_FLOAT16_MAT3x4_AMD = 0x91CB; + int GL_FLOAT16_MAT4x2_AMD = 0x91CC; + int GL_FLOAT16_MAT4x3_AMD = 0x91CD; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDGpuShaderInt64.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDGpuShaderInt64.java index 44e17aba..b4d20f58 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDGpuShaderInt64.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDGpuShaderInt64.java @@ -16,316 +16,173 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.amd; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_AMD_gpu_shader_int64} */ -public final class GLAMDGpuShaderInt64 { - public static final int GL_INT64_NV = 0x140E; - public static final int GL_UNSIGNED_INT64_NV = 0x140F; - public static final int GL_INT8_NV = 0x8FE0; - public static final int GL_INT8_VEC2_NV = 0x8FE1; - public static final int GL_INT8_VEC3_NV = 0x8FE2; - public static final int GL_INT8_VEC4_NV = 0x8FE3; - public static final int GL_INT16_NV = 0x8FE4; - public static final int GL_INT16_VEC2_NV = 0x8FE5; - public static final int GL_INT16_VEC3_NV = 0x8FE6; - public static final int GL_INT16_VEC4_NV = 0x8FE7; - public static final int GL_INT64_VEC2_NV = 0x8FE9; - public static final int GL_INT64_VEC3_NV = 0x8FEA; - public static final int GL_INT64_VEC4_NV = 0x8FEB; - public static final int GL_UNSIGNED_INT8_NV = 0x8FEC; - public static final int GL_UNSIGNED_INT8_VEC2_NV = 0x8FED; - public static final int GL_UNSIGNED_INT8_VEC3_NV = 0x8FEE; - public static final int GL_UNSIGNED_INT8_VEC4_NV = 0x8FEF; - public static final int GL_UNSIGNED_INT16_NV = 0x8FF0; - public static final int GL_UNSIGNED_INT16_VEC2_NV = 0x8FF1; - public static final int GL_UNSIGNED_INT16_VEC3_NV = 0x8FF2; - public static final int GL_UNSIGNED_INT16_VEC4_NV = 0x8FF3; - public static final int GL_UNSIGNED_INT64_VEC2_NV = 0x8FF5; - public static final int GL_UNSIGNED_INT64_VEC3_NV = 0x8FF6; - public static final int GL_UNSIGNED_INT64_VEC4_NV = 0x8FF7; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_AMD_gpu_shader_int64) return; - ext.glUniform1i64NV = load.invoke("glUniform1i64NV", ofVoid(JAVA_INT, JAVA_LONG)); - ext.glUniform2i64NV = load.invoke("glUniform2i64NV", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG)); - ext.glUniform3i64NV = load.invoke("glUniform3i64NV", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glUniform4i64NV = load.invoke("glUniform4i64NV", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glUniform1i64vNV = load.invoke("glUniform1i64vNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform2i64vNV = load.invoke("glUniform2i64vNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform3i64vNV = load.invoke("glUniform3i64vNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform4i64vNV = load.invoke("glUniform4i64vNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform1ui64NV = load.invoke("glUniform1ui64NV", ofVoid(JAVA_INT, JAVA_LONG)); - ext.glUniform2ui64NV = load.invoke("glUniform2ui64NV", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG)); - ext.glUniform3ui64NV = load.invoke("glUniform3ui64NV", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glUniform4ui64NV = load.invoke("glUniform4ui64NV", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glUniform1ui64vNV = load.invoke("glUniform1ui64vNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform2ui64vNV = load.invoke("glUniform2ui64vNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform3ui64vNV = load.invoke("glUniform3ui64vNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform4ui64vNV = load.invoke("glUniform4ui64vNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetUniformi64vNV = load.invoke("glGetUniformi64vNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetUniformui64vNV = load.invoke("glGetUniformui64vNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform1i64NV = load.invoke("glProgramUniform1i64NV", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glProgramUniform2i64NV = load.invoke("glProgramUniform2i64NV", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG)); - ext.glProgramUniform3i64NV = load.invoke("glProgramUniform3i64NV", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glProgramUniform4i64NV = load.invoke("glProgramUniform4i64NV", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glProgramUniform1i64vNV = load.invoke("glProgramUniform1i64vNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform2i64vNV = load.invoke("glProgramUniform2i64vNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform3i64vNV = load.invoke("glProgramUniform3i64vNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform4i64vNV = load.invoke("glProgramUniform4i64vNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform1ui64NV = load.invoke("glProgramUniform1ui64NV", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glProgramUniform2ui64NV = load.invoke("glProgramUniform2ui64NV", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG)); - ext.glProgramUniform3ui64NV = load.invoke("glProgramUniform3ui64NV", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glProgramUniform4ui64NV = load.invoke("glProgramUniform4ui64NV", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glProgramUniform1ui64vNV = load.invoke("glProgramUniform1ui64vNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform2ui64vNV = load.invoke("glProgramUniform2ui64vNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform3ui64vNV = load.invoke("glProgramUniform3ui64vNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform4ui64vNV = load.invoke("glProgramUniform4ui64vNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static void glUniform1i64NV(int location, long x) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform1i64NV).invokeExact(location, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform2i64NV(int location, long x, long y) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform2i64NV).invokeExact(location, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform3i64NV(int location, long x, long y, long z) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform3i64NV).invokeExact(location, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform4i64NV(int location, long x, long y, long z, long w) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform4i64NV).invokeExact(location, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform1i64vNV(int location, int count, @NativeType("const GLint64EXT *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform1i64vNV).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform2i64vNV(int location, int count, @NativeType("const GLint64EXT *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform2i64vNV).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform3i64vNV(int location, int count, @NativeType("const GLint64EXT *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform3i64vNV).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform4i64vNV(int location, int count, @NativeType("const GLint64EXT *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform4i64vNV).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform1ui64NV(int location, long x) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform1ui64NV).invokeExact(location, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform2ui64NV(int location, long x, long y) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform2ui64NV).invokeExact(location, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLAMDGpuShaderInt64 { + int GL_INT64_NV = 0x140E; + int GL_UNSIGNED_INT64_NV = 0x140F; + int GL_INT8_NV = 0x8FE0; + int GL_INT8_VEC2_NV = 0x8FE1; + int GL_INT8_VEC3_NV = 0x8FE2; + int GL_INT8_VEC4_NV = 0x8FE3; + int GL_INT16_NV = 0x8FE4; + int GL_INT16_VEC2_NV = 0x8FE5; + int GL_INT16_VEC3_NV = 0x8FE6; + int GL_INT16_VEC4_NV = 0x8FE7; + int GL_INT64_VEC2_NV = 0x8FE9; + int GL_INT64_VEC3_NV = 0x8FEA; + int GL_INT64_VEC4_NV = 0x8FEB; + int GL_UNSIGNED_INT8_NV = 0x8FEC; + int GL_UNSIGNED_INT8_VEC2_NV = 0x8FED; + int GL_UNSIGNED_INT8_VEC3_NV = 0x8FEE; + int GL_UNSIGNED_INT8_VEC4_NV = 0x8FEF; + int GL_UNSIGNED_INT16_NV = 0x8FF0; + int GL_UNSIGNED_INT16_VEC2_NV = 0x8FF1; + int GL_UNSIGNED_INT16_VEC3_NV = 0x8FF2; + int GL_UNSIGNED_INT16_VEC4_NV = 0x8FF3; + int GL_UNSIGNED_INT64_VEC2_NV = 0x8FF5; + int GL_UNSIGNED_INT64_VEC3_NV = 0x8FF6; + int GL_UNSIGNED_INT64_VEC4_NV = 0x8FF7; + + default void glUniform1i64NV(int location, long x) { + throw new ContextException(); + } + + default void glUniform2i64NV(int location, long x, long y) { + throw new ContextException(); + } + + default void glUniform3i64NV(int location, long x, long y, long z) { + throw new ContextException(); + } + + default void glUniform4i64NV(int location, long x, long y, long z, long w) { + throw new ContextException(); + } + + default void glUniform1i64vNV(int location, int count, @NativeType("const GLint64EXT *") MemorySegment value) { + throw new ContextException(); + } + + default void glUniform2i64vNV(int location, int count, @NativeType("const GLint64EXT *") MemorySegment value) { + throw new ContextException(); + } + + default void glUniform3i64vNV(int location, int count, @NativeType("const GLint64EXT *") MemorySegment value) { + throw new ContextException(); + } + + default void glUniform4i64vNV(int location, int count, @NativeType("const GLint64EXT *") MemorySegment value) { + throw new ContextException(); + } + + default void glUniform1ui64NV(int location, long x) { + throw new ContextException(); + } + + default void glUniform2ui64NV(int location, long x, long y) { + throw new ContextException(); } - public static void glUniform3ui64NV(int location, long x, long y, long z) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform3ui64NV).invokeExact(location, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform3ui64NV(int location, long x, long y, long z) { + throw new ContextException(); } - public static void glUniform4ui64NV(int location, long x, long y, long z, long w) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform4ui64NV).invokeExact(location, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform4ui64NV(int location, long x, long y, long z, long w) { + throw new ContextException(); } - public static void glUniform1ui64vNV(int location, int count, @NativeType("const GLuint64EXT *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform1ui64vNV).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform1ui64vNV(int location, int count, @NativeType("const GLuint64EXT *") MemorySegment value) { + throw new ContextException(); } - public static void glUniform2ui64vNV(int location, int count, @NativeType("const GLuint64EXT *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform2ui64vNV).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform2ui64vNV(int location, int count, @NativeType("const GLuint64EXT *") MemorySegment value) { + throw new ContextException(); } - public static void glUniform3ui64vNV(int location, int count, @NativeType("const GLuint64EXT *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform3ui64vNV).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform3ui64vNV(int location, int count, @NativeType("const GLuint64EXT *") MemorySegment value) { + throw new ContextException(); } - public static void glUniform4ui64vNV(int location, int count, @NativeType("const GLuint64EXT *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform4ui64vNV).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform4ui64vNV(int location, int count, @NativeType("const GLuint64EXT *") MemorySegment value) { + throw new ContextException(); } - public static void glGetUniformi64vNV(int program, int location, @NativeType("GLint64EXT *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetUniformi64vNV).invokeExact(program, location, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetUniformi64vNV(int program, int location, @NativeType("GLint64EXT *") MemorySegment params) { + throw new ContextException(); } - public static void glGetUniformui64vNV(int program, int location, @NativeType("GLuint64EXT *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetUniformui64vNV).invokeExact(program, location, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetUniformui64vNV(int program, int location, @NativeType("GLuint64EXT *") MemorySegment params) { + throw new ContextException(); } - public static void glProgramUniform1i64NV(int program, int location, long x) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform1i64NV).invokeExact(program, location, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform1i64NV(int program, int location, long x) { + throw new ContextException(); } - public static void glProgramUniform2i64NV(int program, int location, long x, long y) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform2i64NV).invokeExact(program, location, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform2i64NV(int program, int location, long x, long y) { + throw new ContextException(); } - public static void glProgramUniform3i64NV(int program, int location, long x, long y, long z) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform3i64NV).invokeExact(program, location, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform3i64NV(int program, int location, long x, long y, long z) { + throw new ContextException(); } - public static void glProgramUniform4i64NV(int program, int location, long x, long y, long z, long w) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform4i64NV).invokeExact(program, location, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform4i64NV(int program, int location, long x, long y, long z, long w) { + throw new ContextException(); } - public static void glProgramUniform1i64vNV(int program, int location, int count, @NativeType("const GLint64EXT *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform1i64vNV).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform1i64vNV(int program, int location, int count, @NativeType("const GLint64EXT *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform2i64vNV(int program, int location, int count, @NativeType("const GLint64EXT *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform2i64vNV).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform2i64vNV(int program, int location, int count, @NativeType("const GLint64EXT *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform3i64vNV(int program, int location, int count, @NativeType("const GLint64EXT *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform3i64vNV).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform3i64vNV(int program, int location, int count, @NativeType("const GLint64EXT *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform4i64vNV(int program, int location, int count, @NativeType("const GLint64EXT *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform4i64vNV).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform4i64vNV(int program, int location, int count, @NativeType("const GLint64EXT *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform1ui64NV(int program, int location, long x) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform1ui64NV).invokeExact(program, location, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform1ui64NV(int program, int location, long x) { + throw new ContextException(); } - public static void glProgramUniform2ui64NV(int program, int location, long x, long y) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform2ui64NV).invokeExact(program, location, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform2ui64NV(int program, int location, long x, long y) { + throw new ContextException(); } - public static void glProgramUniform3ui64NV(int program, int location, long x, long y, long z) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform3ui64NV).invokeExact(program, location, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform3ui64NV(int program, int location, long x, long y, long z) { + throw new ContextException(); } - public static void glProgramUniform4ui64NV(int program, int location, long x, long y, long z, long w) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform4ui64NV).invokeExact(program, location, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform4ui64NV(int program, int location, long x, long y, long z, long w) { + throw new ContextException(); } - public static void glProgramUniform1ui64vNV(int program, int location, int count, @NativeType("const GLuint64EXT *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform1ui64vNV).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform1ui64vNV(int program, int location, int count, @NativeType("const GLuint64EXT *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform2ui64vNV(int program, int location, int count, @NativeType("const GLuint64EXT *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform2ui64vNV).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform2ui64vNV(int program, int location, int count, @NativeType("const GLuint64EXT *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform3ui64vNV(int program, int location, int count, @NativeType("const GLuint64EXT *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform3ui64vNV).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform3ui64vNV(int program, int location, int count, @NativeType("const GLuint64EXT *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform4ui64vNV(int program, int location, int count, @NativeType("const GLuint64EXT *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform4ui64vNV).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform4ui64vNV(int program, int location, int count, @NativeType("const GLuint64EXT *") MemorySegment value) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDInterleavedElements.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDInterleavedElements.java index 432669ee..fda788bb 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDInterleavedElements.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDInterleavedElements.java @@ -16,30 +16,19 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.amd; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_AMD_interleaved_elements} */ -public final class GLAMDInterleavedElements { - public static final int GL_VERTEX_ELEMENT_SWIZZLE_AMD = 0x91A4; - public static final int GL_VERTEX_ID_SWIZZLE_AMD = 0x91A5; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_AMD_interleaved_elements) return; - ext.glVertexAttribParameteriAMD = load.invoke("glVertexAttribParameteriAMD", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLAMDInterleavedElements { + int GL_VERTEX_ELEMENT_SWIZZLE_AMD = 0x91A4; + int GL_VERTEX_ID_SWIZZLE_AMD = 0x91A5; - public static void glVertexAttribParameteriAMD(int index, int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribParameteriAMD).invokeExact(index, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribParameteriAMD(int index, int pname, int param) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDMultiDrawIndirect.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDMultiDrawIndirect.java index 5f15112d..1d4a3fbf 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDMultiDrawIndirect.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDMultiDrawIndirect.java @@ -16,36 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.amd; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_AMD_multi_draw_indirect} */ -public final class GLAMDMultiDrawIndirect { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_AMD_multi_draw_indirect) return; - ext.glMultiDrawArraysIndirectAMD = load.invoke("glMultiDrawArraysIndirectAMD", ofVoid(JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT)); - ext.glMultiDrawElementsIndirectAMD = load.invoke("glMultiDrawElementsIndirectAMD", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT)); - } +public interface GLAMDMultiDrawIndirect { - public static void glMultiDrawArraysIndirectAMD(int mode, @NativeType("const void *") MemorySegment indirect, int primcount, int stride) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiDrawArraysIndirectAMD).invokeExact(mode, indirect, primcount, stride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiDrawArraysIndirectAMD(int mode, @NativeType("const void *") MemorySegment indirect, int primcount, int stride) { + throw new ContextException(); } - public static void glMultiDrawElementsIndirectAMD(int mode, int type, @NativeType("const void *") MemorySegment indirect, int primcount, int stride) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiDrawElementsIndirectAMD).invokeExact(mode, type, indirect, primcount, stride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiDrawElementsIndirectAMD(int mode, int type, @NativeType("const void *") MemorySegment indirect, int primcount, int stride) { + throw new ContextException(); } } 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 04dec874..000ae45a 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 @@ -16,50 +16,30 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.amd; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_AMD_name_gen_delete} */ -public final class GLAMDNameGenDelete { - public static final int GL_DATA_BUFFER_AMD = 0x9151; - public static final int GL_PERFORMANCE_MONITOR_AMD = 0x9152; - public static final int GL_QUERY_OBJECT_AMD = 0x9153; - public static final int GL_VERTEX_ARRAY_OBJECT_AMD = 0x9154; - public static final int GL_SAMPLER_OBJECT_AMD = 0x9155; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_AMD_name_gen_delete) return; - ext.glGenNamesAMD = load.invoke("glGenNamesAMD", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glDeleteNamesAMD = load.invoke("glDeleteNamesAMD", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glIsNameAMD = load.invoke("glIsNameAMD", of(JAVA_BYTE, JAVA_INT, JAVA_INT)); - } +public interface GLAMDNameGenDelete { + int GL_DATA_BUFFER_AMD = 0x9151; + int GL_PERFORMANCE_MONITOR_AMD = 0x9152; + int GL_QUERY_OBJECT_AMD = 0x9153; + int GL_VERTEX_ARRAY_OBJECT_AMD = 0x9154; + int GL_SAMPLER_OBJECT_AMD = 0x9155; - public static void glGenNamesAMD(int identifier, int num, @NativeType("GLuint *") MemorySegment names) { - final var ext = getExtCapabilities(); - try { - check(ext.glGenNamesAMD).invokeExact(identifier, num, names); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGenNamesAMD(int identifier, int num, @NativeType("GLuint *") MemorySegment names) { + throw new ContextException(); } - public static void glDeleteNamesAMD(int identifier, int num, @NativeType("const GLuint *") MemorySegment names) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteNamesAMD).invokeExact(identifier, num, names); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDeleteNamesAMD(int identifier, int num, @NativeType("const GLuint *") MemorySegment names) { + throw new ContextException(); } - public static boolean glIsNameAMD(int identifier, int name) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsNameAMD).invokeExact(identifier, name); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsNameAMD(int identifier, int name) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDOcclusionQueryEvent.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDOcclusionQueryEvent.java index 8791bf02..e63ab6ee 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDOcclusionQueryEvent.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDOcclusionQueryEvent.java @@ -16,34 +16,23 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.amd; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_AMD_occlusion_query_event} */ -public final class GLAMDOcclusionQueryEvent { - public static final int GL_OCCLUSION_QUERY_EVENT_MASK_AMD = 0x874F; - public static final int GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD = 0x00000001; - public static final int GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD = 0x00000002; - public static final int GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD = 0x00000004; - public static final int GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD = 0x00000008; - public static final int GL_QUERY_ALL_EVENT_BITS_AMD = 0xFFFFFFFF; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_AMD_occlusion_query_event) return; - ext.glQueryObjectParameteruiAMD = load.invoke("glQueryObjectParameteruiAMD", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLAMDOcclusionQueryEvent { + int GL_OCCLUSION_QUERY_EVENT_MASK_AMD = 0x874F; + int GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD = 0x00000001; + int GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD = 0x00000002; + int GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD = 0x00000004; + int GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD = 0x00000008; + int GL_QUERY_ALL_EVENT_BITS_AMD = 0xFFFFFFFF; - public static void glQueryObjectParameteruiAMD(int target, int id, int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glQueryObjectParameteruiAMD).invokeExact(target, id, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glQueryObjectParameteruiAMD(int target, int id, int pname, int param) { + throw new ContextException(); } } 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 ef493fc2..335c89f6 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 @@ -16,115 +16,64 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.amd; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_AMD_performance_monitor} */ -public final class GLAMDPerformanceMonitor { - public static final int GL_COUNTER_TYPE_AMD = 0x8BC0; - public static final int GL_COUNTER_RANGE_AMD = 0x8BC1; - public static final int GL_UNSIGNED_INT64_AMD = 0x8BC2; - public static final int GL_PERCENTAGE_AMD = 0x8BC3; - public static final int GL_PERFMON_RESULT_AVAILABLE_AMD = 0x8BC4; - public static final int GL_PERFMON_RESULT_SIZE_AMD = 0x8BC5; - public static final int GL_PERFMON_RESULT_AMD = 0x8BC6; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_AMD_performance_monitor) return; - ext.glGetPerfMonitorGroupsAMD = load.invoke("glGetPerfMonitorGroupsAMD", ofVoid(ADDRESS, JAVA_INT, ADDRESS)); - ext.glGetPerfMonitorCountersAMD = load.invoke("glGetPerfMonitorCountersAMD", ofVoid(JAVA_INT, ADDRESS, ADDRESS, JAVA_INT, ADDRESS)); - ext.glGetPerfMonitorGroupStringAMD = load.invoke("glGetPerfMonitorGroupStringAMD", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - ext.glGetPerfMonitorCounterStringAMD = load.invoke("glGetPerfMonitorCounterStringAMD", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - ext.glGetPerfMonitorCounterInfoAMD = load.invoke("glGetPerfMonitorCounterInfoAMD", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGenPerfMonitorsAMD = load.invoke("glGenPerfMonitorsAMD", ofVoid(JAVA_INT, ADDRESS)); - ext.glDeletePerfMonitorsAMD = load.invoke("glDeletePerfMonitorsAMD", ofVoid(JAVA_INT, ADDRESS)); - ext.glSelectPerfMonitorCountersAMD = load.invoke("glSelectPerfMonitorCountersAMD", ofVoid(JAVA_INT, JAVA_BYTE, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glBeginPerfMonitorAMD = load.invoke("glBeginPerfMonitorAMD", ofVoid(JAVA_INT)); - ext.glEndPerfMonitorAMD = load.invoke("glEndPerfMonitorAMD", ofVoid(JAVA_INT)); - ext.glGetPerfMonitorCounterDataAMD = load.invoke("glGetPerfMonitorCounterDataAMD", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - } +public interface GLAMDPerformanceMonitor { + int GL_COUNTER_TYPE_AMD = 0x8BC0; + int GL_COUNTER_RANGE_AMD = 0x8BC1; + int GL_UNSIGNED_INT64_AMD = 0x8BC2; + int GL_PERCENTAGE_AMD = 0x8BC3; + int GL_PERFMON_RESULT_AVAILABLE_AMD = 0x8BC4; + int GL_PERFMON_RESULT_SIZE_AMD = 0x8BC5; + int GL_PERFMON_RESULT_AMD = 0x8BC6; - public static void glGetPerfMonitorGroupsAMD(@NativeType("GLint *") MemorySegment numGroups, int groupsSize, @NativeType("GLuint *") MemorySegment groups) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPerfMonitorGroupsAMD).invokeExact(numGroups, groupsSize, groups); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPerfMonitorGroupsAMD(@NativeType("GLint *") MemorySegment numGroups, int groupsSize, @NativeType("GLuint *") MemorySegment groups) { + throw new ContextException(); } - public static void glGetPerfMonitorCountersAMD(int group, @NativeType("GLint *") MemorySegment numCounters, @NativeType("GLint *") MemorySegment maxActiveCounters, int counterSize, @NativeType("GLuint *") MemorySegment counters) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPerfMonitorCountersAMD).invokeExact(group, numCounters, maxActiveCounters, counterSize, counters); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPerfMonitorCountersAMD(int group, @NativeType("GLint *") MemorySegment numCounters, @NativeType("GLint *") MemorySegment maxActiveCounters, int counterSize, @NativeType("GLuint *") MemorySegment counters) { + throw new ContextException(); } - public static void glGetPerfMonitorGroupStringAMD(int group, int bufSize, @NativeType("GLsizei *") MemorySegment length, @NativeType("GLchar *") MemorySegment groupString) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPerfMonitorGroupStringAMD).invokeExact(group, bufSize, length, groupString); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPerfMonitorGroupStringAMD(int group, int bufSize, @NativeType("GLsizei *") MemorySegment length, @NativeType("GLchar *") MemorySegment groupString) { + throw new ContextException(); } - public static void glGetPerfMonitorCounterStringAMD(int group, int counter, int bufSize, @NativeType("GLsizei *") MemorySegment length, @NativeType("GLchar *") MemorySegment counterString) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPerfMonitorCounterStringAMD).invokeExact(group, counter, bufSize, length, counterString); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPerfMonitorCounterStringAMD(int group, int counter, int bufSize, @NativeType("GLsizei *") MemorySegment length, @NativeType("GLchar *") MemorySegment counterString) { + throw new ContextException(); } - public static void glGetPerfMonitorCounterInfoAMD(int group, int counter, int pname, @NativeType("void *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPerfMonitorCounterInfoAMD).invokeExact(group, counter, pname, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPerfMonitorCounterInfoAMD(int group, int counter, int pname, @NativeType("void *") MemorySegment data) { + throw new ContextException(); } - public static void glGenPerfMonitorsAMD(int n, @NativeType("GLuint *") MemorySegment monitors) { - final var ext = getExtCapabilities(); - try { - check(ext.glGenPerfMonitorsAMD).invokeExact(n, monitors); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGenPerfMonitorsAMD(int n, @NativeType("GLuint *") MemorySegment monitors) { + throw new ContextException(); } - public static void glDeletePerfMonitorsAMD(int n, @NativeType("GLuint *") MemorySegment monitors) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeletePerfMonitorsAMD).invokeExact(n, monitors); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDeletePerfMonitorsAMD(int n, @NativeType("GLuint *") MemorySegment monitors) { + throw new ContextException(); } - public static void glSelectPerfMonitorCountersAMD(int monitor, boolean enable, int group, int numCounters, @NativeType("GLuint *") MemorySegment counterList) { - final var ext = getExtCapabilities(); - try { - check(ext.glSelectPerfMonitorCountersAMD).invokeExact(monitor, enable, group, numCounters, counterList); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSelectPerfMonitorCountersAMD(int monitor, boolean enable, int group, int numCounters, @NativeType("GLuint *") MemorySegment counterList) { + throw new ContextException(); } - public static void glBeginPerfMonitorAMD(int monitor) { - final var ext = getExtCapabilities(); - try { - check(ext.glBeginPerfMonitorAMD).invokeExact(monitor); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBeginPerfMonitorAMD(int monitor) { + throw new ContextException(); } - public static void glEndPerfMonitorAMD(int monitor) { - final var ext = getExtCapabilities(); - try { - check(ext.glEndPerfMonitorAMD).invokeExact(monitor); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEndPerfMonitorAMD(int monitor) { + throw new ContextException(); } - public static void glGetPerfMonitorCounterDataAMD(int monitor, int pname, int dataSize, @NativeType("GLuint *") MemorySegment data, @NativeType("GLint *") MemorySegment bytesWritten) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPerfMonitorCounterDataAMD).invokeExact(monitor, pname, dataSize, data, bytesWritten); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPerfMonitorCounterDataAMD(int monitor, int pname, int dataSize, @NativeType("GLuint *") MemorySegment data, @NativeType("GLint *") MemorySegment bytesWritten) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDPinnedMemory.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDPinnedMemory.java index 6eb5f498..37c6dc5b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDPinnedMemory.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDPinnedMemory.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.amd; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_AMD_pinned_memory} */ -public final class GLAMDPinnedMemory { - public static final int GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD = 0x9160; +public interface GLAMDPinnedMemory { + int GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD = 0x9160; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDQueryBufferObject.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDQueryBufferObject.java index 46d8d1b6..1ad3e8f9 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDQueryBufferObject.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDQueryBufferObject.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.amd; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_AMD_query_buffer_object} */ -public final class GLAMDQueryBufferObject { - public static final int GL_QUERY_BUFFER_AMD = 0x9192; - public static final int GL_QUERY_BUFFER_BINDING_AMD = 0x9193; - public static final int GL_QUERY_RESULT_NO_WAIT_AMD = 0x9194; +public interface GLAMDQueryBufferObject { + int GL_QUERY_BUFFER_AMD = 0x9192; + int GL_QUERY_BUFFER_BINDING_AMD = 0x9193; + int GL_QUERY_RESULT_NO_WAIT_AMD = 0x9194; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDSamplePositions.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDSamplePositions.java index 62932539..12be90db 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDSamplePositions.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDSamplePositions.java @@ -16,28 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.amd; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_AMD_sample_positions} */ -public final class GLAMDSamplePositions { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_AMD_sample_positions) return; - ext.glSetMultisamplefvAMD = load.invoke("glSetMultisamplefvAMD", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLAMDSamplePositions { - public static void glSetMultisamplefvAMD(int pname, int index, @NativeType("const GLfloat *") MemorySegment val) { - final var ext = getExtCapabilities(); - try { - check(ext.glSetMultisamplefvAMD).invokeExact(pname, index, val); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSetMultisamplefvAMD(int pname, int index, @NativeType("const GLfloat *") MemorySegment val) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDSparseTexture.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDSparseTexture.java index 6d05244c..084aaa91 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDSparseTexture.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDSparseTexture.java @@ -16,45 +16,30 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.amd; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_AMD_sparse_texture} */ -public final class GLAMDSparseTexture { - public static final int GL_VIRTUAL_PAGE_SIZE_X_AMD = 0x9195; - public static final int GL_VIRTUAL_PAGE_SIZE_Y_AMD = 0x9196; - public static final int GL_VIRTUAL_PAGE_SIZE_Z_AMD = 0x9197; - public static final int GL_MAX_SPARSE_TEXTURE_SIZE_AMD = 0x9198; - public static final int GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD = 0x9199; - public static final int GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS = 0x919A; - public static final int GL_MIN_SPARSE_LEVEL_AMD = 0x919B; - public static final int GL_MIN_LOD_WARNING_AMD = 0x919C; - public static final int GL_TEXTURE_STORAGE_SPARSE_BIT_AMD = 0x00000001; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_AMD_sparse_texture) return; - ext.glTexStorageSparseAMD = load.invoke("glTexStorageSparseAMD", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glTextureStorageSparseAMD = load.invoke("glTextureStorageSparseAMD", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLAMDSparseTexture { + int GL_VIRTUAL_PAGE_SIZE_X_AMD = 0x9195; + int GL_VIRTUAL_PAGE_SIZE_Y_AMD = 0x9196; + int GL_VIRTUAL_PAGE_SIZE_Z_AMD = 0x9197; + int GL_MAX_SPARSE_TEXTURE_SIZE_AMD = 0x9198; + int GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD = 0x9199; + int GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS = 0x919A; + int GL_MIN_SPARSE_LEVEL_AMD = 0x919B; + int GL_MIN_LOD_WARNING_AMD = 0x919C; + int GL_TEXTURE_STORAGE_SPARSE_BIT_AMD = 0x00000001; - public static void glTexStorageSparseAMD(int target, int internalFormat, int width, int height, int depth, int layers, int flags) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexStorageSparseAMD).invokeExact(target, internalFormat, width, height, depth, layers, flags); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexStorageSparseAMD(int target, int internalFormat, int width, int height, int depth, int layers, int flags) { + throw new ContextException(); } - public static void glTextureStorageSparseAMD(int texture, int target, int internalFormat, int width, int height, int depth, int layers, int flags) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureStorageSparseAMD).invokeExact(texture, target, internalFormat, width, height, depth, layers, flags); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureStorageSparseAMD(int texture, int target, int internalFormat, int width, int height, int depth, int layers, int flags) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDStencilOperationExtended.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDStencilOperationExtended.java index e13807c1..38eb4d01 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDStencilOperationExtended.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDStencilOperationExtended.java @@ -16,32 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.amd; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_AMD_stencil_operation_extended} */ -public final class GLAMDStencilOperationExtended { - public static final int GL_SET_AMD = 0x874A; - public static final int GL_REPLACE_VALUE_AMD = 0x874B; - public static final int GL_STENCIL_OP_VALUE_AMD = 0x874C; - public static final int GL_STENCIL_BACK_OP_VALUE_AMD = 0x874D; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_AMD_stencil_operation_extended) return; - ext.glStencilOpValueAMD = load.invoke("glStencilOpValueAMD", ofVoid(JAVA_INT, JAVA_INT)); - } +public interface GLAMDStencilOperationExtended { + int GL_SET_AMD = 0x874A; + int GL_REPLACE_VALUE_AMD = 0x874B; + int GL_STENCIL_OP_VALUE_AMD = 0x874C; + int GL_STENCIL_BACK_OP_VALUE_AMD = 0x874D; - public static void glStencilOpValueAMD(int face, int value) { - final var ext = getExtCapabilities(); - try { - check(ext.glStencilOpValueAMD).invokeExact(face, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glStencilOpValueAMD(int face, int value) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDTransformFeedback4.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDTransformFeedback4.java index 8a1250a7..c211e268 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDTransformFeedback4.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDTransformFeedback4.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.amd; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_AMD_transform_feedback4} */ -public final class GLAMDTransformFeedback4 { - public static final int GL_STREAM_RASTERIZATION_AMD = 0x91A0; +public interface GLAMDTransformFeedback4 { + int GL_STREAM_RASTERIZATION_AMD = 0x91A0; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDVertexShaderTessellator.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDVertexShaderTessellator.java index a37f9d69..a59474d2 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDVertexShaderTessellator.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLAMDVertexShaderTessellator.java @@ -16,43 +16,28 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.amd; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_AMD_vertex_shader_tessellator} */ -public final class GLAMDVertexShaderTessellator { - public static final int GL_SAMPLER_BUFFER_AMD = 0x9001; - public static final int GL_INT_SAMPLER_BUFFER_AMD = 0x9002; - public static final int GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD = 0x9003; - public static final int GL_TESSELLATION_MODE_AMD = 0x9004; - public static final int GL_TESSELLATION_FACTOR_AMD = 0x9005; - public static final int GL_DISCRETE_AMD = 0x9006; - public static final int GL_CONTINUOUS_AMD = 0x9007; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_AMD_vertex_shader_tessellator) return; - ext.glTessellationFactorAMD = load.invoke("glTessellationFactorAMD", ofVoid(JAVA_FLOAT)); - ext.glTessellationModeAMD = load.invoke("glTessellationModeAMD", ofVoid(JAVA_INT)); - } +public interface GLAMDVertexShaderTessellator { + int GL_SAMPLER_BUFFER_AMD = 0x9001; + int GL_INT_SAMPLER_BUFFER_AMD = 0x9002; + int GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD = 0x9003; + int GL_TESSELLATION_MODE_AMD = 0x9004; + int GL_TESSELLATION_FACTOR_AMD = 0x9005; + int GL_DISCRETE_AMD = 0x9006; + int GL_CONTINUOUS_AMD = 0x9007; - public static void glTessellationFactorAMD(float factor) { - final var ext = getExtCapabilities(); - try { - check(ext.glTessellationFactorAMD).invokeExact(factor); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTessellationFactorAMD(float factor) { + throw new ContextException(); } - public static void glTessellationModeAMD(int mode) { - final var ext = getExtCapabilities(); - try { - check(ext.glTessellationModeAMD).invokeExact(mode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTessellationModeAMD(int mode) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLDebugProcAMD.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLDebugProcAMD.java index af855e69..9d21bf70 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLDebugProcAMD.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/amd/GLDebugProcAMD.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2022-2023 Overrun Organization + * Copyright (c) 2022-2024 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 @@ -16,17 +16,10 @@ package overrungl.opengl.ext.amd; -import overrungl.Callback; -import overrungl.internal.RuntimeHelper; +import overrun.marshal.Upcall; -import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodHandles; -import java.lang.invoke.MethodType; - -import static java.lang.foreign.ValueLayout.ADDRESS; -import static java.lang.foreign.ValueLayout.JAVA_INT; /** * The OpenGL debug message callback. @@ -35,9 +28,11 @@ * @since 0.1.0 */ @FunctionalInterface -public interface GLDebugProcAMD extends Callback { - FunctionDescriptor DESC = FunctionDescriptor.ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, ADDRESS); - MethodType MTYPE = DESC.toMethodType(); +public interface GLDebugProcAMD extends Upcall { + /** + * The type. + */ + Type TYPE = Upcall.type(); /** * debug callback @@ -51,17 +46,13 @@ public interface GLDebugProcAMD extends Callback { */ void invoke(int id, int category, int severity, String message, MemorySegment userParam); + @Stub default void ninvoke(int id, int category, int severity, int length, MemorySegment message, MemorySegment userParam) { - invoke(id, category, severity, message.reinterpret(length + 1).getString(0), userParam.reinterpret(Long.MAX_VALUE)); - } - - @Override - default FunctionDescriptor descriptor() { - return DESC; + invoke(id, category, severity, message.reinterpret(length + 1).getString(0), userParam); } @Override - default MethodHandle handle(MethodHandles.Lookup lookup) throws NoSuchMethodException, IllegalAccessException { - return lookup.findVirtual(GLDebugProcAMD.class, "ninvoke", MTYPE); + default MemorySegment stub(Arena arena) { + return TYPE.of(arena, this); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEAuxDepthStencil.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEAuxDepthStencil.java index 512f4dde..8004c177 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEAuxDepthStencil.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEAuxDepthStencil.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.apple; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_APPLE_aux_depth_stencil} */ -public final class GLAPPLEAuxDepthStencil { - public static final int GL_AUX_DEPTH_STENCIL_APPLE = 0x8A14; +public interface GLAPPLEAuxDepthStencil { + int GL_AUX_DEPTH_STENCIL_APPLE = 0x8A14; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEClientStorage.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEClientStorage.java index 904c1674..809a7b6b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEClientStorage.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEClientStorage.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.apple; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_APPLE_client_storage} */ -public final class GLAPPLEClientStorage { - public static final int GL_UNPACK_CLIENT_STORAGE_APPLE = 0x85B2; +public interface GLAPPLEClientStorage { + int GL_UNPACK_CLIENT_STORAGE_APPLE = 0x85B2; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEElementArray.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEElementArray.java index ec27f40e..228fac3f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEElementArray.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEElementArray.java @@ -16,63 +16,36 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.apple; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_APPLE_element_array} */ -public final class GLAPPLEElementArray { - public static final int GL_ELEMENT_ARRAY_APPLE = 0x8A0C; - public static final int GL_ELEMENT_ARRAY_TYPE_APPLE = 0x8A0D; - public static final int GL_ELEMENT_ARRAY_POINTER_APPLE = 0x8A0E; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_APPLE_element_array) return; - ext.glElementPointerAPPLE = load.invoke("glElementPointerAPPLE", ofVoid(JAVA_INT, ADDRESS)); - ext.glDrawElementArrayAPPLE = load.invoke("glDrawElementArrayAPPLE", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glDrawRangeElementArrayAPPLE = load.invoke("glDrawRangeElementArrayAPPLE", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMultiDrawElementArrayAPPLE = load.invoke("glMultiDrawElementArrayAPPLE", ofVoid(JAVA_INT, ADDRESS, ADDRESS, JAVA_INT)); - ext.glMultiDrawRangeElementArrayAPPLE = load.invoke("glMultiDrawRangeElementArrayAPPLE", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, ADDRESS, JAVA_INT)); - } +public interface GLAPPLEElementArray { + int GL_ELEMENT_ARRAY_APPLE = 0x8A0C; + int GL_ELEMENT_ARRAY_TYPE_APPLE = 0x8A0D; + int GL_ELEMENT_ARRAY_POINTER_APPLE = 0x8A0E; - public static void glElementPointerAPPLE(int type, @NativeType("const void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glElementPointerAPPLE).invokeExact(type, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glElementPointerAPPLE(int type, @NativeType("const void *") MemorySegment pointer) { + throw new ContextException(); } - public static void glDrawElementArrayAPPLE(int mode, int first, int count) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawElementArrayAPPLE).invokeExact(mode, first, count); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDrawElementArrayAPPLE(int mode, int first, int count) { + throw new ContextException(); } - public static void glDrawRangeElementArrayAPPLE(int mode, int start, int end, int first, int count) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawRangeElementArrayAPPLE).invokeExact(mode, start, end, first, count); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDrawRangeElementArrayAPPLE(int mode, int start, int end, int first, int count) { + throw new ContextException(); } - public static void glMultiDrawElementArrayAPPLE(int mode, @NativeType("const GLint *") MemorySegment first, @NativeType("const GLsizei *") MemorySegment count, int primcount) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiDrawElementArrayAPPLE).invokeExact(mode, first, count, primcount); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiDrawElementArrayAPPLE(int mode, @NativeType("const GLint *") MemorySegment first, @NativeType("const GLsizei *") MemorySegment count, int primcount) { + throw new ContextException(); } - public static void glMultiDrawRangeElementArrayAPPLE(int mode, int start, int end, @NativeType("const GLint *") MemorySegment first, @NativeType("const GLsizei *") MemorySegment count, int primcount) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiDrawRangeElementArrayAPPLE).invokeExact(mode, start, end, first, count, primcount); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiDrawRangeElementArrayAPPLE(int mode, int start, int end, @NativeType("const GLint *") MemorySegment first, @NativeType("const GLsizei *") MemorySegment count, int primcount) { + throw new ContextException(); } } 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 4b942e30..a91d65b8 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 @@ -16,89 +16,47 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.apple; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_APPLE_fence} */ -public final class GLAPPLEFence { - public static final int GL_DRAW_PIXELS_APPLE = 0x8A0A; - public static final int GL_FENCE_APPLE = 0x8A0B; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_APPLE_fence) return; - ext.glGenFencesAPPLE = load.invoke("glGenFencesAPPLE", ofVoid(JAVA_INT, ADDRESS)); - ext.glDeleteFencesAPPLE = load.invoke("glDeleteFencesAPPLE", ofVoid(JAVA_INT, ADDRESS)); - ext.glSetFenceAPPLE = load.invoke("glSetFenceAPPLE", ofVoid(JAVA_INT)); - ext.glIsFenceAPPLE = load.invoke("glIsFenceAPPLE", of(JAVA_BYTE, JAVA_INT)); - ext.glTestFenceAPPLE = load.invoke("glTestFenceAPPLE", of(JAVA_BYTE, JAVA_INT)); - ext.glFinishFenceAPPLE = load.invoke("glFinishFenceAPPLE", ofVoid(JAVA_INT)); - ext.glTestObjectAPPLE = load.invoke("glTestObjectAPPLE", of(JAVA_BYTE, JAVA_INT, JAVA_INT)); - ext.glFinishObjectAPPLE = load.invoke("glFinishObjectAPPLE", ofVoid(JAVA_INT, JAVA_INT)); - } +public interface GLAPPLEFence { + int GL_DRAW_PIXELS_APPLE = 0x8A0A; + int GL_FENCE_APPLE = 0x8A0B; - public static void glGenFencesAPPLE(int n, @NativeType("GLuint *") MemorySegment fences) { - final var ext = getExtCapabilities(); - try { - check(ext.glGenFencesAPPLE).invokeExact(n, fences); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGenFencesAPPLE(int n, @NativeType("GLuint *") MemorySegment fences) { + throw new ContextException(); } - public static void glDeleteFencesAPPLE(int n, @NativeType("const GLuint *") MemorySegment fences) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteFencesAPPLE).invokeExact(n, fences); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDeleteFencesAPPLE(int n, @NativeType("const GLuint *") MemorySegment fences) { + throw new ContextException(); } - public static void glSetFenceAPPLE(int fence) { - final var ext = getExtCapabilities(); - try { - check(ext.glSetFenceAPPLE).invokeExact(fence); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSetFenceAPPLE(int fence) { + throw new ContextException(); } - public static boolean glIsFenceAPPLE(int fence) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsFenceAPPLE).invokeExact(fence); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsFenceAPPLE(int fence) { + throw new ContextException(); } - public static boolean glTestFenceAPPLE(int fence) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glTestFenceAPPLE).invokeExact(fence); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glTestFenceAPPLE(int fence) { + throw new ContextException(); } - public static void glFinishFenceAPPLE(int fence) { - final var ext = getExtCapabilities(); - try { - check(ext.glFinishFenceAPPLE).invokeExact(fence); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFinishFenceAPPLE(int fence) { + throw new ContextException(); } - public static boolean glTestObjectAPPLE(int object, int name) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glTestObjectAPPLE).invokeExact(object, name); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glTestObjectAPPLE(int object, int name) { + throw new ContextException(); } - public static void glFinishObjectAPPLE(int object, int name) { - final var ext = getExtCapabilities(); - try { - check(ext.glFinishObjectAPPLE).invokeExact(object, name); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFinishObjectAPPLE(int object, int name) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEFloatPixels.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEFloatPixels.java index ba6a44c5..2e8d2756 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEFloatPixels.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEFloatPixels.java @@ -16,30 +16,26 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.apple; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_APPLE_float_pixels} */ -public final class GLAPPLEFloatPixels { - public static final int GL_HALF_APPLE = 0x140B; - public static final int GL_RGBA_FLOAT32_APPLE = 0x8814; - public static final int GL_RGB_FLOAT32_APPLE = 0x8815; - public static final int GL_ALPHA_FLOAT32_APPLE = 0x8816; - public static final int GL_INTENSITY_FLOAT32_APPLE = 0x8817; - public static final int GL_LUMINANCE_FLOAT32_APPLE = 0x8818; - public static final int GL_LUMINANCE_ALPHA_FLOAT32_APPLE = 0x8819; - public static final int GL_RGBA_FLOAT16_APPLE = 0x881A; - public static final int GL_RGB_FLOAT16_APPLE = 0x881B; - public static final int GL_ALPHA_FLOAT16_APPLE = 0x881C; - public static final int GL_INTENSITY_FLOAT16_APPLE = 0x881D; - public static final int GL_LUMINANCE_FLOAT16_APPLE = 0x881E; - public static final int GL_LUMINANCE_ALPHA_FLOAT16_APPLE = 0x881F; - public static final int GL_COLOR_FLOAT_APPLE = 0x8A0F; +public interface GLAPPLEFloatPixels { + int GL_HALF_APPLE = 0x140B; + int GL_RGBA_FLOAT32_APPLE = 0x8814; + int GL_RGB_FLOAT32_APPLE = 0x8815; + int GL_ALPHA_FLOAT32_APPLE = 0x8816; + int GL_INTENSITY_FLOAT32_APPLE = 0x8817; + int GL_LUMINANCE_FLOAT32_APPLE = 0x8818; + int GL_LUMINANCE_ALPHA_FLOAT32_APPLE = 0x8819; + int GL_RGBA_FLOAT16_APPLE = 0x881A; + int GL_RGB_FLOAT16_APPLE = 0x881B; + int GL_ALPHA_FLOAT16_APPLE = 0x881C; + int GL_INTENSITY_FLOAT16_APPLE = 0x881D; + int GL_LUMINANCE_FLOAT16_APPLE = 0x881E; + int GL_LUMINANCE_ALPHA_FLOAT16_APPLE = 0x881F; + int GL_COLOR_FLOAT_APPLE = 0x8A0F; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEFlushBufferRange.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEFlushBufferRange.java index 268ee357..5d3ef0c3 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEFlushBufferRange.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEFlushBufferRange.java @@ -16,38 +16,23 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.apple; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_APPLE_flush_buffer_range} */ -public final class GLAPPLEFlushBufferRange { - public static final int GL_BUFFER_SERIALIZED_MODIFY_APPLE = 0x8A12; - public static final int GL_BUFFER_FLUSHING_UNMAP_APPLE = 0x8A13; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_APPLE_flush_buffer_range) return; - ext.glBufferParameteriAPPLE = load.invoke("glBufferParameteriAPPLE", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glFlushMappedBufferRangeAPPLE = load.invoke("glFlushMappedBufferRangeAPPLE", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG)); - } +public interface GLAPPLEFlushBufferRange { + int GL_BUFFER_SERIALIZED_MODIFY_APPLE = 0x8A12; + int GL_BUFFER_FLUSHING_UNMAP_APPLE = 0x8A13; - public static void glBufferParameteriAPPLE(int target, int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glBufferParameteriAPPLE).invokeExact(target, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBufferParameteriAPPLE(int target, int pname, int param) { + throw new ContextException(); } - public static void glFlushMappedBufferRangeAPPLE(int target, long offset, long size) { - final var ext = getExtCapabilities(); - try { - check(ext.glFlushMappedBufferRangeAPPLE).invokeExact(target, offset, size); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFlushMappedBufferRangeAPPLE(int target, long offset, long size) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEObjectPurgeable.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEObjectPurgeable.java index 3e684db4..7cf06a92 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEObjectPurgeable.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEObjectPurgeable.java @@ -16,52 +16,31 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.apple; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_APPLE_object_purgeable} */ -public final class GLAPPLEObjectPurgeable { - public static final int GL_BUFFER_OBJECT_APPLE = 0x85B3; - public static final int GL_RELEASED_APPLE = 0x8A19; - public static final int GL_VOLATILE_APPLE = 0x8A1A; - public static final int GL_RETAINED_APPLE = 0x8A1B; - public static final int GL_UNDEFINED_APPLE = 0x8A1C; - public static final int GL_PURGEABLE_APPLE = 0x8A1D; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_APPLE_object_purgeable) return; - ext.glObjectPurgeableAPPLE = load.invoke("glObjectPurgeableAPPLE", of(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glObjectUnpurgeableAPPLE = load.invoke("glObjectUnpurgeableAPPLE", of(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetObjectParameterivAPPLE = load.invoke("glGetObjectParameterivAPPLE", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLAPPLEObjectPurgeable { + int GL_BUFFER_OBJECT_APPLE = 0x85B3; + int GL_RELEASED_APPLE = 0x8A19; + int GL_VOLATILE_APPLE = 0x8A1A; + int GL_RETAINED_APPLE = 0x8A1B; + int GL_UNDEFINED_APPLE = 0x8A1C; + int GL_PURGEABLE_APPLE = 0x8A1D; - public static int glObjectPurgeableAPPLE(int objectType, int name, int option) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glObjectPurgeableAPPLE).invokeExact(objectType, name, option); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glObjectPurgeableAPPLE(int objectType, int name, int option) { + throw new ContextException(); } - public static int glObjectUnpurgeableAPPLE(int objectType, int name, int option) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glObjectUnpurgeableAPPLE).invokeExact(objectType, name, option); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glObjectUnpurgeableAPPLE(int objectType, int name, int option) { + throw new ContextException(); } - public static void glGetObjectParameterivAPPLE(int objectType, int name, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetObjectParameterivAPPLE).invokeExact(objectType, name, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetObjectParameterivAPPLE(int objectType, int name, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLERgb422.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLERgb422.java index cfb42b2d..5452d2e9 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLERgb422.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLERgb422.java @@ -16,20 +16,16 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.apple; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_APPLE_rgb_422} */ -public final class GLAPPLERgb422 { - public static final int GL_RGB_422_APPLE = 0x8A1F; - public static final int GL_UNSIGNED_SHORT_8_8_APPLE = 0x85BA; - public static final int GL_UNSIGNED_SHORT_8_8_REV_APPLE = 0x85BB; - public static final int GL_RGB_RAW_422_APPLE = 0x8A51; +public interface GLAPPLERgb422 { + int GL_RGB_422_APPLE = 0x8A1F; + int GL_UNSIGNED_SHORT_8_8_APPLE = 0x85BA; + int GL_UNSIGNED_SHORT_8_8_REV_APPLE = 0x85BB; + int GL_RGB_RAW_422_APPLE = 0x8A51; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLERowBytes.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLERowBytes.java index 9348ad53..300a17c2 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLERowBytes.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLERowBytes.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.apple; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_APPLE_row_bytes} */ -public final class GLAPPLERowBytes { - public static final int GL_PACK_ROW_BYTES_APPLE = 0x8A15; - public static final int GL_UNPACK_ROW_BYTES_APPLE = 0x8A16; +public interface GLAPPLERowBytes { + int GL_PACK_ROW_BYTES_APPLE = 0x8A15; + int GL_UNPACK_ROW_BYTES_APPLE = 0x8A16; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLESpecularVector.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLESpecularVector.java index 9f78c2b3..9ccbe630 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLESpecularVector.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLESpecularVector.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.apple; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_APPLE_specular_vector} */ -public final class GLAPPLESpecularVector { - public static final int GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE = 0x85B0; +public interface GLAPPLESpecularVector { + int GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE = 0x85B0; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLETextureRange.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLETextureRange.java index efafb323..80afa037 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLETextureRange.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLETextureRange.java @@ -16,42 +16,27 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.apple; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_APPLE_texture_range} */ -public final class GLAPPLETextureRange { - public static final int GL_TEXTURE_RANGE_LENGTH_APPLE = 0x85B7; - public static final int GL_TEXTURE_RANGE_POINTER_APPLE = 0x85B8; - public static final int GL_TEXTURE_STORAGE_HINT_APPLE = 0x85BC; - public static final int GL_STORAGE_PRIVATE_APPLE = 0x85BD; - public static final int GL_STORAGE_CACHED_APPLE = 0x85BE; - public static final int GL_STORAGE_SHARED_APPLE = 0x85BF; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_APPLE_texture_range) return; - ext.glTextureRangeAPPLE = load.invoke("glTextureRangeAPPLE", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetTexParameterPointervAPPLE = load.invoke("glGetTexParameterPointervAPPLE", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLAPPLETextureRange { + int GL_TEXTURE_RANGE_LENGTH_APPLE = 0x85B7; + int GL_TEXTURE_RANGE_POINTER_APPLE = 0x85B8; + int GL_TEXTURE_STORAGE_HINT_APPLE = 0x85BC; + int GL_STORAGE_PRIVATE_APPLE = 0x85BD; + int GL_STORAGE_CACHED_APPLE = 0x85BE; + int GL_STORAGE_SHARED_APPLE = 0x85BF; - public static void glTextureRangeAPPLE(int target, int length, @NativeType("const void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureRangeAPPLE).invokeExact(target, length, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureRangeAPPLE(int target, int length, @NativeType("const void *") MemorySegment pointer) { + throw new ContextException(); } - public static void glGetTexParameterPointervAPPLE(int target, int pname, @NativeType("void **") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetTexParameterPointervAPPLE).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetTexParameterPointervAPPLE(int target, int pname, @NativeType("void **") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLETransformHint.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLETransformHint.java index c674c0c7..67b789a1 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLETransformHint.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLETransformHint.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.apple; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_APPLE_transform_hint} */ -public final class GLAPPLETransformHint { - public static final int GL_TRANSFORM_HINT_APPLE = 0x85B1; +public interface GLAPPLETransformHint { + int GL_TRANSFORM_HINT_APPLE = 0x85B1; } 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 232d0369..cf7d4fef 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 @@ -16,54 +16,30 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.apple; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_APPLE_vertex_array_object} */ -public final class GLAPPLEVertexArrayObject { - public static final int GL_VERTEX_ARRAY_BINDING_APPLE = 0x85B5; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_APPLE_vertex_array_object) return; - ext.glBindVertexArrayAPPLE = load.invoke("glBindVertexArrayAPPLE", ofVoid(JAVA_INT)); - ext.glDeleteVertexArraysAPPLE = load.invoke("glDeleteVertexArraysAPPLE", ofVoid(JAVA_INT, ADDRESS)); - ext.glGenVertexArraysAPPLE = load.invoke("glGenVertexArraysAPPLE", ofVoid(JAVA_INT, ADDRESS)); - ext.glIsVertexArrayAPPLE = load.invoke("glIsVertexArrayAPPLE", of(JAVA_BYTE, JAVA_INT)); - } +public interface GLAPPLEVertexArrayObject { + int GL_VERTEX_ARRAY_BINDING_APPLE = 0x85B5; - public static void glBindVertexArrayAPPLE(int array) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindVertexArrayAPPLE).invokeExact(array); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBindVertexArrayAPPLE(int array) { + throw new ContextException(); } - public static void glDeleteVertexArraysAPPLE(int n, @NativeType("const GLuint *") MemorySegment arrays) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteVertexArraysAPPLE).invokeExact(n, arrays); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDeleteVertexArraysAPPLE(int n, @NativeType("const GLuint *") MemorySegment arrays) { + throw new ContextException(); } - public static void glGenVertexArraysAPPLE(int n, @NativeType("GLuint *") MemorySegment arrays) { - final var ext = getExtCapabilities(); - try { - check(ext.glGenVertexArraysAPPLE).invokeExact(n, arrays); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGenVertexArraysAPPLE(int n, @NativeType("GLuint *") MemorySegment arrays) { + throw new ContextException(); } - public static boolean glIsVertexArrayAPPLE(int array) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsVertexArrayAPPLE).invokeExact(array); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsVertexArrayAPPLE(int array) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEVertexArrayRange.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEVertexArrayRange.java index 9c6be3d1..ed3c6989 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEVertexArrayRange.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEVertexArrayRange.java @@ -16,49 +16,30 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.apple; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_APPLE_vertex_array_range} */ -public final class GLAPPLEVertexArrayRange { - public static final int GL_VERTEX_ARRAY_RANGE_APPLE = 0x851D; - public static final int GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE = 0x851E; - public static final int GL_VERTEX_ARRAY_STORAGE_HINT_APPLE = 0x851F; - public static final int GL_VERTEX_ARRAY_RANGE_POINTER_APPLE = 0x8521; - public static final int GL_STORAGE_CLIENT_APPLE = 0x85B4; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_APPLE_vertex_array_range) return; - ext.glVertexArrayRangeAPPLE = load.invoke("glVertexArrayRangeAPPLE", ofVoid(JAVA_INT, ADDRESS)); - ext.glFlushVertexArrayRangeAPPLE = load.invoke("glFlushVertexArrayRangeAPPLE", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexArrayParameteriAPPLE = load.invoke("glVertexArrayParameteriAPPLE", ofVoid(JAVA_INT, JAVA_INT)); - } +public interface GLAPPLEVertexArrayRange { + int GL_VERTEX_ARRAY_RANGE_APPLE = 0x851D; + int GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE = 0x851E; + int GL_VERTEX_ARRAY_STORAGE_HINT_APPLE = 0x851F; + int GL_VERTEX_ARRAY_RANGE_POINTER_APPLE = 0x8521; + int GL_STORAGE_CLIENT_APPLE = 0x85B4; - public static void glVertexArrayRangeAPPLE(int length, @NativeType("void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArrayRangeAPPLE).invokeExact(length, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArrayRangeAPPLE(int length, @NativeType("void *") MemorySegment pointer) { + throw new ContextException(); } - public static void glFlushVertexArrayRangeAPPLE(int length, @NativeType("void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glFlushVertexArrayRangeAPPLE).invokeExact(length, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFlushVertexArrayRangeAPPLE(int length, @NativeType("void *") MemorySegment pointer) { + throw new ContextException(); } - public static void glVertexArrayParameteriAPPLE(int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArrayParameteriAPPLE).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArrayParameteriAPPLE(int pname, int param) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEVertexProgramEvaluators.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEVertexProgramEvaluators.java index 4cb4bfa7..13a43cc0 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEVertexProgramEvaluators.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEVertexProgramEvaluators.java @@ -16,87 +16,51 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.apple; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_APPLE_vertex_program_evaluators} */ -public final class GLAPPLEVertexProgramEvaluators { - public static final int GL_VERTEX_ATTRIB_MAP1_APPLE = 0x8A00; - public static final int GL_VERTEX_ATTRIB_MAP2_APPLE = 0x8A01; - public static final int GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE = 0x8A02; - public static final int GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE = 0x8A03; - public static final int GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE = 0x8A04; - public static final int GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE = 0x8A05; - public static final int GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE = 0x8A06; - public static final int GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE = 0x8A07; - public static final int GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE = 0x8A08; - public static final int GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE = 0x8A09; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_APPLE_vertex_program_evaluators) return; - ext.glEnableVertexAttribAPPLE = load.invoke("glEnableVertexAttribAPPLE", ofVoid(JAVA_INT, JAVA_INT)); - ext.glDisableVertexAttribAPPLE = load.invoke("glDisableVertexAttribAPPLE", ofVoid(JAVA_INT, JAVA_INT)); - ext.glIsVertexAttribEnabledAPPLE = load.invoke("glIsVertexAttribEnabledAPPLE", of(JAVA_BYTE, JAVA_INT, JAVA_INT)); - ext.glMapVertexAttrib1dAPPLE = load.invoke("glMapVertexAttrib1dAPPLE", ofVoid(JAVA_INT, JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMapVertexAttrib1fAPPLE = load.invoke("glMapVertexAttrib1fAPPLE", ofVoid(JAVA_INT, JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMapVertexAttrib2dAPPLE = load.invoke("glMapVertexAttrib2dAPPLE", ofVoid(JAVA_INT, JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_INT, JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMapVertexAttrib2fAPPLE = load.invoke("glMapVertexAttrib2fAPPLE", ofVoid(JAVA_INT, JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_INT, JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLAPPLEVertexProgramEvaluators { + int GL_VERTEX_ATTRIB_MAP1_APPLE = 0x8A00; + int GL_VERTEX_ATTRIB_MAP2_APPLE = 0x8A01; + int GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE = 0x8A02; + int GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE = 0x8A03; + int GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE = 0x8A04; + int GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE = 0x8A05; + int GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE = 0x8A06; + int GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE = 0x8A07; + int GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE = 0x8A08; + int GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE = 0x8A09; - public static void glEnableVertexAttribAPPLE(int index, int pname) { - final var ext = getExtCapabilities(); - try { - check(ext.glEnableVertexAttribAPPLE).invokeExact(index, pname); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEnableVertexAttribAPPLE(int index, int pname) { + throw new ContextException(); } - public static void glDisableVertexAttribAPPLE(int index, int pname) { - final var ext = getExtCapabilities(); - try { - check(ext.glDisableVertexAttribAPPLE).invokeExact(index, pname); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDisableVertexAttribAPPLE(int index, int pname) { + throw new ContextException(); } - public static boolean glIsVertexAttribEnabledAPPLE(int index, int pname) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsVertexAttribEnabledAPPLE).invokeExact(index, pname); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsVertexAttribEnabledAPPLE(int index, int pname) { + throw new ContextException(); } - public static void glMapVertexAttrib1dAPPLE(int index, int size, double u1, double u2, int stride, int order, @NativeType("const GLdouble *") MemorySegment points) { - final var ext = getExtCapabilities(); - try { - check(ext.glMapVertexAttrib1dAPPLE).invokeExact(index, size, u1, u2, stride, order, points); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMapVertexAttrib1dAPPLE(int index, int size, double u1, double u2, int stride, int order, @NativeType("const GLdouble *") MemorySegment points) { + throw new ContextException(); } - public static void glMapVertexAttrib1fAPPLE(int index, int size, float u1, float u2, int stride, int order, @NativeType("const GLfloat *") MemorySegment points) { - final var ext = getExtCapabilities(); - try { - check(ext.glMapVertexAttrib1fAPPLE).invokeExact(index, size, u1, u2, stride, order, points); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMapVertexAttrib1fAPPLE(int index, int size, float u1, float u2, int stride, int order, @NativeType("const GLfloat *") MemorySegment points) { + throw new ContextException(); } - public static void glMapVertexAttrib2dAPPLE(int index, int size, double u1, double u2, int ustride, int uorder, double v1, double v2, int vstride, int vorder, @NativeType("const GLdouble *") MemorySegment points) { - final var ext = getExtCapabilities(); - try { - check(ext.glMapVertexAttrib2dAPPLE).invokeExact(index, size, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMapVertexAttrib2dAPPLE(int index, int size, double u1, double u2, int ustride, int uorder, double v1, double v2, int vstride, int vorder, @NativeType("const GLdouble *") MemorySegment points) { + throw new ContextException(); } - public static void glMapVertexAttrib2fAPPLE(int index, int size, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, @NativeType("const GLfloat *") MemorySegment points) { - final var ext = getExtCapabilities(); - try { - check(ext.glMapVertexAttrib2fAPPLE).invokeExact(index, size, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMapVertexAttrib2fAPPLE(int index, int size, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, @NativeType("const GLfloat *") MemorySegment points) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEYcbcr422.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEYcbcr422.java index 398a9489..329f0e4d 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEYcbcr422.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/apple/GLAPPLEYcbcr422.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.apple; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_APPLE_ycbcr_422} */ -public final class GLAPPLEYcbcr422 { - public static final int GL_YCBCR_422_APPLE = 0x85B9; +public interface GLAPPLEYcbcr422 { + int GL_YCBCR_422_APPLE = 0x85B9; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBBindlessTexture.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBBindlessTexture.java index 85a1ba78..53b15f06 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBBindlessTexture.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBBindlessTexture.java @@ -16,154 +16,78 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_bindless_texture} */ -public final class GLARBBindlessTexture { - public static final int GL_UNSIGNED_INT64_ARB = 0x140F; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_bindless_texture) return; - ext.glGetTextureHandleARB = load.invoke("glGetTextureHandleARB", of(JAVA_LONG, JAVA_INT)); - ext.glGetTextureSamplerHandleARB = load.invoke("glGetTextureSamplerHandleARB", of(JAVA_LONG, JAVA_INT, JAVA_INT)); - ext.glMakeTextureHandleResidentARB = load.invoke("glMakeTextureHandleResidentARB", ofVoid(JAVA_LONG)); - ext.glMakeTextureHandleNonResidentARB = load.invoke("glMakeTextureHandleNonResidentARB", ofVoid(JAVA_LONG)); - ext.glGetImageHandleARB = load.invoke("glGetImageHandleARB", of(JAVA_LONG, JAVA_INT, JAVA_INT, JAVA_BYTE, JAVA_INT, JAVA_INT)); - ext.glMakeImageHandleResidentARB = load.invoke("glMakeImageHandleResidentARB", ofVoid(JAVA_LONG, JAVA_INT)); - ext.glMakeImageHandleNonResidentARB = load.invoke("glMakeImageHandleNonResidentARB", ofVoid(JAVA_LONG)); - ext.glUniformHandleui64ARB = load.invoke("glUniformHandleui64ARB", ofVoid(JAVA_INT, JAVA_LONG)); - ext.glUniformHandleui64vARB = load.invoke("glUniformHandleui64vARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniformHandleui64ARB = load.invoke("glProgramUniformHandleui64ARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glProgramUniformHandleui64vARB = load.invoke("glProgramUniformHandleui64vARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glIsTextureHandleResidentARB = load.invoke("glIsTextureHandleResidentARB", of(JAVA_BYTE, JAVA_LONG)); - ext.glIsImageHandleResidentARB = load.invoke("glIsImageHandleResidentARB", of(JAVA_BYTE, JAVA_LONG)); - ext.glVertexAttribL1ui64ARB = load.invoke("glVertexAttribL1ui64ARB", ofVoid(JAVA_INT, JAVA_LONG)); - ext.glVertexAttribL1ui64vARB = load.invoke("glVertexAttribL1ui64vARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glGetVertexAttribLui64vARB = load.invoke("glGetVertexAttribLui64vARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static long glGetTextureHandleARB(int texture) { - final var ext = getExtCapabilities(); - try { - return (long) - check(ext.glGetTextureHandleARB).invokeExact(texture); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static long glGetTextureSamplerHandleARB(int texture, int sampler) { - final var ext = getExtCapabilities(); - try { - return (long) - check(ext.glGetTextureSamplerHandleARB).invokeExact(texture, sampler); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMakeTextureHandleResidentARB(long handle) { - final var ext = getExtCapabilities(); - try { - check(ext.glMakeTextureHandleResidentARB).invokeExact(handle); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMakeTextureHandleNonResidentARB(long handle) { - final var ext = getExtCapabilities(); - try { - check(ext.glMakeTextureHandleNonResidentARB).invokeExact(handle); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static long glGetImageHandleARB(int texture, int level, boolean layered, int layer, int format) { - final var ext = getExtCapabilities(); - try { - return (long) - check(ext.glGetImageHandleARB).invokeExact(texture, level, layered, layer, format); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMakeImageHandleResidentARB(long handle, int access) { - final var ext = getExtCapabilities(); - try { - check(ext.glMakeImageHandleResidentARB).invokeExact(handle, access); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMakeImageHandleNonResidentARB(long handle) { - final var ext = getExtCapabilities(); - try { - check(ext.glMakeImageHandleNonResidentARB).invokeExact(handle); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniformHandleui64ARB(int location, long value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniformHandleui64ARB).invokeExact(location, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniformHandleui64vARB(int location, int count, @NativeType("const GLuint64 *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniformHandleui64vARB).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glProgramUniformHandleui64ARB(int program, int location, long value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformHandleui64ARB).invokeExact(program, location, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glProgramUniformHandleui64vARB(int program, int location, int count, @NativeType("const GLuint64 *") MemorySegment values) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformHandleui64vARB).invokeExact(program, location, count, values); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static boolean glIsTextureHandleResidentARB(long handle) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsTextureHandleResidentARB).invokeExact(handle); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLARBBindlessTexture { + int GL_UNSIGNED_INT64_ARB = 0x140F; + + default long glGetTextureHandleARB(int texture) { + throw new ContextException(); + } + + default long glGetTextureSamplerHandleARB(int texture, int sampler) { + throw new ContextException(); + } + + default void glMakeTextureHandleResidentARB(long handle) { + throw new ContextException(); + } + + default void glMakeTextureHandleNonResidentARB(long handle) { + throw new ContextException(); + } + + default long glGetImageHandleARB(int texture, int level, boolean layered, int layer, int format) { + throw new ContextException(); + } + + default void glMakeImageHandleResidentARB(long handle, int access) { + throw new ContextException(); + } + + default void glMakeImageHandleNonResidentARB(long handle) { + throw new ContextException(); + } + + default void glUniformHandleui64ARB(int location, long value) { + throw new ContextException(); + } + + default void glUniformHandleui64vARB(int location, int count, @NativeType("const GLuint64 *") MemorySegment value) { + throw new ContextException(); + } + + default void glProgramUniformHandleui64ARB(int program, int location, long value) { + throw new ContextException(); + } + + default void glProgramUniformHandleui64vARB(int program, int location, int count, @NativeType("const GLuint64 *") MemorySegment values) { + throw new ContextException(); + } + + default boolean glIsTextureHandleResidentARB(long handle) { + throw new ContextException(); } - public static boolean glIsImageHandleResidentARB(long handle) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsImageHandleResidentARB).invokeExact(handle); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsImageHandleResidentARB(long handle) { + throw new ContextException(); } - public static void glVertexAttribL1ui64ARB(int index, long x) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL1ui64ARB).invokeExact(index, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL1ui64ARB(int index, long x) { + throw new ContextException(); } - public static void glVertexAttribL1ui64vARB(int index, @NativeType("const GLuint64EXT *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL1ui64vARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL1ui64vARB(int index, @NativeType("const GLuint64EXT *") MemorySegment v) { + throw new ContextException(); } - public static void glGetVertexAttribLui64vARB(int index, int pname, @NativeType("GLuint64EXT *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVertexAttribLui64vARB).invokeExact(index, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVertexAttribLui64vARB(int index, int pname, @NativeType("GLuint64EXT *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBCLEvent.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBCLEvent.java index 86a727a9..0cacfdf9 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBCLEvent.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBCLEvent.java @@ -16,31 +16,19 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_cl_event} */ -public final class GLARBCLEvent { - public static final int GL_SYNC_CL_EVENT_ARB = 0x8240; - public static final int GL_SYNC_CL_EVENT_COMPLETE_ARB = 0x8241; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_cl_event) return; - ext.glCreateSyncFromCLeventARB = load.invoke("glCreateSyncFromCLeventARB", of(ADDRESS, ADDRESS, ADDRESS, JAVA_INT)); - } +public interface GLARBCLEvent { + int GL_SYNC_CL_EVENT_ARB = 0x8240; + int GL_SYNC_CL_EVENT_COMPLETE_ARB = 0x8241; - public static @NativeType("GLsync") MemorySegment glCreateSyncFromCLeventARB(@NativeType("struct _cl_context *") MemorySegment context, @NativeType("struct _cl_event *") MemorySegment event, int flags) { - final var ext = getExtCapabilities(); - try { - return (MemorySegment) - check(ext.glCreateSyncFromCLeventARB).invokeExact(context, event, flags); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + @NativeType("GLsync") default MemorySegment glCreateSyncFromCLeventARB(@NativeType("struct _cl_context *") MemorySegment context, @NativeType("struct _cl_event *") MemorySegment event, int flags) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBColorBufferFloat.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBColorBufferFloat.java index 1181ef5f..a49b6b47 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBColorBufferFloat.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBColorBufferFloat.java @@ -16,33 +16,22 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_color_buffer_float} */ -public final class GLARBColorBufferFloat { - public static final int GL_RGBA_FLOAT_MODE_ARB = 0x8820; - public static final int GL_CLAMP_VERTEX_COLOR_ARB = 0x891A; - public static final int GL_CLAMP_FRAGMENT_COLOR_ARB = 0x891B; - public static final int GL_CLAMP_READ_COLOR_ARB = 0x891C; - public static final int GL_FIXED_ONLY_ARB = 0x891D; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_color_buffer_float) return; - ext.glClampColorARB = load.invoke("glClampColorARB", ofVoid(JAVA_INT, JAVA_INT)); - } +public interface GLARBColorBufferFloat { + int GL_RGBA_FLOAT_MODE_ARB = 0x8820; + int GL_CLAMP_VERTEX_COLOR_ARB = 0x891A; + int GL_CLAMP_FRAGMENT_COLOR_ARB = 0x891B; + int GL_CLAMP_READ_COLOR_ARB = 0x891C; + int GL_FIXED_ONLY_ARB = 0x891D; - public static void glClampColorARB(int target, int clamp) { - final var ext = getExtCapabilities(); - try { - check(ext.glClampColorARB).invokeExact(target, clamp); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glClampColorARB(int target, int clamp) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBComputeVariableGroupSize.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBComputeVariableGroupSize.java index c579e7b7..08107f97 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBComputeVariableGroupSize.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBComputeVariableGroupSize.java @@ -16,32 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_compute_variable_group_size} */ -public final class GLARBComputeVariableGroupSize { - public static final int GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB = 0x9344; - public static final int GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB = 0x90EB; - public static final int GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB = 0x9345; - public static final int GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB = 0x91BF; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_compute_variable_group_size) return; - ext.glDispatchComputeGroupSizeARB = load.invoke("glDispatchComputeGroupSizeARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLARBComputeVariableGroupSize { + int GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB = 0x9344; + int GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB = 0x90EB; + int GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB = 0x9345; + int GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB = 0x91BF; - public static void glDispatchComputeGroupSizeARB(int num_groups_x, int num_groups_y, int num_groups_z, int group_size_x, int group_size_y, int group_size_z) { - final var ext = getExtCapabilities(); - try { - check(ext.glDispatchComputeGroupSizeARB).invokeExact(num_groups_x, num_groups_y, num_groups_z, group_size_x, group_size_y, group_size_z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDispatchComputeGroupSizeARB(int num_groups_x, int num_groups_y, int num_groups_z, int group_size_x, int group_size_y, int group_size_z) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBDebugOutput.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBDebugOutput.java index 0d1e3f6a..6f4aaaff 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBDebugOutput.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBDebugOutput.java @@ -16,79 +16,56 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_debug_output} */ -public final class GLARBDebugOutput { - public static final int GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB = 0x8242; - public static final int GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB = 0x8243; - public static final int GL_DEBUG_CALLBACK_FUNCTION_ARB = 0x8244; - public static final int GL_DEBUG_CALLBACK_USER_PARAM_ARB = 0x8245; - public static final int GL_DEBUG_SOURCE_API_ARB = 0x8246; - public static final int GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB = 0x8247; - public static final int GL_DEBUG_SOURCE_SHADER_COMPILER_ARB = 0x8248; - public static final int GL_DEBUG_SOURCE_THIRD_PARTY_ARB = 0x8249; - public static final int GL_DEBUG_SOURCE_APPLICATION_ARB = 0x824A; - public static final int GL_DEBUG_SOURCE_OTHER_ARB = 0x824B; - public static final int GL_DEBUG_TYPE_ERROR_ARB = 0x824C; - public static final int GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB = 0x824D; - public static final int GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB = 0x824E; - public static final int GL_DEBUG_TYPE_PORTABILITY_ARB = 0x824F; - public static final int GL_DEBUG_TYPE_PERFORMANCE_ARB = 0x8250; - public static final int GL_DEBUG_TYPE_OTHER_ARB = 0x8251; - public static final int GL_MAX_DEBUG_MESSAGE_LENGTH_ARB = 0x9143; - public static final int GL_MAX_DEBUG_LOGGED_MESSAGES_ARB = 0x9144; - public static final int GL_DEBUG_LOGGED_MESSAGES_ARB = 0x9145; - public static final int GL_DEBUG_SEVERITY_HIGH_ARB = 0x9146; - public static final int GL_DEBUG_SEVERITY_MEDIUM_ARB = 0x9147; - public static final int GL_DEBUG_SEVERITY_LOW_ARB = 0x9148; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_debug_output) return; - ext.glDebugMessageControlARB = load.invoke("glDebugMessageControlARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, JAVA_BYTE)); - ext.glDebugMessageInsertARB = load.invoke("glDebugMessageInsertARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glDebugMessageCallbackARB = load.invoke("glDebugMessageCallbackARB", ofVoid(ADDRESS, ADDRESS)); - ext.glGetDebugMessageLogARB = load.invoke("glGetDebugMessageLogARB", of(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS)); - } +public interface GLARBDebugOutput { + int GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB = 0x8242; + int GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB = 0x8243; + int GL_DEBUG_CALLBACK_FUNCTION_ARB = 0x8244; + int GL_DEBUG_CALLBACK_USER_PARAM_ARB = 0x8245; + int GL_DEBUG_SOURCE_API_ARB = 0x8246; + int GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB = 0x8247; + int GL_DEBUG_SOURCE_SHADER_COMPILER_ARB = 0x8248; + int GL_DEBUG_SOURCE_THIRD_PARTY_ARB = 0x8249; + int GL_DEBUG_SOURCE_APPLICATION_ARB = 0x824A; + int GL_DEBUG_SOURCE_OTHER_ARB = 0x824B; + int GL_DEBUG_TYPE_ERROR_ARB = 0x824C; + int GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB = 0x824D; + int GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB = 0x824E; + int GL_DEBUG_TYPE_PORTABILITY_ARB = 0x824F; + int GL_DEBUG_TYPE_PERFORMANCE_ARB = 0x8250; + int GL_DEBUG_TYPE_OTHER_ARB = 0x8251; + int GL_MAX_DEBUG_MESSAGE_LENGTH_ARB = 0x9143; + int GL_MAX_DEBUG_LOGGED_MESSAGES_ARB = 0x9144; + int GL_DEBUG_LOGGED_MESSAGES_ARB = 0x9145; + int GL_DEBUG_SEVERITY_HIGH_ARB = 0x9146; + int GL_DEBUG_SEVERITY_MEDIUM_ARB = 0x9147; + int GL_DEBUG_SEVERITY_LOW_ARB = 0x9148; - public static void glDebugMessageControlARB(int source, int type, int severity, int count, @NativeType("const GLuint *") MemorySegment ids, boolean enabled) { - final var ext = getExtCapabilities(); - try { - check(ext.glDebugMessageControlARB).invokeExact(source, type, severity, count, ids, enabled); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDebugMessageControlARB(int source, int type, int severity, int count, @NativeType("const GLuint *") MemorySegment ids, boolean enabled) { + throw new ContextException(); } - public static void glDebugMessageInsertARB(int source, int type, int id, int severity, int length, @NativeType("const GLchar *") MemorySegment buf) { - final var ext = getExtCapabilities(); - try { - check(ext.glDebugMessageInsertARB).invokeExact(source, type, id, severity, length, buf); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDebugMessageInsertARB(int source, int type, int id, int severity, int length, @NativeType("const GLchar *") MemorySegment buf) { + throw new ContextException(); } - public static void glDebugMessageCallbackARB(@NativeType("GLDEBUGPROCARB") MemorySegment callback, @NativeType("const void *") MemorySegment userParam) { - final var ext = getExtCapabilities(); - try { - check(ext.glDebugMessageCallbackARB).invokeExact(callback, userParam); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDebugMessageCallbackARB(@NativeType("GLDEBUGPROCARB") MemorySegment callback, @NativeType("const void *") MemorySegment userParam) { + throw new ContextException(); } - public static void glDebugMessageCallbackARB(Arena arena, GLDebugProc callback, @NativeType("const void *") MemorySegment userParam) { - glDebugMessageCallbackARB(callback.address(arena), userParam); + @overrun.marshal.gen.Skip + default void glDebugMessageCallbackARB(Arena arena, overrungl.opengl.GLDebugProc callback, @NativeType("const void *") MemorySegment userParam) { + glDebugMessageCallbackARB(callback.stub(arena), userParam); } - public static int glGetDebugMessageLogARB(int count, int bufSize, @NativeType("GLenum *") MemorySegment sources, @NativeType("GLenum *") MemorySegment types, @NativeType("GLuint *") MemorySegment ids, @NativeType("GLenum *") MemorySegment severities, @NativeType("GLsizei *") MemorySegment lengths, @NativeType("GLchar *") MemorySegment messageLog) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glGetDebugMessageLogARB).invokeExact(count, bufSize, sources, types, ids, severities, lengths, messageLog); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glGetDebugMessageLogARB(int count, int bufSize, @NativeType("GLenum *") MemorySegment sources, @NativeType("GLenum *") MemorySegment types, @NativeType("GLuint *") MemorySegment ids, @NativeType("GLenum *") MemorySegment severities, @NativeType("GLsizei *") MemorySegment lengths, @NativeType("GLchar *") MemorySegment messageLog) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBDepthTexture.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBDepthTexture.java index 4edddeeb..dd785016 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBDepthTexture.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBDepthTexture.java @@ -16,21 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_depth_texture} */ -public final class GLARBDepthTexture { - public static final int GL_DEPTH_COMPONENT16_ARB = 0x81A5; - public static final int GL_DEPTH_COMPONENT24_ARB = 0x81A6; - public static final int GL_DEPTH_COMPONENT32_ARB = 0x81A7; - public static final int GL_TEXTURE_DEPTH_SIZE_ARB = 0x884A; - public static final int GL_DEPTH_TEXTURE_MODE_ARB = 0x884B; +public interface GLARBDepthTexture { + int GL_DEPTH_COMPONENT16_ARB = 0x81A5; + int GL_DEPTH_COMPONENT24_ARB = 0x81A6; + int GL_DEPTH_COMPONENT32_ARB = 0x81A7; + int GL_TEXTURE_DEPTH_SIZE_ARB = 0x884A; + int GL_DEPTH_TEXTURE_MODE_ARB = 0x884B; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBDrawBuffers.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBDrawBuffers.java index e18300a2..e7139d07 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBDrawBuffers.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBDrawBuffers.java @@ -16,45 +16,34 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_draw_buffers} */ -public final class GLARBDrawBuffers { - public static final int GL_MAX_DRAW_BUFFERS_ARB = 0x8824; - public static final int GL_DRAW_BUFFER0_ARB = 0x8825; - public static final int GL_DRAW_BUFFER1_ARB = 0x8826; - public static final int GL_DRAW_BUFFER2_ARB = 0x8827; - public static final int GL_DRAW_BUFFER3_ARB = 0x8828; - public static final int GL_DRAW_BUFFER4_ARB = 0x8829; - public static final int GL_DRAW_BUFFER5_ARB = 0x882A; - public static final int GL_DRAW_BUFFER6_ARB = 0x882B; - public static final int GL_DRAW_BUFFER7_ARB = 0x882C; - public static final int GL_DRAW_BUFFER8_ARB = 0x882D; - public static final int GL_DRAW_BUFFER9_ARB = 0x882E; - public static final int GL_DRAW_BUFFER10_ARB = 0x882F; - public static final int GL_DRAW_BUFFER11_ARB = 0x8830; - public static final int GL_DRAW_BUFFER12_ARB = 0x8831; - public static final int GL_DRAW_BUFFER13_ARB = 0x8832; - public static final int GL_DRAW_BUFFER14_ARB = 0x8833; - public static final int GL_DRAW_BUFFER15_ARB = 0x8834; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_draw_buffers) return; - ext.glDrawBuffersARB = load.invoke("glDrawBuffersARB", ofVoid(JAVA_INT, ADDRESS)); - } +public interface GLARBDrawBuffers { + int GL_MAX_DRAW_BUFFERS_ARB = 0x8824; + int GL_DRAW_BUFFER0_ARB = 0x8825; + int GL_DRAW_BUFFER1_ARB = 0x8826; + int GL_DRAW_BUFFER2_ARB = 0x8827; + int GL_DRAW_BUFFER3_ARB = 0x8828; + int GL_DRAW_BUFFER4_ARB = 0x8829; + int GL_DRAW_BUFFER5_ARB = 0x882A; + int GL_DRAW_BUFFER6_ARB = 0x882B; + int GL_DRAW_BUFFER7_ARB = 0x882C; + int GL_DRAW_BUFFER8_ARB = 0x882D; + int GL_DRAW_BUFFER9_ARB = 0x882E; + int GL_DRAW_BUFFER10_ARB = 0x882F; + int GL_DRAW_BUFFER11_ARB = 0x8830; + int GL_DRAW_BUFFER12_ARB = 0x8831; + int GL_DRAW_BUFFER13_ARB = 0x8832; + int GL_DRAW_BUFFER14_ARB = 0x8833; + int GL_DRAW_BUFFER15_ARB = 0x8834; - public static void glDrawBuffersARB(int n, @NativeType("const GLenum *") MemorySegment bufs) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawBuffersARB).invokeExact(n, bufs); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDrawBuffersARB(int n, @NativeType("const GLenum *") MemorySegment bufs) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBDrawBuffersBlend.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBDrawBuffersBlend.java index 07362c9c..c3072fde 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBDrawBuffersBlend.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBDrawBuffersBlend.java @@ -16,52 +16,29 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_draw_buffers_blend} */ -public final class GLARBDrawBuffersBlend { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_draw_buffers_blend) return; - ext.glBlendEquationiARB = load.invoke("glBlendEquationiARB", ofVoid(JAVA_INT, JAVA_INT)); - ext.glBlendEquationSeparateiARB = load.invoke("glBlendEquationSeparateiARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glBlendFunciARB = load.invoke("glBlendFunciARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glBlendFuncSeparateiARB = load.invoke("glBlendFuncSeparateiARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLARBDrawBuffersBlend { - public static void glBlendEquationiARB(int buf, int mode) { - final var ext = getExtCapabilities(); - try { - check(ext.glBlendEquationiARB).invokeExact(buf, mode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBlendEquationiARB(int buf, int mode) { + throw new ContextException(); } - public static void glBlendEquationSeparateiARB(int buf, int modeRGB, int modeAlpha) { - final var ext = getExtCapabilities(); - try { - check(ext.glBlendEquationSeparateiARB).invokeExact(buf, modeRGB, modeAlpha); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBlendEquationSeparateiARB(int buf, int modeRGB, int modeAlpha) { + throw new ContextException(); } - public static void glBlendFunciARB(int buf, int src, int dst) { - final var ext = getExtCapabilities(); - try { - check(ext.glBlendFunciARB).invokeExact(buf, src, dst); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBlendFunciARB(int buf, int src, int dst) { + throw new ContextException(); } - public static void glBlendFuncSeparateiARB(int buf, int srcRGB, int dstRGB, int srcAlpha, int dstAlpha) { - final var ext = getExtCapabilities(); - try { - check(ext.glBlendFuncSeparateiARB).invokeExact(buf, srcRGB, dstRGB, srcAlpha, dstAlpha); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBlendFuncSeparateiARB(int buf, int srcRGB, int dstRGB, int srcAlpha, int dstAlpha) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBDrawInstanced.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBDrawInstanced.java index b1db3fae..b5a7cb52 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBDrawInstanced.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBDrawInstanced.java @@ -16,36 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_draw_instanced} */ -public final class GLARBDrawInstanced { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_draw_instanced) return; - ext.glDrawArraysInstancedARB = load.invoke("glDrawArraysInstancedARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glDrawElementsInstancedARB = load.invoke("glDrawElementsInstancedARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT)); - } +public interface GLARBDrawInstanced { - public static void glDrawArraysInstancedARB(int mode, int first, int count, int primcount) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawArraysInstancedARB).invokeExact(mode, first, count, primcount); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDrawArraysInstancedARB(int mode, int first, int count, int primcount) { + throw new ContextException(); } - public static void glDrawElementsInstancedARB(int mode, int count, int type, @NativeType("const void *") MemorySegment indices, int primcount) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawElementsInstancedARB).invokeExact(mode, count, type, indices, primcount); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDrawElementsInstancedARB(int mode, int count, int type, @NativeType("const void *") MemorySegment indices, int primcount) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBES32Compatibility.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBES32Compatibility.java index dbe2f2a2..0713347b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBES32Compatibility.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBES32Compatibility.java @@ -16,31 +16,20 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_ES3_2_compatibility} */ -public final class GLARBES32Compatibility { - public static final int GL_PRIMITIVE_BOUNDING_BOX_ARB = 0x92BE; - public static final int GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB = 0x9381; - public static final int GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB = 0x9382; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_ES3_2_compatibility) return; - ext.glPrimitiveBoundingBoxARB = load.invoke("glPrimitiveBoundingBoxARB", ofVoid(JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - } +public interface GLARBES32Compatibility { + int GL_PRIMITIVE_BOUNDING_BOX_ARB = 0x92BE; + int GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB = 0x9381; + int GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB = 0x9382; - public static void glPrimitiveBoundingBoxARB(float minX, float minY, float minZ, float minW, float maxX, float maxY, float maxZ, float maxW) { - final var ext = getExtCapabilities(); - try { - check(ext.glPrimitiveBoundingBoxARB).invokeExact(minX, minY, minZ, minW, maxX, maxY, maxZ, maxW); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPrimitiveBoundingBoxARB(float minX, float minY, float minZ, float minW, float maxX, float maxY, float maxZ, float maxW) { + throw new ContextException(); } } 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 61d07f40..ee7574fe 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 @@ -16,251 +16,167 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_fragment_program} */ -public final class GLARBFragmentProgram { - public static final int GL_FRAGMENT_PROGRAM_ARB = 0x8804; - public static final int GL_PROGRAM_FORMAT_ASCII_ARB = 0x8875; - public static final int GL_PROGRAM_LENGTH_ARB = 0x8627; - public static final int GL_PROGRAM_FORMAT_ARB = 0x8876; - public static final int GL_PROGRAM_BINDING_ARB = 0x8677; - public static final int GL_PROGRAM_INSTRUCTIONS_ARB = 0x88A0; - public static final int GL_MAX_PROGRAM_INSTRUCTIONS_ARB = 0x88A1; - public static final int GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A2; - public static final int GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A3; - public static final int GL_PROGRAM_TEMPORARIES_ARB = 0x88A4; - public static final int GL_MAX_PROGRAM_TEMPORARIES_ARB = 0x88A5; - public static final int GL_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A6; - public static final int GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A7; - public static final int GL_PROGRAM_PARAMETERS_ARB = 0x88A8; - public static final int GL_MAX_PROGRAM_PARAMETERS_ARB = 0x88A9; - public static final int GL_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AA; - public static final int GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AB; - public static final int GL_PROGRAM_ATTRIBS_ARB = 0x88AC; - public static final int GL_MAX_PROGRAM_ATTRIBS_ARB = 0x88AD; - public static final int GL_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AE; - public static final int GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AF; - public static final int GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB = 0x88B4; - public static final int GL_MAX_PROGRAM_ENV_PARAMETERS_ARB = 0x88B5; - public static final int GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB = 0x88B6; - public static final int GL_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x8805; - public static final int GL_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x8806; - public static final int GL_PROGRAM_TEX_INDIRECTIONS_ARB = 0x8807; - public static final int GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x8808; - public static final int GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x8809; - public static final int GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x880A; - public static final int GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x880B; - public static final int GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x880C; - public static final int GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB = 0x880D; - public static final int GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x880E; - public static final int GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x880F; - public static final int GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x8810; - public static final int GL_PROGRAM_STRING_ARB = 0x8628; - public static final int GL_PROGRAM_ERROR_POSITION_ARB = 0x864B; - public static final int GL_CURRENT_MATRIX_ARB = 0x8641; - public static final int GL_TRANSPOSE_CURRENT_MATRIX_ARB = 0x88B7; - public static final int GL_CURRENT_MATRIX_STACK_DEPTH_ARB = 0x8640; - public static final int GL_MAX_PROGRAM_MATRICES_ARB = 0x862F; - public static final int GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB = 0x862E; - public static final int GL_MAX_TEXTURE_COORDS_ARB = 0x8871; - public static final int GL_MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872; - public static final int GL_PROGRAM_ERROR_STRING_ARB = 0x8874; - public static final int GL_MATRIX0_ARB = 0x88C0; - public static final int GL_MATRIX1_ARB = 0x88C1; - public static final int GL_MATRIX2_ARB = 0x88C2; - public static final int GL_MATRIX3_ARB = 0x88C3; - public static final int GL_MATRIX4_ARB = 0x88C4; - public static final int GL_MATRIX5_ARB = 0x88C5; - public static final int GL_MATRIX6_ARB = 0x88C6; - public static final int GL_MATRIX7_ARB = 0x88C7; - public static final int GL_MATRIX8_ARB = 0x88C8; - public static final int GL_MATRIX9_ARB = 0x88C9; - public static final int GL_MATRIX10_ARB = 0x88CA; - public static final int GL_MATRIX11_ARB = 0x88CB; - public static final int GL_MATRIX12_ARB = 0x88CC; - public static final int GL_MATRIX13_ARB = 0x88CD; - public static final int GL_MATRIX14_ARB = 0x88CE; - public static final int GL_MATRIX15_ARB = 0x88CF; - public static final int GL_MATRIX16_ARB = 0x88D0; - public static final int GL_MATRIX17_ARB = 0x88D1; - public static final int GL_MATRIX18_ARB = 0x88D2; - public static final int GL_MATRIX19_ARB = 0x88D3; - public static final int GL_MATRIX20_ARB = 0x88D4; - public static final int GL_MATRIX21_ARB = 0x88D5; - public static final int GL_MATRIX22_ARB = 0x88D6; - public static final int GL_MATRIX23_ARB = 0x88D7; - public static final int GL_MATRIX24_ARB = 0x88D8; - public static final int GL_MATRIX25_ARB = 0x88D9; - public static final int GL_MATRIX26_ARB = 0x88DA; - public static final int GL_MATRIX27_ARB = 0x88DB; - public static final int GL_MATRIX28_ARB = 0x88DC; - public static final int GL_MATRIX29_ARB = 0x88DD; - public static final int GL_MATRIX30_ARB = 0x88DE; - public static final int GL_MATRIX31_ARB = 0x88DF; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_fragment_program) return; - ext.glProgramStringARB = load.invoke("glProgramStringARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glBindProgramARB = load.invoke("glBindProgramARB", ofVoid(JAVA_INT, JAVA_INT)); - ext.glDeleteProgramsARB = load.invoke("glDeleteProgramsARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glGenProgramsARB = load.invoke("glGenProgramsARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glProgramEnvParameter4dARB = load.invoke("glProgramEnvParameter4dARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glProgramEnvParameter4dvARB = load.invoke("glProgramEnvParameter4dvARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramEnvParameter4fARB = load.invoke("glProgramEnvParameter4fARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glProgramEnvParameter4fvARB = load.invoke("glProgramEnvParameter4fvARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramLocalParameter4dARB = load.invoke("glProgramLocalParameter4dARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glProgramLocalParameter4dvARB = load.invoke("glProgramLocalParameter4dvARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramLocalParameter4fARB = load.invoke("glProgramLocalParameter4fARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glProgramLocalParameter4fvARB = load.invoke("glProgramLocalParameter4fvARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetProgramEnvParameterdvARB = load.invoke("glGetProgramEnvParameterdvARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetProgramEnvParameterfvARB = load.invoke("glGetProgramEnvParameterfvARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetProgramLocalParameterdvARB = load.invoke("glGetProgramLocalParameterdvARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetProgramLocalParameterfvARB = load.invoke("glGetProgramLocalParameterfvARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetProgramivARB = load.invoke("glGetProgramivARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetProgramStringARB = load.invoke("glGetProgramStringARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glIsProgramARB = load.invoke("glIsProgramARB", of(JAVA_BYTE, JAVA_INT)); - } - - public static void glProgramStringARB(int target, int format, int len, @NativeType("const void *") MemorySegment string) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramStringARB).invokeExact(target, format, len, string); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glBindProgramARB(int target, int program) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindProgramARB).invokeExact(target, program); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glDeleteProgramsARB(int n, @NativeType("const GLuint *") MemorySegment programs) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteProgramsARB).invokeExact(n, programs); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glGenProgramsARB(int n, @NativeType("GLuint *") MemorySegment programs) { - final var ext = getExtCapabilities(); - try { - check(ext.glGenProgramsARB).invokeExact(n, programs); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glProgramEnvParameter4dARB(int target, int index, double x, double y, double z, double w) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramEnvParameter4dARB).invokeExact(target, index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glProgramEnvParameter4dvARB(int target, int index, @NativeType("const GLdouble *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramEnvParameter4dvARB).invokeExact(target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } +public interface GLARBFragmentProgram { + int GL_FRAGMENT_PROGRAM_ARB = 0x8804; + int GL_PROGRAM_FORMAT_ASCII_ARB = 0x8875; + int GL_PROGRAM_LENGTH_ARB = 0x8627; + int GL_PROGRAM_FORMAT_ARB = 0x8876; + int GL_PROGRAM_BINDING_ARB = 0x8677; + int GL_PROGRAM_INSTRUCTIONS_ARB = 0x88A0; + int GL_MAX_PROGRAM_INSTRUCTIONS_ARB = 0x88A1; + int GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A2; + int GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A3; + int GL_PROGRAM_TEMPORARIES_ARB = 0x88A4; + int GL_MAX_PROGRAM_TEMPORARIES_ARB = 0x88A5; + int GL_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A6; + int GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A7; + int GL_PROGRAM_PARAMETERS_ARB = 0x88A8; + int GL_MAX_PROGRAM_PARAMETERS_ARB = 0x88A9; + int GL_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AA; + int GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AB; + int GL_PROGRAM_ATTRIBS_ARB = 0x88AC; + int GL_MAX_PROGRAM_ATTRIBS_ARB = 0x88AD; + int GL_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AE; + int GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AF; + int GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB = 0x88B4; + int GL_MAX_PROGRAM_ENV_PARAMETERS_ARB = 0x88B5; + int GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB = 0x88B6; + int GL_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x8805; + int GL_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x8806; + int GL_PROGRAM_TEX_INDIRECTIONS_ARB = 0x8807; + int GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x8808; + int GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x8809; + int GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x880A; + int GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x880B; + int GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x880C; + int GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB = 0x880D; + int GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x880E; + int GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x880F; + int GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x8810; + int GL_PROGRAM_STRING_ARB = 0x8628; + int GL_PROGRAM_ERROR_POSITION_ARB = 0x864B; + int GL_CURRENT_MATRIX_ARB = 0x8641; + int GL_TRANSPOSE_CURRENT_MATRIX_ARB = 0x88B7; + int GL_CURRENT_MATRIX_STACK_DEPTH_ARB = 0x8640; + int GL_MAX_PROGRAM_MATRICES_ARB = 0x862F; + int GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB = 0x862E; + int GL_MAX_TEXTURE_COORDS_ARB = 0x8871; + int GL_MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872; + int GL_PROGRAM_ERROR_STRING_ARB = 0x8874; + int GL_MATRIX0_ARB = 0x88C0; + int GL_MATRIX1_ARB = 0x88C1; + int GL_MATRIX2_ARB = 0x88C2; + int GL_MATRIX3_ARB = 0x88C3; + int GL_MATRIX4_ARB = 0x88C4; + int GL_MATRIX5_ARB = 0x88C5; + int GL_MATRIX6_ARB = 0x88C6; + int GL_MATRIX7_ARB = 0x88C7; + int GL_MATRIX8_ARB = 0x88C8; + int GL_MATRIX9_ARB = 0x88C9; + int GL_MATRIX10_ARB = 0x88CA; + int GL_MATRIX11_ARB = 0x88CB; + int GL_MATRIX12_ARB = 0x88CC; + int GL_MATRIX13_ARB = 0x88CD; + int GL_MATRIX14_ARB = 0x88CE; + int GL_MATRIX15_ARB = 0x88CF; + int GL_MATRIX16_ARB = 0x88D0; + int GL_MATRIX17_ARB = 0x88D1; + int GL_MATRIX18_ARB = 0x88D2; + int GL_MATRIX19_ARB = 0x88D3; + int GL_MATRIX20_ARB = 0x88D4; + int GL_MATRIX21_ARB = 0x88D5; + int GL_MATRIX22_ARB = 0x88D6; + int GL_MATRIX23_ARB = 0x88D7; + int GL_MATRIX24_ARB = 0x88D8; + int GL_MATRIX25_ARB = 0x88D9; + int GL_MATRIX26_ARB = 0x88DA; + int GL_MATRIX27_ARB = 0x88DB; + int GL_MATRIX28_ARB = 0x88DC; + int GL_MATRIX29_ARB = 0x88DD; + int GL_MATRIX30_ARB = 0x88DE; + int GL_MATRIX31_ARB = 0x88DF; + + default void glProgramStringARB(int target, int format, int len, @NativeType("const void *") MemorySegment string) { + throw new ContextException(); + } + + default void glBindProgramARB(int target, int program) { + throw new ContextException(); + } + + default void glDeleteProgramsARB(int n, @NativeType("const GLuint *") MemorySegment programs) { + throw new ContextException(); + } + + default void glGenProgramsARB(int n, @NativeType("GLuint *") MemorySegment programs) { + throw new ContextException(); + } + + default void glProgramEnvParameter4dARB(int target, int index, double x, double y, double z, double w) { + throw new ContextException(); + } + + default void glProgramEnvParameter4dvARB(int target, int index, @NativeType("const GLdouble *") MemorySegment params) { + throw new ContextException(); + } - public static void glProgramEnvParameter4fARB(int target, int index, float x, float y, float z, float w) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramEnvParameter4fARB).invokeExact(target, index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramEnvParameter4fARB(int target, int index, float x, float y, float z, float w) { + throw new ContextException(); } - public static void glProgramEnvParameter4fvARB(int target, int index, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramEnvParameter4fvARB).invokeExact(target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramEnvParameter4fvARB(int target, int index, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glProgramLocalParameter4dARB(int target, int index, double x, double y, double z, double w) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramLocalParameter4dARB).invokeExact(target, index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramLocalParameter4dARB(int target, int index, double x, double y, double z, double w) { + throw new ContextException(); } - public static void glProgramLocalParameter4dvARB(int target, int index, @NativeType("const GLdouble *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramLocalParameter4dvARB).invokeExact(target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramLocalParameter4dvARB(int target, int index, @NativeType("const GLdouble *") MemorySegment params) { + throw new ContextException(); } - public static void glProgramLocalParameter4fARB(int target, int index, float x, float y, float z, float w) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramLocalParameter4fARB).invokeExact(target, index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramLocalParameter4fARB(int target, int index, float x, float y, float z, float w) { + throw new ContextException(); } - public static void glProgramLocalParameter4fvARB(int target, int index, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramLocalParameter4fvARB).invokeExact(target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramLocalParameter4fvARB(int target, int index, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetProgramEnvParameterdvARB(int target, int index, @NativeType("GLdouble *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetProgramEnvParameterdvARB).invokeExact(target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetProgramEnvParameterdvARB(int target, int index, @NativeType("GLdouble *") MemorySegment params) { + throw new ContextException(); } - public static void glGetProgramEnvParameterfvARB(int target, int index, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetProgramEnvParameterfvARB).invokeExact(target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetProgramEnvParameterfvARB(int target, int index, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetProgramLocalParameterdvARB(int target, int index, @NativeType("GLdouble *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetProgramLocalParameterdvARB).invokeExact(target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetProgramLocalParameterdvARB(int target, int index, @NativeType("GLdouble *") MemorySegment params) { + throw new ContextException(); } - public static void glGetProgramLocalParameterfvARB(int target, int index, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetProgramLocalParameterfvARB).invokeExact(target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetProgramLocalParameterfvARB(int target, int index, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetProgramivARB(int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetProgramivARB).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetProgramivARB(int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetProgramStringARB(int target, int pname, @NativeType("void *") MemorySegment string) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetProgramStringARB).invokeExact(target, pname, string); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetProgramStringARB(int target, int pname, @NativeType("void *") MemorySegment string) { + throw new ContextException(); } - public static boolean glIsProgramARB(int program) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsProgramARB).invokeExact(program); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsProgramARB(int program) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBFragmentShader.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBFragmentShader.java index 9e414821..12476b48 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBFragmentShader.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBFragmentShader.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_fragment_shader} */ -public final class GLARBFragmentShader { - public static final int GL_FRAGMENT_SHADER_ARB = 0x8B30; - public static final int GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB = 0x8B49; - public static final int GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB = 0x8B8B; +public interface GLARBFragmentShader { + int GL_FRAGMENT_SHADER_ARB = 0x8B30; + int GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB = 0x8B49; + int GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB = 0x8B8B; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBGLSpirv.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBGLSpirv.java index c00670ef..61ca1306 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBGLSpirv.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBGLSpirv.java @@ -16,30 +16,19 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_gl_spirv} */ -public final class GLARBGLSpirv { - public static final int GL_SHADER_BINARY_FORMAT_SPIR_V_ARB = 0x9551; - public static final int GL_SPIR_V_BINARY_ARB = 0x9552; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_gl_spirv) return; - ext.glSpecializeShaderARB = load.invoke("glSpecializeShaderARB", ofVoid(JAVA_INT, ADDRESS, JAVA_INT, ADDRESS, ADDRESS)); - } +public interface GLARBGLSpirv { + int GL_SHADER_BINARY_FORMAT_SPIR_V_ARB = 0x9551; + int GL_SPIR_V_BINARY_ARB = 0x9552; - public static void glSpecializeShaderARB(int shader, @NativeType("const GLchar *") MemorySegment pEntryPoint, int numSpecializationConstants, @NativeType("const GLuint *") MemorySegment pConstantIndex, @NativeType("const GLuint *") MemorySegment pConstantValue) { - final var ext = getExtCapabilities(); - try { - check(ext.glSpecializeShaderARB).invokeExact(shader, pEntryPoint, numSpecializationConstants, pConstantIndex, pConstantValue); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSpecializeShaderARB(int shader, @NativeType("const GLchar *") MemorySegment pEntryPoint, int numSpecializationConstants, @NativeType("const GLuint *") MemorySegment pConstantIndex, @NativeType("const GLuint *") MemorySegment pConstantValue) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBGeometryShader4.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBGeometryShader4.java index a2e61f4a..c856f9f5 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBGeometryShader4.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBGeometryShader4.java @@ -16,70 +16,47 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_geometry_shader4} */ -public final class GLARBGeometryShader4 { - public static final int GL_LINES_ADJACENCY_ARB = 0x000A; - public static final int GL_LINE_STRIP_ADJACENCY_ARB = 0x000B; - public static final int GL_TRIANGLES_ADJACENCY_ARB = 0x000C; - public static final int GL_TRIANGLE_STRIP_ADJACENCY_ARB = 0x000D; - public static final int GL_PROGRAM_POINT_SIZE_ARB = 0x8642; - public static final int GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB = 0x8C29; - public static final int GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB = 0x8DA7; - public static final int GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB = 0x8DA8; - public static final int GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB = 0x8DA9; - public static final int GL_GEOMETRY_SHADER_ARB = 0x8DD9; - public static final int GL_GEOMETRY_VERTICES_OUT_ARB = 0x8DDA; - public static final int GL_GEOMETRY_INPUT_TYPE_ARB = 0x8DDB; - public static final int GL_GEOMETRY_OUTPUT_TYPE_ARB = 0x8DDC; - public static final int GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB = 0x8DDD; - public static final int GL_MAX_VERTEX_VARYING_COMPONENTS_ARB = 0x8DDE; - public static final int GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB = 0x8DDF; - public static final int GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB = 0x8DE0; - public static final int GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB = 0x8DE1; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_geometry_shader4) return; - ext.glProgramParameteriARB = load.invoke("glProgramParameteriARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glFramebufferTextureARB = load.invoke("glFramebufferTextureARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glFramebufferTextureLayerARB = load.invoke("glFramebufferTextureLayerARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glFramebufferTextureFaceARB = load.invoke("glFramebufferTextureFaceARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } - - public static void glProgramParameteriARB(int program, int pname, int value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramParameteriARB).invokeExact(program, pname, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLARBGeometryShader4 { + int GL_LINES_ADJACENCY_ARB = 0x000A; + int GL_LINE_STRIP_ADJACENCY_ARB = 0x000B; + int GL_TRIANGLES_ADJACENCY_ARB = 0x000C; + int GL_TRIANGLE_STRIP_ADJACENCY_ARB = 0x000D; + int GL_PROGRAM_POINT_SIZE_ARB = 0x8642; + int GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB = 0x8C29; + int GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB = 0x8DA7; + int GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB = 0x8DA8; + int GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB = 0x8DA9; + int GL_GEOMETRY_SHADER_ARB = 0x8DD9; + int GL_GEOMETRY_VERTICES_OUT_ARB = 0x8DDA; + int GL_GEOMETRY_INPUT_TYPE_ARB = 0x8DDB; + int GL_GEOMETRY_OUTPUT_TYPE_ARB = 0x8DDC; + int GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB = 0x8DDD; + int GL_MAX_VERTEX_VARYING_COMPONENTS_ARB = 0x8DDE; + int GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB = 0x8DDF; + int GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB = 0x8DE0; + int GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB = 0x8DE1; + + default void glProgramParameteriARB(int program, int pname, int value) { + throw new ContextException(); } - public static void glFramebufferTextureARB(int target, int attachment, int texture, int level) { - final var ext = getExtCapabilities(); - try { - check(ext.glFramebufferTextureARB).invokeExact(target, attachment, texture, level); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFramebufferTextureARB(int target, int attachment, int texture, int level) { + throw new ContextException(); } - public static void glFramebufferTextureLayerARB(int target, int attachment, int texture, int level, int layer) { - final var ext = getExtCapabilities(); - try { - check(ext.glFramebufferTextureLayerARB).invokeExact(target, attachment, texture, level, layer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFramebufferTextureLayerARB(int target, int attachment, int texture, int level, int layer) { + throw new ContextException(); } - public static void glFramebufferTextureFaceARB(int target, int attachment, int texture, int level, int face) { - final var ext = getExtCapabilities(); - try { - check(ext.glFramebufferTextureFaceARB).invokeExact(target, attachment, texture, level, face); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFramebufferTextureFaceARB(int target, int attachment, int texture, int level, int face) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBGpuShaderInt64.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBGpuShaderInt64.java index 366af38e..5075ef18 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBGpuShaderInt64.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBGpuShaderInt64.java @@ -16,315 +16,164 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_gpu_shader_int64} */ -public final class GLARBGpuShaderInt64 { - public static final int GL_INT64_ARB = 0x140E; - public static final int GL_INT64_VEC2_ARB = 0x8FE9; - public static final int GL_INT64_VEC3_ARB = 0x8FEA; - public static final int GL_INT64_VEC4_ARB = 0x8FEB; - public static final int GL_UNSIGNED_INT64_VEC2_ARB = 0x8FF5; - public static final int GL_UNSIGNED_INT64_VEC3_ARB = 0x8FF6; - public static final int GL_UNSIGNED_INT64_VEC4_ARB = 0x8FF7; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_gpu_shader_int64) return; - ext.glUniform1i64ARB = load.invoke("glUniform1i64ARB", ofVoid(JAVA_INT, JAVA_LONG)); - ext.glUniform2i64ARB = load.invoke("glUniform2i64ARB", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG)); - ext.glUniform3i64ARB = load.invoke("glUniform3i64ARB", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glUniform4i64ARB = load.invoke("glUniform4i64ARB", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glUniform1i64vARB = load.invoke("glUniform1i64vARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform2i64vARB = load.invoke("glUniform2i64vARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform3i64vARB = load.invoke("glUniform3i64vARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform4i64vARB = load.invoke("glUniform4i64vARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform1ui64ARB = load.invoke("glUniform1ui64ARB", ofVoid(JAVA_INT, JAVA_LONG)); - ext.glUniform2ui64ARB = load.invoke("glUniform2ui64ARB", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG)); - ext.glUniform3ui64ARB = load.invoke("glUniform3ui64ARB", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glUniform4ui64ARB = load.invoke("glUniform4ui64ARB", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glUniform1ui64vARB = load.invoke("glUniform1ui64vARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform2ui64vARB = load.invoke("glUniform2ui64vARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform3ui64vARB = load.invoke("glUniform3ui64vARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform4ui64vARB = load.invoke("glUniform4ui64vARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetUniformi64vARB = load.invoke("glGetUniformi64vARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetUniformui64vARB = load.invoke("glGetUniformui64vARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetnUniformi64vARB = load.invoke("glGetnUniformi64vARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetnUniformui64vARB = load.invoke("glGetnUniformui64vARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform1i64ARB = load.invoke("glProgramUniform1i64ARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glProgramUniform2i64ARB = load.invoke("glProgramUniform2i64ARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG)); - ext.glProgramUniform3i64ARB = load.invoke("glProgramUniform3i64ARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glProgramUniform4i64ARB = load.invoke("glProgramUniform4i64ARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glProgramUniform1i64vARB = load.invoke("glProgramUniform1i64vARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform2i64vARB = load.invoke("glProgramUniform2i64vARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform3i64vARB = load.invoke("glProgramUniform3i64vARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform4i64vARB = load.invoke("glProgramUniform4i64vARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform1ui64ARB = load.invoke("glProgramUniform1ui64ARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glProgramUniform2ui64ARB = load.invoke("glProgramUniform2ui64ARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG)); - ext.glProgramUniform3ui64ARB = load.invoke("glProgramUniform3ui64ARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glProgramUniform4ui64ARB = load.invoke("glProgramUniform4ui64ARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glProgramUniform1ui64vARB = load.invoke("glProgramUniform1ui64vARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform2ui64vARB = load.invoke("glProgramUniform2ui64vARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform3ui64vARB = load.invoke("glProgramUniform3ui64vARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform4ui64vARB = load.invoke("glProgramUniform4ui64vARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static void glUniform1i64ARB(int location, long x) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform1i64ARB).invokeExact(location, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform2i64ARB(int location, long x, long y) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform2i64ARB).invokeExact(location, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform3i64ARB(int location, long x, long y, long z) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform3i64ARB).invokeExact(location, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform4i64ARB(int location, long x, long y, long z, long w) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform4i64ARB).invokeExact(location, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform1i64vARB(int location, int count, @NativeType("const GLint64 *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform1i64vARB).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform2i64vARB(int location, int count, @NativeType("const GLint64 *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform2i64vARB).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform3i64vARB(int location, int count, @NativeType("const GLint64 *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform3i64vARB).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform4i64vARB(int location, int count, @NativeType("const GLint64 *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform4i64vARB).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform1ui64ARB(int location, long x) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform1ui64ARB).invokeExact(location, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform2ui64ARB(int location, long x, long y) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform2ui64ARB).invokeExact(location, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLARBGpuShaderInt64 { + int GL_INT64_ARB = 0x140E; + int GL_INT64_VEC2_ARB = 0x8FE9; + int GL_INT64_VEC3_ARB = 0x8FEA; + int GL_INT64_VEC4_ARB = 0x8FEB; + int GL_UNSIGNED_INT64_VEC2_ARB = 0x8FF5; + int GL_UNSIGNED_INT64_VEC3_ARB = 0x8FF6; + int GL_UNSIGNED_INT64_VEC4_ARB = 0x8FF7; + + default void glUniform1i64ARB(int location, long x) { + throw new ContextException(); + } + + default void glUniform2i64ARB(int location, long x, long y) { + throw new ContextException(); + } + + default void glUniform3i64ARB(int location, long x, long y, long z) { + throw new ContextException(); + } + + default void glUniform4i64ARB(int location, long x, long y, long z, long w) { + throw new ContextException(); + } + + default void glUniform1i64vARB(int location, int count, @NativeType("const GLint64 *") MemorySegment value) { + throw new ContextException(); + } + + default void glUniform2i64vARB(int location, int count, @NativeType("const GLint64 *") MemorySegment value) { + throw new ContextException(); + } + + default void glUniform3i64vARB(int location, int count, @NativeType("const GLint64 *") MemorySegment value) { + throw new ContextException(); + } + + default void glUniform4i64vARB(int location, int count, @NativeType("const GLint64 *") MemorySegment value) { + throw new ContextException(); + } + + default void glUniform1ui64ARB(int location, long x) { + throw new ContextException(); + } + + default void glUniform2ui64ARB(int location, long x, long y) { + throw new ContextException(); } - public static void glUniform3ui64ARB(int location, long x, long y, long z) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform3ui64ARB).invokeExact(location, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform3ui64ARB(int location, long x, long y, long z) { + throw new ContextException(); } - public static void glUniform4ui64ARB(int location, long x, long y, long z, long w) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform4ui64ARB).invokeExact(location, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform4ui64ARB(int location, long x, long y, long z, long w) { + throw new ContextException(); } - public static void glUniform1ui64vARB(int location, int count, @NativeType("const GLuint64 *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform1ui64vARB).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform1ui64vARB(int location, int count, @NativeType("const GLuint64 *") MemorySegment value) { + throw new ContextException(); } - public static void glUniform2ui64vARB(int location, int count, @NativeType("const GLuint64 *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform2ui64vARB).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform2ui64vARB(int location, int count, @NativeType("const GLuint64 *") MemorySegment value) { + throw new ContextException(); } - public static void glUniform3ui64vARB(int location, int count, @NativeType("const GLuint64 *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform3ui64vARB).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform3ui64vARB(int location, int count, @NativeType("const GLuint64 *") MemorySegment value) { + throw new ContextException(); } - public static void glUniform4ui64vARB(int location, int count, @NativeType("const GLuint64 *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform4ui64vARB).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform4ui64vARB(int location, int count, @NativeType("const GLuint64 *") MemorySegment value) { + throw new ContextException(); } - public static void glGetUniformi64vARB(int program, int location, @NativeType("GLint64 *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetUniformi64vARB).invokeExact(program, location, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetUniformi64vARB(int program, int location, @NativeType("GLint64 *") MemorySegment params) { + throw new ContextException(); } - public static void glGetUniformui64vARB(int program, int location, @NativeType("GLuint64 *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetUniformui64vARB).invokeExact(program, location, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetUniformui64vARB(int program, int location, @NativeType("GLuint64 *") MemorySegment params) { + throw new ContextException(); } - public static void glGetnUniformi64vARB(int program, int location, int bufSize, @NativeType("GLint64 *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetnUniformi64vARB).invokeExact(program, location, bufSize, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetnUniformi64vARB(int program, int location, int bufSize, @NativeType("GLint64 *") MemorySegment params) { + throw new ContextException(); } - public static void glGetnUniformui64vARB(int program, int location, int bufSize, @NativeType("GLuint64 *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetnUniformui64vARB).invokeExact(program, location, bufSize, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetnUniformui64vARB(int program, int location, int bufSize, @NativeType("GLuint64 *") MemorySegment params) { + throw new ContextException(); } - public static void glProgramUniform1i64ARB(int program, int location, long x) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform1i64ARB).invokeExact(program, location, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform1i64ARB(int program, int location, long x) { + throw new ContextException(); } - public static void glProgramUniform2i64ARB(int program, int location, long x, long y) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform2i64ARB).invokeExact(program, location, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform2i64ARB(int program, int location, long x, long y) { + throw new ContextException(); } - public static void glProgramUniform3i64ARB(int program, int location, long x, long y, long z) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform3i64ARB).invokeExact(program, location, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform3i64ARB(int program, int location, long x, long y, long z) { + throw new ContextException(); } - public static void glProgramUniform4i64ARB(int program, int location, long x, long y, long z, long w) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform4i64ARB).invokeExact(program, location, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform4i64ARB(int program, int location, long x, long y, long z, long w) { + throw new ContextException(); } - public static void glProgramUniform1i64vARB(int program, int location, int count, @NativeType("const GLint64 *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform1i64vARB).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform1i64vARB(int program, int location, int count, @NativeType("const GLint64 *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform2i64vARB(int program, int location, int count, @NativeType("const GLint64 *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform2i64vARB).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform2i64vARB(int program, int location, int count, @NativeType("const GLint64 *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform3i64vARB(int program, int location, int count, @NativeType("const GLint64 *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform3i64vARB).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform3i64vARB(int program, int location, int count, @NativeType("const GLint64 *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform4i64vARB(int program, int location, int count, @NativeType("const GLint64 *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform4i64vARB).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform4i64vARB(int program, int location, int count, @NativeType("const GLint64 *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform1ui64ARB(int program, int location, long x) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform1ui64ARB).invokeExact(program, location, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform1ui64ARB(int program, int location, long x) { + throw new ContextException(); } - public static void glProgramUniform2ui64ARB(int program, int location, long x, long y) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform2ui64ARB).invokeExact(program, location, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform2ui64ARB(int program, int location, long x, long y) { + throw new ContextException(); } - public static void glProgramUniform3ui64ARB(int program, int location, long x, long y, long z) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform3ui64ARB).invokeExact(program, location, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform3ui64ARB(int program, int location, long x, long y, long z) { + throw new ContextException(); } - public static void glProgramUniform4ui64ARB(int program, int location, long x, long y, long z, long w) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform4ui64ARB).invokeExact(program, location, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform4ui64ARB(int program, int location, long x, long y, long z, long w) { + throw new ContextException(); } - public static void glProgramUniform1ui64vARB(int program, int location, int count, @NativeType("const GLuint64 *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform1ui64vARB).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform1ui64vARB(int program, int location, int count, @NativeType("const GLuint64 *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform2ui64vARB(int program, int location, int count, @NativeType("const GLuint64 *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform2ui64vARB).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform2ui64vARB(int program, int location, int count, @NativeType("const GLuint64 *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform3ui64vARB(int program, int location, int count, @NativeType("const GLuint64 *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform3ui64vARB).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform3ui64vARB(int program, int location, int count, @NativeType("const GLuint64 *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform4ui64vARB(int program, int location, int count, @NativeType("const GLuint64 *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform4ui64vARB).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform4ui64vARB(int program, int location, int count, @NativeType("const GLuint64 *") MemorySegment value) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBHalfFloatPixel.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBHalfFloatPixel.java index a7531247..a1eb8142 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBHalfFloatPixel.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBHalfFloatPixel.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_half_float_pixel} */ -public final class GLARBHalfFloatPixel { - public static final int GL_HALF_FLOAT_ARB = 0x140B; +public interface GLARBHalfFloatPixel { + int GL_HALF_FLOAT_ARB = 0x140B; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBImaging.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBImaging.java index 67ca262a..b1d2bf6f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBImaging.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBImaging.java @@ -16,328 +16,193 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_imaging} */ -public final class GLARBImaging { - public static final int GL_CONVOLUTION_BORDER_MODE = 0x8013; - public static final int GL_CONVOLUTION_FILTER_SCALE = 0x8014; - public static final int GL_CONVOLUTION_FILTER_BIAS = 0x8015; - public static final int GL_REDUCE = 0x8016; - public static final int GL_CONVOLUTION_FORMAT = 0x8017; - public static final int GL_CONVOLUTION_WIDTH = 0x8018; - public static final int GL_CONVOLUTION_HEIGHT = 0x8019; - public static final int GL_MAX_CONVOLUTION_WIDTH = 0x801A; - public static final int GL_MAX_CONVOLUTION_HEIGHT = 0x801B; - public static final int GL_POST_CONVOLUTION_RED_SCALE = 0x801C; - public static final int GL_POST_CONVOLUTION_GREEN_SCALE = 0x801D; - public static final int GL_POST_CONVOLUTION_BLUE_SCALE = 0x801E; - public static final int GL_POST_CONVOLUTION_ALPHA_SCALE = 0x801F; - public static final int GL_POST_CONVOLUTION_RED_BIAS = 0x8020; - public static final int GL_POST_CONVOLUTION_GREEN_BIAS = 0x8021; - public static final int GL_POST_CONVOLUTION_BLUE_BIAS = 0x8022; - public static final int GL_POST_CONVOLUTION_ALPHA_BIAS = 0x8023; - public static final int GL_HISTOGRAM_WIDTH = 0x8026; - public static final int GL_HISTOGRAM_FORMAT = 0x8027; - public static final int GL_HISTOGRAM_RED_SIZE = 0x8028; - public static final int GL_HISTOGRAM_GREEN_SIZE = 0x8029; - public static final int GL_HISTOGRAM_BLUE_SIZE = 0x802A; - public static final int GL_HISTOGRAM_ALPHA_SIZE = 0x802B; - public static final int GL_HISTOGRAM_LUMINANCE_SIZE = 0x802C; - public static final int GL_HISTOGRAM_SINK = 0x802D; - public static final int GL_MINMAX_FORMAT = 0x802F; - public static final int GL_MINMAX_SINK = 0x8030; - public static final int GL_TABLE_TOO_LARGE = 0x8031; - public static final int GL_COLOR_MATRIX = 0x80B1; - public static final int GL_COLOR_MATRIX_STACK_DEPTH = 0x80B2; - public static final int GL_MAX_COLOR_MATRIX_STACK_DEPTH = 0x80B3; - public static final int GL_POST_COLOR_MATRIX_RED_SCALE = 0x80B4; - public static final int GL_POST_COLOR_MATRIX_GREEN_SCALE = 0x80B5; - public static final int GL_POST_COLOR_MATRIX_BLUE_SCALE = 0x80B6; - public static final int GL_POST_COLOR_MATRIX_ALPHA_SCALE = 0x80B7; - public static final int GL_POST_COLOR_MATRIX_RED_BIAS = 0x80B8; - public static final int GL_POST_COLOR_MATRIX_GREEN_BIAS = 0x80B9; - public static final int GL_POST_COLOR_MATRIX_BLUE_BIAS = 0x80BA; - public static final int GL_POST_COLOR_MATRIX_ALPHA_BIAS = 0x80BB; - public static final int GL_COLOR_TABLE_SCALE = 0x80D6; - public static final int GL_COLOR_TABLE_BIAS = 0x80D7; - public static final int GL_COLOR_TABLE_FORMAT = 0x80D8; - public static final int GL_COLOR_TABLE_WIDTH = 0x80D9; - public static final int GL_COLOR_TABLE_RED_SIZE = 0x80DA; - public static final int GL_COLOR_TABLE_GREEN_SIZE = 0x80DB; - public static final int GL_COLOR_TABLE_BLUE_SIZE = 0x80DC; - public static final int GL_COLOR_TABLE_ALPHA_SIZE = 0x80DD; - public static final int GL_COLOR_TABLE_LUMINANCE_SIZE = 0x80DE; - public static final int GL_COLOR_TABLE_INTENSITY_SIZE = 0x80DF; - public static final int GL_CONSTANT_BORDER = 0x8151; - public static final int GL_REPLICATE_BORDER = 0x8153; - public static final int GL_CONVOLUTION_BORDER_COLOR = 0x8154; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_imaging) return; - ext.glColorTable = load.invoke("glColorTable", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glColorTableParameterfv = load.invoke("glColorTableParameterfv", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glColorTableParameteriv = load.invoke("glColorTableParameteriv", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCopyColorTable = load.invoke("glCopyColorTable", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetColorTable = load.invoke("glGetColorTable", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetColorTableParameterfv = load.invoke("glGetColorTableParameterfv", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetColorTableParameteriv = load.invoke("glGetColorTableParameteriv", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glColorSubTable = load.invoke("glColorSubTable", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCopyColorSubTable = load.invoke("glCopyColorSubTable", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glConvolutionFilter1D = load.invoke("glConvolutionFilter1D", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glConvolutionFilter2D = load.invoke("glConvolutionFilter2D", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glConvolutionParameterf = load.invoke("glConvolutionParameterf", ofVoid(JAVA_INT, JAVA_INT, JAVA_FLOAT)); - ext.glConvolutionParameterfv = load.invoke("glConvolutionParameterfv", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glConvolutionParameteri = load.invoke("glConvolutionParameteri", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glConvolutionParameteriv = load.invoke("glConvolutionParameteriv", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCopyConvolutionFilter1D = load.invoke("glCopyConvolutionFilter1D", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glCopyConvolutionFilter2D = load.invoke("glCopyConvolutionFilter2D", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetConvolutionFilter = load.invoke("glGetConvolutionFilter", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetConvolutionParameterfv = load.invoke("glGetConvolutionParameterfv", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetConvolutionParameteriv = load.invoke("glGetConvolutionParameteriv", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetSeparableFilter = load.invoke("glGetSeparableFilter", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, ADDRESS, ADDRESS)); - ext.glSeparableFilter2D = load.invoke("glSeparableFilter2D", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - ext.glGetHistogram = load.invoke("glGetHistogram", ofVoid(JAVA_INT, JAVA_BYTE, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetHistogramParameterfv = load.invoke("glGetHistogramParameterfv", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetHistogramParameteriv = load.invoke("glGetHistogramParameteriv", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMinmax = load.invoke("glGetMinmax", ofVoid(JAVA_INT, JAVA_BYTE, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMinmaxParameterfv = load.invoke("glGetMinmaxParameterfv", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMinmaxParameteriv = load.invoke("glGetMinmaxParameteriv", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glHistogram = load.invoke("glHistogram", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE)); - ext.glMinmax = load.invoke("glMinmax", ofVoid(JAVA_INT, JAVA_INT, JAVA_BYTE)); - ext.glResetHistogram = load.invoke("glResetHistogram", ofVoid(JAVA_INT)); - ext.glResetMinmax = load.invoke("glResetMinmax", ofVoid(JAVA_INT)); - } - - public static void glColorTable(int target, int internalformat, int width, int format, int type, @NativeType("const void *") MemorySegment table) { - final var ext = getExtCapabilities(); - try { - check(ext.glColorTable).invokeExact(target, internalformat, width, format, type, table); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glColorTableParameterfv(int target, int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glColorTableParameterfv).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glColorTableParameteriv(int target, int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glColorTableParameteriv).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glCopyColorTable(int target, int internalformat, int x, int y, int width) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyColorTable).invokeExact(target, internalformat, x, y, width); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glGetColorTable(int target, int format, int type, @NativeType("void *") MemorySegment table) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetColorTable).invokeExact(target, format, type, table); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glGetColorTableParameterfv(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetColorTableParameterfv).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glGetColorTableParameteriv(int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetColorTableParameteriv).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glColorSubTable(int target, int start, int count, int format, int type, @NativeType("const void *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glColorSubTable).invokeExact(target, start, count, format, type, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glCopyColorSubTable(int target, int start, int x, int y, int width) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyColorSubTable).invokeExact(target, start, x, y, width); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, @NativeType("const void *") MemorySegment image) { - final var ext = getExtCapabilities(); - try { - check(ext.glConvolutionFilter1D).invokeExact(target, internalformat, width, format, type, image); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLARBImaging { + int GL_CONVOLUTION_BORDER_MODE = 0x8013; + int GL_CONVOLUTION_FILTER_SCALE = 0x8014; + int GL_CONVOLUTION_FILTER_BIAS = 0x8015; + int GL_REDUCE = 0x8016; + int GL_CONVOLUTION_FORMAT = 0x8017; + int GL_CONVOLUTION_WIDTH = 0x8018; + int GL_CONVOLUTION_HEIGHT = 0x8019; + int GL_MAX_CONVOLUTION_WIDTH = 0x801A; + int GL_MAX_CONVOLUTION_HEIGHT = 0x801B; + int GL_POST_CONVOLUTION_RED_SCALE = 0x801C; + int GL_POST_CONVOLUTION_GREEN_SCALE = 0x801D; + int GL_POST_CONVOLUTION_BLUE_SCALE = 0x801E; + int GL_POST_CONVOLUTION_ALPHA_SCALE = 0x801F; + int GL_POST_CONVOLUTION_RED_BIAS = 0x8020; + int GL_POST_CONVOLUTION_GREEN_BIAS = 0x8021; + int GL_POST_CONVOLUTION_BLUE_BIAS = 0x8022; + int GL_POST_CONVOLUTION_ALPHA_BIAS = 0x8023; + int GL_HISTOGRAM_WIDTH = 0x8026; + int GL_HISTOGRAM_FORMAT = 0x8027; + int GL_HISTOGRAM_RED_SIZE = 0x8028; + int GL_HISTOGRAM_GREEN_SIZE = 0x8029; + int GL_HISTOGRAM_BLUE_SIZE = 0x802A; + int GL_HISTOGRAM_ALPHA_SIZE = 0x802B; + int GL_HISTOGRAM_LUMINANCE_SIZE = 0x802C; + int GL_HISTOGRAM_SINK = 0x802D; + int GL_MINMAX_FORMAT = 0x802F; + int GL_MINMAX_SINK = 0x8030; + int GL_TABLE_TOO_LARGE = 0x8031; + int GL_COLOR_MATRIX = 0x80B1; + int GL_COLOR_MATRIX_STACK_DEPTH = 0x80B2; + int GL_MAX_COLOR_MATRIX_STACK_DEPTH = 0x80B3; + int GL_POST_COLOR_MATRIX_RED_SCALE = 0x80B4; + int GL_POST_COLOR_MATRIX_GREEN_SCALE = 0x80B5; + int GL_POST_COLOR_MATRIX_BLUE_SCALE = 0x80B6; + int GL_POST_COLOR_MATRIX_ALPHA_SCALE = 0x80B7; + int GL_POST_COLOR_MATRIX_RED_BIAS = 0x80B8; + int GL_POST_COLOR_MATRIX_GREEN_BIAS = 0x80B9; + int GL_POST_COLOR_MATRIX_BLUE_BIAS = 0x80BA; + int GL_POST_COLOR_MATRIX_ALPHA_BIAS = 0x80BB; + int GL_COLOR_TABLE_SCALE = 0x80D6; + int GL_COLOR_TABLE_BIAS = 0x80D7; + int GL_COLOR_TABLE_FORMAT = 0x80D8; + int GL_COLOR_TABLE_WIDTH = 0x80D9; + int GL_COLOR_TABLE_RED_SIZE = 0x80DA; + int GL_COLOR_TABLE_GREEN_SIZE = 0x80DB; + int GL_COLOR_TABLE_BLUE_SIZE = 0x80DC; + int GL_COLOR_TABLE_ALPHA_SIZE = 0x80DD; + int GL_COLOR_TABLE_LUMINANCE_SIZE = 0x80DE; + int GL_COLOR_TABLE_INTENSITY_SIZE = 0x80DF; + int GL_CONSTANT_BORDER = 0x8151; + int GL_REPLICATE_BORDER = 0x8153; + int GL_CONVOLUTION_BORDER_COLOR = 0x8154; + + default void glColorTable(int target, int internalformat, int width, int format, int type, @NativeType("const void *") MemorySegment table) { + throw new ContextException(); + } + + default void glColorTableParameterfv(int target, int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); + } + + default void glColorTableParameteriv(int target, int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); + } + + default void glCopyColorTable(int target, int internalformat, int x, int y, int width) { + throw new ContextException(); + } + + default void glGetColorTable(int target, int format, int type, @NativeType("void *") MemorySegment table) { + throw new ContextException(); + } + + default void glGetColorTableParameterfv(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); + } + + default void glGetColorTableParameteriv(int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); + } + + default void glColorSubTable(int target, int start, int count, int format, int type, @NativeType("const void *") MemorySegment data) { + throw new ContextException(); + } + + default void glCopyColorSubTable(int target, int start, int x, int y, int width) { + throw new ContextException(); + } + + default void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, @NativeType("const void *") MemorySegment image) { + throw new ContextException(); } - public static void glConvolutionFilter2D(int target, int internalformat, int width, int height, int format, int type, @NativeType("const void *") MemorySegment image) { - final var ext = getExtCapabilities(); - try { - check(ext.glConvolutionFilter2D).invokeExact(target, internalformat, width, height, format, type, image); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glConvolutionFilter2D(int target, int internalformat, int width, int height, int format, int type, @NativeType("const void *") MemorySegment image) { + throw new ContextException(); } - public static void glConvolutionParameterf(int target, int pname, float params) { - final var ext = getExtCapabilities(); - try { - check(ext.glConvolutionParameterf).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glConvolutionParameterf(int target, int pname, float params) { + throw new ContextException(); } - public static void glConvolutionParameterfv(int target, int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glConvolutionParameterfv).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glConvolutionParameterfv(int target, int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glConvolutionParameteri(int target, int pname, int params) { - final var ext = getExtCapabilities(); - try { - check(ext.glConvolutionParameteri).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glConvolutionParameteri(int target, int pname, int params) { + throw new ContextException(); } - public static void glConvolutionParameteriv(int target, int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glConvolutionParameteriv).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glConvolutionParameteriv(int target, int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glCopyConvolutionFilter1D(int target, int internalformat, int x, int y, int width) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyConvolutionFilter1D).invokeExact(target, internalformat, x, y, width); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyConvolutionFilter1D(int target, int internalformat, int x, int y, int width) { + throw new ContextException(); } - public static void glCopyConvolutionFilter2D(int target, int internalformat, int x, int y, int width, int height) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyConvolutionFilter2D).invokeExact(target, internalformat, x, y, width, height); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyConvolutionFilter2D(int target, int internalformat, int x, int y, int width, int height) { + throw new ContextException(); } - public static void glGetConvolutionFilter(int target, int format, int type, @NativeType("void *") MemorySegment image) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetConvolutionFilter).invokeExact(target, format, type, image); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetConvolutionFilter(int target, int format, int type, @NativeType("void *") MemorySegment image) { + throw new ContextException(); } - public static void glGetConvolutionParameterfv(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetConvolutionParameterfv).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetConvolutionParameterfv(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetConvolutionParameteriv(int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetConvolutionParameteriv).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetConvolutionParameteriv(int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetSeparableFilter(int target, int format, int type, @NativeType("void *") MemorySegment row, @NativeType("void *") MemorySegment column, @NativeType("void *") MemorySegment span) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetSeparableFilter).invokeExact(target, format, type, row, column, span); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetSeparableFilter(int target, int format, int type, @NativeType("void *") MemorySegment row, @NativeType("void *") MemorySegment column, @NativeType("void *") MemorySegment span) { + throw new ContextException(); } - public static void glSeparableFilter2D(int target, int internalformat, int width, int height, int format, int type, @NativeType("const void *") MemorySegment row, @NativeType("const void *") MemorySegment column) { - final var ext = getExtCapabilities(); - try { - check(ext.glSeparableFilter2D).invokeExact(target, internalformat, width, height, format, type, row, column); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSeparableFilter2D(int target, int internalformat, int width, int height, int format, int type, @NativeType("const void *") MemorySegment row, @NativeType("const void *") MemorySegment column) { + throw new ContextException(); } - public static void glGetHistogram(int target, boolean reset, int format, int type, @NativeType("void *") MemorySegment values) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetHistogram).invokeExact(target, reset, format, type, values); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetHistogram(int target, boolean reset, int format, int type, @NativeType("void *") MemorySegment values) { + throw new ContextException(); } - public static void glGetHistogramParameterfv(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetHistogramParameterfv).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetHistogramParameterfv(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetHistogramParameteriv(int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetHistogramParameteriv).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetHistogramParameteriv(int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetMinmax(int target, boolean reset, int format, int type, @NativeType("void *") MemorySegment values) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMinmax).invokeExact(target, reset, format, type, values); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMinmax(int target, boolean reset, int format, int type, @NativeType("void *") MemorySegment values) { + throw new ContextException(); } - public static void glGetMinmaxParameterfv(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMinmaxParameterfv).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMinmaxParameterfv(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetMinmaxParameteriv(int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMinmaxParameteriv).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMinmaxParameteriv(int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glHistogram(int target, int width, int internalformat, boolean sink) { - final var ext = getExtCapabilities(); - try { - check(ext.glHistogram).invokeExact(target, width, internalformat, sink); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glHistogram(int target, int width, int internalformat, boolean sink) { + throw new ContextException(); } - public static void glMinmax(int target, int internalformat, boolean sink) { - final var ext = getExtCapabilities(); - try { - check(ext.glMinmax).invokeExact(target, internalformat, sink); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMinmax(int target, int internalformat, boolean sink) { + throw new ContextException(); } - public static void glResetHistogram(int target) { - final var ext = getExtCapabilities(); - try { - check(ext.glResetHistogram).invokeExact(target); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glResetHistogram(int target) { + throw new ContextException(); } - public static void glResetMinmax(int target) { - final var ext = getExtCapabilities(); - try { - check(ext.glResetMinmax).invokeExact(target); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glResetMinmax(int target) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBIndirectParameters.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBIndirectParameters.java index 366db1d4..90fc2982 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBIndirectParameters.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBIndirectParameters.java @@ -16,38 +16,23 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_indirect_parameters} */ -public final class GLARBIndirectParameters { - public static final int GL_PARAMETER_BUFFER_ARB = 0x80EE; - public static final int GL_PARAMETER_BUFFER_BINDING_ARB = 0x80EF; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_indirect_parameters) return; - ext.glMultiDrawArraysIndirectCountARB = load.invoke("glMultiDrawArraysIndirectCountARB", ofVoid(JAVA_INT, ADDRESS, JAVA_LONG, JAVA_INT, JAVA_INT)); - ext.glMultiDrawElementsIndirectCountARB = load.invoke("glMultiDrawElementsIndirectCountARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_LONG, JAVA_INT, JAVA_INT)); - } +public interface GLARBIndirectParameters { + int GL_PARAMETER_BUFFER_ARB = 0x80EE; + int GL_PARAMETER_BUFFER_BINDING_ARB = 0x80EF; - public static void glMultiDrawArraysIndirectCountARB(int mode, @NativeType("const void *") MemorySegment indirect, long drawcount, int maxdrawcount, int stride) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiDrawArraysIndirectCountARB).invokeExact(mode, indirect, drawcount, maxdrawcount, stride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiDrawArraysIndirectCountARB(int mode, @NativeType("const void *") MemorySegment indirect, long drawcount, int maxdrawcount, int stride) { + throw new ContextException(); } - public static void glMultiDrawElementsIndirectCountARB(int mode, int type, @NativeType("const void *") MemorySegment indirect, long drawcount, int maxdrawcount, int stride) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiDrawElementsIndirectCountARB).invokeExact(mode, type, indirect, drawcount, maxdrawcount, stride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiDrawElementsIndirectCountARB(int mode, int type, @NativeType("const void *") MemorySegment indirect, long drawcount, int maxdrawcount, int stride) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBInstancedArrays.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBInstancedArrays.java index 0fa02483..1fe3dd84 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBInstancedArrays.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBInstancedArrays.java @@ -16,29 +16,18 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_instanced_arrays} */ -public final class GLARBInstancedArrays { - public static final int GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB = 0x88FE; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_instanced_arrays) return; - ext.glVertexAttribDivisorARB = load.invoke("glVertexAttribDivisorARB", ofVoid(JAVA_INT, JAVA_INT)); - } +public interface GLARBInstancedArrays { + int GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB = 0x88FE; - public static void glVertexAttribDivisorARB(int index, int divisor) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribDivisorARB).invokeExact(index, divisor); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribDivisorARB(int index, int divisor) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBInternalformatQuery2.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBInternalformatQuery2.java index 28a501bc..72dc3581 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBInternalformatQuery2.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBInternalformatQuery2.java @@ -16,36 +16,32 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_internalformat_query2} */ -public final class GLARBInternalformatQuery2 { - public static final int GL_SRGB_DECODE_ARB = 0x8299; - public static final int GL_VIEW_CLASS_EAC_R11 = 0x9383; - public static final int GL_VIEW_CLASS_EAC_RG11 = 0x9384; - public static final int GL_VIEW_CLASS_ETC2_RGB = 0x9385; - public static final int GL_VIEW_CLASS_ETC2_RGBA = 0x9386; - public static final int GL_VIEW_CLASS_ETC2_EAC_RGBA = 0x9387; - public static final int GL_VIEW_CLASS_ASTC_4x4_RGBA = 0x9388; - public static final int GL_VIEW_CLASS_ASTC_5x4_RGBA = 0x9389; - public static final int GL_VIEW_CLASS_ASTC_5x5_RGBA = 0x938A; - public static final int GL_VIEW_CLASS_ASTC_6x5_RGBA = 0x938B; - public static final int GL_VIEW_CLASS_ASTC_6x6_RGBA = 0x938C; - public static final int GL_VIEW_CLASS_ASTC_8x5_RGBA = 0x938D; - public static final int GL_VIEW_CLASS_ASTC_8x6_RGBA = 0x938E; - public static final int GL_VIEW_CLASS_ASTC_8x8_RGBA = 0x938F; - public static final int GL_VIEW_CLASS_ASTC_10x5_RGBA = 0x9390; - public static final int GL_VIEW_CLASS_ASTC_10x6_RGBA = 0x9391; - public static final int GL_VIEW_CLASS_ASTC_10x8_RGBA = 0x9392; - public static final int GL_VIEW_CLASS_ASTC_10x10_RGBA = 0x9393; - public static final int GL_VIEW_CLASS_ASTC_12x10_RGBA = 0x9394; - public static final int GL_VIEW_CLASS_ASTC_12x12_RGBA = 0x9395; +public interface GLARBInternalformatQuery2 { + int GL_SRGB_DECODE_ARB = 0x8299; + int GL_VIEW_CLASS_EAC_R11 = 0x9383; + int GL_VIEW_CLASS_EAC_RG11 = 0x9384; + int GL_VIEW_CLASS_ETC2_RGB = 0x9385; + int GL_VIEW_CLASS_ETC2_RGBA = 0x9386; + int GL_VIEW_CLASS_ETC2_EAC_RGBA = 0x9387; + int GL_VIEW_CLASS_ASTC_4x4_RGBA = 0x9388; + int GL_VIEW_CLASS_ASTC_5x4_RGBA = 0x9389; + int GL_VIEW_CLASS_ASTC_5x5_RGBA = 0x938A; + int GL_VIEW_CLASS_ASTC_6x5_RGBA = 0x938B; + int GL_VIEW_CLASS_ASTC_6x6_RGBA = 0x938C; + int GL_VIEW_CLASS_ASTC_8x5_RGBA = 0x938D; + int GL_VIEW_CLASS_ASTC_8x6_RGBA = 0x938E; + int GL_VIEW_CLASS_ASTC_8x8_RGBA = 0x938F; + int GL_VIEW_CLASS_ASTC_10x5_RGBA = 0x9390; + int GL_VIEW_CLASS_ASTC_10x6_RGBA = 0x9391; + int GL_VIEW_CLASS_ASTC_10x8_RGBA = 0x9392; + int GL_VIEW_CLASS_ASTC_10x10_RGBA = 0x9393; + int GL_VIEW_CLASS_ASTC_12x10_RGBA = 0x9394; + int GL_VIEW_CLASS_ASTC_12x12_RGBA = 0x9395; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBMatrixPalette.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBMatrixPalette.java index 4ec72c5d..f5f9895e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBMatrixPalette.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBMatrixPalette.java @@ -16,70 +16,43 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_matrix_palette} */ -public final class GLARBMatrixPalette { - public static final int GL_MATRIX_PALETTE_ARB = 0x8840; - public static final int GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB = 0x8841; - public static final int GL_MAX_PALETTE_MATRICES_ARB = 0x8842; - public static final int GL_CURRENT_PALETTE_MATRIX_ARB = 0x8843; - public static final int GL_MATRIX_INDEX_ARRAY_ARB = 0x8844; - public static final int GL_CURRENT_MATRIX_INDEX_ARB = 0x8845; - public static final int GL_MATRIX_INDEX_ARRAY_SIZE_ARB = 0x8846; - public static final int GL_MATRIX_INDEX_ARRAY_TYPE_ARB = 0x8847; - public static final int GL_MATRIX_INDEX_ARRAY_STRIDE_ARB = 0x8848; - public static final int GL_MATRIX_INDEX_ARRAY_POINTER_ARB = 0x8849; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_matrix_palette) return; - ext.glCurrentPaletteMatrixARB = load.invoke("glCurrentPaletteMatrixARB", ofVoid(JAVA_INT)); - ext.glMatrixIndexubvARB = load.invoke("glMatrixIndexubvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glMatrixIndexusvARB = load.invoke("glMatrixIndexusvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glMatrixIndexuivARB = load.invoke("glMatrixIndexuivARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glMatrixIndexPointerARB = load.invoke("glMatrixIndexPointerARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static void glCurrentPaletteMatrixARB(int index) { - final var ext = getExtCapabilities(); - try { - check(ext.glCurrentPaletteMatrixARB).invokeExact(index); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLARBMatrixPalette { + int GL_MATRIX_PALETTE_ARB = 0x8840; + int GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB = 0x8841; + int GL_MAX_PALETTE_MATRICES_ARB = 0x8842; + int GL_CURRENT_PALETTE_MATRIX_ARB = 0x8843; + int GL_MATRIX_INDEX_ARRAY_ARB = 0x8844; + int GL_CURRENT_MATRIX_INDEX_ARB = 0x8845; + int GL_MATRIX_INDEX_ARRAY_SIZE_ARB = 0x8846; + int GL_MATRIX_INDEX_ARRAY_TYPE_ARB = 0x8847; + int GL_MATRIX_INDEX_ARRAY_STRIDE_ARB = 0x8848; + int GL_MATRIX_INDEX_ARRAY_POINTER_ARB = 0x8849; + + default void glCurrentPaletteMatrixARB(int index) { + throw new ContextException(); } - public static void glMatrixIndexubvARB(int size, @NativeType("const GLubyte *") MemorySegment indices) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixIndexubvARB).invokeExact(size, indices); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMatrixIndexubvARB(int size, @NativeType("const GLubyte *") MemorySegment indices) { + throw new ContextException(); } - public static void glMatrixIndexusvARB(int size, @NativeType("const GLushort *") MemorySegment indices) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixIndexusvARB).invokeExact(size, indices); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMatrixIndexusvARB(int size, @NativeType("const GLushort *") MemorySegment indices) { + throw new ContextException(); } - public static void glMatrixIndexuivARB(int size, @NativeType("const GLuint *") MemorySegment indices) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixIndexuivARB).invokeExact(size, indices); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMatrixIndexuivARB(int size, @NativeType("const GLuint *") MemorySegment indices) { + throw new ContextException(); } - public static void glMatrixIndexPointerARB(int size, int type, int stride, @NativeType("const void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixIndexPointerARB).invokeExact(size, type, stride, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMatrixIndexPointerARB(int size, int type, int stride, @NativeType("const void *") MemorySegment pointer) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBMultisample.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBMultisample.java index 7307e93e..c018b261 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBMultisample.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBMultisample.java @@ -16,37 +16,26 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_multisample} */ -public final class GLARBMultisample { - public static final int GL_MULTISAMPLE_ARB = 0x809D; - public static final int GL_SAMPLE_ALPHA_TO_COVERAGE_ARB = 0x809E; - public static final int GL_SAMPLE_ALPHA_TO_ONE_ARB = 0x809F; - public static final int GL_SAMPLE_COVERAGE_ARB = 0x80A0; - public static final int GL_SAMPLE_BUFFERS_ARB = 0x80A8; - public static final int GL_SAMPLES_ARB = 0x80A9; - public static final int GL_SAMPLE_COVERAGE_VALUE_ARB = 0x80AA; - public static final int GL_SAMPLE_COVERAGE_INVERT_ARB = 0x80AB; - public static final int GL_MULTISAMPLE_BIT_ARB = 0x20000000; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_multisample) return; - ext.glSampleCoverageARB = load.invoke("glSampleCoverageARB", ofVoid(JAVA_FLOAT, JAVA_BYTE)); - } +public interface GLARBMultisample { + int GL_MULTISAMPLE_ARB = 0x809D; + int GL_SAMPLE_ALPHA_TO_COVERAGE_ARB = 0x809E; + int GL_SAMPLE_ALPHA_TO_ONE_ARB = 0x809F; + int GL_SAMPLE_COVERAGE_ARB = 0x80A0; + int GL_SAMPLE_BUFFERS_ARB = 0x80A8; + int GL_SAMPLES_ARB = 0x80A9; + int GL_SAMPLE_COVERAGE_VALUE_ARB = 0x80AA; + int GL_SAMPLE_COVERAGE_INVERT_ARB = 0x80AB; + int GL_MULTISAMPLE_BIT_ARB = 0x20000000; - public static void glSampleCoverageARB(float value, boolean invert) { - final var ext = getExtCapabilities(); - try { - check(ext.glSampleCoverageARB).invokeExact(value, invert); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSampleCoverageARB(float value, boolean invert) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBMultitexture.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBMultitexture.java index 95ddf7fb..c37b1e30 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBMultitexture.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBMultitexture.java @@ -16,327 +16,184 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_multitexture} */ -public final class GLARBMultitexture { - public static final int GL_TEXTURE0_ARB = 0x84C0; - public static final int GL_TEXTURE1_ARB = 0x84C1; - public static final int GL_TEXTURE2_ARB = 0x84C2; - public static final int GL_TEXTURE3_ARB = 0x84C3; - public static final int GL_TEXTURE4_ARB = 0x84C4; - public static final int GL_TEXTURE5_ARB = 0x84C5; - public static final int GL_TEXTURE6_ARB = 0x84C6; - public static final int GL_TEXTURE7_ARB = 0x84C7; - public static final int GL_TEXTURE8_ARB = 0x84C8; - public static final int GL_TEXTURE9_ARB = 0x84C9; - public static final int GL_TEXTURE10_ARB = 0x84CA; - public static final int GL_TEXTURE11_ARB = 0x84CB; - public static final int GL_TEXTURE12_ARB = 0x84CC; - public static final int GL_TEXTURE13_ARB = 0x84CD; - public static final int GL_TEXTURE14_ARB = 0x84CE; - public static final int GL_TEXTURE15_ARB = 0x84CF; - public static final int GL_TEXTURE16_ARB = 0x84D0; - public static final int GL_TEXTURE17_ARB = 0x84D1; - public static final int GL_TEXTURE18_ARB = 0x84D2; - public static final int GL_TEXTURE19_ARB = 0x84D3; - public static final int GL_TEXTURE20_ARB = 0x84D4; - public static final int GL_TEXTURE21_ARB = 0x84D5; - public static final int GL_TEXTURE22_ARB = 0x84D6; - public static final int GL_TEXTURE23_ARB = 0x84D7; - public static final int GL_TEXTURE24_ARB = 0x84D8; - public static final int GL_TEXTURE25_ARB = 0x84D9; - public static final int GL_TEXTURE26_ARB = 0x84DA; - public static final int GL_TEXTURE27_ARB = 0x84DB; - public static final int GL_TEXTURE28_ARB = 0x84DC; - public static final int GL_TEXTURE29_ARB = 0x84DD; - public static final int GL_TEXTURE30_ARB = 0x84DE; - public static final int GL_TEXTURE31_ARB = 0x84DF; - public static final int GL_ACTIVE_TEXTURE_ARB = 0x84E0; - public static final int GL_CLIENT_ACTIVE_TEXTURE_ARB = 0x84E1; - public static final int GL_MAX_TEXTURE_UNITS_ARB = 0x84E2; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_multitexture) return; - ext.glActiveTextureARB = load.invoke("glActiveTextureARB", ofVoid(JAVA_INT)); - ext.glClientActiveTextureARB = load.invoke("glClientActiveTextureARB", ofVoid(JAVA_INT)); - ext.glMultiTexCoord1dARB = load.invoke("glMultiTexCoord1dARB", ofVoid(JAVA_INT, JAVA_DOUBLE)); - ext.glMultiTexCoord1dvARB = load.invoke("glMultiTexCoord1dvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord1fARB = load.invoke("glMultiTexCoord1fARB", ofVoid(JAVA_INT, JAVA_FLOAT)); - ext.glMultiTexCoord1fvARB = load.invoke("glMultiTexCoord1fvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord1iARB = load.invoke("glMultiTexCoord1iARB", ofVoid(JAVA_INT, JAVA_INT)); - ext.glMultiTexCoord1ivARB = load.invoke("glMultiTexCoord1ivARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord1sARB = load.invoke("glMultiTexCoord1sARB", ofVoid(JAVA_INT, JAVA_SHORT)); - ext.glMultiTexCoord1svARB = load.invoke("glMultiTexCoord1svARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord2dARB = load.invoke("glMultiTexCoord2dARB", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glMultiTexCoord2dvARB = load.invoke("glMultiTexCoord2dvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord2fARB = load.invoke("glMultiTexCoord2fARB", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glMultiTexCoord2fvARB = load.invoke("glMultiTexCoord2fvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord2iARB = load.invoke("glMultiTexCoord2iARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMultiTexCoord2ivARB = load.invoke("glMultiTexCoord2ivARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord2sARB = load.invoke("glMultiTexCoord2sARB", ofVoid(JAVA_INT, JAVA_SHORT, JAVA_SHORT)); - ext.glMultiTexCoord2svARB = load.invoke("glMultiTexCoord2svARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord3dARB = load.invoke("glMultiTexCoord3dARB", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glMultiTexCoord3dvARB = load.invoke("glMultiTexCoord3dvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord3fARB = load.invoke("glMultiTexCoord3fARB", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glMultiTexCoord3fvARB = load.invoke("glMultiTexCoord3fvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord3iARB = load.invoke("glMultiTexCoord3iARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMultiTexCoord3ivARB = load.invoke("glMultiTexCoord3ivARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord3sARB = load.invoke("glMultiTexCoord3sARB", ofVoid(JAVA_INT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glMultiTexCoord3svARB = load.invoke("glMultiTexCoord3svARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord4dARB = load.invoke("glMultiTexCoord4dARB", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glMultiTexCoord4dvARB = load.invoke("glMultiTexCoord4dvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord4fARB = load.invoke("glMultiTexCoord4fARB", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glMultiTexCoord4fvARB = load.invoke("glMultiTexCoord4fvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord4iARB = load.invoke("glMultiTexCoord4iARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMultiTexCoord4ivARB = load.invoke("glMultiTexCoord4ivARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord4sARB = load.invoke("glMultiTexCoord4sARB", ofVoid(JAVA_INT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glMultiTexCoord4svARB = load.invoke("glMultiTexCoord4svARB", ofVoid(JAVA_INT, ADDRESS)); - } - - public static void glActiveTextureARB(int texture) { - final var ext = getExtCapabilities(); - try { - check(ext.glActiveTextureARB).invokeExact(texture); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glClientActiveTextureARB(int texture) { - final var ext = getExtCapabilities(); - try { - check(ext.glClientActiveTextureARB).invokeExact(texture); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMultiTexCoord1dARB(int target, double s) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord1dARB).invokeExact(target, s); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMultiTexCoord1dvARB(int target, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord1dvARB).invokeExact(target, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMultiTexCoord1fARB(int target, float s) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord1fARB).invokeExact(target, s); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMultiTexCoord1fvARB(int target, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord1fvARB).invokeExact(target, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMultiTexCoord1iARB(int target, int s) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord1iARB).invokeExact(target, s); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMultiTexCoord1ivARB(int target, @NativeType("const GLint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord1ivARB).invokeExact(target, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMultiTexCoord1sARB(int target, short s) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord1sARB).invokeExact(target, s); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMultiTexCoord1svARB(int target, @NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord1svARB).invokeExact(target, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLARBMultitexture { + int GL_TEXTURE0_ARB = 0x84C0; + int GL_TEXTURE1_ARB = 0x84C1; + int GL_TEXTURE2_ARB = 0x84C2; + int GL_TEXTURE3_ARB = 0x84C3; + int GL_TEXTURE4_ARB = 0x84C4; + int GL_TEXTURE5_ARB = 0x84C5; + int GL_TEXTURE6_ARB = 0x84C6; + int GL_TEXTURE7_ARB = 0x84C7; + int GL_TEXTURE8_ARB = 0x84C8; + int GL_TEXTURE9_ARB = 0x84C9; + int GL_TEXTURE10_ARB = 0x84CA; + int GL_TEXTURE11_ARB = 0x84CB; + int GL_TEXTURE12_ARB = 0x84CC; + int GL_TEXTURE13_ARB = 0x84CD; + int GL_TEXTURE14_ARB = 0x84CE; + int GL_TEXTURE15_ARB = 0x84CF; + int GL_TEXTURE16_ARB = 0x84D0; + int GL_TEXTURE17_ARB = 0x84D1; + int GL_TEXTURE18_ARB = 0x84D2; + int GL_TEXTURE19_ARB = 0x84D3; + int GL_TEXTURE20_ARB = 0x84D4; + int GL_TEXTURE21_ARB = 0x84D5; + int GL_TEXTURE22_ARB = 0x84D6; + int GL_TEXTURE23_ARB = 0x84D7; + int GL_TEXTURE24_ARB = 0x84D8; + int GL_TEXTURE25_ARB = 0x84D9; + int GL_TEXTURE26_ARB = 0x84DA; + int GL_TEXTURE27_ARB = 0x84DB; + int GL_TEXTURE28_ARB = 0x84DC; + int GL_TEXTURE29_ARB = 0x84DD; + int GL_TEXTURE30_ARB = 0x84DE; + int GL_TEXTURE31_ARB = 0x84DF; + int GL_ACTIVE_TEXTURE_ARB = 0x84E0; + int GL_CLIENT_ACTIVE_TEXTURE_ARB = 0x84E1; + int GL_MAX_TEXTURE_UNITS_ARB = 0x84E2; + + default void glActiveTextureARB(int texture) { + throw new ContextException(); + } + + default void glClientActiveTextureARB(int texture) { + throw new ContextException(); + } + + default void glMultiTexCoord1dARB(int target, double s) { + throw new ContextException(); + } + + default void glMultiTexCoord1dvARB(int target, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); + } + + default void glMultiTexCoord1fARB(int target, float s) { + throw new ContextException(); + } + + default void glMultiTexCoord1fvARB(int target, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); + } + + default void glMultiTexCoord1iARB(int target, int s) { + throw new ContextException(); + } + + default void glMultiTexCoord1ivARB(int target, @NativeType("const GLint *") MemorySegment v) { + throw new ContextException(); + } + + default void glMultiTexCoord1sARB(int target, short s) { + throw new ContextException(); + } + + default void glMultiTexCoord1svARB(int target, @NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } - public static void glMultiTexCoord2dARB(int target, double s, double t) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord2dARB).invokeExact(target, s, t); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord2dARB(int target, double s, double t) { + throw new ContextException(); } - public static void glMultiTexCoord2dvARB(int target, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord2dvARB).invokeExact(target, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord2dvARB(int target, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glMultiTexCoord2fARB(int target, float s, float t) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord2fARB).invokeExact(target, s, t); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord2fARB(int target, float s, float t) { + throw new ContextException(); } - public static void glMultiTexCoord2fvARB(int target, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord2fvARB).invokeExact(target, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord2fvARB(int target, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glMultiTexCoord2iARB(int target, int s, int t) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord2iARB).invokeExact(target, s, t); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord2iARB(int target, int s, int t) { + throw new ContextException(); } - public static void glMultiTexCoord2ivARB(int target, @NativeType("const GLint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord2ivARB).invokeExact(target, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord2ivARB(int target, @NativeType("const GLint *") MemorySegment v) { + throw new ContextException(); } - public static void glMultiTexCoord2sARB(int target, short s, short t) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord2sARB).invokeExact(target, s, t); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord2sARB(int target, short s, short t) { + throw new ContextException(); } - public static void glMultiTexCoord2svARB(int target, @NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord2svARB).invokeExact(target, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord2svARB(int target, @NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } - public static void glMultiTexCoord3dARB(int target, double s, double t, double r) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord3dARB).invokeExact(target, s, t, r); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord3dARB(int target, double s, double t, double r) { + throw new ContextException(); } - public static void glMultiTexCoord3dvARB(int target, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord3dvARB).invokeExact(target, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord3dvARB(int target, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glMultiTexCoord3fARB(int target, float s, float t, float r) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord3fARB).invokeExact(target, s, t, r); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord3fARB(int target, float s, float t, float r) { + throw new ContextException(); } - public static void glMultiTexCoord3fvARB(int target, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord3fvARB).invokeExact(target, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord3fvARB(int target, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glMultiTexCoord3iARB(int target, int s, int t, int r) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord3iARB).invokeExact(target, s, t, r); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord3iARB(int target, int s, int t, int r) { + throw new ContextException(); } - public static void glMultiTexCoord3ivARB(int target, @NativeType("const GLint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord3ivARB).invokeExact(target, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord3ivARB(int target, @NativeType("const GLint *") MemorySegment v) { + throw new ContextException(); } - public static void glMultiTexCoord3sARB(int target, short s, short t, short r) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord3sARB).invokeExact(target, s, t, r); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord3sARB(int target, short s, short t, short r) { + throw new ContextException(); } - public static void glMultiTexCoord3svARB(int target, @NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord3svARB).invokeExact(target, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord3svARB(int target, @NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } - public static void glMultiTexCoord4dARB(int target, double s, double t, double r, double q) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord4dARB).invokeExact(target, s, t, r, q); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord4dARB(int target, double s, double t, double r, double q) { + throw new ContextException(); } - public static void glMultiTexCoord4dvARB(int target, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord4dvARB).invokeExact(target, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord4dvARB(int target, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glMultiTexCoord4fARB(int target, float s, float t, float r, float q) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord4fARB).invokeExact(target, s, t, r, q); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord4fARB(int target, float s, float t, float r, float q) { + throw new ContextException(); } - public static void glMultiTexCoord4fvARB(int target, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord4fvARB).invokeExact(target, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord4fvARB(int target, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glMultiTexCoord4iARB(int target, int s, int t, int r, int q) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord4iARB).invokeExact(target, s, t, r, q); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord4iARB(int target, int s, int t, int r, int q) { + throw new ContextException(); } - public static void glMultiTexCoord4ivARB(int target, @NativeType("const GLint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord4ivARB).invokeExact(target, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord4ivARB(int target, @NativeType("const GLint *") MemorySegment v) { + throw new ContextException(); } - public static void glMultiTexCoord4sARB(int target, short s, short t, short r, short q) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord4sARB).invokeExact(target, s, t, r, q); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord4sARB(int target, short s, short t, short r, short q) { + throw new ContextException(); } - public static void glMultiTexCoord4svARB(int target, @NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord4svARB).invokeExact(target, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord4svARB(int target, @NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBOcclusionQuery.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBOcclusionQuery.java index 1d388905..140562ff 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBOcclusionQuery.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBOcclusionQuery.java @@ -16,90 +16,50 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_occlusion_query} */ -public final class GLARBOcclusionQuery { - public static final int GL_QUERY_COUNTER_BITS_ARB = 0x8864; - public static final int GL_CURRENT_QUERY_ARB = 0x8865; - public static final int GL_QUERY_RESULT_ARB = 0x8866; - public static final int GL_QUERY_RESULT_AVAILABLE_ARB = 0x8867; - public static final int GL_SAMPLES_PASSED_ARB = 0x8914; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_occlusion_query) return; - ext.glGenQueriesARB = load.invoke("glGenQueriesARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glDeleteQueriesARB = load.invoke("glDeleteQueriesARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glIsQueryARB = load.invoke("glIsQueryARB", of(JAVA_BYTE, JAVA_INT)); - ext.glBeginQueryARB = load.invoke("glBeginQueryARB", ofVoid(JAVA_INT, JAVA_INT)); - ext.glEndQueryARB = load.invoke("glEndQueryARB", ofVoid(JAVA_INT)); - ext.glGetQueryivARB = load.invoke("glGetQueryivARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetQueryObjectivARB = load.invoke("glGetQueryObjectivARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetQueryObjectuivARB = load.invoke("glGetQueryObjectuivARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLARBOcclusionQuery { + int GL_QUERY_COUNTER_BITS_ARB = 0x8864; + int GL_CURRENT_QUERY_ARB = 0x8865; + int GL_QUERY_RESULT_ARB = 0x8866; + int GL_QUERY_RESULT_AVAILABLE_ARB = 0x8867; + int GL_SAMPLES_PASSED_ARB = 0x8914; - public static void glGenQueriesARB(int n, @NativeType("GLuint *") MemorySegment ids) { - final var ext = getExtCapabilities(); - try { - check(ext.glGenQueriesARB).invokeExact(n, ids); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGenQueriesARB(int n, @NativeType("GLuint *") MemorySegment ids) { + throw new ContextException(); } - public static void glDeleteQueriesARB(int n, @NativeType("const GLuint *") MemorySegment ids) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteQueriesARB).invokeExact(n, ids); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDeleteQueriesARB(int n, @NativeType("const GLuint *") MemorySegment ids) { + throw new ContextException(); } - public static boolean glIsQueryARB(int id) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsQueryARB).invokeExact(id); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsQueryARB(int id) { + throw new ContextException(); } - public static void glBeginQueryARB(int target, int id) { - final var ext = getExtCapabilities(); - try { - check(ext.glBeginQueryARB).invokeExact(target, id); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBeginQueryARB(int target, int id) { + throw new ContextException(); } - public static void glEndQueryARB(int target) { - final var ext = getExtCapabilities(); - try { - check(ext.glEndQueryARB).invokeExact(target); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEndQueryARB(int target) { + throw new ContextException(); } - public static void glGetQueryivARB(int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetQueryivARB).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetQueryivARB(int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetQueryObjectivARB(int id, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetQueryObjectivARB).invokeExact(id, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetQueryObjectivARB(int id, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetQueryObjectuivARB(int id, int pname, @NativeType("GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetQueryObjectuivARB).invokeExact(id, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetQueryObjectuivARB(int id, int pname, @NativeType("GLuint *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBParallelShaderCompile.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBParallelShaderCompile.java index e244de40..41869a4e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBParallelShaderCompile.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBParallelShaderCompile.java @@ -16,30 +16,19 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_parallel_shader_compile} */ -public final class GLARBParallelShaderCompile { - public static final int GL_MAX_SHADER_COMPILER_THREADS_ARB = 0x91B0; - public static final int GL_COMPLETION_STATUS_ARB = 0x91B1; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_parallel_shader_compile) return; - ext.glMaxShaderCompilerThreadsARB = load.invoke("glMaxShaderCompilerThreadsARB", ofVoid(JAVA_INT)); - } +public interface GLARBParallelShaderCompile { + int GL_MAX_SHADER_COMPILER_THREADS_ARB = 0x91B0; + int GL_COMPLETION_STATUS_ARB = 0x91B1; - public static void glMaxShaderCompilerThreadsARB(int count) { - final var ext = getExtCapabilities(); - try { - check(ext.glMaxShaderCompilerThreadsARB).invokeExact(count); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMaxShaderCompilerThreadsARB(int count) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBPipelineStatisticsQuery.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBPipelineStatisticsQuery.java index 90f8d82b..4649cf71 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBPipelineStatisticsQuery.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBPipelineStatisticsQuery.java @@ -16,26 +16,22 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_pipeline_statistics_query} */ -public final class GLARBPipelineStatisticsQuery { - public static final int GL_VERTICES_SUBMITTED_ARB = 0x82EE; - public static final int GL_PRIMITIVES_SUBMITTED_ARB = 0x82EF; - public static final int GL_VERTEX_SHADER_INVOCATIONS_ARB = 0x82F0; - public static final int GL_TESS_CONTROL_SHADER_PATCHES_ARB = 0x82F1; - public static final int GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB = 0x82F2; - public static final int GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB = 0x82F3; - public static final int GL_FRAGMENT_SHADER_INVOCATIONS_ARB = 0x82F4; - public static final int GL_COMPUTE_SHADER_INVOCATIONS_ARB = 0x82F5; - public static final int GL_CLIPPING_INPUT_PRIMITIVES_ARB = 0x82F6; - public static final int GL_CLIPPING_OUTPUT_PRIMITIVES_ARB = 0x82F7; +public interface GLARBPipelineStatisticsQuery { + int GL_VERTICES_SUBMITTED_ARB = 0x82EE; + int GL_PRIMITIVES_SUBMITTED_ARB = 0x82EF; + int GL_VERTEX_SHADER_INVOCATIONS_ARB = 0x82F0; + int GL_TESS_CONTROL_SHADER_PATCHES_ARB = 0x82F1; + int GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB = 0x82F2; + int GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB = 0x82F3; + int GL_FRAGMENT_SHADER_INVOCATIONS_ARB = 0x82F4; + int GL_COMPUTE_SHADER_INVOCATIONS_ARB = 0x82F5; + int GL_CLIPPING_INPUT_PRIMITIVES_ARB = 0x82F6; + int GL_CLIPPING_OUTPUT_PRIMITIVES_ARB = 0x82F7; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBPixelBufferObject.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBPixelBufferObject.java index 3a9331ec..219b4893 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBPixelBufferObject.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBPixelBufferObject.java @@ -16,20 +16,16 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_pixel_buffer_object} */ -public final class GLARBPixelBufferObject { - public static final int GL_PIXEL_PACK_BUFFER_ARB = 0x88EB; - public static final int GL_PIXEL_UNPACK_BUFFER_ARB = 0x88EC; - public static final int GL_PIXEL_PACK_BUFFER_BINDING_ARB = 0x88ED; - public static final int GL_PIXEL_UNPACK_BUFFER_BINDING_ARB = 0x88EF; +public interface GLARBPixelBufferObject { + int GL_PIXEL_PACK_BUFFER_ARB = 0x88EB; + int GL_PIXEL_UNPACK_BUFFER_ARB = 0x88EC; + int GL_PIXEL_PACK_BUFFER_BINDING_ARB = 0x88ED; + int GL_PIXEL_UNPACK_BUFFER_BINDING_ARB = 0x88EF; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBPointParameters.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBPointParameters.java index e4ca8279..e94d5f92 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBPointParameters.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBPointParameters.java @@ -16,40 +16,25 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_point_parameters} */ -public final class GLARBPointParameters { - public static final int GL_POINT_SIZE_MIN_ARB = 0x8126; - public static final int GL_POINT_SIZE_MAX_ARB = 0x8127; - public static final int GL_POINT_FADE_THRESHOLD_SIZE_ARB = 0x8128; - public static final int GL_POINT_DISTANCE_ATTENUATION_ARB = 0x8129; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_point_parameters) return; - ext.glPointParameterfARB = load.invoke("glPointParameterfARB", ofVoid(JAVA_INT, JAVA_FLOAT)); - ext.glPointParameterfvARB = load.invoke("glPointParameterfvARB", ofVoid(JAVA_INT, ADDRESS)); - } +public interface GLARBPointParameters { + int GL_POINT_SIZE_MIN_ARB = 0x8126; + int GL_POINT_SIZE_MAX_ARB = 0x8127; + int GL_POINT_FADE_THRESHOLD_SIZE_ARB = 0x8128; + int GL_POINT_DISTANCE_ATTENUATION_ARB = 0x8129; - public static void glPointParameterfARB(int pname, float param) { - final var ext = getExtCapabilities(); - try { - check(ext.glPointParameterfARB).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPointParameterfARB(int pname, float param) { + throw new ContextException(); } - public static void glPointParameterfvARB(int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glPointParameterfvARB).invokeExact(pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPointParameterfvARB(int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBPointSprite.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBPointSprite.java index 3b6bbf3d..daad528e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBPointSprite.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBPointSprite.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_point_sprite} */ -public final class GLARBPointSprite { - public static final int GL_POINT_SPRITE_ARB = 0x8861; - public static final int GL_COORD_REPLACE_ARB = 0x8862; +public interface GLARBPointSprite { + int GL_POINT_SPRITE_ARB = 0x8861; + int GL_COORD_REPLACE_ARB = 0x8862; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBRobustness.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBRobustness.java index 47efb739..39cd6876 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBRobustness.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBRobustness.java @@ -16,92 +16,52 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_robustness} */ -public final class GLARBRobustness { - public static final int GL_NO_RESET_NOTIFICATION_ARB = 0x8261; - public static final int GL_RESET_NOTIFICATION_STRATEGY_ARB = 0x8256; - public static final int GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB = 0x00000004; - public static final int GL_UNKNOWN_CONTEXT_RESET_ARB = 0x8255; - public static final int GL_LOSE_CONTEXT_ON_RESET_ARB = 0x8252; - public static final int GL_INNOCENT_CONTEXT_RESET_ARB = 0x8254; - public static final int GL_GUILTY_CONTEXT_RESET_ARB = 0x8253; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_robustness) return; - ext.glGetGraphicsResetStatusARB = load.invoke("glGetGraphicsResetStatusARB", of(JAVA_INT)); - ext.glGetnCompressedTexImageARB = load.invoke("glGetnCompressedTexImageARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetnTexImageARB = load.invoke("glGetnTexImageARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetnUniformdvARB = load.invoke("glGetnUniformdvARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetnUniformfvARB = load.invoke("glGetnUniformfvARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetnUniformivARB = load.invoke("glGetnUniformivARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetnUniformuivARB = load.invoke("glGetnUniformuivARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glReadnPixelsARB = load.invoke("glReadnPixelsARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLARBRobustness { + int GL_NO_RESET_NOTIFICATION_ARB = 0x8261; + int GL_RESET_NOTIFICATION_STRATEGY_ARB = 0x8256; + int GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB = 0x00000004; + int GL_UNKNOWN_CONTEXT_RESET_ARB = 0x8255; + int GL_LOSE_CONTEXT_ON_RESET_ARB = 0x8252; + int GL_INNOCENT_CONTEXT_RESET_ARB = 0x8254; + int GL_GUILTY_CONTEXT_RESET_ARB = 0x8253; - public static int glGetGraphicsResetStatusARB() { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glGetGraphicsResetStatusARB).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glGetGraphicsResetStatusARB() { + throw new ContextException(); } - public static void glGetnCompressedTexImageARB(int target, int lod, int bufSize, @NativeType("void*") MemorySegment img) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetnCompressedTexImageARB).invokeExact(target, lod, bufSize, img); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetnCompressedTexImageARB(int target, int lod, int bufSize, @NativeType("void*") MemorySegment img) { + throw new ContextException(); } - public static void glGetnTexImageARB(int target, int level, int format, int type, int bufSize, @NativeType("void*") MemorySegment img) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetnTexImageARB).invokeExact(target, level, format, type, bufSize, img); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetnTexImageARB(int target, int level, int format, int type, int bufSize, @NativeType("void*") MemorySegment img) { + throw new ContextException(); } - public static void glGetnUniformdvARB(int program, int location, int bufSize, @NativeType("GLdouble*") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetnUniformdvARB).invokeExact(program, location, bufSize, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetnUniformdvARB(int program, int location, int bufSize, @NativeType("GLdouble*") MemorySegment params) { + throw new ContextException(); } - public static void glGetnUniformfvARB(int program, int location, int bufSize, @NativeType("GLfloat*") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetnUniformfvARB).invokeExact(program, location, bufSize, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetnUniformfvARB(int program, int location, int bufSize, @NativeType("GLfloat*") MemorySegment params) { + throw new ContextException(); } - public static void glGetnUniformivARB(int program, int location, int bufSize, @NativeType("GLint*") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetnUniformivARB).invokeExact(program, location, bufSize, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetnUniformivARB(int program, int location, int bufSize, @NativeType("GLint*") MemorySegment params) { + throw new ContextException(); } - public static void glGetnUniformuivARB(int program, int location, int bufSize, @NativeType("GLuint*") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetnUniformuivARB).invokeExact(program, location, bufSize, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetnUniformuivARB(int program, int location, int bufSize, @NativeType("GLuint*") MemorySegment params) { + throw new ContextException(); } - public static void glReadnPixelsARB(int x, int y, int width, int height, int format, int type, int bufSize, @NativeType("void*") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glReadnPixelsARB).invokeExact(x, y, width, height, format, type, bufSize, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReadnPixelsARB(int x, int y, int width, int height, int format, int type, int bufSize, @NativeType("void*") MemorySegment data) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBSampleLocations.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBSampleLocations.java index f1059e61..8c893a5e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBSampleLocations.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBSampleLocations.java @@ -16,52 +16,33 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_sample_locations} */ -public final class GLARBSampleLocations { - public static final int GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB = 0x933D; - public static final int GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB = 0x933E; - public static final int GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB = 0x933F; - public static final int GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB = 0x9340; - public static final int GL_SAMPLE_LOCATION_ARB = 0x8E50; - public static final int GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB = 0x9341; - public static final int GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB = 0x9342; - public static final int GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB = 0x9343; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_sample_locations) return; - ext.glEvaluateDepthValuesARB = load.invoke("glEvaluateDepthValuesARB", ofVoid()); - ext.glFramebufferSampleLocationsfvARB = load.invoke("glFramebufferSampleLocationsfvARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glNamedFramebufferSampleLocationsfvARB = load.invoke("glNamedFramebufferSampleLocationsfvARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLARBSampleLocations { + int GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB = 0x933D; + int GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB = 0x933E; + int GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB = 0x933F; + int GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB = 0x9340; + int GL_SAMPLE_LOCATION_ARB = 0x8E50; + int GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB = 0x9341; + int GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB = 0x9342; + int GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB = 0x9343; - public static void glEvaluateDepthValuesARB() { - final var ext = getExtCapabilities(); - try { - check(ext.glEvaluateDepthValuesARB).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEvaluateDepthValuesARB() { + throw new ContextException(); } - public static void glFramebufferSampleLocationsfvARB(int target, int start, int count, @NativeType("const GLfloat *v") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glFramebufferSampleLocationsfvARB).invokeExact(target, start, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFramebufferSampleLocationsfvARB(int target, int start, int count, @NativeType("const GLfloat *v") MemorySegment v) { + throw new ContextException(); } - public static void glNamedFramebufferSampleLocationsfvARB(int framebuffer, int start, int count, @NativeType("const GLfloat *v") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedFramebufferSampleLocationsfvARB).invokeExact(framebuffer, start, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedFramebufferSampleLocationsfvARB(int framebuffer, int start, int count, @NativeType("const GLfloat *v") MemorySegment v) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBSampleShading.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBSampleShading.java index 2ce7f94a..1f7f9f88 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBSampleShading.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBSampleShading.java @@ -16,30 +16,19 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_sample_shading} */ -public final class GLARBSampleShading { - public static final int GL_SAMPLE_SHADING_ARB = 0x8C36; - public static final int GL_MIN_SAMPLE_SHADING_VALUE_ARB = 0x8C37; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_sample_shading) return; - ext.glMinSampleShadingARB = load.invoke("glMinSampleShadingARB", ofVoid(JAVA_FLOAT)); - } +public interface GLARBSampleShading { + int GL_SAMPLE_SHADING_ARB = 0x8C36; + int GL_MIN_SAMPLE_SHADING_VALUE_ARB = 0x8C37; - public static void glMinSampleShadingARB(float value) { - final var ext = getExtCapabilities(); - try { - check(ext.glMinSampleShadingARB).invokeExact(value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMinSampleShadingARB(float value) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBShaderObjects.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBShaderObjects.java index 4f0c6ebd..ccea15ae 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBShaderObjects.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBShaderObjects.java @@ -16,370 +16,203 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_shader_objects} */ -public final class GLARBShaderObjects { - public static final int GL_PROGRAM_OBJECT_ARB = 0x8B40; - public static final int GL_SHADER_OBJECT_ARB = 0x8B48; - public static final int GL_OBJECT_TYPE_ARB = 0x8B4E; - public static final int GL_OBJECT_SUBTYPE_ARB = 0x8B4F; - public static final int GL_FLOAT_VEC2_ARB = 0x8B50; - public static final int GL_FLOAT_VEC3_ARB = 0x8B51; - public static final int GL_FLOAT_VEC4_ARB = 0x8B52; - public static final int GL_INT_VEC2_ARB = 0x8B53; - public static final int GL_INT_VEC3_ARB = 0x8B54; - public static final int GL_INT_VEC4_ARB = 0x8B55; - public static final int GL_BOOL_ARB = 0x8B56; - public static final int GL_BOOL_VEC2_ARB = 0x8B57; - public static final int GL_BOOL_VEC3_ARB = 0x8B58; - public static final int GL_BOOL_VEC4_ARB = 0x8B59; - public static final int GL_FLOAT_MAT2_ARB = 0x8B5A; - public static final int GL_FLOAT_MAT3_ARB = 0x8B5B; - public static final int GL_FLOAT_MAT4_ARB = 0x8B5C; - public static final int GL_SAMPLER_1D_ARB = 0x8B5D; - public static final int GL_SAMPLER_2D_ARB = 0x8B5E; - public static final int GL_SAMPLER_3D_ARB = 0x8B5F; - public static final int GL_SAMPLER_CUBE_ARB = 0x8B60; - public static final int GL_SAMPLER_1D_SHADOW_ARB = 0x8B61; - public static final int GL_SAMPLER_2D_SHADOW_ARB = 0x8B62; - public static final int GL_SAMPLER_2D_RECT_ARB = 0x8B63; - public static final int GL_SAMPLER_2D_RECT_SHADOW_ARB = 0x8B64; - public static final int GL_OBJECT_DELETE_STATUS_ARB = 0x8B80; - public static final int GL_OBJECT_COMPILE_STATUS_ARB = 0x8B81; - public static final int GL_OBJECT_LINK_STATUS_ARB = 0x8B82; - public static final int GL_OBJECT_VALIDATE_STATUS_ARB = 0x8B83; - public static final int GL_OBJECT_INFO_LOG_LENGTH_ARB = 0x8B84; - public static final int GL_OBJECT_ATTACHED_OBJECTS_ARB = 0x8B85; - public static final int GL_OBJECT_ACTIVE_UNIFORMS_ARB = 0x8B86; - public static final int GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB = 0x8B87; - public static final int GL_OBJECT_SHADER_SOURCE_LENGTH_ARB = 0x8B88; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_shader_objects) return; - ext.glDeleteObjectARB = load.invoke("glDeleteObjectARB", ofVoid(JAVA_INT)); - ext.glGetHandleARB = load.invoke("glGetHandleARB", of(JAVA_INT, JAVA_INT)); - ext.glDetachObjectARB = load.invoke("glDetachObjectARB", ofVoid(JAVA_INT, JAVA_INT)); - ext.glCreateShaderObjectARB = load.invoke("glCreateShaderObjectARB", of(JAVA_INT, JAVA_INT)); - ext.glShaderSourceARB = load.invoke("glShaderSourceARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - ext.glCompileShaderARB = load.invoke("glCompileShaderARB", ofVoid(JAVA_INT)); - ext.glCreateProgramObjectARB = load.invoke("glCreateProgramObjectARB", of(JAVA_INT)); - ext.glAttachObjectARB = load.invoke("glAttachObjectARB", ofVoid(JAVA_INT, JAVA_INT)); - ext.glLinkProgramARB = load.invoke("glLinkProgramARB", ofVoid(JAVA_INT)); - ext.glUseProgramObjectARB = load.invoke("glUseProgramObjectARB", ofVoid(JAVA_INT)); - ext.glValidateProgramARB = load.invoke("glValidateProgramARB", ofVoid(JAVA_INT)); - ext.glUniform1fARB = load.invoke("glUniform1fARB", ofVoid(JAVA_INT, JAVA_FLOAT)); - ext.glUniform2fARB = load.invoke("glUniform2fARB", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glUniform3fARB = load.invoke("glUniform3fARB", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glUniform4fARB = load.invoke("glUniform4fARB", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glUniform1iARB = load.invoke("glUniform1iARB", ofVoid(JAVA_INT, JAVA_INT)); - ext.glUniform2iARB = load.invoke("glUniform2iARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glUniform3iARB = load.invoke("glUniform3iARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glUniform4iARB = load.invoke("glUniform4iARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glUniform1fvARB = load.invoke("glUniform1fvARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform2fvARB = load.invoke("glUniform2fvARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform3fvARB = load.invoke("glUniform3fvARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform4fvARB = load.invoke("glUniform4fvARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform1ivARB = load.invoke("glUniform1ivARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform2ivARB = load.invoke("glUniform2ivARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform3ivARB = load.invoke("glUniform3ivARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform4ivARB = load.invoke("glUniform4ivARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniformMatrix2fvARB = load.invoke("glUniformMatrix2fvARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glUniformMatrix3fvARB = load.invoke("glUniformMatrix3fvARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glUniformMatrix4fvARB = load.invoke("glUniformMatrix4fvARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glGetObjectParameterfvARB = load.invoke("glGetObjectParameterfvARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetObjectParameterivARB = load.invoke("glGetObjectParameterivARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetInfoLogARB = load.invoke("glGetInfoLogARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - ext.glGetAttachedObjectsARB = load.invoke("glGetAttachedObjectsARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - ext.glGetUniformLocationARB = load.invoke("glGetUniformLocationARB", of(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetActiveUniformARB = load.invoke("glGetActiveUniformARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, ADDRESS, ADDRESS, ADDRESS)); - ext.glGetUniformfvARB = load.invoke("glGetUniformfvARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetUniformivARB = load.invoke("glGetUniformivARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetShaderSourceARB = load.invoke("glGetShaderSourceARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - } - - public static void glDeleteObjectARB(int obj) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteObjectARB).invokeExact(obj); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static int glGetHandleARB(int pname) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glGetHandleARB).invokeExact(pname); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glDetachObjectARB(int containerObj, int attachedObj) { - final var ext = getExtCapabilities(); - try { - check(ext.glDetachObjectARB).invokeExact(containerObj, attachedObj); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static int glCreateShaderObjectARB(int shaderType) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glCreateShaderObjectARB).invokeExact(shaderType); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glShaderSourceARB(int shaderObj, int count, @NativeType("const GLcharARB**") MemorySegment string, @NativeType("const GLint*") MemorySegment length) { - final var ext = getExtCapabilities(); - try { - check(ext.glShaderSourceARB).invokeExact(shaderObj, count, string, length); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glCompileShaderARB(int shaderObj) { - final var ext = getExtCapabilities(); - try { - check(ext.glCompileShaderARB).invokeExact(shaderObj); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static int glCreateProgramObjectARB() { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glCreateProgramObjectARB).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glAttachObjectARB(int containerObj, int obj) { - final var ext = getExtCapabilities(); - try { - check(ext.glAttachObjectARB).invokeExact(containerObj, obj); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glLinkProgramARB(int programObj) { - final var ext = getExtCapabilities(); - try { - check(ext.glLinkProgramARB).invokeExact(programObj); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUseProgramObjectARB(int programObj) { - final var ext = getExtCapabilities(); - try { - check(ext.glUseProgramObjectARB).invokeExact(programObj); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLARBShaderObjects { + int GL_PROGRAM_OBJECT_ARB = 0x8B40; + int GL_SHADER_OBJECT_ARB = 0x8B48; + int GL_OBJECT_TYPE_ARB = 0x8B4E; + int GL_OBJECT_SUBTYPE_ARB = 0x8B4F; + int GL_FLOAT_VEC2_ARB = 0x8B50; + int GL_FLOAT_VEC3_ARB = 0x8B51; + int GL_FLOAT_VEC4_ARB = 0x8B52; + int GL_INT_VEC2_ARB = 0x8B53; + int GL_INT_VEC3_ARB = 0x8B54; + int GL_INT_VEC4_ARB = 0x8B55; + int GL_BOOL_ARB = 0x8B56; + int GL_BOOL_VEC2_ARB = 0x8B57; + int GL_BOOL_VEC3_ARB = 0x8B58; + int GL_BOOL_VEC4_ARB = 0x8B59; + int GL_FLOAT_MAT2_ARB = 0x8B5A; + int GL_FLOAT_MAT3_ARB = 0x8B5B; + int GL_FLOAT_MAT4_ARB = 0x8B5C; + int GL_SAMPLER_1D_ARB = 0x8B5D; + int GL_SAMPLER_2D_ARB = 0x8B5E; + int GL_SAMPLER_3D_ARB = 0x8B5F; + int GL_SAMPLER_CUBE_ARB = 0x8B60; + int GL_SAMPLER_1D_SHADOW_ARB = 0x8B61; + int GL_SAMPLER_2D_SHADOW_ARB = 0x8B62; + int GL_SAMPLER_2D_RECT_ARB = 0x8B63; + int GL_SAMPLER_2D_RECT_SHADOW_ARB = 0x8B64; + int GL_OBJECT_DELETE_STATUS_ARB = 0x8B80; + int GL_OBJECT_COMPILE_STATUS_ARB = 0x8B81; + int GL_OBJECT_LINK_STATUS_ARB = 0x8B82; + int GL_OBJECT_VALIDATE_STATUS_ARB = 0x8B83; + int GL_OBJECT_INFO_LOG_LENGTH_ARB = 0x8B84; + int GL_OBJECT_ATTACHED_OBJECTS_ARB = 0x8B85; + int GL_OBJECT_ACTIVE_UNIFORMS_ARB = 0x8B86; + int GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB = 0x8B87; + int GL_OBJECT_SHADER_SOURCE_LENGTH_ARB = 0x8B88; + + default void glDeleteObjectARB(int obj) { + throw new ContextException(); + } + + default int glGetHandleARB(int pname) { + throw new ContextException(); + } + + default void glDetachObjectARB(int containerObj, int attachedObj) { + throw new ContextException(); + } + + default int glCreateShaderObjectARB(int shaderType) { + throw new ContextException(); + } + + default void glShaderSourceARB(int shaderObj, int count, @NativeType("const GLcharARB**") MemorySegment string, @NativeType("const GLint*") MemorySegment length) { + throw new ContextException(); + } + + default void glCompileShaderARB(int shaderObj) { + throw new ContextException(); + } + + default int glCreateProgramObjectARB() { + throw new ContextException(); + } + + default void glAttachObjectARB(int containerObj, int obj) { + throw new ContextException(); + } + + default void glLinkProgramARB(int programObj) { + throw new ContextException(); + } + + default void glUseProgramObjectARB(int programObj) { + throw new ContextException(); } - public static void glValidateProgramARB(int programObj) { - final var ext = getExtCapabilities(); - try { - check(ext.glValidateProgramARB).invokeExact(programObj); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glValidateProgramARB(int programObj) { + throw new ContextException(); } - public static void glUniform1fARB(int location, float v0) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform1fARB).invokeExact(location, v0); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform1fARB(int location, float v0) { + throw new ContextException(); } - public static void glUniform2fARB(int location, float v0, float v1) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform2fARB).invokeExact(location, v0, v1); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform2fARB(int location, float v0, float v1) { + throw new ContextException(); } - public static void glUniform3fARB(int location, float v0, float v1, float v2) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform3fARB).invokeExact(location, v0, v1, v2); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform3fARB(int location, float v0, float v1, float v2) { + throw new ContextException(); } - public static void glUniform4fARB(int location, float v0, float v1, float v2, float v3) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform4fARB).invokeExact(location, v0, v1, v2, v3); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform4fARB(int location, float v0, float v1, float v2, float v3) { + throw new ContextException(); } - public static void glUniform1iARB(int location, int v0) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform1iARB).invokeExact(location, v0); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform1iARB(int location, int v0) { + throw new ContextException(); } - public static void glUniform2iARB(int location, int v0, int v1) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform2iARB).invokeExact(location, v0, v1); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform2iARB(int location, int v0, int v1) { + throw new ContextException(); } - public static void glUniform3iARB(int location, int v0, int v1, int v2) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform3iARB).invokeExact(location, v0, v1, v2); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform3iARB(int location, int v0, int v1, int v2) { + throw new ContextException(); } - public static void glUniform4iARB(int location, int v0, int v1, int v2, int v3) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform4iARB).invokeExact(location, v0, v1, v2, v3); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform4iARB(int location, int v0, int v1, int v2, int v3) { + throw new ContextException(); } - public static void glUniform1fvARB(int location, int count, @NativeType("const GLfloat*") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform1fvARB).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform1fvARB(int location, int count, @NativeType("const GLfloat*") MemorySegment value) { + throw new ContextException(); } - public static void glUniform2fvARB(int location, int count, @NativeType("const GLfloat*") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform2fvARB).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform2fvARB(int location, int count, @NativeType("const GLfloat*") MemorySegment value) { + throw new ContextException(); } - public static void glUniform3fvARB(int location, int count, @NativeType("const GLfloat*") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform3fvARB).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform3fvARB(int location, int count, @NativeType("const GLfloat*") MemorySegment value) { + throw new ContextException(); } - public static void glUniform4fvARB(int location, int count, @NativeType("const GLfloat*") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform4fvARB).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform4fvARB(int location, int count, @NativeType("const GLfloat*") MemorySegment value) { + throw new ContextException(); } - public static void glUniform1ivARB(int location, int count, @NativeType("const GLint*") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform1ivARB).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform1ivARB(int location, int count, @NativeType("const GLint*") MemorySegment value) { + throw new ContextException(); } - public static void glUniform2ivARB(int location, int count, @NativeType("const GLint*") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform2ivARB).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform2ivARB(int location, int count, @NativeType("const GLint*") MemorySegment value) { + throw new ContextException(); } - public static void glUniform3ivARB(int location, int count, @NativeType("const GLint*") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform3ivARB).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform3ivARB(int location, int count, @NativeType("const GLint*") MemorySegment value) { + throw new ContextException(); } - public static void glUniform4ivARB(int location, int count, @NativeType("const GLint*") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform4ivARB).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform4ivARB(int location, int count, @NativeType("const GLint*") MemorySegment value) { + throw new ContextException(); } - public static void glUniformMatrix2fvARB(int location, int count, boolean transpose, @NativeType("const GLfloat*") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniformMatrix2fvARB).invokeExact(location, count, transpose, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniformMatrix2fvARB(int location, int count, boolean transpose, @NativeType("const GLfloat*") MemorySegment value) { + throw new ContextException(); } - public static void glUniformMatrix3fvARB(int location, int count, boolean transpose, @NativeType("const GLfloat*") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniformMatrix3fvARB).invokeExact(location, count, transpose, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniformMatrix3fvARB(int location, int count, boolean transpose, @NativeType("const GLfloat*") MemorySegment value) { + throw new ContextException(); } - public static void glUniformMatrix4fvARB(int location, int count, boolean transpose, @NativeType("const GLfloat*") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniformMatrix4fvARB).invokeExact(location, count, transpose, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniformMatrix4fvARB(int location, int count, boolean transpose, @NativeType("const GLfloat*") MemorySegment value) { + throw new ContextException(); } - public static void glGetObjectParameterfvARB(int obj, int pname, @NativeType("GLfloat*") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetObjectParameterfvARB).invokeExact(obj, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetObjectParameterfvARB(int obj, int pname, @NativeType("GLfloat*") MemorySegment params) { + throw new ContextException(); } - public static void glGetObjectParameterivARB(int obj, int pname, @NativeType("GLint*") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetObjectParameterivARB).invokeExact(obj, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetObjectParameterivARB(int obj, int pname, @NativeType("GLint*") MemorySegment params) { + throw new ContextException(); } - public static void glGetInfoLogARB(int obj, int maxLength, @NativeType("GLsizei*") MemorySegment length, @NativeType("GLcharARB*") MemorySegment infoLog) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetInfoLogARB).invokeExact(obj, maxLength, length, infoLog); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetInfoLogARB(int obj, int maxLength, @NativeType("GLsizei*") MemorySegment length, @NativeType("GLcharARB*") MemorySegment infoLog) { + throw new ContextException(); } - public static void glGetAttachedObjectsARB(int containerObj, int maxCount, @NativeType("GLsizei*") MemorySegment count, @NativeType("GLhandleARB*") MemorySegment obj) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetAttachedObjectsARB).invokeExact(containerObj, maxCount, count, obj); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetAttachedObjectsARB(int containerObj, int maxCount, @NativeType("GLsizei*") MemorySegment count, @NativeType("GLhandleARB*") MemorySegment obj) { + throw new ContextException(); } - public static int glGetUniformLocationARB(int programObj, @NativeType("const GLcharARB*") MemorySegment name) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glGetUniformLocationARB).invokeExact(programObj, name); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glGetUniformLocationARB(int programObj, @NativeType("const GLcharARB*") MemorySegment name) { + throw new ContextException(); } - public static void glGetActiveUniformARB(int programObj, int index, int maxLength, @NativeType("GLsizei*") MemorySegment length, @NativeType("GLint*") MemorySegment size, @NativeType("GLenum*") MemorySegment type, @NativeType("GLcharARB*") MemorySegment name) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetActiveUniformARB).invokeExact(programObj, index, maxLength, length, size, type, name); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetActiveUniformARB(int programObj, int index, int maxLength, @NativeType("GLsizei*") MemorySegment length, @NativeType("GLint*") MemorySegment size, @NativeType("GLenum*") MemorySegment type, @NativeType("GLcharARB*") MemorySegment name) { + throw new ContextException(); } - public static void glGetUniformfvARB(int programObj, int location, @NativeType("GLfloat*") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetUniformfvARB).invokeExact(programObj, location, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetUniformfvARB(int programObj, int location, @NativeType("GLfloat*") MemorySegment params) { + throw new ContextException(); } - public static void glGetUniformivARB(int programObj, int location, @NativeType("GLint*") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetUniformivARB).invokeExact(programObj, location, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetUniformivARB(int programObj, int location, @NativeType("GLint*") MemorySegment params) { + throw new ContextException(); } - public static void glGetShaderSourceARB(int obj, int maxLength, @NativeType("GLsizei*") MemorySegment length, @NativeType("GLcharARB*") MemorySegment source) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetShaderSourceARB).invokeExact(obj, maxLength, length, source); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetShaderSourceARB(int obj, int maxLength, @NativeType("GLsizei*") MemorySegment length, @NativeType("GLcharARB*") MemorySegment source) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBShadingLanguageInclude.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBShadingLanguageInclude.java index 5dfc355f..3a6e38ac 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBShadingLanguageInclude.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBShadingLanguageInclude.java @@ -16,72 +16,40 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_shading_language_include} */ -public final class GLARBShadingLanguageInclude { - public static final int GL_SHADER_INCLUDE_ARB = 0x8DAE; - public static final int GL_NAMED_STRING_LENGTH_ARB = 0x8DE9; - public static final int GL_NAMED_STRING_TYPE_ARB = 0x8DEA; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_shading_language_include) return; - ext.glNamedStringARB = load.invoke("glNamedStringARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, ADDRESS)); - ext.glDeleteNamedStringARB = load.invoke("glDeleteNamedStringARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glCompileShaderIncludeARB = load.invoke("glCompileShaderIncludeARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - ext.glIsNamedStringARB = load.invoke("glIsNamedStringARB", of(JAVA_BYTE, JAVA_INT, ADDRESS)); - ext.glGetNamedStringARB = load.invoke("glGetNamedStringARB", ofVoid(JAVA_INT, ADDRESS, JAVA_INT, ADDRESS, ADDRESS)); - ext.glGetNamedStringivARB = load.invoke("glGetNamedStringivARB", ofVoid(JAVA_INT, ADDRESS, JAVA_INT, ADDRESS)); - } +public interface GLARBShadingLanguageInclude { + int GL_SHADER_INCLUDE_ARB = 0x8DAE; + int GL_NAMED_STRING_LENGTH_ARB = 0x8DE9; + int GL_NAMED_STRING_TYPE_ARB = 0x8DEA; - public static void glNamedStringARB(int type, int nameLen, @NativeType("const GLchar*") MemorySegment name, int stringLen, @NativeType("const GLchar*") MemorySegment string) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedStringARB).invokeExact(type, nameLen, name, stringLen, string); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedStringARB(int type, int nameLen, @NativeType("const GLchar*") MemorySegment name, int stringLen, @NativeType("const GLchar*") MemorySegment string) { + throw new ContextException(); } - public static void glDeleteNamedStringARB(int nameLen, @NativeType("const GLchar*") MemorySegment name) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteNamedStringARB).invokeExact(nameLen, name); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDeleteNamedStringARB(int nameLen, @NativeType("const GLchar*") MemorySegment name) { + throw new ContextException(); } - public static void glCompileShaderIncludeARB(int shader, int count, @NativeType("const GLchar *const*") MemorySegment path, @NativeType("const GLint*") MemorySegment length) { - final var ext = getExtCapabilities(); - try { - check(ext.glCompileShaderIncludeARB).invokeExact(shader, count, path, length); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCompileShaderIncludeARB(int shader, int count, @NativeType("const GLchar *const*") MemorySegment path, @NativeType("const GLint*") MemorySegment length) { + throw new ContextException(); } - public static boolean glIsNamedStringARB(int nameLen, @NativeType("const GLchar*") MemorySegment name) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsNamedStringARB).invokeExact(nameLen, name); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsNamedStringARB(int nameLen, @NativeType("const GLchar*") MemorySegment name) { + throw new ContextException(); } - public static void glGetNamedStringARB(int nameLen, @NativeType("const GLchar*") MemorySegment name, int bufSize, @NativeType("GLint*") MemorySegment stringLen, @NativeType("GLchar*") MemorySegment string) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetNamedStringARB).invokeExact(nameLen, name, bufSize, stringLen, string); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetNamedStringARB(int nameLen, @NativeType("const GLchar*") MemorySegment name, int bufSize, @NativeType("GLint*") MemorySegment stringLen, @NativeType("GLchar*") MemorySegment string) { + throw new ContextException(); } - public static void glGetNamedStringivARB(int nameLen, @NativeType("const GLchar*") MemorySegment name, int pname, @NativeType("GLint*") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetNamedStringivARB).invokeExact(nameLen, name, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetNamedStringivARB(int nameLen, @NativeType("const GLchar*") MemorySegment name, int pname, @NativeType("GLint*") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBShadow.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBShadow.java index e410d045..bc145da3 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBShadow.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBShadow.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_shadow} */ -public final class GLARBShadow { - public static final int GL_TEXTURE_COMPARE_MODE_ARB = 0x884C; - public static final int GL_TEXTURE_COMPARE_FUNC_ARB = 0x884D; - public static final int GL_COMPARE_R_TO_TEXTURE_ARB = 0x884E; +public interface GLARBShadow { + int GL_TEXTURE_COMPARE_MODE_ARB = 0x884C; + int GL_TEXTURE_COMPARE_FUNC_ARB = 0x884D; + int GL_COMPARE_R_TO_TEXTURE_ARB = 0x884E; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBShadowAmbient.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBShadowAmbient.java index d922b49e..5a5db5fb 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBShadowAmbient.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBShadowAmbient.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_shadow_ambient} */ -public final class GLARBShadowAmbient { - public static final int GL_TEXTURE_COMPARE_FAIL_VALUE_ARB = 0x80BF; +public interface GLARBShadowAmbient { + int GL_TEXTURE_COMPARE_FAIL_VALUE_ARB = 0x80BF; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBSparseBuffer.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBSparseBuffer.java index fa16c390..178c3fe4 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBSparseBuffer.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBSparseBuffer.java @@ -16,46 +16,27 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_sparse_buffer} */ -public final class GLARBSparseBuffer { - public static final int GL_SPARSE_STORAGE_BIT_ARB = 0x0400; - public static final int GL_SPARSE_BUFFER_PAGE_SIZE_ARB = 0x82F8; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_sparse_buffer) return; - ext.glBufferPageCommitmentARB = load.invoke("glBufferPageCommitmentARB", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_BYTE)); - ext.glNamedBufferPageCommitmentEXT = load.invoke("glNamedBufferPageCommitmentEXT", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_BYTE)); - ext.glNamedBufferPageCommitmentARB = load.invoke("glNamedBufferPageCommitmentARB", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_BYTE)); - } +public interface GLARBSparseBuffer { + int GL_SPARSE_STORAGE_BIT_ARB = 0x0400; + int GL_SPARSE_BUFFER_PAGE_SIZE_ARB = 0x82F8; - public static void glBufferPageCommitmentARB(int target, long offset, long size, boolean commit) { - final var ext = getExtCapabilities(); - try { - check(ext.glBufferPageCommitmentARB).invokeExact(target, offset, size, commit); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBufferPageCommitmentARB(int target, long offset, long size, boolean commit) { + throw new ContextException(); } - public static void glNamedBufferPageCommitmentEXT(int buffer, long offset, long size, boolean commit) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedBufferPageCommitmentEXT).invokeExact(buffer, offset, size, commit); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedBufferPageCommitmentEXT(int buffer, long offset, long size, boolean commit) { + throw new ContextException(); } - public static void glNamedBufferPageCommitmentARB(int buffer, long offset, long size, boolean commit) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedBufferPageCommitmentARB).invokeExact(buffer, offset, size, commit); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedBufferPageCommitmentARB(int buffer, long offset, long size, boolean commit) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBSparseTexture.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBSparseTexture.java index 61da4460..34744101 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBSparseTexture.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBSparseTexture.java @@ -16,39 +16,28 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_sparse_texture} */ -public final class GLARBSparseTexture { - public static final int GL_TEXTURE_SPARSE_ARB = 0x91A6; - public static final int GL_VIRTUAL_PAGE_SIZE_INDEX_ARB = 0x91A7; - public static final int GL_NUM_SPARSE_LEVELS_ARB = 0x91AA; - public static final int GL_NUM_VIRTUAL_PAGE_SIZES_ARB = 0x91A8; - public static final int GL_VIRTUAL_PAGE_SIZE_X_ARB = 0x9195; - public static final int GL_VIRTUAL_PAGE_SIZE_Y_ARB = 0x9196; - public static final int GL_VIRTUAL_PAGE_SIZE_Z_ARB = 0x9197; - public static final int GL_MAX_SPARSE_TEXTURE_SIZE_ARB = 0x9198; - public static final int GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB = 0x9199; - public static final int GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB = 0x919A; - public static final int GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB = 0x91A9; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_sparse_texture) return; - ext.glTexPageCommitmentARB = load.invoke("glTexPageCommitmentARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE)); - } +public interface GLARBSparseTexture { + int GL_TEXTURE_SPARSE_ARB = 0x91A6; + int GL_VIRTUAL_PAGE_SIZE_INDEX_ARB = 0x91A7; + int GL_NUM_SPARSE_LEVELS_ARB = 0x91AA; + int GL_NUM_VIRTUAL_PAGE_SIZES_ARB = 0x91A8; + int GL_VIRTUAL_PAGE_SIZE_X_ARB = 0x9195; + int GL_VIRTUAL_PAGE_SIZE_Y_ARB = 0x9196; + int GL_VIRTUAL_PAGE_SIZE_Z_ARB = 0x9197; + int GL_MAX_SPARSE_TEXTURE_SIZE_ARB = 0x9198; + int GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB = 0x9199; + int GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB = 0x919A; + int GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB = 0x91A9; - public static void glTexPageCommitmentARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, boolean commit) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexPageCommitmentARB).invokeExact(target, level, xoffset, yoffset, zoffset, width, height, depth, commit); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexPageCommitmentARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, boolean commit) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureBorderClamp.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureBorderClamp.java index fc68f058..dae12362 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureBorderClamp.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureBorderClamp.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_texture_border_clamp} */ -public final class GLARBTextureBorderClamp { - public static final int GL_CLAMP_TO_BORDER_ARB = 0x812D; +public interface GLARBTextureBorderClamp { + int GL_CLAMP_TO_BORDER_ARB = 0x812D; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureBufferObject.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureBufferObject.java index 8b3ec23c..d00db87a 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureBufferObject.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureBufferObject.java @@ -16,33 +16,22 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_texture_buffer_object} */ -public final class GLARBTextureBufferObject { - public static final int GL_TEXTURE_BUFFER_ARB = 0x8C2A; - public static final int GL_MAX_TEXTURE_BUFFER_SIZE_ARB = 0x8C2B; - public static final int GL_TEXTURE_BINDING_BUFFER_ARB = 0x8C2C; - public static final int GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB = 0x8C2D; - public static final int GL_TEXTURE_BUFFER_FORMAT_ARB = 0x8C2E; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_texture_buffer_object) return; - ext.glTexBufferARB = load.invoke("glTexBufferARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLARBTextureBufferObject { + int GL_TEXTURE_BUFFER_ARB = 0x8C2A; + int GL_MAX_TEXTURE_BUFFER_SIZE_ARB = 0x8C2B; + int GL_TEXTURE_BINDING_BUFFER_ARB = 0x8C2C; + int GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB = 0x8C2D; + int GL_TEXTURE_BUFFER_FORMAT_ARB = 0x8C2E; - public static void glTexBufferARB(int target, int internalFormat, int buffer) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexBufferARB).invokeExact(target, internalFormat, buffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexBufferARB(int target, int internalFormat, int buffer) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureCompression.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureCompression.java index d6e1ff9a..eb8a921c 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureCompression.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureCompression.java @@ -16,87 +16,52 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_texture_compression} */ -public final class GLARBTextureCompression { - public static final int GL_COMPRESSED_ALPHA_ARB = 0x84E9; - public static final int GL_COMPRESSED_LUMINANCE_ARB = 0x84EA; - public static final int GL_COMPRESSED_LUMINANCE_ALPHA_ARB = 0x84EB; - public static final int GL_COMPRESSED_INTENSITY_ARB = 0x84EC; - public static final int GL_COMPRESSED_RGB_ARB = 0x84ED; - public static final int GL_COMPRESSED_RGBA_ARB = 0x84EE; - public static final int GL_TEXTURE_COMPRESSION_HINT_ARB = 0x84EF; - public static final int GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB = 0x86A0; - public static final int GL_TEXTURE_COMPRESSED_ARB = 0x86A1; - public static final int GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A2; - public static final int GL_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A3; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_texture_compression) return; - ext.glCompressedTexImage3DARB = load.invoke("glCompressedTexImage3DARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCompressedTexImage2DARB = load.invoke("glCompressedTexImage2DARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCompressedTexImage1DARB = load.invoke("glCompressedTexImage1DARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCompressedTexSubImage3DARB = load.invoke("glCompressedTexSubImage3DARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCompressedTexSubImage2DARB = load.invoke("glCompressedTexSubImage2DARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCompressedTexSubImage1DARB = load.invoke("glCompressedTexSubImage1DARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetCompressedTexImageARB = load.invoke("glGetCompressedTexImageARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLARBTextureCompression { + int GL_COMPRESSED_ALPHA_ARB = 0x84E9; + int GL_COMPRESSED_LUMINANCE_ARB = 0x84EA; + int GL_COMPRESSED_LUMINANCE_ALPHA_ARB = 0x84EB; + int GL_COMPRESSED_INTENSITY_ARB = 0x84EC; + int GL_COMPRESSED_RGB_ARB = 0x84ED; + int GL_COMPRESSED_RGBA_ARB = 0x84EE; + int GL_TEXTURE_COMPRESSION_HINT_ARB = 0x84EF; + int GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB = 0x86A0; + int GL_TEXTURE_COMPRESSED_ARB = 0x86A1; + int GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A2; + int GL_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A3; - public static void glCompressedTexImage3DARB(int target, int level, int internalFormat, int width, int height, int depth, int border, int imageSize, @NativeType("const void*") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glCompressedTexImage3DARB).invokeExact(target, level, internalFormat, width, height, depth, border, imageSize, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCompressedTexImage3DARB(int target, int level, int internalFormat, int width, int height, int depth, int border, int imageSize, @NativeType("const void*") MemorySegment data) { + throw new ContextException(); } - public static void glCompressedTexImage2DARB(int target, int level, int internalFormat, int width, int height, int border, int imageSize, @NativeType("const void*") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glCompressedTexImage2DARB).invokeExact(target, level, internalFormat, width, height, border, imageSize, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCompressedTexImage2DARB(int target, int level, int internalFormat, int width, int height, int border, int imageSize, @NativeType("const void*") MemorySegment data) { + throw new ContextException(); } - public static void glCompressedTexImage1DARB(int target, int level, int internalFormat, int width, int border, int imageSize, @NativeType("const void*") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glCompressedTexImage1DARB).invokeExact(target, level, internalFormat, width, border, imageSize, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCompressedTexImage1DARB(int target, int level, int internalFormat, int width, int border, int imageSize, @NativeType("const void*") MemorySegment data) { + throw new ContextException(); } - public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, @NativeType("const void*") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glCompressedTexSubImage3DARB).invokeExact(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, @NativeType("const void*") MemorySegment data) { + throw new ContextException(); } - public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, @NativeType("const void*") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glCompressedTexSubImage2DARB).invokeExact(target, level, xoffset, yoffset, width, height, format, imageSize, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, @NativeType("const void*") MemorySegment data) { + throw new ContextException(); } - public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int format, int imageSize, @NativeType("const void*") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glCompressedTexSubImage1DARB).invokeExact(target, level, xoffset, width, format, imageSize, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int format, int imageSize, @NativeType("const void*") MemorySegment data) { + throw new ContextException(); } - public static void glGetCompressedTexImageARB(int target, int level, @NativeType("void*") MemorySegment img) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetCompressedTexImageARB).invokeExact(target, level, img); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetCompressedTexImageARB(int target, int level, @NativeType("void*") MemorySegment img) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureCompressionBptc.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureCompressionBptc.java index 70b3bb71..e52dec8f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureCompressionBptc.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureCompressionBptc.java @@ -16,20 +16,16 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_texture_compression_bptc} */ -public final class GLARBTextureCompressionBptc { - public static final int GL_COMPRESSED_RGBA_BPTC_UNORM_ARB = 0x8E8C; - public static final int GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB = 0x8E8D; - public static final int GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB = 0x8E8E; - public static final int GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB = 0x8E8F; +public interface GLARBTextureCompressionBptc { + int GL_COMPRESSED_RGBA_BPTC_UNORM_ARB = 0x8E8C; + int GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB = 0x8E8D; + int GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB = 0x8E8E; + int GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB = 0x8E8F; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureCubeMap.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureCubeMap.java index 39341c22..d03ec6c2 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureCubeMap.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureCubeMap.java @@ -16,28 +16,24 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_texture_cube_map} */ -public final class GLARBTextureCubeMap { - public static final int GL_NORMAL_MAP_ARB = 0x8511; - public static final int GL_REFLECTION_MAP_ARB = 0x8512; - public static final int GL_TEXTURE_CUBE_MAP_ARB = 0x8513; - public static final int GL_TEXTURE_BINDING_CUBE_MAP_ARB = 0x8514; - public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x8515; - public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x8516; - public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x8517; - public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x8518; - public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x8519; - public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x851A; - public static final int GL_PROXY_TEXTURE_CUBE_MAP_ARB = 0x851B; - public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB = 0x851C; +public interface GLARBTextureCubeMap { + int GL_NORMAL_MAP_ARB = 0x8511; + int GL_REFLECTION_MAP_ARB = 0x8512; + int GL_TEXTURE_CUBE_MAP_ARB = 0x8513; + int GL_TEXTURE_BINDING_CUBE_MAP_ARB = 0x8514; + int GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x8515; + int GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x8516; + int GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x8517; + int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x8518; + int GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x8519; + int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x851A; + int GL_PROXY_TEXTURE_CUBE_MAP_ARB = 0x851B; + int GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB = 0x851C; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureCubeMapArray.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureCubeMapArray.java index 1226fb4e..523cf8bf 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureCubeMapArray.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureCubeMapArray.java @@ -16,23 +16,19 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_texture_cube_map_array} */ -public final class GLARBTextureCubeMapArray { - public static final int GL_TEXTURE_CUBE_MAP_ARRAY_ARB = 0x9009; - public static final int GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB = 0x900A; - public static final int GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB = 0x900B; - public static final int GL_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900C; - public static final int GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB = 0x900D; - public static final int GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900E; - public static final int GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900F; +public interface GLARBTextureCubeMapArray { + int GL_TEXTURE_CUBE_MAP_ARRAY_ARB = 0x9009; + int GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB = 0x900A; + int GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB = 0x900B; + int GL_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900C; + int GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB = 0x900D; + int GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900E; + int GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900F; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureEnvCombine.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureEnvCombine.java index b57c6400..be169d1b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureEnvCombine.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureEnvCombine.java @@ -16,38 +16,34 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_texture_env_combine} */ -public final class GLARBTextureEnvCombine { - public static final int GL_COMBINE_ARB = 0x8570; - public static final int GL_COMBINE_RGB_ARB = 0x8571; - public static final int GL_COMBINE_ALPHA_ARB = 0x8572; - public static final int GL_SOURCE0_RGB_ARB = 0x8580; - public static final int GL_SOURCE1_RGB_ARB = 0x8581; - public static final int GL_SOURCE2_RGB_ARB = 0x8582; - public static final int GL_SOURCE0_ALPHA_ARB = 0x8588; - public static final int GL_SOURCE1_ALPHA_ARB = 0x8589; - public static final int GL_SOURCE2_ALPHA_ARB = 0x858A; - public static final int GL_OPERAND0_RGB_ARB = 0x8590; - public static final int GL_OPERAND1_RGB_ARB = 0x8591; - public static final int GL_OPERAND2_RGB_ARB = 0x8592; - public static final int GL_OPERAND0_ALPHA_ARB = 0x8598; - public static final int GL_OPERAND1_ALPHA_ARB = 0x8599; - public static final int GL_OPERAND2_ALPHA_ARB = 0x859A; - public static final int GL_RGB_SCALE_ARB = 0x8573; - public static final int GL_ADD_SIGNED_ARB = 0x8574; - public static final int GL_INTERPOLATE_ARB = 0x8575; - public static final int GL_SUBTRACT_ARB = 0x84E7; - public static final int GL_CONSTANT_ARB = 0x8576; - public static final int GL_PRIMARY_COLOR_ARB = 0x8577; - public static final int GL_PREVIOUS_ARB = 0x8578; +public interface GLARBTextureEnvCombine { + int GL_COMBINE_ARB = 0x8570; + int GL_COMBINE_RGB_ARB = 0x8571; + int GL_COMBINE_ALPHA_ARB = 0x8572; + int GL_SOURCE0_RGB_ARB = 0x8580; + int GL_SOURCE1_RGB_ARB = 0x8581; + int GL_SOURCE2_RGB_ARB = 0x8582; + int GL_SOURCE0_ALPHA_ARB = 0x8588; + int GL_SOURCE1_ALPHA_ARB = 0x8589; + int GL_SOURCE2_ALPHA_ARB = 0x858A; + int GL_OPERAND0_RGB_ARB = 0x8590; + int GL_OPERAND1_RGB_ARB = 0x8591; + int GL_OPERAND2_RGB_ARB = 0x8592; + int GL_OPERAND0_ALPHA_ARB = 0x8598; + int GL_OPERAND1_ALPHA_ARB = 0x8599; + int GL_OPERAND2_ALPHA_ARB = 0x859A; + int GL_RGB_SCALE_ARB = 0x8573; + int GL_ADD_SIGNED_ARB = 0x8574; + int GL_INTERPOLATE_ARB = 0x8575; + int GL_SUBTRACT_ARB = 0x84E7; + int GL_CONSTANT_ARB = 0x8576; + int GL_PRIMARY_COLOR_ARB = 0x8577; + int GL_PREVIOUS_ARB = 0x8578; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureEnvDot3.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureEnvDot3.java index d52bff2d..114e3b88 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureEnvDot3.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureEnvDot3.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_texture_env_dot3} */ -public final class GLARBTextureEnvDot3 { - public static final int GL_DOT3_RGB_ARB = 0x86AE; - public static final int GL_DOT3_RGBA_ARB = 0x86AF; +public interface GLARBTextureEnvDot3 { + int GL_DOT3_RGB_ARB = 0x86AE; + int GL_DOT3_RGBA_ARB = 0x86AF; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureFilterMinmax.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureFilterMinmax.java index d8ecf803..3b814cc8 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureFilterMinmax.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureFilterMinmax.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_texture_filter_minmax} */ -public final class GLARBTextureFilterMinmax { - public static final int GL_TEXTURE_REDUCTION_MODE_ARB = 0x9366; - public static final int GL_WEIGHTED_AVERAGE_ARB = 0x9367; +public interface GLARBTextureFilterMinmax { + int GL_TEXTURE_REDUCTION_MODE_ARB = 0x9366; + int GL_WEIGHTED_AVERAGE_ARB = 0x9367; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureFloat.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureFloat.java index 421125e3..77056a27 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureFloat.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureFloat.java @@ -16,36 +16,32 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_texture_float} */ -public final class GLARBTextureFloat { - public static final int GL_TEXTURE_RED_TYPE_ARB = 0x8C10; - public static final int GL_TEXTURE_GREEN_TYPE_ARB = 0x8C11; - public static final int GL_TEXTURE_BLUE_TYPE_ARB = 0x8C12; - public static final int GL_TEXTURE_ALPHA_TYPE_ARB = 0x8C13; - public static final int GL_TEXTURE_LUMINANCE_TYPE_ARB = 0x8C14; - public static final int GL_TEXTURE_INTENSITY_TYPE_ARB = 0x8C15; - public static final int GL_TEXTURE_DEPTH_TYPE_ARB = 0x8C16; - public static final int GL_UNSIGNED_NORMALIZED_ARB = 0x8C17; - public static final int GL_RGBA32F_ARB = 0x8814; - public static final int GL_RGB32F_ARB = 0x8815; - public static final int GL_ALPHA32F_ARB = 0x8816; - public static final int GL_INTENSITY32F_ARB = 0x8817; - public static final int GL_LUMINANCE32F_ARB = 0x8818; - public static final int GL_LUMINANCE_ALPHA32F_ARB = 0x8819; - public static final int GL_RGBA16F_ARB = 0x881A; - public static final int GL_RGB16F_ARB = 0x881B; - public static final int GL_ALPHA16F_ARB = 0x881C; - public static final int GL_INTENSITY16F_ARB = 0x881D; - public static final int GL_LUMINANCE16F_ARB = 0x881E; - public static final int GL_LUMINANCE_ALPHA16F_ARB = 0x881F; +public interface GLARBTextureFloat { + int GL_TEXTURE_RED_TYPE_ARB = 0x8C10; + int GL_TEXTURE_GREEN_TYPE_ARB = 0x8C11; + int GL_TEXTURE_BLUE_TYPE_ARB = 0x8C12; + int GL_TEXTURE_ALPHA_TYPE_ARB = 0x8C13; + int GL_TEXTURE_LUMINANCE_TYPE_ARB = 0x8C14; + int GL_TEXTURE_INTENSITY_TYPE_ARB = 0x8C15; + int GL_TEXTURE_DEPTH_TYPE_ARB = 0x8C16; + int GL_UNSIGNED_NORMALIZED_ARB = 0x8C17; + int GL_RGBA32F_ARB = 0x8814; + int GL_RGB32F_ARB = 0x8815; + int GL_ALPHA32F_ARB = 0x8816; + int GL_INTENSITY32F_ARB = 0x8817; + int GL_LUMINANCE32F_ARB = 0x8818; + int GL_LUMINANCE_ALPHA32F_ARB = 0x8819; + int GL_RGBA16F_ARB = 0x881A; + int GL_RGB16F_ARB = 0x881B; + int GL_ALPHA16F_ARB = 0x881C; + int GL_INTENSITY16F_ARB = 0x881D; + int GL_LUMINANCE16F_ARB = 0x881E; + int GL_LUMINANCE_ALPHA16F_ARB = 0x881F; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureGather.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureGather.java index b25a38c3..710b9a40 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureGather.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureGather.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_texture_gather} */ -public final class GLARBTextureGather { - public static final int GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5E; - public static final int GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5F; - public static final int GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB = 0x8F9F; +public interface GLARBTextureGather { + int GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5E; + int GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5F; + int GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB = 0x8F9F; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureMirroredRepeat.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureMirroredRepeat.java index 6349ccab..7b88fc63 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureMirroredRepeat.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureMirroredRepeat.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_texture_mirrored_repeat} */ -public final class GLARBTextureMirroredRepeat { - public static final int GL_MIRRORED_REPEAT_ARB = 0x8370; +public interface GLARBTextureMirroredRepeat { + int GL_MIRRORED_REPEAT_ARB = 0x8370; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureRectangle.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureRectangle.java index 7b30e5c3..3b9d7975 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureRectangle.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTextureRectangle.java @@ -16,20 +16,16 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_texture_rectangle} */ -public final class GLARBTextureRectangle { - public static final int GL_TEXTURE_RECTANGLE_ARB = 0x84F5; - public static final int GL_TEXTURE_BINDING_RECTANGLE_ARB = 0x84F6; - public static final int GL_PROXY_TEXTURE_RECTANGLE_ARB = 0x84F7; - public static final int GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB = 0x84F8; +public interface GLARBTextureRectangle { + int GL_TEXTURE_RECTANGLE_ARB = 0x84F5; + int GL_TEXTURE_BINDING_RECTANGLE_ARB = 0x84F6; + int GL_PROXY_TEXTURE_RECTANGLE_ARB = 0x84F7; + int GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB = 0x84F8; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTransformFeedbackOverflowQuery.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTransformFeedbackOverflowQuery.java index 46c310eb..2bd65993 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTransformFeedbackOverflowQuery.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTransformFeedbackOverflowQuery.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_transform_feedback_overflow_query} */ -public final class GLARBTransformFeedbackOverflowQuery { - public static final int GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB = 0x82EC; - public static final int GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB = 0x82ED; +public interface GLARBTransformFeedbackOverflowQuery { + int GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB = 0x82EC; + int GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB = 0x82ED; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTransposeMatrix.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTransposeMatrix.java index 8e848adc..0a2a85c7 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTransposeMatrix.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBTransposeMatrix.java @@ -16,56 +16,33 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_transpose_matrix} */ -public final class GLARBTransposeMatrix { - public static final int GL_TRANSPOSE_MODELVIEW_MATRIX_ARB = 0x84E3; - public static final int GL_TRANSPOSE_PROJECTION_MATRIX_ARB = 0x84E4; - public static final int GL_TRANSPOSE_TEXTURE_MATRIX_ARB = 0x84E5; - public static final int GL_TRANSPOSE_COLOR_MATRIX_ARB = 0x84E6; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_transpose_matrix) return; - ext.glLoadTransposeMatrixfARB = load.invoke("glLoadTransposeMatrixfARB", ofVoid(ADDRESS)); - ext.glLoadTransposeMatrixdARB = load.invoke("glLoadTransposeMatrixdARB", ofVoid(ADDRESS)); - ext.glMultTransposeMatrixfARB = load.invoke("glMultTransposeMatrixfARB", ofVoid(ADDRESS)); - ext.glMultTransposeMatrixdARB = load.invoke("glMultTransposeMatrixdARB", ofVoid(ADDRESS)); - } - - public static void glLoadTransposeMatrixfARB(@NativeType("const GLfloat*") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glLoadTransposeMatrixfARB).invokeExact(m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLARBTransposeMatrix { + int GL_TRANSPOSE_MODELVIEW_MATRIX_ARB = 0x84E3; + int GL_TRANSPOSE_PROJECTION_MATRIX_ARB = 0x84E4; + int GL_TRANSPOSE_TEXTURE_MATRIX_ARB = 0x84E5; + int GL_TRANSPOSE_COLOR_MATRIX_ARB = 0x84E6; + + default void glLoadTransposeMatrixfARB(@NativeType("const GLfloat*") MemorySegment m) { + throw new ContextException(); } - public static void glLoadTransposeMatrixdARB(@NativeType("const GLdouble*") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glLoadTransposeMatrixdARB).invokeExact(m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glLoadTransposeMatrixdARB(@NativeType("const GLdouble*") MemorySegment m) { + throw new ContextException(); } - public static void glMultTransposeMatrixfARB(@NativeType("const GLfloat*") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultTransposeMatrixfARB).invokeExact(m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultTransposeMatrixfARB(@NativeType("const GLfloat*") MemorySegment m) { + throw new ContextException(); } - public static void glMultTransposeMatrixdARB(@NativeType("const GLdouble*") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultTransposeMatrixdARB).invokeExact(m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultTransposeMatrixdARB(@NativeType("const GLdouble*") MemorySegment m) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBVertexBlend.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBVertexBlend.java index b8c90f24..bbb4d9b7 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBVertexBlend.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBVertexBlend.java @@ -16,142 +16,95 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_vertex_blend} */ -public final class GLARBVertexBlend { - public static final int GL_MAX_VERTEX_UNITS_ARB = 0x86A4; - public static final int GL_ACTIVE_VERTEX_UNITS_ARB = 0x86A5; - public static final int GL_WEIGHT_SUM_UNITY_ARB = 0x86A6; - public static final int GL_VERTEX_BLEND_ARB = 0x86A7; - public static final int GL_CURRENT_WEIGHT_ARB = 0x86A8; - public static final int GL_WEIGHT_ARRAY_TYPE_ARB = 0x86A9; - public static final int GL_WEIGHT_ARRAY_STRIDE_ARB = 0x86AA; - public static final int GL_WEIGHT_ARRAY_SIZE_ARB = 0x86AB; - public static final int GL_WEIGHT_ARRAY_POINTER_ARB = 0x86AC; - public static final int GL_WEIGHT_ARRAY_ARB = 0x86AD; - public static final int GL_MODELVIEW0_ARB = 0x1700; - public static final int GL_MODELVIEW1_ARB = 0x850A; - public static final int GL_MODELVIEW2_ARB = 0x8722; - public static final int GL_MODELVIEW3_ARB = 0x8723; - public static final int GL_MODELVIEW4_ARB = 0x8724; - public static final int GL_MODELVIEW5_ARB = 0x8725; - public static final int GL_MODELVIEW6_ARB = 0x8726; - public static final int GL_MODELVIEW7_ARB = 0x8727; - public static final int GL_MODELVIEW8_ARB = 0x8728; - public static final int GL_MODELVIEW9_ARB = 0x8729; - public static final int GL_MODELVIEW10_ARB = 0x872A; - public static final int GL_MODELVIEW11_ARB = 0x872B; - public static final int GL_MODELVIEW12_ARB = 0x872C; - public static final int GL_MODELVIEW13_ARB = 0x872D; - public static final int GL_MODELVIEW14_ARB = 0x872E; - public static final int GL_MODELVIEW15_ARB = 0x872F; - public static final int GL_MODELVIEW16_ARB = 0x8730; - public static final int GL_MODELVIEW17_ARB = 0x8731; - public static final int GL_MODELVIEW18_ARB = 0x8732; - public static final int GL_MODELVIEW19_ARB = 0x8733; - public static final int GL_MODELVIEW20_ARB = 0x8734; - public static final int GL_MODELVIEW21_ARB = 0x8735; - public static final int GL_MODELVIEW22_ARB = 0x8736; - public static final int GL_MODELVIEW23_ARB = 0x8737; - public static final int GL_MODELVIEW24_ARB = 0x8738; - public static final int GL_MODELVIEW25_ARB = 0x8739; - public static final int GL_MODELVIEW26_ARB = 0x873A; - public static final int GL_MODELVIEW27_ARB = 0x873B; - public static final int GL_MODELVIEW28_ARB = 0x873C; - public static final int GL_MODELVIEW29_ARB = 0x873D; - public static final int GL_MODELVIEW30_ARB = 0x873E; - public static final int GL_MODELVIEW31_ARB = 0x873F; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_vertex_blend) return; - ext.glWeightbvARB = load.invoke("glWeightbvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glWeightsvARB = load.invoke("glWeightsvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glWeightivARB = load.invoke("glWeightivARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glWeightfvARB = load.invoke("glWeightfvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glWeightdvARB = load.invoke("glWeightdvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glWeightubvARB = load.invoke("glWeightubvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glWeightusvARB = load.invoke("glWeightusvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glWeightuivARB = load.invoke("glWeightuivARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glWeightPointerARB = load.invoke("glWeightPointerARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVertexBlendARB = load.invoke("glVertexBlendARB", ofVoid(JAVA_INT)); - } +public interface GLARBVertexBlend { + int GL_MAX_VERTEX_UNITS_ARB = 0x86A4; + int GL_ACTIVE_VERTEX_UNITS_ARB = 0x86A5; + int GL_WEIGHT_SUM_UNITY_ARB = 0x86A6; + int GL_VERTEX_BLEND_ARB = 0x86A7; + int GL_CURRENT_WEIGHT_ARB = 0x86A8; + int GL_WEIGHT_ARRAY_TYPE_ARB = 0x86A9; + int GL_WEIGHT_ARRAY_STRIDE_ARB = 0x86AA; + int GL_WEIGHT_ARRAY_SIZE_ARB = 0x86AB; + int GL_WEIGHT_ARRAY_POINTER_ARB = 0x86AC; + int GL_WEIGHT_ARRAY_ARB = 0x86AD; + int GL_MODELVIEW0_ARB = 0x1700; + int GL_MODELVIEW1_ARB = 0x850A; + int GL_MODELVIEW2_ARB = 0x8722; + int GL_MODELVIEW3_ARB = 0x8723; + int GL_MODELVIEW4_ARB = 0x8724; + int GL_MODELVIEW5_ARB = 0x8725; + int GL_MODELVIEW6_ARB = 0x8726; + int GL_MODELVIEW7_ARB = 0x8727; + int GL_MODELVIEW8_ARB = 0x8728; + int GL_MODELVIEW9_ARB = 0x8729; + int GL_MODELVIEW10_ARB = 0x872A; + int GL_MODELVIEW11_ARB = 0x872B; + int GL_MODELVIEW12_ARB = 0x872C; + int GL_MODELVIEW13_ARB = 0x872D; + int GL_MODELVIEW14_ARB = 0x872E; + int GL_MODELVIEW15_ARB = 0x872F; + int GL_MODELVIEW16_ARB = 0x8730; + int GL_MODELVIEW17_ARB = 0x8731; + int GL_MODELVIEW18_ARB = 0x8732; + int GL_MODELVIEW19_ARB = 0x8733; + int GL_MODELVIEW20_ARB = 0x8734; + int GL_MODELVIEW21_ARB = 0x8735; + int GL_MODELVIEW22_ARB = 0x8736; + int GL_MODELVIEW23_ARB = 0x8737; + int GL_MODELVIEW24_ARB = 0x8738; + int GL_MODELVIEW25_ARB = 0x8739; + int GL_MODELVIEW26_ARB = 0x873A; + int GL_MODELVIEW27_ARB = 0x873B; + int GL_MODELVIEW28_ARB = 0x873C; + int GL_MODELVIEW29_ARB = 0x873D; + int GL_MODELVIEW30_ARB = 0x873E; + int GL_MODELVIEW31_ARB = 0x873F; - public static void glWeightbvARB(int size, @NativeType("const GLbyte*") MemorySegment weights) { - final var ext = getExtCapabilities(); - try { - check(ext.glWeightbvARB).invokeExact(size, weights); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWeightbvARB(int size, @NativeType("const GLbyte*") MemorySegment weights) { + throw new ContextException(); } - public static void glWeightsvARB(int size, @NativeType("const GLshort*") MemorySegment weights) { - final var ext = getExtCapabilities(); - try { - check(ext.glWeightsvARB).invokeExact(size, weights); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWeightsvARB(int size, @NativeType("const GLshort*") MemorySegment weights) { + throw new ContextException(); } - public static void glWeightivARB(int size, @NativeType("const GLint*") MemorySegment weights) { - final var ext = getExtCapabilities(); - try { - check(ext.glWeightivARB).invokeExact(size, weights); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWeightivARB(int size, @NativeType("const GLint*") MemorySegment weights) { + throw new ContextException(); } - public static void glWeightfvARB(int size, @NativeType("const GLfloat*") MemorySegment weights) { - final var ext = getExtCapabilities(); - try { - check(ext.glWeightfvARB).invokeExact(size, weights); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWeightfvARB(int size, @NativeType("const GLfloat*") MemorySegment weights) { + throw new ContextException(); } - public static void glWeightdvARB(int size, @NativeType("const GLdouble*") MemorySegment weights) { - final var ext = getExtCapabilities(); - try { - check(ext.glWeightdvARB).invokeExact(size, weights); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWeightdvARB(int size, @NativeType("const GLdouble*") MemorySegment weights) { + throw new ContextException(); } - public static void glWeightubvARB(int size, @NativeType("const GLubyte*") MemorySegment weights) { - final var ext = getExtCapabilities(); - try { - check(ext.glWeightubvARB).invokeExact(size, weights); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWeightubvARB(int size, @NativeType("const GLubyte*") MemorySegment weights) { + throw new ContextException(); } - public static void glWeightusvARB(int size, @NativeType("const GLushort*") MemorySegment weights) { - final var ext = getExtCapabilities(); - try { - check(ext.glWeightusvARB).invokeExact(size, weights); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWeightusvARB(int size, @NativeType("const GLushort*") MemorySegment weights) { + throw new ContextException(); } - public static void glWeightuivARB(int size, @NativeType("const GLuint*") MemorySegment weights) { - final var ext = getExtCapabilities(); - try { - check(ext.glWeightuivARB).invokeExact(size, weights); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWeightuivARB(int size, @NativeType("const GLuint*") MemorySegment weights) { + throw new ContextException(); } - public static void glWeightPointerARB(int size, int type, int stride, @NativeType("const void*") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glWeightPointerARB).invokeExact(size, type, stride, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWeightPointerARB(int size, int type, int stride, @NativeType("const void*") MemorySegment pointer) { + throw new ContextException(); } - public static void glVertexBlendARB(int count) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexBlendARB).invokeExact(count); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexBlendARB(int count) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBVertexBufferObject.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBVertexBufferObject.java index b88324d2..f7766a2a 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBVertexBufferObject.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBVertexBufferObject.java @@ -16,142 +16,88 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_vertex_buffer_object} */ -public final class GLARBVertexBufferObject { - public static final int GL_BUFFER_SIZE_ARB = 0x8764; - public static final int GL_BUFFER_USAGE_ARB = 0x8765; - public static final int GL_ARRAY_BUFFER_ARB = 0x8892; - public static final int GL_ELEMENT_ARRAY_BUFFER_ARB = 0x8893; - public static final int GL_ARRAY_BUFFER_BINDING_ARB = 0x8894; - public static final int GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB = 0x8895; - public static final int GL_VERTEX_ARRAY_BUFFER_BINDING_ARB = 0x8896; - public static final int GL_NORMAL_ARRAY_BUFFER_BINDING_ARB = 0x8897; - public static final int GL_COLOR_ARRAY_BUFFER_BINDING_ARB = 0x8898; - public static final int GL_INDEX_ARRAY_BUFFER_BINDING_ARB = 0x8899; - public static final int GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB = 0x889A; - public static final int GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB = 0x889B; - public static final int GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB = 0x889C; - public static final int GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB = 0x889D; - public static final int GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB = 0x889E; - public static final int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB = 0x889F; - public static final int GL_READ_ONLY_ARB = 0x88B8; - public static final int GL_WRITE_ONLY_ARB = 0x88B9; - public static final int GL_READ_WRITE_ARB = 0x88BA; - public static final int GL_BUFFER_ACCESS_ARB = 0x88BB; - public static final int GL_BUFFER_MAPPED_ARB = 0x88BC; - public static final int GL_BUFFER_MAP_POINTER_ARB = 0x88BD; - public static final int GL_STREAM_DRAW_ARB = 0x88E0; - public static final int GL_STREAM_READ_ARB = 0x88E1; - public static final int GL_STREAM_COPY_ARB = 0x88E2; - public static final int GL_STATIC_DRAW_ARB = 0x88E4; - public static final int GL_STATIC_READ_ARB = 0x88E5; - public static final int GL_STATIC_COPY_ARB = 0x88E6; - public static final int GL_DYNAMIC_DRAW_ARB = 0x88E8; - public static final int GL_DYNAMIC_READ_ARB = 0x88E9; - public static final int GL_DYNAMIC_COPY_ARB = 0x88EA; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_vertex_buffer_object) return; - ext.glBindBufferARB = load.invoke("glBindBufferARB", ofVoid(JAVA_INT, JAVA_INT)); - ext.glDeleteBuffersARB = load.invoke("glDeleteBuffersARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glGenBuffersARB = load.invoke("glGenBuffersARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glIsBufferARB = load.invoke("glIsBufferARB", of(JAVA_BYTE, JAVA_INT)); - ext.glBufferDataARB = load.invoke("glBufferDataARB", ofVoid(JAVA_INT, JAVA_LONG, ADDRESS, JAVA_INT)); - ext.glBufferSubDataARB = load.invoke("glBufferSubDataARB", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, ADDRESS)); - ext.glGetBufferSubDataARB = load.invoke("glGetBufferSubDataARB", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, ADDRESS)); - ext.glMapBufferARB = load.invoke("glMapBufferARB", of(ADDRESS, JAVA_INT, JAVA_INT)); - ext.glUnmapBufferARB = load.invoke("glUnmapBufferARB", of(JAVA_BYTE, JAVA_INT)); - ext.glGetBufferParameterivARB = load.invoke("glGetBufferParameterivARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetBufferPointervARB = load.invoke("glGetBufferPointervARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLARBVertexBufferObject { + int GL_BUFFER_SIZE_ARB = 0x8764; + int GL_BUFFER_USAGE_ARB = 0x8765; + int GL_ARRAY_BUFFER_ARB = 0x8892; + int GL_ELEMENT_ARRAY_BUFFER_ARB = 0x8893; + int GL_ARRAY_BUFFER_BINDING_ARB = 0x8894; + int GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB = 0x8895; + int GL_VERTEX_ARRAY_BUFFER_BINDING_ARB = 0x8896; + int GL_NORMAL_ARRAY_BUFFER_BINDING_ARB = 0x8897; + int GL_COLOR_ARRAY_BUFFER_BINDING_ARB = 0x8898; + int GL_INDEX_ARRAY_BUFFER_BINDING_ARB = 0x8899; + int GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB = 0x889A; + int GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB = 0x889B; + int GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB = 0x889C; + int GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB = 0x889D; + int GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB = 0x889E; + int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB = 0x889F; + int GL_READ_ONLY_ARB = 0x88B8; + int GL_WRITE_ONLY_ARB = 0x88B9; + int GL_READ_WRITE_ARB = 0x88BA; + int GL_BUFFER_ACCESS_ARB = 0x88BB; + int GL_BUFFER_MAPPED_ARB = 0x88BC; + int GL_BUFFER_MAP_POINTER_ARB = 0x88BD; + int GL_STREAM_DRAW_ARB = 0x88E0; + int GL_STREAM_READ_ARB = 0x88E1; + int GL_STREAM_COPY_ARB = 0x88E2; + int GL_STATIC_DRAW_ARB = 0x88E4; + int GL_STATIC_READ_ARB = 0x88E5; + int GL_STATIC_COPY_ARB = 0x88E6; + int GL_DYNAMIC_DRAW_ARB = 0x88E8; + int GL_DYNAMIC_READ_ARB = 0x88E9; + int GL_DYNAMIC_COPY_ARB = 0x88EA; - public static void glBindBufferARB(int target, int buffer) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindBufferARB).invokeExact(target, buffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBindBufferARB(int target, int buffer) { + throw new ContextException(); } - public static void glDeleteBuffersARB(int n, @NativeType("const GLuint*") MemorySegment buffers) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteBuffersARB).invokeExact(n, buffers); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDeleteBuffersARB(int n, @NativeType("const GLuint*") MemorySegment buffers) { + throw new ContextException(); } - public static void glGenBuffersARB(int n, @NativeType("GLuint*") MemorySegment buffers) { - final var ext = getExtCapabilities(); - try { - check(ext.glGenBuffersARB).invokeExact(n, buffers); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGenBuffersARB(int n, @NativeType("GLuint*") MemorySegment buffers) { + throw new ContextException(); } - public static boolean glIsBufferARB(int buffer) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsBufferARB).invokeExact(buffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsBufferARB(int buffer) { + throw new ContextException(); } - public static void glBufferDataARB(int target, long size, @NativeType("const void*") MemorySegment data, int usage) { - final var ext = getExtCapabilities(); - try { - check(ext.glBufferDataARB).invokeExact(target, size, data, usage); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBufferDataARB(int target, long size, @NativeType("const void*") MemorySegment data, int usage) { + throw new ContextException(); } - public static void glBufferSubDataARB(int target, long offset, long size, @NativeType("const void*") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glBufferSubDataARB).invokeExact(target, offset, size, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBufferSubDataARB(int target, long offset, long size, @NativeType("const void*") MemorySegment data) { + throw new ContextException(); } - public static void glGetBufferSubDataARB(int target, long offset, long size, @NativeType("void*") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetBufferSubDataARB).invokeExact(target, offset, size, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetBufferSubDataARB(int target, long offset, long size, @NativeType("void*") MemorySegment data) { + throw new ContextException(); } - public static @NativeType("void*") MemorySegment glMapBufferARB(int target, int access) { - final var ext = getExtCapabilities(); - try { - return (MemorySegment) - check(ext.glMapBufferARB).invokeExact(target, access); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + @NativeType("void*") default MemorySegment glMapBufferARB(int target, int access) { + throw new ContextException(); } - public static boolean glUnmapBufferARB(int target) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glUnmapBufferARB).invokeExact(target); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glUnmapBufferARB(int target) { + throw new ContextException(); } - public static void glGetBufferParameterivARB(int target, int pname, @NativeType("GLint*") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetBufferParameterivARB).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetBufferParameterivARB(int target, int pname, @NativeType("GLint*") MemorySegment params) { + throw new ContextException(); } - public static void glGetBufferPointervARB(int target, int pname, @NativeType("void**") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetBufferPointervARB).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetBufferPointervARB(int target, int pname, @NativeType("void**") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBVertexProgram.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBVertexProgram.java index dd1f839f..068d213c 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBVertexProgram.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBVertexProgram.java @@ -16,380 +16,201 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_vertex_program} */ -public final class GLARBVertexProgram { - public static final int GL_COLOR_SUM_ARB = 0x8458; - public static final int GL_VERTEX_PROGRAM_ARB = 0x8620; - public static final int GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB = 0x8622; - public static final int GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB = 0x8623; - public static final int GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB = 0x8624; - public static final int GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB = 0x8625; - public static final int GL_CURRENT_VERTEX_ATTRIB_ARB = 0x8626; - public static final int GL_VERTEX_PROGRAM_POINT_SIZE_ARB = 0x8642; - public static final int GL_VERTEX_PROGRAM_TWO_SIDE_ARB = 0x8643; - public static final int GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB = 0x8645; - public static final int GL_MAX_VERTEX_ATTRIBS_ARB = 0x8869; - public static final int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A; - public static final int GL_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B0; - public static final int GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B1; - public static final int GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B2; - public static final int GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B3; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_vertex_program) return; - ext.glVertexAttrib1dARB = load.invoke("glVertexAttrib1dARB", ofVoid(JAVA_INT, JAVA_DOUBLE)); - ext.glVertexAttrib1dvARB = load.invoke("glVertexAttrib1dvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib1fARB = load.invoke("glVertexAttrib1fARB", ofVoid(JAVA_INT, JAVA_FLOAT)); - ext.glVertexAttrib1fvARB = load.invoke("glVertexAttrib1fvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib1sARB = load.invoke("glVertexAttrib1sARB", ofVoid(JAVA_INT, JAVA_SHORT)); - ext.glVertexAttrib1svARB = load.invoke("glVertexAttrib1svARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib2dARB = load.invoke("glVertexAttrib2dARB", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glVertexAttrib2dvARB = load.invoke("glVertexAttrib2dvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib2fARB = load.invoke("glVertexAttrib2fARB", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glVertexAttrib2fvARB = load.invoke("glVertexAttrib2fvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib2sARB = load.invoke("glVertexAttrib2sARB", ofVoid(JAVA_INT, JAVA_SHORT, JAVA_SHORT)); - ext.glVertexAttrib2svARB = load.invoke("glVertexAttrib2svARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib3dARB = load.invoke("glVertexAttrib3dARB", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glVertexAttrib3dvARB = load.invoke("glVertexAttrib3dvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib3fARB = load.invoke("glVertexAttrib3fARB", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glVertexAttrib3fvARB = load.invoke("glVertexAttrib3fvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib3sARB = load.invoke("glVertexAttrib3sARB", ofVoid(JAVA_INT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glVertexAttrib3svARB = load.invoke("glVertexAttrib3svARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib4NbvARB = load.invoke("glVertexAttrib4NbvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib4NivARB = load.invoke("glVertexAttrib4NivARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib4NsvARB = load.invoke("glVertexAttrib4NsvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib4NubARB = load.invoke("glVertexAttrib4NubARB", ofVoid(JAVA_INT, JAVA_BYTE, JAVA_BYTE, JAVA_BYTE, JAVA_BYTE)); - ext.glVertexAttrib4NubvARB = load.invoke("glVertexAttrib4NubvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib4NuivARB = load.invoke("glVertexAttrib4NuivARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib4NusvARB = load.invoke("glVertexAttrib4NusvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib4bvARB = load.invoke("glVertexAttrib4bvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib4dARB = load.invoke("glVertexAttrib4dARB", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glVertexAttrib4dvARB = load.invoke("glVertexAttrib4dvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib4fARB = load.invoke("glVertexAttrib4fARB", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glVertexAttrib4fvARB = load.invoke("glVertexAttrib4fvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib4ivARB = load.invoke("glVertexAttrib4ivARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib4sARB = load.invoke("glVertexAttrib4sARB", ofVoid(JAVA_INT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glVertexAttrib4svARB = load.invoke("glVertexAttrib4svARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib4ubvARB = load.invoke("glVertexAttrib4ubvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib4uivARB = load.invoke("glVertexAttrib4uivARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib4usvARB = load.invoke("glVertexAttrib4usvARB", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribPointerARB = load.invoke("glVertexAttribPointerARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, JAVA_INT, ADDRESS)); - ext.glEnableVertexAttribArrayARB = load.invoke("glEnableVertexAttribArrayARB", ofVoid(JAVA_INT)); - ext.glDisableVertexAttribArrayARB = load.invoke("glDisableVertexAttribArrayARB", ofVoid(JAVA_INT)); - ext.glGetVertexAttribdvARB = load.invoke("glGetVertexAttribdvARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVertexAttribfvARB = load.invoke("glGetVertexAttribfvARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVertexAttribivARB = load.invoke("glGetVertexAttribivARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVertexAttribPointervARB = load.invoke("glGetVertexAttribPointervARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static void glVertexAttrib1dARB(int index, double x) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib1dARB).invokeExact(index, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertexAttrib1dvARB(int index, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib1dvARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertexAttrib1fARB(int index, float x) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib1fARB).invokeExact(index, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertexAttrib1fvARB(int index, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib1fvARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertexAttrib1sARB(int index, short x) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib1sARB).invokeExact(index, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertexAttrib1svARB(int index, @NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib1svARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertexAttrib2dARB(int index, double x, double y) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib2dARB).invokeExact(index, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertexAttrib2dvARB(int index, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib2dvARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertexAttrib2fARB(int index, float x, float y) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib2fARB).invokeExact(index, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertexAttrib2fvARB(int index, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib2fvARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLARBVertexProgram { + int GL_COLOR_SUM_ARB = 0x8458; + int GL_VERTEX_PROGRAM_ARB = 0x8620; + int GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB = 0x8622; + int GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB = 0x8623; + int GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB = 0x8624; + int GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB = 0x8625; + int GL_CURRENT_VERTEX_ATTRIB_ARB = 0x8626; + int GL_VERTEX_PROGRAM_POINT_SIZE_ARB = 0x8642; + int GL_VERTEX_PROGRAM_TWO_SIDE_ARB = 0x8643; + int GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB = 0x8645; + int GL_MAX_VERTEX_ATTRIBS_ARB = 0x8869; + int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A; + int GL_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B0; + int GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B1; + int GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B2; + int GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B3; + + default void glVertexAttrib1dARB(int index, double x) { + throw new ContextException(); + } + + default void glVertexAttrib1dvARB(int index, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); + } + + default void glVertexAttrib1fARB(int index, float x) { + throw new ContextException(); + } + + default void glVertexAttrib1fvARB(int index, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); + } + + default void glVertexAttrib1sARB(int index, short x) { + throw new ContextException(); + } + + default void glVertexAttrib1svARB(int index, @NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); + } + + default void glVertexAttrib2dARB(int index, double x, double y) { + throw new ContextException(); + } + + default void glVertexAttrib2dvARB(int index, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); + } + + default void glVertexAttrib2fARB(int index, float x, float y) { + throw new ContextException(); + } + + default void glVertexAttrib2fvARB(int index, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib2sARB(int index, short x, short y) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib2sARB).invokeExact(index, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib2sARB(int index, short x, short y) { + throw new ContextException(); } - public static void glVertexAttrib2svARB(int index, @NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib2svARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib2svARB(int index, @NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib3dARB(int index, double x, double y, double z) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib3dARB).invokeExact(index, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib3dARB(int index, double x, double y, double z) { + throw new ContextException(); } - public static void glVertexAttrib3dvARB(int index, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib3dvARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib3dvARB(int index, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib3fARB(int index, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib3fARB).invokeExact(index, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib3fARB(int index, float x, float y, float z) { + throw new ContextException(); } - public static void glVertexAttrib3fvARB(int index, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib3fvARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib3fvARB(int index, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib3sARB(int index, short x, short y, short z) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib3sARB).invokeExact(index, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib3sARB(int index, short x, short y, short z) { + throw new ContextException(); } - public static void glVertexAttrib3svARB(int index, @NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib3svARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib3svARB(int index, @NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib4NbvARB(int index, @NativeType("const GLbyte *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4NbvARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4NbvARB(int index, @NativeType("const GLbyte *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib4NivARB(int index, @NativeType("const GLint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4NivARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4NivARB(int index, @NativeType("const GLint *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib4NsvARB(int index, @NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4NsvARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4NsvARB(int index, @NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib4NubARB(int index, byte x, byte y, byte z, byte w) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4NubARB).invokeExact(index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4NubARB(int index, byte x, byte y, byte z, byte w) { + throw new ContextException(); } - public static void glVertexAttrib4NubvARB(int index, @NativeType("const GLubyte *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4NubvARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4NubvARB(int index, @NativeType("const GLubyte *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib4NuivARB(int index, @NativeType("const GLuint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4NuivARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4NuivARB(int index, @NativeType("const GLuint *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib4NusvARB(int index, @NativeType("const GLushort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4NusvARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4NusvARB(int index, @NativeType("const GLushort *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib4bvARB(int index, @NativeType("const GLbyte *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4bvARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4bvARB(int index, @NativeType("const GLbyte *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib4dARB(int index, double x, double y, double z, double w) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4dARB).invokeExact(index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4dARB(int index, double x, double y, double z, double w) { + throw new ContextException(); } - public static void glVertexAttrib4dvARB(int index, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4dvARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4dvARB(int index, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib4fARB(int index, float x, float y, float z, float w) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4fARB).invokeExact(index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4fARB(int index, float x, float y, float z, float w) { + throw new ContextException(); } - public static void glVertexAttrib4fvARB(int index, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4fvARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4fvARB(int index, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib4ivARB(int index, @NativeType("const GLint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4ivARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4ivARB(int index, @NativeType("const GLint *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib4sARB(int index, short x, short y, short z, short w) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4sARB).invokeExact(index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4sARB(int index, short x, short y, short z, short w) { + throw new ContextException(); } - public static void glVertexAttrib4svARB(int index, @NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4svARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4svARB(int index, @NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib4ubvARB(int index, @NativeType("const GLubyte *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4ubvARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4ubvARB(int index, @NativeType("const GLubyte *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib4uivARB(int index, @NativeType("const GLuint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4uivARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4uivARB(int index, @NativeType("const GLuint *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib4usvARB(int index, @NativeType("const GLushort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4usvARB).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4usvARB(int index, @NativeType("const GLushort *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribPointerARB(int index, int size, int type, boolean normalized, int stride, @NativeType("const void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribPointerARB).invokeExact(index, size, type, normalized, stride, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribPointerARB(int index, int size, int type, boolean normalized, int stride, @NativeType("const void *") MemorySegment pointer) { + throw new ContextException(); } - public static void glEnableVertexAttribArrayARB(int index) { - final var ext = getExtCapabilities(); - try { - check(ext.glEnableVertexAttribArrayARB).invokeExact(index); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEnableVertexAttribArrayARB(int index) { + throw new ContextException(); } - public static void glDisableVertexAttribArrayARB(int index) { - final var ext = getExtCapabilities(); - try { - check(ext.glDisableVertexAttribArrayARB).invokeExact(index); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDisableVertexAttribArrayARB(int index) { + throw new ContextException(); } - public static void glGetVertexAttribdvARB(int index, int pname, @NativeType("GLdouble *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVertexAttribdvARB).invokeExact(index, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVertexAttribdvARB(int index, int pname, @NativeType("GLdouble *") MemorySegment params) { + throw new ContextException(); } - public static void glGetVertexAttribfvARB(int index, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVertexAttribfvARB).invokeExact(index, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVertexAttribfvARB(int index, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetVertexAttribivARB(int index, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVertexAttribivARB).invokeExact(index, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVertexAttribivARB(int index, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetVertexAttribPointervARB(int index, int pname, @NativeType("void **") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVertexAttribPointervARB).invokeExact(index, pname, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVertexAttribPointervARB(int index, int pname, @NativeType("void **") MemorySegment pointer) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBVertexShader.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBVertexShader.java index e8b4db31..e5b6d87b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBVertexShader.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBVertexShader.java @@ -16,52 +16,32 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_vertex_shader} */ -public final class GLARBVertexShader { - public static final int GL_VERTEX_SHADER_ARB = 0x8B31; - public static final int GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB = 0x8B4A; - public static final int GL_MAX_VARYING_FLOATS_ARB = 0x8B4B; - public static final int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB = 0x8B4C; - public static final int GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB = 0x8B4D; - public static final int GL_OBJECT_ACTIVE_ATTRIBUTES_ARB = 0x8B89; - public static final int GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB = 0x8B8A; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_vertex_shader) return; - ext.glBindAttribLocationARB = load.invoke("glBindAttribLocationARB", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetActiveAttribARB = load.invoke("glGetActiveAttribARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, ADDRESS, ADDRESS, ADDRESS)); - ext.glGetAttribLocationARB = load.invoke("glGetAttribLocationARB", of(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLARBVertexShader { + int GL_VERTEX_SHADER_ARB = 0x8B31; + int GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB = 0x8B4A; + int GL_MAX_VARYING_FLOATS_ARB = 0x8B4B; + int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB = 0x8B4C; + int GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB = 0x8B4D; + int GL_OBJECT_ACTIVE_ATTRIBUTES_ARB = 0x8B89; + int GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB = 0x8B8A; - public static void glBindAttribLocationARB(int programObj, int index, @NativeType("const GLcharARB *") MemorySegment name) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindAttribLocationARB).invokeExact(programObj, index, name); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBindAttribLocationARB(int programObj, int index, @NativeType("const GLcharARB *") MemorySegment name) { + throw new ContextException(); } - public static void glGetActiveAttribARB(int programObj, int index, int maxLength, @NativeType("GLsizei *") MemorySegment length, @NativeType("GLint *") MemorySegment size, @NativeType("GLenum *") MemorySegment type, @NativeType("GLcharARB *") MemorySegment name) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetActiveAttribARB).invokeExact(programObj, index, maxLength, length, size, type, name); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetActiveAttribARB(int programObj, int index, int maxLength, @NativeType("GLsizei *") MemorySegment length, @NativeType("GLint *") MemorySegment size, @NativeType("GLenum *") MemorySegment type, @NativeType("GLcharARB *") MemorySegment name) { + throw new ContextException(); } - public static int glGetAttribLocationARB(int programObj, @NativeType("const GLcharARB *") MemorySegment name) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glGetAttribLocationARB).invokeExact(programObj, name); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glGetAttribLocationARB(int programObj, @NativeType("const GLcharARB *") MemorySegment name) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBViewportArray.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBViewportArray.java index 6a7a402c..25c650ac 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBViewportArray.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBViewportArray.java @@ -16,36 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_viewport_array} */ -public final class GLARBViewportArray { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_viewport_array) return; - ext.glDepthRangeArraydvNV = load.invoke("glDepthRangeArraydvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glDepthRangeIndexeddNV = load.invoke("glDepthRangeIndexeddNV", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE)); - } +public interface GLARBViewportArray { - public static void glDepthRangeArraydvNV(int first, int count, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glDepthRangeArraydvNV).invokeExact(first, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDepthRangeArraydvNV(int first, int count, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glDepthRangeIndexeddNV(int index, double n, double f) { - final var ext = getExtCapabilities(); - try { - check(ext.glDepthRangeIndexeddNV).invokeExact(index, n, f); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDepthRangeIndexeddNV(int index, double n, double f) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBWindowPos.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBWindowPos.java index 6a52a5da..710a69f8 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBWindowPos.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/arb/GLARBWindowPos.java @@ -16,148 +16,77 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.arb; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ARB_window_pos} */ -public final class GLARBWindowPos { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ARB_window_pos) return; - ext.glWindowPos2dARB = load.invoke("glWindowPos2dARB", ofVoid(JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glWindowPos2dvARB = load.invoke("glWindowPos2dvARB", ofVoid(ADDRESS)); - ext.glWindowPos2fARB = load.invoke("glWindowPos2fARB", ofVoid(JAVA_FLOAT, JAVA_FLOAT)); - ext.glWindowPos2fvARB = load.invoke("glWindowPos2fvARB", ofVoid(ADDRESS)); - ext.glWindowPos2iARB = load.invoke("glWindowPos2iARB", ofVoid(JAVA_INT, JAVA_INT)); - ext.glWindowPos2ivARB = load.invoke("glWindowPos2ivARB", ofVoid(ADDRESS)); - ext.glWindowPos2sARB = load.invoke("glWindowPos2sARB", ofVoid(JAVA_SHORT, JAVA_SHORT)); - ext.glWindowPos2svARB = load.invoke("glWindowPos2svARB", ofVoid(ADDRESS)); - ext.glWindowPos3dARB = load.invoke("glWindowPos3dARB", ofVoid(JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glWindowPos3dvARB = load.invoke("glWindowPos3dvARB", ofVoid(ADDRESS)); - ext.glWindowPos3fARB = load.invoke("glWindowPos3fARB", ofVoid(JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glWindowPos3fvARB = load.invoke("glWindowPos3fvARB", ofVoid(ADDRESS)); - ext.glWindowPos3iARB = load.invoke("glWindowPos3iARB", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glWindowPos3ivARB = load.invoke("glWindowPos3ivARB", ofVoid(ADDRESS)); - ext.glWindowPos3sARB = load.invoke("glWindowPos3sARB", ofVoid(JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glWindowPos3svARB = load.invoke("glWindowPos3svARB", ofVoid(ADDRESS)); - } +public interface GLARBWindowPos { - public static void glWindowPos2dARB(double x, double y) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos2dARB).invokeExact(x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos2dARB(double x, double y) { + throw new ContextException(); } - public static void glWindowPos2dvARB(@NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos2dvARB).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos2dvARB(@NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glWindowPos2fARB(float x, float y) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos2fARB).invokeExact(x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos2fARB(float x, float y) { + throw new ContextException(); } - public static void glWindowPos2fvARB(@NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos2fvARB).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos2fvARB(@NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glWindowPos2iARB(int x, int y) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos2iARB).invokeExact(x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos2iARB(int x, int y) { + throw new ContextException(); } - public static void glWindowPos2ivARB(@NativeType("const GLint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos2ivARB).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos2ivARB(@NativeType("const GLint *") MemorySegment v) { + throw new ContextException(); } - public static void glWindowPos2sARB(short x, short y) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos2sARB).invokeExact(x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos2sARB(short x, short y) { + throw new ContextException(); } - public static void glWindowPos2svARB(@NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos2svARB).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos2svARB(@NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } - public static void glWindowPos3dARB(double x, double y, double z) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos3dARB).invokeExact(x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos3dARB(double x, double y, double z) { + throw new ContextException(); } - public static void glWindowPos3dvARB(@NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos3dvARB).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos3dvARB(@NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glWindowPos3fARB(float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos3fARB).invokeExact(x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos3fARB(float x, float y, float z) { + throw new ContextException(); } - public static void glWindowPos3fvARB(@NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos3fvARB).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos3fvARB(@NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glWindowPos3iARB(int x, int y, int z) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos3iARB).invokeExact(x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos3iARB(int x, int y, int z) { + throw new ContextException(); } - public static void glWindowPos3ivARB(@NativeType("const GLint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos3ivARB).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos3ivARB(@NativeType("const GLint *") MemorySegment v) { + throw new ContextException(); } - public static void glWindowPos3sARB(short x, short y, short z) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos3sARB).invokeExact(x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos3sARB(short x, short y, short z) { + throw new ContextException(); } - public static void glWindowPos3svARB(@NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos3svARB).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos3svARB(@NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIDrawBuffers.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIDrawBuffers.java index d1aae866..8d68a03d 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIDrawBuffers.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIDrawBuffers.java @@ -16,45 +16,34 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ati; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ATI_draw_buffers} */ -public final class GLATIDrawBuffers { - public static final int GL_MAX_DRAW_BUFFERS_ATI = 0x8824; - public static final int GL_DRAW_BUFFER0_ATI = 0x8825; - public static final int GL_DRAW_BUFFER1_ATI = 0x8826; - public static final int GL_DRAW_BUFFER2_ATI = 0x8827; - public static final int GL_DRAW_BUFFER3_ATI = 0x8828; - public static final int GL_DRAW_BUFFER4_ATI = 0x8829; - public static final int GL_DRAW_BUFFER5_ATI = 0x882A; - public static final int GL_DRAW_BUFFER6_ATI = 0x882B; - public static final int GL_DRAW_BUFFER7_ATI = 0x882C; - public static final int GL_DRAW_BUFFER8_ATI = 0x882D; - public static final int GL_DRAW_BUFFER9_ATI = 0x882E; - public static final int GL_DRAW_BUFFER10_ATI = 0x882F; - public static final int GL_DRAW_BUFFER11_ATI = 0x8830; - public static final int GL_DRAW_BUFFER12_ATI = 0x8831; - public static final int GL_DRAW_BUFFER13_ATI = 0x8832; - public static final int GL_DRAW_BUFFER14_ATI = 0x8833; - public static final int GL_DRAW_BUFFER15_ATI = 0x8834; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ATI_draw_buffers) return; - ext.glDrawBuffersATI = load.invoke("glDrawBuffersATI", ofVoid(JAVA_INT, ADDRESS)); - } +public interface GLATIDrawBuffers { + int GL_MAX_DRAW_BUFFERS_ATI = 0x8824; + int GL_DRAW_BUFFER0_ATI = 0x8825; + int GL_DRAW_BUFFER1_ATI = 0x8826; + int GL_DRAW_BUFFER2_ATI = 0x8827; + int GL_DRAW_BUFFER3_ATI = 0x8828; + int GL_DRAW_BUFFER4_ATI = 0x8829; + int GL_DRAW_BUFFER5_ATI = 0x882A; + int GL_DRAW_BUFFER6_ATI = 0x882B; + int GL_DRAW_BUFFER7_ATI = 0x882C; + int GL_DRAW_BUFFER8_ATI = 0x882D; + int GL_DRAW_BUFFER9_ATI = 0x882E; + int GL_DRAW_BUFFER10_ATI = 0x882F; + int GL_DRAW_BUFFER11_ATI = 0x8830; + int GL_DRAW_BUFFER12_ATI = 0x8831; + int GL_DRAW_BUFFER13_ATI = 0x8832; + int GL_DRAW_BUFFER14_ATI = 0x8833; + int GL_DRAW_BUFFER15_ATI = 0x8834; - public static void glDrawBuffersATI(int n, @NativeType("const GLenum *") MemorySegment bufs) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawBuffersATI).invokeExact(n, bufs); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDrawBuffersATI(int n, @NativeType("const GLenum *") MemorySegment bufs) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIElementArray.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIElementArray.java index 9c142156..a088c8e3 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIElementArray.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIElementArray.java @@ -16,47 +16,28 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ati; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ATI_element_array} */ -public final class GLATIElementArray { - public static final int GL_ELEMENT_ARRAY_ATI = 0x8768; - public static final int GL_ELEMENT_ARRAY_TYPE_ATI = 0x8769; - public static final int GL_ELEMENT_ARRAY_POINTER_ATI = 0x876A; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ATI_element_array) return; - ext.glElementPointerATI = load.invoke("glElementPointerATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glDrawElementArrayATI = load.invoke("glDrawElementArrayATI", ofVoid(JAVA_INT, JAVA_INT)); - ext.glDrawRangeElementArrayATI = load.invoke("glDrawRangeElementArrayATI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLATIElementArray { + int GL_ELEMENT_ARRAY_ATI = 0x8768; + int GL_ELEMENT_ARRAY_TYPE_ATI = 0x8769; + int GL_ELEMENT_ARRAY_POINTER_ATI = 0x876A; - public static void glElementPointerATI(int type, @NativeType("const void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glElementPointerATI).invokeExact(type, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glElementPointerATI(int type, @NativeType("const void *") MemorySegment pointer) { + throw new ContextException(); } - public static void glDrawElementArrayATI(int mode, int count) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawElementArrayATI).invokeExact(mode, count); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDrawElementArrayATI(int mode, int count) { + throw new ContextException(); } - public static void glDrawRangeElementArrayATI(int mode, int start, int end, int count) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawRangeElementArrayATI).invokeExact(mode, start, end, count); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDrawRangeElementArrayATI(int mode, int start, int end, int count) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIEnvmapBumpmap.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIEnvmapBumpmap.java index a528be6d..a4904ef6 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIEnvmapBumpmap.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIEnvmapBumpmap.java @@ -16,60 +16,37 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ati; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ATI_envmap_bumpmap} */ -public final class GLATIEnvmapBumpmap { - public static final int GL_BUMP_ROT_MATRIX_ATI = 0x8775; - public static final int GL_BUMP_ROT_MATRIX_SIZE_ATI = 0x8776; - public static final int GL_BUMP_NUM_TEX_UNITS_ATI = 0x8777; - public static final int GL_BUMP_TEX_UNITS_ATI = 0x8778; - public static final int GL_DUDV_ATI = 0x8779; - public static final int GL_DU8DV8_ATI = 0x877A; - public static final int GL_BUMP_ENVMAP_ATI = 0x877B; - public static final int GL_BUMP_TARGET_ATI = 0x877C; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ATI_envmap_bumpmap) return; - ext.glTexBumpParameterivATI = load.invoke("glTexBumpParameterivATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glTexBumpParameterfvATI = load.invoke("glTexBumpParameterfvATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glGetTexBumpParameterivATI = load.invoke("glGetTexBumpParameterivATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glGetTexBumpParameterfvATI = load.invoke("glGetTexBumpParameterfvATI", ofVoid(JAVA_INT, ADDRESS)); - } - - public static void glTexBumpParameterivATI(int pname, @NativeType("const GLint *") MemorySegment param) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexBumpParameterivATI).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLATIEnvmapBumpmap { + int GL_BUMP_ROT_MATRIX_ATI = 0x8775; + int GL_BUMP_ROT_MATRIX_SIZE_ATI = 0x8776; + int GL_BUMP_NUM_TEX_UNITS_ATI = 0x8777; + int GL_BUMP_TEX_UNITS_ATI = 0x8778; + int GL_DUDV_ATI = 0x8779; + int GL_DU8DV8_ATI = 0x877A; + int GL_BUMP_ENVMAP_ATI = 0x877B; + int GL_BUMP_TARGET_ATI = 0x877C; + + default void glTexBumpParameterivATI(int pname, @NativeType("const GLint *") MemorySegment param) { + throw new ContextException(); } - public static void glTexBumpParameterfvATI(int pname, @NativeType("const GLfloat *") MemorySegment param) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexBumpParameterfvATI).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexBumpParameterfvATI(int pname, @NativeType("const GLfloat *") MemorySegment param) { + throw new ContextException(); } - public static void glGetTexBumpParameterivATI(int pname, @NativeType("GLint *") MemorySegment param) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetTexBumpParameterivATI).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetTexBumpParameterivATI(int pname, @NativeType("GLint *") MemorySegment param) { + throw new ContextException(); } - public static void glGetTexBumpParameterfvATI(int pname, @NativeType("GLfloat *") MemorySegment param) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetTexBumpParameterfvATI).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetTexBumpParameterfvATI(int pname, @NativeType("GLfloat *") MemorySegment param) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIFragmentShader.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIFragmentShader.java index 14118cae..0e293efb 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIFragmentShader.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIFragmentShader.java @@ -16,237 +16,173 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ati; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ATI_fragment_shader} */ -public final class GLATIFragmentShader { - public static final int GL_FRAGMENT_SHADER_ATI = 0x8920; - public static final int GL_REG_0_ATI = 0x8921; - public static final int GL_REG_1_ATI = 0x8922; - public static final int GL_REG_2_ATI = 0x8923; - public static final int GL_REG_3_ATI = 0x8924; - public static final int GL_REG_4_ATI = 0x8925; - public static final int GL_REG_5_ATI = 0x8926; - public static final int GL_REG_6_ATI = 0x8927; - public static final int GL_REG_7_ATI = 0x8928; - public static final int GL_REG_8_ATI = 0x8929; - public static final int GL_REG_9_ATI = 0x892A; - public static final int GL_REG_10_ATI = 0x892B; - public static final int GL_REG_11_ATI = 0x892C; - public static final int GL_REG_12_ATI = 0x892D; - public static final int GL_REG_13_ATI = 0x892E; - public static final int GL_REG_14_ATI = 0x892F; - public static final int GL_REG_15_ATI = 0x8930; - public static final int GL_REG_16_ATI = 0x8931; - public static final int GL_REG_17_ATI = 0x8932; - public static final int GL_REG_18_ATI = 0x8933; - public static final int GL_REG_19_ATI = 0x8934; - public static final int GL_REG_20_ATI = 0x8935; - public static final int GL_REG_21_ATI = 0x8936; - public static final int GL_REG_22_ATI = 0x8937; - public static final int GL_REG_23_ATI = 0x8938; - public static final int GL_REG_24_ATI = 0x8939; - public static final int GL_REG_25_ATI = 0x893A; - public static final int GL_REG_26_ATI = 0x893B; - public static final int GL_REG_27_ATI = 0x893C; - public static final int GL_REG_28_ATI = 0x893D; - public static final int GL_REG_29_ATI = 0x893E; - public static final int GL_REG_30_ATI = 0x893F; - public static final int GL_REG_31_ATI = 0x8940; - public static final int GL_CON_0_ATI = 0x8941; - public static final int GL_CON_1_ATI = 0x8942; - public static final int GL_CON_2_ATI = 0x8943; - public static final int GL_CON_3_ATI = 0x8944; - public static final int GL_CON_4_ATI = 0x8945; - public static final int GL_CON_5_ATI = 0x8946; - public static final int GL_CON_6_ATI = 0x8947; - public static final int GL_CON_7_ATI = 0x8948; - public static final int GL_CON_8_ATI = 0x8949; - public static final int GL_CON_9_ATI = 0x894A; - public static final int GL_CON_10_ATI = 0x894B; - public static final int GL_CON_11_ATI = 0x894C; - public static final int GL_CON_12_ATI = 0x894D; - public static final int GL_CON_13_ATI = 0x894E; - public static final int GL_CON_14_ATI = 0x894F; - public static final int GL_CON_15_ATI = 0x8950; - public static final int GL_CON_16_ATI = 0x8951; - public static final int GL_CON_17_ATI = 0x8952; - public static final int GL_CON_18_ATI = 0x8953; - public static final int GL_CON_19_ATI = 0x8954; - public static final int GL_CON_20_ATI = 0x8955; - public static final int GL_CON_21_ATI = 0x8956; - public static final int GL_CON_22_ATI = 0x8957; - public static final int GL_CON_23_ATI = 0x8958; - public static final int GL_CON_24_ATI = 0x8959; - public static final int GL_CON_25_ATI = 0x895A; - public static final int GL_CON_26_ATI = 0x895B; - public static final int GL_CON_27_ATI = 0x895C; - public static final int GL_CON_28_ATI = 0x895D; - public static final int GL_CON_29_ATI = 0x895E; - public static final int GL_CON_30_ATI = 0x895F; - public static final int GL_CON_31_ATI = 0x8960; - public static final int GL_MOV_ATI = 0x8961; - public static final int GL_ADD_ATI = 0x8963; - public static final int GL_MUL_ATI = 0x8964; - public static final int GL_SUB_ATI = 0x8965; - public static final int GL_DOT3_ATI = 0x8966; - public static final int GL_DOT4_ATI = 0x8967; - public static final int GL_MAD_ATI = 0x8968; - public static final int GL_LERP_ATI = 0x8969; - public static final int GL_CND_ATI = 0x896A; - public static final int GL_CND0_ATI = 0x896B; - public static final int GL_DOT2_ADD_ATI = 0x896C; - public static final int GL_SECONDARY_INTERPOLATOR_ATI = 0x896D; - public static final int GL_NUM_FRAGMENT_REGISTERS_ATI = 0x896E; - public static final int GL_NUM_FRAGMENT_CONSTANTS_ATI = 0x896F; - public static final int GL_NUM_PASSES_ATI = 0x8970; - public static final int GL_NUM_INSTRUCTIONS_PER_PASS_ATI = 0x8971; - public static final int GL_NUM_INSTRUCTIONS_TOTAL_ATI = 0x8972; - public static final int GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI = 0x8973; - public static final int GL_NUM_LOOPBACK_COMPONENTS_ATI = 0x8974; - public static final int GL_COLOR_ALPHA_PAIRING_ATI = 0x8975; - public static final int GL_SWIZZLE_STR_ATI = 0x8976; - public static final int GL_SWIZZLE_STQ_ATI = 0x8977; - public static final int GL_SWIZZLE_STR_DR_ATI = 0x8978; - public static final int GL_SWIZZLE_STQ_DQ_ATI = 0x8979; - public static final int GL_SWIZZLE_STRQ_ATI = 0x897A; - public static final int GL_SWIZZLE_STRQ_DQ_ATI = 0x897B; - public static final int GL_RED_BIT_ATI = 0x00000001; - public static final int GL_GREEN_BIT_ATI = 0x00000002; - public static final int GL_BLUE_BIT_ATI = 0x00000004; - public static final int GL_2X_BIT_ATI = 0x00000001; - public static final int GL_4X_BIT_ATI = 0x00000002; - public static final int GL_8X_BIT_ATI = 0x00000004; - public static final int GL_HALF_BIT_ATI = 0x00000008; - public static final int GL_QUARTER_BIT_ATI = 0x00000010; - public static final int GL_EIGHTH_BIT_ATI = 0x00000020; - public static final int GL_SATURATE_BIT_ATI = 0x00000040; - public static final int GL_COMP_BIT_ATI = 0x00000002; - public static final int GL_NEGATE_BIT_ATI = 0x00000004; - public static final int GL_BIAS_BIT_ATI = 0x00000008; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ATI_fragment_shader) return; - ext.glGenFragmentShadersATI = load.invoke("glGenFragmentShadersATI", of(JAVA_INT, JAVA_INT)); - ext.glBindFragmentShaderATI = load.invoke("glBindFragmentShaderATI", ofVoid(JAVA_INT)); - ext.glDeleteFragmentShaderATI = load.invoke("glDeleteFragmentShaderATI", ofVoid(JAVA_INT)); - ext.glBeginFragmentShaderATI = load.invoke("glBeginFragmentShaderATI", ofVoid()); - ext.glEndFragmentShaderATI = load.invoke("glEndFragmentShaderATI", ofVoid()); - ext.glPassTexCoordATI = load.invoke("glPassTexCoordATI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glSampleMapATI = load.invoke("glSampleMapATI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glColorFragmentOp1ATI = load.invoke("glColorFragmentOp1ATI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glColorFragmentOp2ATI = load.invoke("glColorFragmentOp2ATI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glColorFragmentOp3ATI = load.invoke("glColorFragmentOp3ATI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glAlphaFragmentOp1ATI = load.invoke("glAlphaFragmentOp1ATI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glAlphaFragmentOp2ATI = load.invoke("glAlphaFragmentOp2ATI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glAlphaFragmentOp3ATI = load.invoke("glAlphaFragmentOp3ATI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glSetFragmentShaderConstantATI = load.invoke("glSetFragmentShaderConstantATI", ofVoid(JAVA_INT, ADDRESS)); - } - - public static int glGenFragmentShadersATI(int range) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glGenFragmentShadersATI).invokeExact(range); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLATIFragmentShader { + int GL_FRAGMENT_SHADER_ATI = 0x8920; + int GL_REG_0_ATI = 0x8921; + int GL_REG_1_ATI = 0x8922; + int GL_REG_2_ATI = 0x8923; + int GL_REG_3_ATI = 0x8924; + int GL_REG_4_ATI = 0x8925; + int GL_REG_5_ATI = 0x8926; + int GL_REG_6_ATI = 0x8927; + int GL_REG_7_ATI = 0x8928; + int GL_REG_8_ATI = 0x8929; + int GL_REG_9_ATI = 0x892A; + int GL_REG_10_ATI = 0x892B; + int GL_REG_11_ATI = 0x892C; + int GL_REG_12_ATI = 0x892D; + int GL_REG_13_ATI = 0x892E; + int GL_REG_14_ATI = 0x892F; + int GL_REG_15_ATI = 0x8930; + int GL_REG_16_ATI = 0x8931; + int GL_REG_17_ATI = 0x8932; + int GL_REG_18_ATI = 0x8933; + int GL_REG_19_ATI = 0x8934; + int GL_REG_20_ATI = 0x8935; + int GL_REG_21_ATI = 0x8936; + int GL_REG_22_ATI = 0x8937; + int GL_REG_23_ATI = 0x8938; + int GL_REG_24_ATI = 0x8939; + int GL_REG_25_ATI = 0x893A; + int GL_REG_26_ATI = 0x893B; + int GL_REG_27_ATI = 0x893C; + int GL_REG_28_ATI = 0x893D; + int GL_REG_29_ATI = 0x893E; + int GL_REG_30_ATI = 0x893F; + int GL_REG_31_ATI = 0x8940; + int GL_CON_0_ATI = 0x8941; + int GL_CON_1_ATI = 0x8942; + int GL_CON_2_ATI = 0x8943; + int GL_CON_3_ATI = 0x8944; + int GL_CON_4_ATI = 0x8945; + int GL_CON_5_ATI = 0x8946; + int GL_CON_6_ATI = 0x8947; + int GL_CON_7_ATI = 0x8948; + int GL_CON_8_ATI = 0x8949; + int GL_CON_9_ATI = 0x894A; + int GL_CON_10_ATI = 0x894B; + int GL_CON_11_ATI = 0x894C; + int GL_CON_12_ATI = 0x894D; + int GL_CON_13_ATI = 0x894E; + int GL_CON_14_ATI = 0x894F; + int GL_CON_15_ATI = 0x8950; + int GL_CON_16_ATI = 0x8951; + int GL_CON_17_ATI = 0x8952; + int GL_CON_18_ATI = 0x8953; + int GL_CON_19_ATI = 0x8954; + int GL_CON_20_ATI = 0x8955; + int GL_CON_21_ATI = 0x8956; + int GL_CON_22_ATI = 0x8957; + int GL_CON_23_ATI = 0x8958; + int GL_CON_24_ATI = 0x8959; + int GL_CON_25_ATI = 0x895A; + int GL_CON_26_ATI = 0x895B; + int GL_CON_27_ATI = 0x895C; + int GL_CON_28_ATI = 0x895D; + int GL_CON_29_ATI = 0x895E; + int GL_CON_30_ATI = 0x895F; + int GL_CON_31_ATI = 0x8960; + int GL_MOV_ATI = 0x8961; + int GL_ADD_ATI = 0x8963; + int GL_MUL_ATI = 0x8964; + int GL_SUB_ATI = 0x8965; + int GL_DOT3_ATI = 0x8966; + int GL_DOT4_ATI = 0x8967; + int GL_MAD_ATI = 0x8968; + int GL_LERP_ATI = 0x8969; + int GL_CND_ATI = 0x896A; + int GL_CND0_ATI = 0x896B; + int GL_DOT2_ADD_ATI = 0x896C; + int GL_SECONDARY_INTERPOLATOR_ATI = 0x896D; + int GL_NUM_FRAGMENT_REGISTERS_ATI = 0x896E; + int GL_NUM_FRAGMENT_CONSTANTS_ATI = 0x896F; + int GL_NUM_PASSES_ATI = 0x8970; + int GL_NUM_INSTRUCTIONS_PER_PASS_ATI = 0x8971; + int GL_NUM_INSTRUCTIONS_TOTAL_ATI = 0x8972; + int GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI = 0x8973; + int GL_NUM_LOOPBACK_COMPONENTS_ATI = 0x8974; + int GL_COLOR_ALPHA_PAIRING_ATI = 0x8975; + int GL_SWIZZLE_STR_ATI = 0x8976; + int GL_SWIZZLE_STQ_ATI = 0x8977; + int GL_SWIZZLE_STR_DR_ATI = 0x8978; + int GL_SWIZZLE_STQ_DQ_ATI = 0x8979; + int GL_SWIZZLE_STRQ_ATI = 0x897A; + int GL_SWIZZLE_STRQ_DQ_ATI = 0x897B; + int GL_RED_BIT_ATI = 0x00000001; + int GL_GREEN_BIT_ATI = 0x00000002; + int GL_BLUE_BIT_ATI = 0x00000004; + int GL_2X_BIT_ATI = 0x00000001; + int GL_4X_BIT_ATI = 0x00000002; + int GL_8X_BIT_ATI = 0x00000004; + int GL_HALF_BIT_ATI = 0x00000008; + int GL_QUARTER_BIT_ATI = 0x00000010; + int GL_EIGHTH_BIT_ATI = 0x00000020; + int GL_SATURATE_BIT_ATI = 0x00000040; + int GL_COMP_BIT_ATI = 0x00000002; + int GL_NEGATE_BIT_ATI = 0x00000004; + int GL_BIAS_BIT_ATI = 0x00000008; + + default int glGenFragmentShadersATI(int range) { + throw new ContextException(); } - public static void glBindFragmentShaderATI(int id) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindFragmentShaderATI).invokeExact(id); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBindFragmentShaderATI(int id) { + throw new ContextException(); } - public static void glDeleteFragmentShaderATI(int id) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteFragmentShaderATI).invokeExact(id); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDeleteFragmentShaderATI(int id) { + throw new ContextException(); } - public static void glBeginFragmentShaderATI() { - final var ext = getExtCapabilities(); - try { - check(ext.glBeginFragmentShaderATI).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBeginFragmentShaderATI() { + throw new ContextException(); } - public static void glEndFragmentShaderATI() { - final var ext = getExtCapabilities(); - try { - check(ext.glEndFragmentShaderATI).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEndFragmentShaderATI() { + throw new ContextException(); } - public static void glPassTexCoordATI(int dst, int coord, int swizzle) { - final var ext = getExtCapabilities(); - try { - check(ext.glPassTexCoordATI).invokeExact(dst, coord, swizzle); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPassTexCoordATI(int dst, int coord, int swizzle) { + throw new ContextException(); } - public static void glSampleMapATI(int dst, int interp, int swizzle) { - final var ext = getExtCapabilities(); - try { - check(ext.glSampleMapATI).invokeExact(dst, interp, swizzle); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSampleMapATI(int dst, int interp, int swizzle) { + throw new ContextException(); } - public static void glColorFragmentOp1ATI(int op, int dst, int dstMask, int dstMod, int arg1, int arg1Rep, int arg1Mod) { - final var ext = getExtCapabilities(); - try { - check(ext.glColorFragmentOp1ATI).invokeExact(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glColorFragmentOp1ATI(int op, int dst, int dstMask, int dstMod, int arg1, int arg1Rep, int arg1Mod) { + throw new ContextException(); } - public static void glColorFragmentOp2ATI(int op, int dst, int dstMask, int dstMod, int arg1, int arg1Rep, int arg1Mod, int arg2, int arg2Rep, int arg2Mod) { - final var ext = getExtCapabilities(); - try { - check(ext.glColorFragmentOp2ATI).invokeExact(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glColorFragmentOp2ATI(int op, int dst, int dstMask, int dstMod, int arg1, int arg1Rep, int arg1Mod, int arg2, int arg2Rep, int arg2Mod) { + throw new ContextException(); } - public static void glColorFragmentOp3ATI(int op, int dst, int dstMask, int dstMod, int arg1, int arg1Rep, int arg1Mod, int arg2, int arg2Rep, int arg2Mod, int arg3, int arg3Rep, int arg3Mod) { - final var ext = getExtCapabilities(); - try { - check(ext.glColorFragmentOp3ATI).invokeExact(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glColorFragmentOp3ATI(int op, int dst, int dstMask, int dstMod, int arg1, int arg1Rep, int arg1Mod, int arg2, int arg2Rep, int arg2Mod, int arg3, int arg3Rep, int arg3Mod) { + throw new ContextException(); } - public static void glAlphaFragmentOp1ATI(int op, int dst, int dstMod, int arg1, int arg1Rep, int arg1Mod) { - final var ext = getExtCapabilities(); - try { - check(ext.glAlphaFragmentOp1ATI).invokeExact(op, dst, dstMod, arg1, arg1Rep, arg1Mod); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glAlphaFragmentOp1ATI(int op, int dst, int dstMod, int arg1, int arg1Rep, int arg1Mod) { + throw new ContextException(); } - public static void glAlphaFragmentOp2ATI(int op, int dst, int dstMod, int arg1, int arg1Rep, int arg1Mod, int arg2, int arg2Rep, int arg2Mod) { - final var ext = getExtCapabilities(); - try { - check(ext.glAlphaFragmentOp2ATI).invokeExact(op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glAlphaFragmentOp2ATI(int op, int dst, int dstMod, int arg1, int arg1Rep, int arg1Mod, int arg2, int arg2Rep, int arg2Mod) { + throw new ContextException(); } - public static void glAlphaFragmentOp3ATI(int op, int dst, int dstMod, int arg1, int arg1Rep, int arg1Mod, int arg2, int arg2Rep, int arg2Mod, int arg3, int arg3Rep, int arg3Mod) { - final var ext = getExtCapabilities(); - try { - check(ext.glAlphaFragmentOp3ATI).invokeExact(op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glAlphaFragmentOp3ATI(int op, int dst, int dstMod, int arg1, int arg1Rep, int arg1Mod, int arg2, int arg2Rep, int arg2Mod, int arg3, int arg3Rep, int arg3Mod) { + throw new ContextException(); } - public static void glSetFragmentShaderConstantATI(int dst, @NativeType("const GLfloat *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glSetFragmentShaderConstantATI).invokeExact(dst, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSetFragmentShaderConstantATI(int dst, @NativeType("const GLfloat *") MemorySegment value) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIMapObjectBuffer.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIMapObjectBuffer.java index 4812b584..e0947ba9 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIMapObjectBuffer.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIMapObjectBuffer.java @@ -16,37 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ati; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ATI_map_object_buffer} */ -public final class GLATIMapObjectBuffer { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ATI_map_object_buffer) return; - ext.glMapObjectBufferATI = load.invoke("glMapObjectBufferATI", of(ADDRESS, JAVA_INT)); - ext.glUnmapObjectBufferATI = load.invoke("glUnmapObjectBufferATI", ofVoid(JAVA_INT)); - } +public interface GLATIMapObjectBuffer { - public static @NativeType("void*") MemorySegment glMapObjectBufferATI(int buffer) { - final var ext = getExtCapabilities(); - try { - return (MemorySegment) - check(ext.glMapObjectBufferATI).invokeExact(buffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + @NativeType("void*") default MemorySegment glMapObjectBufferATI(int buffer) { + throw new ContextException(); } - public static void glUnmapObjectBufferATI(int buffer) { - final var ext = getExtCapabilities(); - try { - check(ext.glUnmapObjectBufferATI).invokeExact(buffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUnmapObjectBufferATI(int buffer) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIMeminfo.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIMeminfo.java index 20d3dce6..fdc4972f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIMeminfo.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIMeminfo.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ati; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ATI_meminfo} */ -public final class GLATIMeminfo { - public static final int GL_VBO_FREE_MEMORY_ATI = 0x87FB; - public static final int GL_TEXTURE_FREE_MEMORY_ATI = 0x87FC; - public static final int GL_RENDERBUFFER_FREE_MEMORY_ATI = 0x87FD; +public interface GLATIMeminfo { + int GL_VBO_FREE_MEMORY_ATI = 0x87FB; + int GL_TEXTURE_FREE_MEMORY_ATI = 0x87FC; + int GL_RENDERBUFFER_FREE_MEMORY_ATI = 0x87FD; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIPixelFormatFloat.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIPixelFormatFloat.java index 2a125224..1d75851e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIPixelFormatFloat.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIPixelFormatFloat.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ati; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ATI_pixel_format_float} */ -public final class GLATIPixelFormatFloat { - public static final int GL_RGBA_FLOAT_MODE_ATI = 0x8820; - public static final int GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI = 0x8835; +public interface GLATIPixelFormatFloat { + int GL_RGBA_FLOAT_MODE_ATI = 0x8820; + int GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI = 0x8835; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIPnTriangles.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIPnTriangles.java index a15809c1..4f3ff91a 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIPnTriangles.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIPnTriangles.java @@ -16,45 +16,30 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ati; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ATI_pn_triangles} */ -public final class GLATIPnTriangles { - public static final int GL_PN_TRIANGLES_ATI = 0x87F0; - public static final int GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F1; - public static final int GL_PN_TRIANGLES_POINT_MODE_ATI = 0x87F2; - public static final int GL_PN_TRIANGLES_NORMAL_MODE_ATI = 0x87F3; - public static final int GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F4; - public static final int GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI = 0x87F5; - public static final int GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI = 0x87F6; - public static final int GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI = 0x87F7; - public static final int GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI = 0x87F8; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ATI_pn_triangles) return; - ext.glPNTrianglesiATI = load.invoke("glPNTrianglesiATI", ofVoid(JAVA_INT, JAVA_INT)); - ext.glPNTrianglesfATI = load.invoke("glPNTrianglesfATI", ofVoid(JAVA_INT, JAVA_FLOAT)); - } +public interface GLATIPnTriangles { + int GL_PN_TRIANGLES_ATI = 0x87F0; + int GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F1; + int GL_PN_TRIANGLES_POINT_MODE_ATI = 0x87F2; + int GL_PN_TRIANGLES_NORMAL_MODE_ATI = 0x87F3; + int GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F4; + int GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI = 0x87F5; + int GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI = 0x87F6; + int GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI = 0x87F7; + int GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI = 0x87F8; - public static void glPNTrianglesiATI(int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glPNTrianglesiATI).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPNTrianglesiATI(int pname, int param) { + throw new ContextException(); } - public static void glPNTrianglesfATI(int pname, float param) { - final var ext = getExtCapabilities(); - try { - check(ext.glPNTrianglesfATI).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPNTrianglesfATI(int pname, float param) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATISeparateStencil.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATISeparateStencil.java index e5ab8f74..c3236526 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATISeparateStencil.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATISeparateStencil.java @@ -16,40 +16,25 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ati; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ATI_separate_stencil} */ -public final class GLATISeparateStencil { - public static final int GL_STENCIL_BACK_FUNC_ATI = 0x8800; - public static final int GL_STENCIL_BACK_FAIL_ATI = 0x8801; - public static final int GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI = 0x8802; - public static final int GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI = 0x8803; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ATI_separate_stencil) return; - ext.glStencilOpSeparateATI = load.invoke("glStencilOpSeparateATI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glStencilFuncSeparateATI = load.invoke("glStencilFuncSeparateATI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLATISeparateStencil { + int GL_STENCIL_BACK_FUNC_ATI = 0x8800; + int GL_STENCIL_BACK_FAIL_ATI = 0x8801; + int GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI = 0x8802; + int GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI = 0x8803; - public static void glStencilOpSeparateATI(int face, int sfail, int dpfail, int dppass) { - final var ext = getExtCapabilities(); - try { - check(ext.glStencilOpSeparateATI).invokeExact(face, sfail, dpfail, dppass); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glStencilOpSeparateATI(int face, int sfail, int dpfail, int dppass) { + throw new ContextException(); } - public static void glStencilFuncSeparateATI(int frontfunc, int backfunc, int ref, int mask) { - final var ext = getExtCapabilities(); - try { - check(ext.glStencilFuncSeparateATI).invokeExact(frontfunc, backfunc, ref, mask); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glStencilFuncSeparateATI(int frontfunc, int backfunc, int ref, int mask) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATITextFragmentShader.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATITextFragmentShader.java index 3e7f8a1a..b842b10d 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATITextFragmentShader.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATITextFragmentShader.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ati; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ATI_text_fragment_shader} */ -public final class GLATITextFragmentShader { - public static final int GL_TEXT_FRAGMENT_SHADER_ATI = 0x8200; +public interface GLATITextFragmentShader { + int GL_TEXT_FRAGMENT_SHADER_ATI = 0x8200; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATITextureEnvCombine3.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATITextureEnvCombine3.java index f63ccd70..68b66387 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATITextureEnvCombine3.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATITextureEnvCombine3.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ati; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ATI_texture_env_combine3} */ -public final class GLATITextureEnvCombine3 { - public static final int GL_MODULATE_ADD_ATI = 0x8744; - public static final int GL_MODULATE_SIGNED_ADD_ATI = 0x8745; - public static final int GL_MODULATE_SUBTRACT_ATI = 0x8746; +public interface GLATITextureEnvCombine3 { + int GL_MODULATE_ADD_ATI = 0x8744; + int GL_MODULATE_SIGNED_ADD_ATI = 0x8745; + int GL_MODULATE_SUBTRACT_ATI = 0x8746; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATITextureFloat.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATITextureFloat.java index 5c86a1ad..22828659 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATITextureFloat.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATITextureFloat.java @@ -16,28 +16,24 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ati; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ATI_texture_float} */ -public final class GLATITextureFloat { - public static final int GL_RGBA_FLOAT32_ATI = 0x8814; - public static final int GL_RGB_FLOAT32_ATI = 0x8815; - public static final int GL_ALPHA_FLOAT32_ATI = 0x8816; - public static final int GL_INTENSITY_FLOAT32_ATI = 0x8817; - public static final int GL_LUMINANCE_FLOAT32_ATI = 0x8818; - public static final int GL_LUMINANCE_ALPHA_FLOAT32_ATI = 0x8819; - public static final int GL_RGBA_FLOAT16_ATI = 0x881A; - public static final int GL_RGB_FLOAT16_ATI = 0x881B; - public static final int GL_ALPHA_FLOAT16_ATI = 0x881C; - public static final int GL_INTENSITY_FLOAT16_ATI = 0x881D; - public static final int GL_LUMINANCE_FLOAT16_ATI = 0x881E; - public static final int GL_LUMINANCE_ALPHA_FLOAT16_ATI = 0x881F; +public interface GLATITextureFloat { + int GL_RGBA_FLOAT32_ATI = 0x8814; + int GL_RGB_FLOAT32_ATI = 0x8815; + int GL_ALPHA_FLOAT32_ATI = 0x8816; + int GL_INTENSITY_FLOAT32_ATI = 0x8817; + int GL_LUMINANCE_FLOAT32_ATI = 0x8818; + int GL_LUMINANCE_ALPHA_FLOAT32_ATI = 0x8819; + int GL_RGBA_FLOAT16_ATI = 0x881A; + int GL_RGB_FLOAT16_ATI = 0x881B; + int GL_ALPHA_FLOAT16_ATI = 0x881C; + int GL_INTENSITY_FLOAT16_ATI = 0x881D; + int GL_LUMINANCE_FLOAT16_ATI = 0x881E; + int GL_LUMINANCE_ALPHA_FLOAT16_ATI = 0x881F; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATITextureMirrorOnce.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATITextureMirrorOnce.java index edb6d808..d3bb0123 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATITextureMirrorOnce.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATITextureMirrorOnce.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ati; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ATI_texture_mirror_once} */ -public final class GLATITextureMirrorOnce { - public static final int GL_MIRROR_CLAMP_ATI = 0x8742; - public static final int GL_MIRROR_CLAMP_TO_EDGE_ATI = 0x8743; +public interface GLATITextureMirrorOnce { + int GL_MIRROR_CLAMP_ATI = 0x8742; + int GL_MIRROR_CLAMP_TO_EDGE_ATI = 0x8743; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIVertexArrayObject.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIVertexArrayObject.java index a4cac56a..86c3b05e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIVertexArrayObject.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIVertexArrayObject.java @@ -16,126 +16,69 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ati; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ATI_vertex_array_object} */ -public final class GLATIVertexArrayObject { - public static final int GL_STATIC_ATI = 0x8760; - public static final int GL_DYNAMIC_ATI = 0x8761; - public static final int GL_PRESERVE_ATI = 0x8762; - public static final int GL_DISCARD_ATI = 0x8763; - public static final int GL_OBJECT_BUFFER_SIZE_ATI = 0x8764; - public static final int GL_OBJECT_BUFFER_USAGE_ATI = 0x8765; - public static final int GL_ARRAY_OBJECT_BUFFER_ATI = 0x8766; - public static final int GL_ARRAY_OBJECT_OFFSET_ATI = 0x8767; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ATI_vertex_array_object) return; - ext.glNewObjectBufferATI = load.invoke("glNewObjectBufferATI", of(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT)); - ext.glIsObjectBufferATI = load.invoke("glIsObjectBufferATI", of(JAVA_BYTE, JAVA_INT)); - ext.glUpdateObjectBufferATI = load.invoke("glUpdateObjectBufferATI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT)); - ext.glGetObjectBufferfvATI = load.invoke("glGetObjectBufferfvATI", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetObjectBufferivATI = load.invoke("glGetObjectBufferivATI", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glFreeObjectBufferATI = load.invoke("glFreeObjectBufferATI", ofVoid(JAVA_INT)); - ext.glArrayObjectATI = load.invoke("glArrayObjectATI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetArrayObjectfvATI = load.invoke("glGetArrayObjectfvATI", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetArrayObjectivATI = load.invoke("glGetArrayObjectivATI", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVariantArrayObjectATI = load.invoke("glVariantArrayObjectATI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetVariantArrayObjectfvATI = load.invoke("glGetVariantArrayObjectfvATI", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVariantArrayObjectivATI = load.invoke("glGetVariantArrayObjectivATI", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static int glNewObjectBufferATI(int size, @NativeType("const void *") MemorySegment pointer, int usage) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glNewObjectBufferATI).invokeExact(size, pointer, usage); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLATIVertexArrayObject { + int GL_STATIC_ATI = 0x8760; + int GL_DYNAMIC_ATI = 0x8761; + int GL_PRESERVE_ATI = 0x8762; + int GL_DISCARD_ATI = 0x8763; + int GL_OBJECT_BUFFER_SIZE_ATI = 0x8764; + int GL_OBJECT_BUFFER_USAGE_ATI = 0x8765; + int GL_ARRAY_OBJECT_BUFFER_ATI = 0x8766; + int GL_ARRAY_OBJECT_OFFSET_ATI = 0x8767; + + default int glNewObjectBufferATI(int size, @NativeType("const void *") MemorySegment pointer, int usage) { + throw new ContextException(); } - public static boolean glIsObjectBufferATI(int buffer) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsObjectBufferATI).invokeExact(buffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsObjectBufferATI(int buffer) { + throw new ContextException(); } - public static void glUpdateObjectBufferATI(int buffer, int offset, int size, @NativeType("const void *") MemorySegment pointer, int preserve) { - final var ext = getExtCapabilities(); - try { - check(ext.glUpdateObjectBufferATI).invokeExact(buffer, offset, size, pointer, preserve); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUpdateObjectBufferATI(int buffer, int offset, int size, @NativeType("const void *") MemorySegment pointer, int preserve) { + throw new ContextException(); } - public static void glGetObjectBufferfvATI(int buffer, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetObjectBufferfvATI).invokeExact(buffer, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetObjectBufferfvATI(int buffer, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetObjectBufferivATI(int buffer, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetObjectBufferivATI).invokeExact(buffer, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetObjectBufferivATI(int buffer, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glFreeObjectBufferATI(int buffer) { - final var ext = getExtCapabilities(); - try { - check(ext.glFreeObjectBufferATI).invokeExact(buffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFreeObjectBufferATI(int buffer) { + throw new ContextException(); } - public static void glArrayObjectATI(int array, int size, int type, int stride, int buffer, int offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glArrayObjectATI).invokeExact(array, size, type, stride, buffer, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glArrayObjectATI(int array, int size, int type, int stride, int buffer, int offset) { + throw new ContextException(); } - public static void glGetArrayObjectfvATI(int array, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetArrayObjectfvATI).invokeExact(array, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetArrayObjectfvATI(int array, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetArrayObjectivATI(int array, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetArrayObjectivATI).invokeExact(array, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetArrayObjectivATI(int array, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glVariantArrayObjectATI(int id, int type, int stride, int buffer, int offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glVariantArrayObjectATI).invokeExact(id, type, stride, buffer, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVariantArrayObjectATI(int id, int type, int stride, int buffer, int offset) { + throw new ContextException(); } - public static void glGetVariantArrayObjectfvATI(int id, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVariantArrayObjectfvATI).invokeExact(id, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVariantArrayObjectfvATI(int id, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetVariantArrayObjectivATI(int id, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVariantArrayObjectivATI).invokeExact(id, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVariantArrayObjectivATI(int id, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIVertexAttribArrayObject.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIVertexAttribArrayObject.java index 0806c8b3..a9b62857 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIVertexAttribArrayObject.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIVertexAttribArrayObject.java @@ -16,44 +16,25 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ati; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ATI_vertex_attrib_array_object} */ -public final class GLATIVertexAttribArrayObject { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ATI_vertex_attrib_array_object) return; - ext.glVertexAttribArrayObjectATI = load.invoke("glVertexAttribArrayObjectATI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetVertexAttribArrayObjectfvATI = load.invoke("glGetVertexAttribArrayObjectfvATI", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVertexAttribArrayObjectivATI = load.invoke("glGetVertexAttribArrayObjectivATI", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLATIVertexAttribArrayObject { - public static void glVertexAttribArrayObjectATI(int index, int size, int type, boolean normalized, int stride, int buffer, int offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribArrayObjectATI).invokeExact(index, size, type, normalized, stride, buffer, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribArrayObjectATI(int index, int size, int type, boolean normalized, int stride, int buffer, int offset) { + throw new ContextException(); } - public static void glGetVertexAttribArrayObjectfvATI(int index, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVertexAttribArrayObjectfvATI).invokeExact(index, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVertexAttribArrayObjectfvATI(int index, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetVertexAttribArrayObjectivATI(int index, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVertexAttribArrayObjectivATI).invokeExact(index, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVertexAttribArrayObjectivATI(int index, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIVertexStreams.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIVertexStreams.java index 170a5911..986993a2 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIVertexStreams.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ati/GLATIVertexStreams.java @@ -16,390 +16,203 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ati; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_ATI_vertex_streams} */ -public final class GLATIVertexStreams { - public static final int GL_MAX_VERTEX_STREAMS_ATI = 0x876B; - public static final int GL_VERTEX_STREAM0_ATI = 0x876C; - public static final int GL_VERTEX_STREAM1_ATI = 0x876D; - public static final int GL_VERTEX_STREAM2_ATI = 0x876E; - public static final int GL_VERTEX_STREAM3_ATI = 0x876F; - public static final int GL_VERTEX_STREAM4_ATI = 0x8770; - public static final int GL_VERTEX_STREAM5_ATI = 0x8771; - public static final int GL_VERTEX_STREAM6_ATI = 0x8772; - public static final int GL_VERTEX_STREAM7_ATI = 0x8773; - public static final int GL_VERTEX_SOURCE_ATI = 0x8774; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_ATI_vertex_streams) return; - ext.glVertexStream1sATI = load.invoke("glVertexStream1sATI", ofVoid(JAVA_INT, JAVA_SHORT)); - ext.glVertexStream1svATI = load.invoke("glVertexStream1svATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexStream1iATI = load.invoke("glVertexStream1iATI", ofVoid(JAVA_INT, JAVA_INT)); - ext.glVertexStream1ivATI = load.invoke("glVertexStream1ivATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexStream1fATI = load.invoke("glVertexStream1fATI", ofVoid(JAVA_INT, JAVA_FLOAT)); - ext.glVertexStream1fvATI = load.invoke("glVertexStream1fvATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexStream1dATI = load.invoke("glVertexStream1dATI", ofVoid(JAVA_INT, JAVA_DOUBLE)); - ext.glVertexStream1dvATI = load.invoke("glVertexStream1dvATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexStream2sATI = load.invoke("glVertexStream2sATI", ofVoid(JAVA_INT, JAVA_SHORT, JAVA_SHORT)); - ext.glVertexStream2svATI = load.invoke("glVertexStream2svATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexStream2iATI = load.invoke("glVertexStream2iATI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glVertexStream2ivATI = load.invoke("glVertexStream2ivATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexStream2fATI = load.invoke("glVertexStream2fATI", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glVertexStream2fvATI = load.invoke("glVertexStream2fvATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexStream2dATI = load.invoke("glVertexStream2dATI", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glVertexStream2dvATI = load.invoke("glVertexStream2dvATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexStream3sATI = load.invoke("glVertexStream3sATI", ofVoid(JAVA_INT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glVertexStream3svATI = load.invoke("glVertexStream3svATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexStream3iATI = load.invoke("glVertexStream3iATI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glVertexStream3ivATI = load.invoke("glVertexStream3ivATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexStream3fATI = load.invoke("glVertexStream3fATI", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glVertexStream3fvATI = load.invoke("glVertexStream3fvATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexStream3dATI = load.invoke("glVertexStream3dATI", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glVertexStream3dvATI = load.invoke("glVertexStream3dvATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexStream4sATI = load.invoke("glVertexStream4sATI", ofVoid(JAVA_INT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glVertexStream4svATI = load.invoke("glVertexStream4svATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexStream4iATI = load.invoke("glVertexStream4iATI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glVertexStream4ivATI = load.invoke("glVertexStream4ivATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexStream4fATI = load.invoke("glVertexStream4fATI", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glVertexStream4fvATI = load.invoke("glVertexStream4fvATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexStream4dATI = load.invoke("glVertexStream4dATI", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glVertexStream4dvATI = load.invoke("glVertexStream4dvATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glNormalStream3bATI = load.invoke("glNormalStream3bATI", ofVoid(JAVA_INT, JAVA_BYTE, JAVA_BYTE, JAVA_BYTE)); - ext.glNormalStream3bvATI = load.invoke("glNormalStream3bvATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glNormalStream3sATI = load.invoke("glNormalStream3sATI", ofVoid(JAVA_INT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glNormalStream3svATI = load.invoke("glNormalStream3svATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glNormalStream3iATI = load.invoke("glNormalStream3iATI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glNormalStream3ivATI = load.invoke("glNormalStream3ivATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glNormalStream3fATI = load.invoke("glNormalStream3fATI", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glNormalStream3fvATI = load.invoke("glNormalStream3fvATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glNormalStream3dATI = load.invoke("glNormalStream3dATI", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glNormalStream3dvATI = load.invoke("glNormalStream3dvATI", ofVoid(JAVA_INT, ADDRESS)); - ext.glClientActiveVertexStreamATI = load.invoke("glClientActiveVertexStreamATI", ofVoid(JAVA_INT)); - ext.glVertexBlendEnviATI = load.invoke("glVertexBlendEnviATI", ofVoid(JAVA_INT, JAVA_INT)); - ext.glVertexBlendEnvfATI = load.invoke("glVertexBlendEnvfATI", ofVoid(JAVA_INT, JAVA_FLOAT)); - } - - public static void glVertexStream1sATI(int stream, short x) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream1sATI).invokeExact(stream, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertexStream1svATI(int stream, @NativeType("const GLshort *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream1svATI).invokeExact(stream, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertexStream1iATI(int stream, int x) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream1iATI).invokeExact(stream, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertexStream1ivATI(int stream, @NativeType("const GLint *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream1ivATI).invokeExact(stream, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertexStream1fATI(int stream, float x) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream1fATI).invokeExact(stream, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertexStream1fvATI(int stream, @NativeType("const GLfloat *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream1fvATI).invokeExact(stream, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertexStream1dATI(int stream, double x) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream1dATI).invokeExact(stream, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertexStream1dvATI(int stream, @NativeType("const GLdouble *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream1dvATI).invokeExact(stream, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertexStream2sATI(int stream, short x, short y) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream2sATI).invokeExact(stream, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertexStream2svATI(int stream, @NativeType("const GLshort *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream2svATI).invokeExact(stream, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLATIVertexStreams { + int GL_MAX_VERTEX_STREAMS_ATI = 0x876B; + int GL_VERTEX_STREAM0_ATI = 0x876C; + int GL_VERTEX_STREAM1_ATI = 0x876D; + int GL_VERTEX_STREAM2_ATI = 0x876E; + int GL_VERTEX_STREAM3_ATI = 0x876F; + int GL_VERTEX_STREAM4_ATI = 0x8770; + int GL_VERTEX_STREAM5_ATI = 0x8771; + int GL_VERTEX_STREAM6_ATI = 0x8772; + int GL_VERTEX_STREAM7_ATI = 0x8773; + int GL_VERTEX_SOURCE_ATI = 0x8774; + + default void glVertexStream1sATI(int stream, short x) { + throw new ContextException(); + } + + default void glVertexStream1svATI(int stream, @NativeType("const GLshort *") MemorySegment coords) { + throw new ContextException(); + } + + default void glVertexStream1iATI(int stream, int x) { + throw new ContextException(); + } + + default void glVertexStream1ivATI(int stream, @NativeType("const GLint *") MemorySegment coords) { + throw new ContextException(); + } + + default void glVertexStream1fATI(int stream, float x) { + throw new ContextException(); + } + + default void glVertexStream1fvATI(int stream, @NativeType("const GLfloat *") MemorySegment coords) { + throw new ContextException(); + } + + default void glVertexStream1dATI(int stream, double x) { + throw new ContextException(); + } + + default void glVertexStream1dvATI(int stream, @NativeType("const GLdouble *") MemorySegment coords) { + throw new ContextException(); + } + + default void glVertexStream2sATI(int stream, short x, short y) { + throw new ContextException(); + } + + default void glVertexStream2svATI(int stream, @NativeType("const GLshort *") MemorySegment coords) { + throw new ContextException(); } - public static void glVertexStream2iATI(int stream, int x, int y) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream2iATI).invokeExact(stream, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream2iATI(int stream, int x, int y) { + throw new ContextException(); } - public static void glVertexStream2ivATI(int stream, @NativeType("const GLint *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream2ivATI).invokeExact(stream, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream2ivATI(int stream, @NativeType("const GLint *") MemorySegment coords) { + throw new ContextException(); } - public static void glVertexStream2fATI(int stream, float x, float y) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream2fATI).invokeExact(stream, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream2fATI(int stream, float x, float y) { + throw new ContextException(); } - public static void glVertexStream2fvATI(int stream, @NativeType("const GLfloat *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream2fvATI).invokeExact(stream, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream2fvATI(int stream, @NativeType("const GLfloat *") MemorySegment coords) { + throw new ContextException(); } - public static void glVertexStream2dATI(int stream, double x, double y) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream2dATI).invokeExact(stream, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream2dATI(int stream, double x, double y) { + throw new ContextException(); } - public static void glVertexStream2dvATI(int stream, @NativeType("const GLdouble *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream2dvATI).invokeExact(stream, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream2dvATI(int stream, @NativeType("const GLdouble *") MemorySegment coords) { + throw new ContextException(); } - public static void glVertexStream3sATI(int stream, short x, short y, short z) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream3sATI).invokeExact(stream, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream3sATI(int stream, short x, short y, short z) { + throw new ContextException(); } - public static void glVertexStream3svATI(int stream, @NativeType("const GLshort *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream3svATI).invokeExact(stream, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream3svATI(int stream, @NativeType("const GLshort *") MemorySegment coords) { + throw new ContextException(); } - public static void glVertexStream3iATI(int stream, int x, int y, int z) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream3iATI).invokeExact(stream, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream3iATI(int stream, int x, int y, int z) { + throw new ContextException(); } - public static void glVertexStream3ivATI(int stream, @NativeType("const GLint *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream3ivATI).invokeExact(stream, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream3ivATI(int stream, @NativeType("const GLint *") MemorySegment coords) { + throw new ContextException(); } - public static void glVertexStream3fATI(int stream, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream3fATI).invokeExact(stream, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream3fATI(int stream, float x, float y, float z) { + throw new ContextException(); } - public static void glVertexStream3fvATI(int stream, @NativeType("const GLfloat *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream3fvATI).invokeExact(stream, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream3fvATI(int stream, @NativeType("const GLfloat *") MemorySegment coords) { + throw new ContextException(); } - public static void glVertexStream3dATI(int stream, double x, double y, double z) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream3dATI).invokeExact(stream, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream3dATI(int stream, double x, double y, double z) { + throw new ContextException(); } - public static void glVertexStream3dvATI(int stream, @NativeType("const GLdouble *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream3dvATI).invokeExact(stream, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream3dvATI(int stream, @NativeType("const GLdouble *") MemorySegment coords) { + throw new ContextException(); } - public static void glVertexStream4sATI(int stream, short x, short y, short z, short w) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream4sATI).invokeExact(stream, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream4sATI(int stream, short x, short y, short z, short w) { + throw new ContextException(); } - public static void glVertexStream4svATI(int stream, @NativeType("const GLshort *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream4svATI).invokeExact(stream, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream4svATI(int stream, @NativeType("const GLshort *") MemorySegment coords) { + throw new ContextException(); } - public static void glVertexStream4iATI(int stream, int x, int y, int z, int w) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream4iATI).invokeExact(stream, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream4iATI(int stream, int x, int y, int z, int w) { + throw new ContextException(); } - public static void glVertexStream4ivATI(int stream, @NativeType("const GLint *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream4ivATI).invokeExact(stream, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream4ivATI(int stream, @NativeType("const GLint *") MemorySegment coords) { + throw new ContextException(); } - public static void glVertexStream4fATI(int stream, float x, float y, float z, float w) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream4fATI).invokeExact(stream, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream4fATI(int stream, float x, float y, float z, float w) { + throw new ContextException(); } - public static void glVertexStream4fvATI(int stream, @NativeType("const GLfloat *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream4fvATI).invokeExact(stream, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream4fvATI(int stream, @NativeType("const GLfloat *") MemorySegment coords) { + throw new ContextException(); } - public static void glVertexStream4dATI(int stream, double x, double y, double z, double w) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream4dATI).invokeExact(stream, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream4dATI(int stream, double x, double y, double z, double w) { + throw new ContextException(); } - public static void glVertexStream4dvATI(int stream, @NativeType("const GLdouble *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexStream4dvATI).invokeExact(stream, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexStream4dvATI(int stream, @NativeType("const GLdouble *") MemorySegment coords) { + throw new ContextException(); } - public static void glNormalStream3bATI(int stream, byte nx, byte ny, byte nz) { - final var ext = getExtCapabilities(); - try { - check(ext.glNormalStream3bATI).invokeExact(stream, nx, ny, nz); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNormalStream3bATI(int stream, byte nx, byte ny, byte nz) { + throw new ContextException(); } - public static void glNormalStream3bvATI(int stream, @NativeType("const GLbyte *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glNormalStream3bvATI).invokeExact(stream, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNormalStream3bvATI(int stream, @NativeType("const GLbyte *") MemorySegment coords) { + throw new ContextException(); } - public static void glNormalStream3sATI(int stream, short nx, short ny, short nz) { - final var ext = getExtCapabilities(); - try { - check(ext.glNormalStream3sATI).invokeExact(stream, nx, ny, nz); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNormalStream3sATI(int stream, short nx, short ny, short nz) { + throw new ContextException(); } - public static void glNormalStream3svATI(int stream, @NativeType("const GLshort *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glNormalStream3svATI).invokeExact(stream, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNormalStream3svATI(int stream, @NativeType("const GLshort *") MemorySegment coords) { + throw new ContextException(); } - public static void glNormalStream3iATI(int stream, int nx, int ny, int nz) { - final var ext = getExtCapabilities(); - try { - check(ext.glNormalStream3iATI).invokeExact(stream, nx, ny, nz); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNormalStream3iATI(int stream, int nx, int ny, int nz) { + throw new ContextException(); } - public static void glNormalStream3ivATI(int stream, @NativeType("const GLint *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glNormalStream3ivATI).invokeExact(stream, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNormalStream3ivATI(int stream, @NativeType("const GLint *") MemorySegment coords) { + throw new ContextException(); } - public static void glNormalStream3fATI(int stream, float nx, float ny, float nz) { - final var ext = getExtCapabilities(); - try { - check(ext.glNormalStream3fATI).invokeExact(stream, nx, ny, nz); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNormalStream3fATI(int stream, float nx, float ny, float nz) { + throw new ContextException(); } - public static void glNormalStream3fvATI(int stream, @NativeType("const GLfloat *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glNormalStream3fvATI).invokeExact(stream, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNormalStream3fvATI(int stream, @NativeType("const GLfloat *") MemorySegment coords) { + throw new ContextException(); } - public static void glNormalStream3dATI(int stream, double nx, double ny, double nz) { - final var ext = getExtCapabilities(); - try { - check(ext.glNormalStream3dATI).invokeExact(stream, nx, ny, nz); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNormalStream3dATI(int stream, double nx, double ny, double nz) { + throw new ContextException(); } - public static void glNormalStream3dvATI(int stream, @NativeType("const GLdouble *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glNormalStream3dvATI).invokeExact(stream, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNormalStream3dvATI(int stream, @NativeType("const GLdouble *") MemorySegment coords) { + throw new ContextException(); } - public static void glClientActiveVertexStreamATI(int stream) { - final var ext = getExtCapabilities(); - try { - check(ext.glClientActiveVertexStreamATI).invokeExact(stream); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glClientActiveVertexStreamATI(int stream) { + throw new ContextException(); } - public static void glVertexBlendEnviATI(int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexBlendEnviATI).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexBlendEnviATI(int pname, int param) { + throw new ContextException(); } - public static void glVertexBlendEnvfATI(int pname, float param) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexBlendEnvfATI).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexBlendEnvfATI(int pname, float param) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXT422Pixels.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXT422Pixels.java index 5fc033ac..b3824988 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXT422Pixels.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXT422Pixels.java @@ -16,20 +16,16 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_422_pixels} */ -public final class GLEXT422Pixels { - public static final int GL_422_EXT = 0x80CC; - public static final int GL_422_REV_EXT = 0x80CD; - public static final int GL_422_AVERAGE_EXT = 0x80CE; - public static final int GL_422_REV_AVERAGE_EXT = 0x80CF; +public interface GLEXT422Pixels { + int GL_422_EXT = 0x80CC; + int GL_422_REV_EXT = 0x80CD; + int GL_422_AVERAGE_EXT = 0x80CE; + int GL_422_REV_AVERAGE_EXT = 0x80CF; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTAbgr.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTAbgr.java index 09cc274f..0f670c80 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTAbgr.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTAbgr.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_abgr} */ -public final class GLEXTAbgr { - public static final int GL_ABGR_EXT = 0x8000; +public interface GLEXTAbgr { + int GL_ABGR_EXT = 0x8000; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBgra.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBgra.java index b747954d..f1e8f865 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBgra.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBgra.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_bgra} */ -public final class GLEXTBgra { - public static final int GL_BGR_EXT = 0x80E0; - public static final int GL_BGRA_EXT = 0x80E1; +public interface GLEXTBgra { + int GL_BGR_EXT = 0x80E0; + int GL_BGRA_EXT = 0x80E1; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBindableUniform.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBindableUniform.java index f0078417..6ee5d678 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBindableUniform.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBindableUniform.java @@ -16,52 +16,31 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_bindable_uniform} */ -public final class GLEXTBindableUniform { - public static final int GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT = 0x8DE2; - public static final int GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT = 0x8DE3; - public static final int GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT = 0x8DE4; - public static final int GL_MAX_BINDABLE_UNIFORM_SIZE_EXT = 0x8DED; - public static final int GL_UNIFORM_BUFFER_EXT = 0x8DEE; - public static final int GL_UNIFORM_BUFFER_BINDING_EXT = 0x8DEF; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_bindable_uniform) return; - ext.glUniformBufferEXT = load.invoke("glUniformBufferEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetUniformBufferSizeEXT = load.invoke("glGetUniformBufferSizeEXT", of(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetUniformOffsetEXT = load.invoke("glGetUniformOffsetEXT", of(JAVA_LONG, JAVA_INT, JAVA_INT)); - } +public interface GLEXTBindableUniform { + int GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT = 0x8DE2; + int GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT = 0x8DE3; + int GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT = 0x8DE4; + int GL_MAX_BINDABLE_UNIFORM_SIZE_EXT = 0x8DED; + int GL_UNIFORM_BUFFER_EXT = 0x8DEE; + int GL_UNIFORM_BUFFER_BINDING_EXT = 0x8DEF; - public static void glUniformBufferEXT(int program, int location, int buffer) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniformBufferEXT).invokeExact(program, location, buffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniformBufferEXT(int program, int location, int buffer) { + throw new ContextException(); } - public static int glGetUniformBufferSizeEXT(int program, int location) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glGetUniformBufferSizeEXT).invokeExact(program, location); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glGetUniformBufferSizeEXT(int program, int location) { + throw new ContextException(); } - public static long glGetUniformOffsetEXT(int program, int location) { - final var ext = getExtCapabilities(); - try { - return (long) - check(ext.glGetUniformOffsetEXT).invokeExact(program, location); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default long glGetUniformOffsetEXT(int program, int location) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBlendColor.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBlendColor.java index 9aacab36..ee524b68 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBlendColor.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBlendColor.java @@ -16,33 +16,22 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_blend_color} */ -public final class GLEXTBlendColor { - public static final int GL_CONSTANT_COLOR_EXT = 0x8001; - public static final int GL_ONE_MINUS_CONSTANT_COLOR_EXT = 0x8002; - public static final int GL_CONSTANT_ALPHA_EXT = 0x8003; - public static final int GL_ONE_MINUS_CONSTANT_ALPHA_EXT = 0x8004; - public static final int GL_BLEND_COLOR_EXT = 0x8005; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_blend_color) return; - ext.glBlendColorEXT = load.invoke("glBlendColorEXT", ofVoid(JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - } +public interface GLEXTBlendColor { + int GL_CONSTANT_COLOR_EXT = 0x8001; + int GL_ONE_MINUS_CONSTANT_COLOR_EXT = 0x8002; + int GL_CONSTANT_ALPHA_EXT = 0x8003; + int GL_ONE_MINUS_CONSTANT_ALPHA_EXT = 0x8004; + int GL_BLEND_COLOR_EXT = 0x8005; - public static void glBlendColorEXT(float red, float green, float blue, float alpha) { - final var ext = getExtCapabilities(); - try { - check(ext.glBlendColorEXT).invokeExact(red, green, blue, alpha); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBlendColorEXT(float red, float green, float blue, float alpha) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBlendEquationSeparate.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBlendEquationSeparate.java index 6a1ad785..6c088567 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBlendEquationSeparate.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBlendEquationSeparate.java @@ -16,30 +16,19 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_blend_equation_separate} */ -public final class GLEXTBlendEquationSeparate { - public static final int GL_BLEND_EQUATION_RGB_EXT = 0x8009; - public static final int GL_BLEND_EQUATION_ALPHA_EXT = 0x883D; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_blend_equation_separate) return; - ext.glBlendEquationSeparateEXT = load.invoke("glBlendEquationSeparateEXT", ofVoid(JAVA_INT, JAVA_INT)); - } +public interface GLEXTBlendEquationSeparate { + int GL_BLEND_EQUATION_RGB_EXT = 0x8009; + int GL_BLEND_EQUATION_ALPHA_EXT = 0x883D; - public static void glBlendEquationSeparateEXT(int modeRGB, int modeAlpha) { - final var ext = getExtCapabilities(); - try { - check(ext.glBlendEquationSeparateEXT).invokeExact(modeRGB, modeAlpha); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBlendEquationSeparateEXT(int modeRGB, int modeAlpha) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBlendFuncSeparate.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBlendFuncSeparate.java index d5bd751a..29319c9e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBlendFuncSeparate.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBlendFuncSeparate.java @@ -16,32 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_blend_func_separate} */ -public final class GLEXTBlendFuncSeparate { - public static final int GL_BLEND_DST_RGB_EXT = 0x80C8; - public static final int GL_BLEND_SRC_RGB_EXT = 0x80C9; - public static final int GL_BLEND_DST_ALPHA_EXT = 0x80CA; - public static final int GL_BLEND_SRC_ALPHA_EXT = 0x80CB; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_blend_func_separate) return; - ext.glBlendFuncSeparateEXT = load.invoke("glBlendFuncSeparateEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLEXTBlendFuncSeparate { + int GL_BLEND_DST_RGB_EXT = 0x80C8; + int GL_BLEND_SRC_RGB_EXT = 0x80C9; + int GL_BLEND_DST_ALPHA_EXT = 0x80CA; + int GL_BLEND_SRC_ALPHA_EXT = 0x80CB; - public static void glBlendFuncSeparateEXT(int sfactorRGB, int dfactorRGB, int sfactorAlpha, int dfactorAlpha) { - final var ext = getExtCapabilities(); - try { - check(ext.glBlendFuncSeparateEXT).invokeExact(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBlendFuncSeparateEXT(int sfactorRGB, int dfactorRGB, int sfactorAlpha, int dfactorAlpha) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBlendMinmax.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBlendMinmax.java index caa8ba1c..117a4837 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBlendMinmax.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBlendMinmax.java @@ -16,32 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_blend_minmax} */ -public final class GLEXTBlendMinmax { - public static final int GL_MIN_EXT = 0x8007; - public static final int GL_MAX_EXT = 0x8008; - public static final int GL_FUNC_ADD_EXT = 0x8006; - public static final int GL_BLEND_EQUATION_EXT = 0x8009; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_blend_minmax) return; - ext.glBlendEquationEXT = load.invoke("glBlendEquationEXT", ofVoid(JAVA_INT)); - } +public interface GLEXTBlendMinmax { + int GL_MIN_EXT = 0x8007; + int GL_MAX_EXT = 0x8008; + int GL_FUNC_ADD_EXT = 0x8006; + int GL_BLEND_EQUATION_EXT = 0x8009; - public static void glBlendEquationEXT(int mode) { - final var ext = getExtCapabilities(); - try { - check(ext.glBlendEquationEXT).invokeExact(mode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBlendEquationEXT(int mode) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBlendSubtract.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBlendSubtract.java index cb713676..f2b4b6f3 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBlendSubtract.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTBlendSubtract.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_blend_subtract} */ -public final class GLEXTBlendSubtract { - public static final int GL_FUNC_SUBTRACT_EXT = 0x800A; - public static final int GL_FUNC_REVERSE_SUBTRACT_EXT = 0x800B; +public interface GLEXTBlendSubtract { + int GL_FUNC_SUBTRACT_EXT = 0x800A; + int GL_FUNC_REVERSE_SUBTRACT_EXT = 0x800B; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTClipVolumeHint.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTClipVolumeHint.java index 740364dc..d6776a02 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTClipVolumeHint.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTClipVolumeHint.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_clip_volume_hint} */ -public final class GLEXTClipVolumeHint { - public static final int GL_CLIP_VOLUME_CLIPPING_HINT_EXT = 0x80F0; +public interface GLEXTClipVolumeHint { + int GL_CLIP_VOLUME_CLIPPING_HINT_EXT = 0x80F0; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTCmyka.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTCmyka.java index 3d8b83a6..1c95a237 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTCmyka.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTCmyka.java @@ -16,20 +16,16 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_cmyka} */ -public final class GLEXTCmyka { - public static final int GL_CMYK_EXT = 0x800C; - public static final int GL_CMYKA_EXT = 0x800D; - public static final int GL_PACK_CMYK_HINT_EXT = 0x800E; - public static final int GL_UNPACK_CMYK_HINT_EXT = 0x800F; +public interface GLEXTCmyka { + int GL_CMYK_EXT = 0x800C; + int GL_CMYKA_EXT = 0x800D; + int GL_PACK_CMYK_HINT_EXT = 0x800E; + int GL_UNPACK_CMYK_HINT_EXT = 0x800F; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTColorSubtable.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTColorSubtable.java index 430ccd55..6a06a25f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTColorSubtable.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTColorSubtable.java @@ -16,36 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_color_subtable} */ -public final class GLEXTColorSubtable { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_color_subtable) return; - ext.glColorSubTableEXT = load.invoke("glColorSubTableEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCopyColorSubTableEXT = load.invoke("glCopyColorSubTableEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLEXTColorSubtable { - public static void glColorSubTableEXT(int target, int start, int count, int format, int type, @NativeType("const void *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glColorSubTableEXT).invokeExact(target, start, count, format, type, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glColorSubTableEXT(int target, int start, int count, int format, int type, @NativeType("const void *") MemorySegment data) { + throw new ContextException(); } - public static void glCopyColorSubTableEXT(int target, int start, int x, int y, int width) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyColorSubTableEXT).invokeExact(target, start, x, y, width); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyColorSubTableEXT(int target, int start, int x, int y, int width) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTCompiledVertexArray.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTCompiledVertexArray.java index bf5df8e0..c167e351 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTCompiledVertexArray.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTCompiledVertexArray.java @@ -16,38 +16,23 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_compiled_vertex_array} */ -public final class GLEXTCompiledVertexArray { - public static final int GL_ARRAY_ELEMENT_LOCK_FIRST_EXT = 0x81A8; - public static final int GL_ARRAY_ELEMENT_LOCK_COUNT_EXT = 0x81A9; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_compiled_vertex_array) return; - ext.glLockArraysEXT = load.invoke("glLockArraysEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glUnlockArraysEXT = load.invoke("glUnlockArraysEXT", ofVoid()); - } +public interface GLEXTCompiledVertexArray { + int GL_ARRAY_ELEMENT_LOCK_FIRST_EXT = 0x81A8; + int GL_ARRAY_ELEMENT_LOCK_COUNT_EXT = 0x81A9; - public static void glLockArraysEXT(int first, int count) { - final var ext = getExtCapabilities(); - try { - check(ext.glLockArraysEXT).invokeExact(first, count); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glLockArraysEXT(int first, int count) { + throw new ContextException(); } - public static void glUnlockArraysEXT() { - final var ext = getExtCapabilities(); - try { - check(ext.glUnlockArraysEXT).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUnlockArraysEXT() { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTConvolution.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTConvolution.java index 45824b9a..2a53f944 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTConvolution.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTConvolution.java @@ -16,144 +16,85 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_convolution} */ -public final class GLEXTConvolution { - public static final int GL_CONVOLUTION_1D_EXT = 0x8010; - public static final int GL_CONVOLUTION_2D_EXT = 0x8011; - public static final int GL_SEPARABLE_2D_EXT = 0x8012; - public static final int GL_CONVOLUTION_BORDER_MODE_EXT = 0x8013; - public static final int GL_CONVOLUTION_FILTER_SCALE_EXT = 0x8014; - public static final int GL_CONVOLUTION_FILTER_BIAS_EXT = 0x8015; - public static final int GL_REDUCE_EXT = 0x8016; - public static final int GL_CONVOLUTION_FORMAT_EXT = 0x8017; - public static final int GL_CONVOLUTION_WIDTH_EXT = 0x8018; - public static final int GL_CONVOLUTION_HEIGHT_EXT = 0x8019; - public static final int GL_MAX_CONVOLUTION_WIDTH_EXT = 0x801A; - public static final int GL_MAX_CONVOLUTION_HEIGHT_EXT = 0x801B; - public static final int GL_POST_CONVOLUTION_RED_SCALE_EXT = 0x801C; - public static final int GL_POST_CONVOLUTION_GREEN_SCALE_EXT = 0x801D; - public static final int GL_POST_CONVOLUTION_BLUE_SCALE_EXT = 0x801E; - public static final int GL_POST_CONVOLUTION_ALPHA_SCALE_EXT = 0x801F; - public static final int GL_POST_CONVOLUTION_RED_BIAS_EXT = 0x8020; - public static final int GL_POST_CONVOLUTION_GREEN_BIAS_EXT = 0x8021; - public static final int GL_POST_CONVOLUTION_BLUE_BIAS_EXT = 0x8022; - public static final int GL_POST_CONVOLUTION_ALPHA_BIAS_EXT = 0x8023; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_convolution) return; - ext.glConvolutionFilter1DEXT = load.invoke("glConvolutionFilter1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glConvolutionFilter2DEXT = load.invoke("glConvolutionFilter2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glConvolutionParameterfEXT = load.invoke("glConvolutionParameterfEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_FLOAT)); - ext.glConvolutionParameterfvEXT = load.invoke("glConvolutionParameterfvEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glConvolutionParameteriEXT = load.invoke("glConvolutionParameteriEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glConvolutionParameterivEXT = load.invoke("glConvolutionParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCopyConvolutionFilter1DEXT = load.invoke("glCopyConvolutionFilter1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glCopyConvolutionFilter2DEXT = load.invoke("glCopyConvolutionFilter2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetConvolutionFilterEXT = load.invoke("glGetConvolutionFilterEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetConvolutionParameterfvEXT = load.invoke("glGetConvolutionParameterfvEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetConvolutionParameterivEXT = load.invoke("glGetConvolutionParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetSeparableFilterEXT = load.invoke("glGetSeparableFilterEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, ADDRESS, ADDRESS)); - ext.glSeparableFilter2DEXT = load.invoke("glSeparableFilter2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - } - - public static void glConvolutionFilter1DEXT(int target, int internalformat, int width, int format, int type, @NativeType("const void *") MemorySegment image) { - final var ext = getExtCapabilities(); - try { - check(ext.glConvolutionFilter1DEXT).invokeExact(target, internalformat, width, format, type, image); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLEXTConvolution { + int GL_CONVOLUTION_1D_EXT = 0x8010; + int GL_CONVOLUTION_2D_EXT = 0x8011; + int GL_SEPARABLE_2D_EXT = 0x8012; + int GL_CONVOLUTION_BORDER_MODE_EXT = 0x8013; + int GL_CONVOLUTION_FILTER_SCALE_EXT = 0x8014; + int GL_CONVOLUTION_FILTER_BIAS_EXT = 0x8015; + int GL_REDUCE_EXT = 0x8016; + int GL_CONVOLUTION_FORMAT_EXT = 0x8017; + int GL_CONVOLUTION_WIDTH_EXT = 0x8018; + int GL_CONVOLUTION_HEIGHT_EXT = 0x8019; + int GL_MAX_CONVOLUTION_WIDTH_EXT = 0x801A; + int GL_MAX_CONVOLUTION_HEIGHT_EXT = 0x801B; + int GL_POST_CONVOLUTION_RED_SCALE_EXT = 0x801C; + int GL_POST_CONVOLUTION_GREEN_SCALE_EXT = 0x801D; + int GL_POST_CONVOLUTION_BLUE_SCALE_EXT = 0x801E; + int GL_POST_CONVOLUTION_ALPHA_SCALE_EXT = 0x801F; + int GL_POST_CONVOLUTION_RED_BIAS_EXT = 0x8020; + int GL_POST_CONVOLUTION_GREEN_BIAS_EXT = 0x8021; + int GL_POST_CONVOLUTION_BLUE_BIAS_EXT = 0x8022; + int GL_POST_CONVOLUTION_ALPHA_BIAS_EXT = 0x8023; + + default void glConvolutionFilter1DEXT(int target, int internalformat, int width, int format, int type, @NativeType("const void *") MemorySegment image) { + throw new ContextException(); } - public static void glConvolutionFilter2DEXT(int target, int internalformat, int width, int height, int format, int type, @NativeType("const void *") MemorySegment image) { - final var ext = getExtCapabilities(); - try { - check(ext.glConvolutionFilter2DEXT).invokeExact(target, internalformat, width, height, format, type, image); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glConvolutionFilter2DEXT(int target, int internalformat, int width, int height, int format, int type, @NativeType("const void *") MemorySegment image) { + throw new ContextException(); } - public static void glConvolutionParameterfEXT(int target, int pname, float params) { - final var ext = getExtCapabilities(); - try { - check(ext.glConvolutionParameterfEXT).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glConvolutionParameterfEXT(int target, int pname, float params) { + throw new ContextException(); } - public static void glConvolutionParameterfvEXT(int target, int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glConvolutionParameterfvEXT).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glConvolutionParameterfvEXT(int target, int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glConvolutionParameteriEXT(int target, int pname, int params) { - final var ext = getExtCapabilities(); - try { - check(ext.glConvolutionParameteriEXT).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glConvolutionParameteriEXT(int target, int pname, int params) { + throw new ContextException(); } - public static void glConvolutionParameterivEXT(int target, int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glConvolutionParameterivEXT).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glConvolutionParameterivEXT(int target, int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glCopyConvolutionFilter1DEXT(int target, int internalformat, int x, int y, int width) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyConvolutionFilter1DEXT).invokeExact(target, internalformat, x, y, width); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyConvolutionFilter1DEXT(int target, int internalformat, int x, int y, int width) { + throw new ContextException(); } - public static void glCopyConvolutionFilter2DEXT(int target, int internalformat, int x, int y, int width, int height) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyConvolutionFilter2DEXT).invokeExact(target, internalformat, x, y, width, height); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyConvolutionFilter2DEXT(int target, int internalformat, int x, int y, int width, int height) { + throw new ContextException(); } - public static void glGetConvolutionFilterEXT(int target, int format, int type, @NativeType("void *") MemorySegment image) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetConvolutionFilterEXT).invokeExact(target, format, type, image); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetConvolutionFilterEXT(int target, int format, int type, @NativeType("void *") MemorySegment image) { + throw new ContextException(); } - public static void glGetConvolutionParameterfvEXT(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetConvolutionParameterfvEXT).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetConvolutionParameterfvEXT(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetConvolutionParameterivEXT(int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetConvolutionParameterivEXT).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetConvolutionParameterivEXT(int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetSeparableFilterEXT(int target, int format, int type, @NativeType("void *") MemorySegment row, @NativeType("void *") MemorySegment column, @NativeType("void *") MemorySegment span) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetSeparableFilterEXT).invokeExact(target, format, type, row, column, span); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetSeparableFilterEXT(int target, int format, int type, @NativeType("void *") MemorySegment row, @NativeType("void *") MemorySegment column, @NativeType("void *") MemorySegment span) { + throw new ContextException(); } - public static void glSeparableFilter2DEXT(int target, int internalformat, int width, int height, int format, int type, @NativeType("const void *") MemorySegment row, @NativeType("const void *") MemorySegment column) { - final var ext = getExtCapabilities(); - try { - check(ext.glSeparableFilter2DEXT).invokeExact(target, internalformat, width, height, format, type, row, column); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSeparableFilter2DEXT(int target, int internalformat, int width, int height, int format, int type, @NativeType("const void *") MemorySegment row, @NativeType("const void *") MemorySegment column) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTCoordinateFrame.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTCoordinateFrame.java index 28b59fc6..b89fa0d6 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTCoordinateFrame.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTCoordinateFrame.java @@ -16,210 +16,115 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_coordinate_frame} */ -public final class GLEXTCoordinateFrame { - public static final int GL_TANGENT_ARRAY_EXT = 0x8439; - public static final int GL_BINORMAL_ARRAY_EXT = 0x843A; - public static final int GL_CURRENT_TANGENT_EXT = 0x843B; - public static final int GL_CURRENT_BINORMAL_EXT = 0x843C; - public static final int GL_TANGENT_ARRAY_TYPE_EXT = 0x843E; - public static final int GL_TANGENT_ARRAY_STRIDE_EXT = 0x843F; - public static final int GL_BINORMAL_ARRAY_TYPE_EXT = 0x8440; - public static final int GL_BINORMAL_ARRAY_STRIDE_EXT = 0x8441; - public static final int GL_TANGENT_ARRAY_POINTER_EXT = 0x8442; - public static final int GL_BINORMAL_ARRAY_POINTER_EXT = 0x8443; - public static final int GL_MAP1_TANGENT_EXT = 0x8444; - public static final int GL_MAP2_TANGENT_EXT = 0x8445; - public static final int GL_MAP1_BINORMAL_EXT = 0x8446; - public static final int GL_MAP2_BINORMAL_EXT = 0x8447; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_coordinate_frame) return; - ext.glTangent3bEXT = load.invoke("glTangent3bEXT", ofVoid(JAVA_BYTE, JAVA_BYTE, JAVA_BYTE)); - ext.glTangent3bvEXT = load.invoke("glTangent3bvEXT", ofVoid(ADDRESS)); - ext.glTangent3dEXT = load.invoke("glTangent3dEXT", ofVoid(JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glTangent3dvEXT = load.invoke("glTangent3dvEXT", ofVoid(ADDRESS)); - ext.glTangent3fEXT = load.invoke("glTangent3fEXT", ofVoid(JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glTangent3fvEXT = load.invoke("glTangent3fvEXT", ofVoid(ADDRESS)); - ext.glTangent3iEXT = load.invoke("glTangent3iEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glTangent3ivEXT = load.invoke("glTangent3ivEXT", ofVoid(ADDRESS)); - ext.glTangent3sEXT = load.invoke("glTangent3sEXT", ofVoid(JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glTangent3svEXT = load.invoke("glTangent3svEXT", ofVoid(ADDRESS)); - ext.glBinormal3bEXT = load.invoke("glBinormal3bEXT", ofVoid(JAVA_BYTE, JAVA_BYTE, JAVA_BYTE)); - ext.glBinormal3bvEXT = load.invoke("glBinormal3bvEXT", ofVoid(ADDRESS)); - ext.glBinormal3dEXT = load.invoke("glBinormal3dEXT", ofVoid(JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glBinormal3dvEXT = load.invoke("glBinormal3dvEXT", ofVoid(ADDRESS)); - ext.glBinormal3fEXT = load.invoke("glBinormal3fEXT", ofVoid(JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glBinormal3fvEXT = load.invoke("glBinormal3fvEXT", ofVoid(ADDRESS)); - ext.glBinormal3iEXT = load.invoke("glBinormal3iEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glBinormal3ivEXT = load.invoke("glBinormal3ivEXT", ofVoid(ADDRESS)); - ext.glBinormal3sEXT = load.invoke("glBinormal3sEXT", ofVoid(JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glBinormal3svEXT = load.invoke("glBinormal3svEXT", ofVoid(ADDRESS)); - ext.glTangentPointerEXT = load.invoke("glTangentPointerEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glBinormalPointerEXT = load.invoke("glBinormalPointerEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static void glTangent3bEXT(byte tx, byte ty, byte tz) { - final var ext = getExtCapabilities(); - try { - check(ext.glTangent3bEXT).invokeExact(tx, ty, tz); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glTangent3bvEXT(@NativeType("const GLbyte *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glTangent3bvEXT).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glTangent3dEXT(double tx, double ty, double tz) { - final var ext = getExtCapabilities(); - try { - check(ext.glTangent3dEXT).invokeExact(tx, ty, tz); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glTangent3dvEXT(@NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glTangent3dvEXT).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glTangent3fEXT(float tx, float ty, float tz) { - final var ext = getExtCapabilities(); - try { - check(ext.glTangent3fEXT).invokeExact(tx, ty, tz); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glTangent3fvEXT(@NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glTangent3fvEXT).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glTangent3iEXT(int tx, int ty, int tz) { - final var ext = getExtCapabilities(); - try { - check(ext.glTangent3iEXT).invokeExact(tx, ty, tz); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glTangent3ivEXT(@NativeType("const GLint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glTangent3ivEXT).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glTangent3sEXT(short tx, short ty, short tz) { - final var ext = getExtCapabilities(); - try { - check(ext.glTangent3sEXT).invokeExact(tx, ty, tz); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glTangent3svEXT(@NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glTangent3svEXT).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glBinormal3bEXT(byte bx, byte by, byte bz) { - final var ext = getExtCapabilities(); - try { - check(ext.glBinormal3bEXT).invokeExact(bx, by, bz); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLEXTCoordinateFrame { + int GL_TANGENT_ARRAY_EXT = 0x8439; + int GL_BINORMAL_ARRAY_EXT = 0x843A; + int GL_CURRENT_TANGENT_EXT = 0x843B; + int GL_CURRENT_BINORMAL_EXT = 0x843C; + int GL_TANGENT_ARRAY_TYPE_EXT = 0x843E; + int GL_TANGENT_ARRAY_STRIDE_EXT = 0x843F; + int GL_BINORMAL_ARRAY_TYPE_EXT = 0x8440; + int GL_BINORMAL_ARRAY_STRIDE_EXT = 0x8441; + int GL_TANGENT_ARRAY_POINTER_EXT = 0x8442; + int GL_BINORMAL_ARRAY_POINTER_EXT = 0x8443; + int GL_MAP1_TANGENT_EXT = 0x8444; + int GL_MAP2_TANGENT_EXT = 0x8445; + int GL_MAP1_BINORMAL_EXT = 0x8446; + int GL_MAP2_BINORMAL_EXT = 0x8447; + + default void glTangent3bEXT(byte tx, byte ty, byte tz) { + throw new ContextException(); + } + + default void glTangent3bvEXT(@NativeType("const GLbyte *") MemorySegment v) { + throw new ContextException(); + } + + default void glTangent3dEXT(double tx, double ty, double tz) { + throw new ContextException(); + } + + default void glTangent3dvEXT(@NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); + } + + default void glTangent3fEXT(float tx, float ty, float tz) { + throw new ContextException(); + } + + default void glTangent3fvEXT(@NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); + } + + default void glTangent3iEXT(int tx, int ty, int tz) { + throw new ContextException(); + } + + default void glTangent3ivEXT(@NativeType("const GLint *") MemorySegment v) { + throw new ContextException(); + } + + default void glTangent3sEXT(short tx, short ty, short tz) { + throw new ContextException(); + } + + default void glTangent3svEXT(@NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); + } + + default void glBinormal3bEXT(byte bx, byte by, byte bz) { + throw new ContextException(); } - public static void glBinormal3bvEXT(@NativeType("const GLbyte *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glBinormal3bvEXT).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBinormal3bvEXT(@NativeType("const GLbyte *") MemorySegment v) { + throw new ContextException(); } - public static void glBinormal3dEXT(double bx, double by, double bz) { - final var ext = getExtCapabilities(); - try { - check(ext.glBinormal3dEXT).invokeExact(bx, by, bz); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBinormal3dEXT(double bx, double by, double bz) { + throw new ContextException(); } - public static void glBinormal3dvEXT(@NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glBinormal3dvEXT).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBinormal3dvEXT(@NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glBinormal3fEXT(float bx, float by, float bz) { - final var ext = getExtCapabilities(); - try { - check(ext.glBinormal3fEXT).invokeExact(bx, by, bz); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBinormal3fEXT(float bx, float by, float bz) { + throw new ContextException(); } - public static void glBinormal3fvEXT(@NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glBinormal3fvEXT).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBinormal3fvEXT(@NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glBinormal3iEXT(int bx, int by, int bz) { - final var ext = getExtCapabilities(); - try { - check(ext.glBinormal3iEXT).invokeExact(bx, by, bz); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBinormal3iEXT(int bx, int by, int bz) { + throw new ContextException(); } - public static void glBinormal3ivEXT(@NativeType("const GLint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glBinormal3ivEXT).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBinormal3ivEXT(@NativeType("const GLint *") MemorySegment v) { + throw new ContextException(); } - public static void glBinormal3sEXT(short bx, short by, short bz) { - final var ext = getExtCapabilities(); - try { - check(ext.glBinormal3sEXT).invokeExact(bx, by, bz); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBinormal3sEXT(short bx, short by, short bz) { + throw new ContextException(); } - public static void glBinormal3svEXT(@NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glBinormal3svEXT).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBinormal3svEXT(@NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } - public static void glTangentPointerEXT(int type, int stride, @NativeType("const void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glTangentPointerEXT).invokeExact(type, stride, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTangentPointerEXT(int type, int stride, @NativeType("const void *") MemorySegment pointer) { + throw new ContextException(); } - public static void glBinormalPointerEXT(int type, int stride, @NativeType("const void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glBinormalPointerEXT).invokeExact(type, stride, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBinormalPointerEXT(int type, int stride, @NativeType("const void *") MemorySegment pointer) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTCopyTexture.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTCopyTexture.java index 4cc5c38c..1d82f52f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTCopyTexture.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTCopyTexture.java @@ -16,60 +16,33 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_copy_texture} */ -public final class GLEXTCopyTexture { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_copy_texture) return; - ext.glCopyTexImage1DEXT = load.invoke("glCopyTexImage1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glCopyTexImage2DEXT = load.invoke("glCopyTexImage2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glCopyTexSubImage1DEXT = load.invoke("glCopyTexSubImage1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glCopyTexSubImage2DEXT = load.invoke("glCopyTexSubImage2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glCopyTexSubImage3DEXT = load.invoke("glCopyTexSubImage3DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLEXTCopyTexture { - public static void glCopyTexImage1DEXT(int target, int level, int internalformat, int x, int y, int width, int border) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyTexImage1DEXT).invokeExact(target, level, internalformat, x, y, width, border); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyTexImage1DEXT(int target, int level, int internalformat, int x, int y, int width, int border) { + throw new ContextException(); } - public static void glCopyTexImage2DEXT(int target, int level, int internalformat, int x, int y, int width, int height, int border) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyTexImage2DEXT).invokeExact(target, level, internalformat, x, y, width, height, border); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyTexImage2DEXT(int target, int level, int internalformat, int x, int y, int width, int height, int border) { + throw new ContextException(); } - public static void glCopyTexSubImage1DEXT(int target, int level, int xoffset, int x, int y, int width) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyTexSubImage1DEXT).invokeExact(target, level, xoffset, x, y, width); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyTexSubImage1DEXT(int target, int level, int xoffset, int x, int y, int width) { + throw new ContextException(); } - public static void glCopyTexSubImage2DEXT(int target, int level, int xoffset, int yoffset, int x, int y, int width, int height) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyTexSubImage2DEXT).invokeExact(target, level, xoffset, yoffset, x, y, width, height); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyTexSubImage2DEXT(int target, int level, int xoffset, int yoffset, int x, int y, int width, int height) { + throw new ContextException(); } - public static void glCopyTexSubImage3DEXT(int target, int level, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyTexSubImage3DEXT).invokeExact(target, level, xoffset, yoffset, zoffset, x, y, width, height); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyTexSubImage3DEXT(int target, int level, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTCullVertex.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTCullVertex.java index f963412a..e840b630 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTCullVertex.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTCullVertex.java @@ -16,39 +16,24 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_cull_vertex} */ -public final class GLEXTCullVertex { - public static final int GL_CULL_VERTEX_EXT = 0x81AA; - public static final int GL_CULL_VERTEX_EYE_POSITION_EXT = 0x81AB; - public static final int GL_CULL_VERTEX_OBJECT_POSITION_EXT = 0x81AC; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_cull_vertex) return; - ext.glCullParameterdvEXT = load.invoke("glCullParameterdvEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glCullParameterfvEXT = load.invoke("glCullParameterfvEXT", ofVoid(JAVA_INT, ADDRESS)); - } +public interface GLEXTCullVertex { + int GL_CULL_VERTEX_EXT = 0x81AA; + int GL_CULL_VERTEX_EYE_POSITION_EXT = 0x81AB; + int GL_CULL_VERTEX_OBJECT_POSITION_EXT = 0x81AC; - public static void glCullParameterdvEXT(int pname, @NativeType("GLdouble *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glCullParameterdvEXT).invokeExact(pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCullParameterdvEXT(int pname, @NativeType("GLdouble *") MemorySegment params) { + throw new ContextException(); } - public static void glCullParameterfvEXT(int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glCullParameterfvEXT).invokeExact(pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCullParameterfvEXT(int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDebugLabel.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDebugLabel.java index c8abe18d..18b62926 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDebugLabel.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDebugLabel.java @@ -16,42 +16,27 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_debug_label} */ -public final class GLEXTDebugLabel { - public static final int GL_PROGRAM_PIPELINE_OBJECT_EXT = 0x8A4F; - public static final int GL_PROGRAM_OBJECT_EXT = 0x8B40; - public static final int GL_SHADER_OBJECT_EXT = 0x8B48; - public static final int GL_BUFFER_OBJECT_EXT = 0x9151; - public static final int GL_QUERY_OBJECT_EXT = 0x9153; - public static final int GL_VERTEX_ARRAY_OBJECT_EXT = 0x9154; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_debug_label) return; - ext.glLabelObjectEXT = load.invoke("glLabelObjectEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetObjectLabelEXT = load.invoke("glGetObjectLabelEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - } +public interface GLEXTDebugLabel { + int GL_PROGRAM_PIPELINE_OBJECT_EXT = 0x8A4F; + int GL_PROGRAM_OBJECT_EXT = 0x8B40; + int GL_SHADER_OBJECT_EXT = 0x8B48; + int GL_BUFFER_OBJECT_EXT = 0x9151; + int GL_QUERY_OBJECT_EXT = 0x9153; + int GL_VERTEX_ARRAY_OBJECT_EXT = 0x9154; - public static void glLabelObjectEXT(int type, int object, int length, @NativeType("const GLchar *") MemorySegment label) { - final var ext = getExtCapabilities(); - try { - check(ext.glLabelObjectEXT).invokeExact(type, object, length, label); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glLabelObjectEXT(int type, int object, int length, @NativeType("const GLchar *") MemorySegment label) { + throw new ContextException(); } - public static void glGetObjectLabelEXT(int type, int object, int bufSize, @NativeType("GLsizei *") MemorySegment length, @NativeType("GLchar *") MemorySegment label) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetObjectLabelEXT).invokeExact(type, object, bufSize, length, label); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetObjectLabelEXT(int type, int object, int bufSize, @NativeType("GLsizei *") MemorySegment length, @NativeType("GLchar *") MemorySegment label) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDebugMarker.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDebugMarker.java index e0b582d3..0d041b7a 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDebugMarker.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDebugMarker.java @@ -16,44 +16,25 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_debug_marker} */ -public final class GLEXTDebugMarker { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_debug_marker) return; - ext.glInsertEventMarkerEXT = load.invoke("glInsertEventMarkerEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glPushGroupMarkerEXT = load.invoke("glPushGroupMarkerEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glPopGroupMarkerEXT = load.invoke("glPopGroupMarkerEXT", ofVoid()); - } +public interface GLEXTDebugMarker { - public static void glInsertEventMarkerEXT(int length, @NativeType("const GLchar *") MemorySegment marker) { - final var ext = getExtCapabilities(); - try { - check(ext.glInsertEventMarkerEXT).invokeExact(length, marker); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glInsertEventMarkerEXT(int length, @NativeType("const GLchar *") MemorySegment marker) { + throw new ContextException(); } - public static void glPushGroupMarkerEXT(int length, @NativeType("const GLchar *") MemorySegment marker) { - final var ext = getExtCapabilities(); - try { - check(ext.glPushGroupMarkerEXT).invokeExact(length, marker); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPushGroupMarkerEXT(int length, @NativeType("const GLchar *") MemorySegment marker) { + throw new ContextException(); } - public static void glPopGroupMarkerEXT() { - final var ext = getExtCapabilities(); - try { - check(ext.glPopGroupMarkerEXT).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPopGroupMarkerEXT() { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDepthBoundsTest.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDepthBoundsTest.java index 873d6492..f2c719d8 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDepthBoundsTest.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDepthBoundsTest.java @@ -16,30 +16,19 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_depth_bounds_test} */ -public final class GLEXTDepthBoundsTest { - public static final int GL_DEPTH_BOUNDS_TEST_EXT = 0x8890; - public static final int GL_DEPTH_BOUNDS_EXT = 0x8891; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_depth_bounds_test) return; - ext.glDepthBoundsEXT = load.invoke("glDepthBoundsEXT", ofVoid(JAVA_DOUBLE, JAVA_DOUBLE)); - } +public interface GLEXTDepthBoundsTest { + int GL_DEPTH_BOUNDS_TEST_EXT = 0x8890; + int GL_DEPTH_BOUNDS_EXT = 0x8891; - public static void glDepthBoundsEXT(double zmin, double zmax) { - final var ext = getExtCapabilities(); - try { - check(ext.glDepthBoundsEXT).invokeExact(zmin, zmax); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDepthBoundsEXT(double zmin, double zmax) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDirectStateAccess.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDirectStateAccess.java index 8c8711df..41ffec55 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDirectStateAccess.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDirectStateAccess.java @@ -16,2067 +16,1036 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_direct_state_access} */ -public final class GLEXTDirectStateAccess { - public static final int GL_PROGRAM_MATRIX_EXT = 0x8E2D; - public static final int GL_TRANSPOSE_PROGRAM_MATRIX_EXT = 0x8E2E; - public static final int GL_PROGRAM_MATRIX_STACK_DEPTH_EXT = 0x8E2F; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_direct_state_access) return; - ext.glMatrixLoadfEXT = load.invoke("glMatrixLoadfEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glMatrixLoaddEXT = load.invoke("glMatrixLoaddEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glMatrixMultfEXT = load.invoke("glMatrixMultfEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glMatrixMultdEXT = load.invoke("glMatrixMultdEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glMatrixLoadIdentityEXT = load.invoke("glMatrixLoadIdentityEXT", ofVoid(JAVA_INT)); - ext.glMatrixRotatefEXT = load.invoke("glMatrixRotatefEXT", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glMatrixRotatedEXT = load.invoke("glMatrixRotatedEXT", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glMatrixScalefEXT = load.invoke("glMatrixScalefEXT", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glMatrixScaledEXT = load.invoke("glMatrixScaledEXT", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glMatrixTranslatefEXT = load.invoke("glMatrixTranslatefEXT", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glMatrixTranslatedEXT = load.invoke("glMatrixTranslatedEXT", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glMatrixFrustumEXT = load.invoke("glMatrixFrustumEXT", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glMatrixOrthoEXT = load.invoke("glMatrixOrthoEXT", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glMatrixPopEXT = load.invoke("glMatrixPopEXT", ofVoid(JAVA_INT)); - ext.glMatrixPushEXT = load.invoke("glMatrixPushEXT", ofVoid(JAVA_INT)); - ext.glClientAttribDefaultEXT = load.invoke("glClientAttribDefaultEXT", ofVoid(JAVA_INT)); - ext.glPushClientAttribDefaultEXT = load.invoke("glPushClientAttribDefaultEXT", ofVoid(JAVA_INT)); - ext.glTextureParameterfEXT = load.invoke("glTextureParameterfEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_FLOAT)); - ext.glTextureParameterfvEXT = load.invoke("glTextureParameterfvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glTextureParameteriEXT = load.invoke("glTextureParameteriEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glTextureParameterivEXT = load.invoke("glTextureParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glTextureImage1DEXT = load.invoke("glTextureImage1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glTextureImage2DEXT = load.invoke("glTextureImage2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glTextureSubImage1DEXT = load.invoke("glTextureSubImage1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glTextureSubImage2DEXT = load.invoke("glTextureSubImage2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCopyTextureImage1DEXT = load.invoke("glCopyTextureImage1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glCopyTextureImage2DEXT = load.invoke("glCopyTextureImage2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glCopyTextureSubImage1DEXT = load.invoke("glCopyTextureSubImage1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glCopyTextureSubImage2DEXT = load.invoke("glCopyTextureSubImage2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetTextureImageEXT = load.invoke("glGetTextureImageEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetTextureParameterfvEXT = load.invoke("glGetTextureParameterfvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetTextureParameterivEXT = load.invoke("glGetTextureParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetTextureLevelParameterfvEXT = load.invoke("glGetTextureLevelParameterfvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetTextureLevelParameterivEXT = load.invoke("glGetTextureLevelParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glTextureImage3DEXT = load.invoke("glTextureImage3DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glTextureSubImage3DEXT = load.invoke("glTextureSubImage3DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCopyTextureSubImage3DEXT = load.invoke("glCopyTextureSubImage3DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glBindMultiTextureEXT = load.invoke("glBindMultiTextureEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMultiTexCoordPointerEXT = load.invoke("glMultiTexCoordPointerEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMultiTexEnvfEXT = load.invoke("glMultiTexEnvfEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_FLOAT)); - ext.glMultiTexEnvfvEXT = load.invoke("glMultiTexEnvfvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMultiTexEnviEXT = load.invoke("glMultiTexEnviEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMultiTexEnvivEXT = load.invoke("glMultiTexEnvivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMultiTexGendEXT = load.invoke("glMultiTexGendEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_DOUBLE)); - ext.glMultiTexGendvEXT = load.invoke("glMultiTexGendvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMultiTexGenfEXT = load.invoke("glMultiTexGenfEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_FLOAT)); - ext.glMultiTexGenfvEXT = load.invoke("glMultiTexGenfvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMultiTexGeniEXT = load.invoke("glMultiTexGeniEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMultiTexGenivEXT = load.invoke("glMultiTexGenivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMultiTexEnvfvEXT = load.invoke("glGetMultiTexEnvfvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMultiTexEnvivEXT = load.invoke("glGetMultiTexEnvivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMultiTexGendvEXT = load.invoke("glGetMultiTexGendvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMultiTexGenfvEXT = load.invoke("glGetMultiTexGenfvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMultiTexGenivEXT = load.invoke("glGetMultiTexGenivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMultiTexParameteriEXT = load.invoke("glMultiTexParameteriEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMultiTexParameterivEXT = load.invoke("glMultiTexParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMultiTexParameterfEXT = load.invoke("glMultiTexParameterfEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_FLOAT)); - ext.glMultiTexParameterfvEXT = load.invoke("glMultiTexParameterfvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMultiTexImage1DEXT = load.invoke("glMultiTexImage1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMultiTexImage2DEXT = load.invoke("glMultiTexImage2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMultiTexSubImage1DEXT = load.invoke("glMultiTexSubImage1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMultiTexSubImage2DEXT = load.invoke("glMultiTexSubImage2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCopyMultiTexImage1DEXT = load.invoke("glCopyMultiTexImage1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glCopyMultiTexImage2DEXT = load.invoke("glCopyMultiTexImage2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glCopyMultiTexSubImage1DEXT = load.invoke("glCopyMultiTexSubImage1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glCopyMultiTexSubImage2DEXT = load.invoke("glCopyMultiTexSubImage2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetMultiTexImageEXT = load.invoke("glGetMultiTexImageEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMultiTexParameterfvEXT = load.invoke("glGetMultiTexParameterfvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMultiTexParameterivEXT = load.invoke("glGetMultiTexParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMultiTexLevelParameterfvEXT = load.invoke("glGetMultiTexLevelParameterfvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMultiTexLevelParameterivEXT = load.invoke("glGetMultiTexLevelParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMultiTexImage3DEXT = load.invoke("glMultiTexImage3DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMultiTexSubImage3DEXT = load.invoke("glMultiTexSubImage3DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCopyMultiTexSubImage3DEXT = load.invoke("glCopyMultiTexSubImage3DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glEnableClientStateIndexedEXT = load.invoke("glEnableClientStateIndexedEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glDisableClientStateIndexedEXT = load.invoke("glDisableClientStateIndexedEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glGetFloatIndexedvEXT = load.invoke("glGetFloatIndexedvEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetDoubleIndexedvEXT = load.invoke("glGetDoubleIndexedvEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetPointerIndexedvEXT = load.invoke("glGetPointerIndexedvEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glEnableIndexedEXT = load.invoke("glEnableIndexedEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glDisableIndexedEXT = load.invoke("glDisableIndexedEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glIsEnabledIndexedEXT = load.invoke("glIsEnabledIndexedEXT", of(JAVA_BYTE, JAVA_INT, JAVA_INT)); - ext.glGetIntegerIndexedvEXT = load.invoke("glGetIntegerIndexedvEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetBooleanIndexedvEXT = load.invoke("glGetBooleanIndexedvEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCompressedTextureImage3DEXT = load.invoke("glCompressedTextureImage3DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCompressedTextureImage2DEXT = load.invoke("glCompressedTextureImage2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCompressedTextureImage1DEXT = load.invoke("glCompressedTextureImage1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCompressedTextureSubImage3DEXT = load.invoke("glCompressedTextureSubImage3DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCompressedTextureSubImage2DEXT = load.invoke("glCompressedTextureSubImage2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCompressedTextureSubImage1DEXT = load.invoke("glCompressedTextureSubImage1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetCompressedTextureImageEXT = load.invoke("glGetCompressedTextureImageEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCompressedMultiTexImage3DEXT = load.invoke("glCompressedMultiTexImage3DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCompressedMultiTexImage2DEXT = load.invoke("glCompressedMultiTexImage2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCompressedMultiTexImage1DEXT = load.invoke("glCompressedMultiTexImage1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCompressedMultiTexSubImage3DEXT = load.invoke("glCompressedMultiTexSubImage3DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCompressedMultiTexSubImage2DEXT = load.invoke("glCompressedMultiTexSubImage2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCompressedMultiTexSubImage1DEXT = load.invoke("glCompressedMultiTexSubImage1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetCompressedMultiTexImageEXT = load.invoke("glGetCompressedMultiTexImageEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMatrixLoadTransposefEXT = load.invoke("glMatrixLoadTransposefEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glMatrixLoadTransposedEXT = load.invoke("glMatrixLoadTransposedEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glMatrixMultTransposefEXT = load.invoke("glMatrixMultTransposefEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glMatrixMultTransposedEXT = load.invoke("glMatrixMultTransposedEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glNamedBufferDataEXT = load.invoke("glNamedBufferDataEXT", ofVoid(JAVA_INT, JAVA_LONG, ADDRESS, JAVA_INT)); - ext.glNamedBufferSubDataEXT = load.invoke("glNamedBufferSubDataEXT", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, ADDRESS)); - ext.glMapNamedBufferEXT = load.invoke("glMapNamedBufferEXT", of(ADDRESS, JAVA_INT, JAVA_INT)); - ext.glUnmapNamedBufferEXT = load.invoke("glUnmapNamedBufferEXT", of(JAVA_BYTE, JAVA_INT)); - ext.glGetNamedBufferParameterivEXT = load.invoke("glGetNamedBufferParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetNamedBufferPointervEXT = load.invoke("glGetNamedBufferPointervEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetNamedBufferSubDataEXT = load.invoke("glGetNamedBufferSubDataEXT", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, ADDRESS)); - ext.glProgramUniform1fEXT = load.invoke("glProgramUniform1fEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_FLOAT)); - ext.glProgramUniform2fEXT = load.invoke("glProgramUniform2fEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glProgramUniform3fEXT = load.invoke("glProgramUniform3fEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glProgramUniform4fEXT = load.invoke("glProgramUniform4fEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glProgramUniform1iEXT = load.invoke("glProgramUniform1iEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glProgramUniform2iEXT = load.invoke("glProgramUniform2iEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glProgramUniform3iEXT = load.invoke("glProgramUniform3iEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glProgramUniform4iEXT = load.invoke("glProgramUniform4iEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glProgramUniform1fvEXT = load.invoke("glProgramUniform1fvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform2fvEXT = load.invoke("glProgramUniform2fvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform3fvEXT = load.invoke("glProgramUniform3fvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform4fvEXT = load.invoke("glProgramUniform4fvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform1ivEXT = load.invoke("glProgramUniform1ivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform2ivEXT = load.invoke("glProgramUniform2ivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform3ivEXT = load.invoke("glProgramUniform3ivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform4ivEXT = load.invoke("glProgramUniform4ivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniformMatrix2fvEXT = load.invoke("glProgramUniformMatrix2fvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glProgramUniformMatrix3fvEXT = load.invoke("glProgramUniformMatrix3fvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glProgramUniformMatrix4fvEXT = load.invoke("glProgramUniformMatrix4fvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glProgramUniformMatrix2x3fvEXT = load.invoke("glProgramUniformMatrix2x3fvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glProgramUniformMatrix3x2fvEXT = load.invoke("glProgramUniformMatrix3x2fvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glProgramUniformMatrix2x4fvEXT = load.invoke("glProgramUniformMatrix2x4fvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glProgramUniformMatrix4x2fvEXT = load.invoke("glProgramUniformMatrix4x2fvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glProgramUniformMatrix3x4fvEXT = load.invoke("glProgramUniformMatrix3x4fvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glProgramUniformMatrix4x3fvEXT = load.invoke("glProgramUniformMatrix4x3fvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glTextureBufferEXT = load.invoke("glTextureBufferEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMultiTexBufferEXT = load.invoke("glMultiTexBufferEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glTextureParameterIivEXT = load.invoke("glTextureParameterIivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glTextureParameterIuivEXT = load.invoke("glTextureParameterIuivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetTextureParameterIivEXT = load.invoke("glGetTextureParameterIivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetTextureParameterIuivEXT = load.invoke("glGetTextureParameterIuivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMultiTexParameterIivEXT = load.invoke("glMultiTexParameterIivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMultiTexParameterIuivEXT = load.invoke("glMultiTexParameterIuivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMultiTexParameterIivEXT = load.invoke("glGetMultiTexParameterIivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMultiTexParameterIuivEXT = load.invoke("glGetMultiTexParameterIuivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform1uiEXT = load.invoke("glProgramUniform1uiEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glProgramUniform2uiEXT = load.invoke("glProgramUniform2uiEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glProgramUniform3uiEXT = load.invoke("glProgramUniform3uiEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glProgramUniform4uiEXT = load.invoke("glProgramUniform4uiEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glProgramUniform1uivEXT = load.invoke("glProgramUniform1uivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform2uivEXT = load.invoke("glProgramUniform2uivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform3uivEXT = load.invoke("glProgramUniform3uivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform4uivEXT = load.invoke("glProgramUniform4uivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glNamedProgramLocalParameters4fvEXT = load.invoke("glNamedProgramLocalParameters4fvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glNamedProgramLocalParameterI4iEXT = load.invoke("glNamedProgramLocalParameterI4iEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glNamedProgramLocalParameterI4ivEXT = load.invoke("glNamedProgramLocalParameterI4ivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glNamedProgramLocalParametersI4ivEXT = load.invoke("glNamedProgramLocalParametersI4ivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glNamedProgramLocalParameterI4uiEXT = load.invoke("glNamedProgramLocalParameterI4uiEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glNamedProgramLocalParameterI4uivEXT = load.invoke("glNamedProgramLocalParameterI4uivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glNamedProgramLocalParametersI4uivEXT = load.invoke("glNamedProgramLocalParametersI4uivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetNamedProgramLocalParameterIivEXT = load.invoke("glGetNamedProgramLocalParameterIivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetNamedProgramLocalParameterIuivEXT = load.invoke("glGetNamedProgramLocalParameterIuivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glEnableClientStateiEXT = load.invoke("glEnableClientStateiEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glDisableClientStateiEXT = load.invoke("glDisableClientStateiEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glGetFloati_vEXT = load.invoke("glGetFloati_vEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetDoublei_vEXT = load.invoke("glGetDoublei_vEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetPointeri_vEXT = load.invoke("glGetPointeri_vEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glNamedProgramStringEXT = load.invoke("glNamedProgramStringEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glNamedProgramLocalParameter4dEXT = load.invoke("glNamedProgramLocalParameter4dEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glNamedProgramLocalParameter4dvEXT = load.invoke("glNamedProgramLocalParameter4dvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glNamedProgramLocalParameter4fEXT = load.invoke("glNamedProgramLocalParameter4fEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glNamedProgramLocalParameter4fvEXT = load.invoke("glNamedProgramLocalParameter4fvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetNamedProgramLocalParameterdvEXT = load.invoke("glGetNamedProgramLocalParameterdvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetNamedProgramLocalParameterfvEXT = load.invoke("glGetNamedProgramLocalParameterfvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetNamedProgramivEXT = load.invoke("glGetNamedProgramivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetNamedProgramStringEXT = load.invoke("glGetNamedProgramStringEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glNamedRenderbufferStorageEXT = load.invoke("glNamedRenderbufferStorageEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetNamedRenderbufferParameterivEXT = load.invoke("glGetNamedRenderbufferParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glNamedRenderbufferStorageMultisampleEXT = load.invoke("glNamedRenderbufferStorageMultisampleEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glNamedRenderbufferStorageMultisampleCoverageEXT = load.invoke("glNamedRenderbufferStorageMultisampleCoverageEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glCheckNamedFramebufferStatusEXT = load.invoke("glCheckNamedFramebufferStatusEXT", of(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glNamedFramebufferTexture1DEXT = load.invoke("glNamedFramebufferTexture1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glNamedFramebufferTexture2DEXT = load.invoke("glNamedFramebufferTexture2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glNamedFramebufferTexture3DEXT = load.invoke("glNamedFramebufferTexture3DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glNamedFramebufferRenderbufferEXT = load.invoke("glNamedFramebufferRenderbufferEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetNamedFramebufferAttachmentParameterivEXT = load.invoke("glGetNamedFramebufferAttachmentParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGenerateTextureMipmapEXT = load.invoke("glGenerateTextureMipmapEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glGenerateMultiTexMipmapEXT = load.invoke("glGenerateMultiTexMipmapEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glFramebufferDrawBufferEXT = load.invoke("glFramebufferDrawBufferEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glFramebufferDrawBuffersEXT = load.invoke("glFramebufferDrawBuffersEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glFramebufferReadBufferEXT = load.invoke("glFramebufferReadBufferEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glGetFramebufferParameterivEXT = load.invoke("glGetFramebufferParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glNamedCopyBufferSubDataEXT = load.invoke("glNamedCopyBufferSubDataEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glNamedFramebufferTextureEXT = load.invoke("glNamedFramebufferTextureEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glNamedFramebufferTextureLayerEXT = load.invoke("glNamedFramebufferTextureLayerEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glNamedFramebufferTextureFaceEXT = load.invoke("glNamedFramebufferTextureFaceEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glTextureRenderbufferEXT = load.invoke("glTextureRenderbufferEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMultiTexRenderbufferEXT = load.invoke("glMultiTexRenderbufferEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glVertexArrayVertexOffsetEXT = load.invoke("glVertexArrayVertexOffsetEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glVertexArrayColorOffsetEXT = load.invoke("glVertexArrayColorOffsetEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glVertexArrayEdgeFlagOffsetEXT = load.invoke("glVertexArrayEdgeFlagOffsetEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glVertexArrayIndexOffsetEXT = load.invoke("glVertexArrayIndexOffsetEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glVertexArrayNormalOffsetEXT = load.invoke("glVertexArrayNormalOffsetEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glVertexArrayTexCoordOffsetEXT = load.invoke("glVertexArrayTexCoordOffsetEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glVertexArrayMultiTexCoordOffsetEXT = load.invoke("glVertexArrayMultiTexCoordOffsetEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glVertexArrayFogCoordOffsetEXT = load.invoke("glVertexArrayFogCoordOffsetEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glVertexArraySecondaryColorOffsetEXT = load.invoke("glVertexArraySecondaryColorOffsetEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glVertexArrayVertexAttribOffsetEXT = load.invoke("glVertexArrayVertexAttribOffsetEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, JAVA_INT, JAVA_LONG)); - ext.glVertexArrayVertexAttribIOffsetEXT = load.invoke("glVertexArrayVertexAttribIOffsetEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glEnableVertexArrayEXT = load.invoke("glEnableVertexArrayEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glDisableVertexArrayEXT = load.invoke("glDisableVertexArrayEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glEnableVertexArrayAttribEXT = load.invoke("glEnableVertexArrayAttribEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glDisableVertexArrayAttribEXT = load.invoke("glDisableVertexArrayAttribEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glGetVertexArrayIntegervEXT = load.invoke("glGetVertexArrayIntegervEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVertexArrayPointervEXT = load.invoke("glGetVertexArrayPointervEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVertexArrayIntegeri_vEXT = load.invoke("glGetVertexArrayIntegeri_vEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVertexArrayPointeri_vEXT = load.invoke("glGetVertexArrayPointeri_vEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMapNamedBufferRangeEXT = load.invoke("glMapNamedBufferRangeEXT", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_INT)); - ext.glFlushMappedNamedBufferRangeEXT = load.invoke("glFlushMappedNamedBufferRangeEXT", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG)); - ext.glNamedBufferStorageEXT = load.invoke("glNamedBufferStorageEXT", ofVoid(JAVA_INT, JAVA_LONG, ADDRESS, JAVA_INT)); - ext.glClearNamedBufferDataEXT = load.invoke("glClearNamedBufferDataEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glClearNamedBufferSubDataEXT = load.invoke("glClearNamedBufferSubDataEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glNamedFramebufferParameteriEXT = load.invoke("glNamedFramebufferParameteriEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetNamedFramebufferParameterivEXT = load.invoke("glGetNamedFramebufferParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform1dEXT = load.invoke("glProgramUniform1dEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_DOUBLE)); - ext.glProgramUniform2dEXT = load.invoke("glProgramUniform2dEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glProgramUniform3dEXT = load.invoke("glProgramUniform3dEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glProgramUniform4dEXT = load.invoke("glProgramUniform4dEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glProgramUniform1dvEXT = load.invoke("glProgramUniform1dvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform2dvEXT = load.invoke("glProgramUniform2dvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform3dvEXT = load.invoke("glProgramUniform3dvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniform4dvEXT = load.invoke("glProgramUniform4dvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniformMatrix2dvEXT = load.invoke("glProgramUniformMatrix2dvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glProgramUniformMatrix3dvEXT = load.invoke("glProgramUniformMatrix3dvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glProgramUniformMatrix4dvEXT = load.invoke("glProgramUniformMatrix4dvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glProgramUniformMatrix2x3dvEXT = load.invoke("glProgramUniformMatrix2x3dvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glProgramUniformMatrix2x4dvEXT = load.invoke("glProgramUniformMatrix2x4dvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glProgramUniformMatrix3x2dvEXT = load.invoke("glProgramUniformMatrix3x2dvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glProgramUniformMatrix3x4dvEXT = load.invoke("glProgramUniformMatrix3x4dvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glProgramUniformMatrix4x2dvEXT = load.invoke("glProgramUniformMatrix4x2dvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glProgramUniformMatrix4x3dvEXT = load.invoke("glProgramUniformMatrix4x3dvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glTextureBufferRangeEXT = load.invoke("glTextureBufferRangeEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG)); - ext.glTextureStorage1DEXT = load.invoke("glTextureStorage1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glTextureStorage2DEXT = load.invoke("glTextureStorage2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glTextureStorage3DEXT = load.invoke("glTextureStorage3DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glTextureStorage2DMultisampleEXT = load.invoke("glTextureStorage2DMultisampleEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE)); - ext.glTextureStorage3DMultisampleEXT = load.invoke("glTextureStorage3DMultisampleEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE)); - ext.glVertexArrayBindVertexBufferEXT = load.invoke("glVertexArrayBindVertexBufferEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_INT)); - ext.glVertexArrayVertexAttribFormatEXT = load.invoke("glVertexArrayVertexAttribFormatEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, JAVA_INT)); - ext.glVertexArrayVertexAttribIFormatEXT = load.invoke("glVertexArrayVertexAttribIFormatEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glVertexArrayVertexAttribLFormatEXT = load.invoke("glVertexArrayVertexAttribLFormatEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glVertexArrayVertexAttribBindingEXT = load.invoke("glVertexArrayVertexAttribBindingEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glVertexArrayVertexBindingDivisorEXT = load.invoke("glVertexArrayVertexBindingDivisorEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glVertexArrayVertexAttribLOffsetEXT = load.invoke("glVertexArrayVertexAttribLOffsetEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glTexturePageCommitmentEXT = load.invoke("glTexturePageCommitmentEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE)); - ext.glVertexArrayVertexAttribDivisorEXT = load.invoke("glVertexArrayVertexAttribDivisorEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - } - - public static void glMatrixLoadfEXT(int mode, @NativeType("const GLfloat *") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixLoadfEXT).invokeExact(mode, m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMatrixLoaddEXT(int mode, @NativeType("const GLdouble *") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixLoaddEXT).invokeExact(mode, m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMatrixMultfEXT(int mode, @NativeType("const GLfloat *") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixMultfEXT).invokeExact(mode, m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMatrixMultdEXT(int mode, @NativeType("const GLdouble *") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixMultdEXT).invokeExact(mode, m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMatrixLoadIdentityEXT(int mode) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixLoadIdentityEXT).invokeExact(mode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMatrixRotatefEXT(int mode, float angle, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixRotatefEXT).invokeExact(mode, angle, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMatrixRotatedEXT(int mode, double angle, double x, double y, double z) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixRotatedEXT).invokeExact(mode, angle, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMatrixScalefEXT(int mode, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixScalefEXT).invokeExact(mode, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMatrixScaledEXT(int mode, double x, double y, double z) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixScaledEXT).invokeExact(mode, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMatrixTranslatefEXT(int mode, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixTranslatefEXT).invokeExact(mode, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLEXTDirectStateAccess { + int GL_PROGRAM_MATRIX_EXT = 0x8E2D; + int GL_TRANSPOSE_PROGRAM_MATRIX_EXT = 0x8E2E; + int GL_PROGRAM_MATRIX_STACK_DEPTH_EXT = 0x8E2F; + + default void glMatrixLoadfEXT(int mode, @NativeType("const GLfloat *") MemorySegment m) { + throw new ContextException(); + } + + default void glMatrixLoaddEXT(int mode, @NativeType("const GLdouble *") MemorySegment m) { + throw new ContextException(); + } + + default void glMatrixMultfEXT(int mode, @NativeType("const GLfloat *") MemorySegment m) { + throw new ContextException(); + } + + default void glMatrixMultdEXT(int mode, @NativeType("const GLdouble *") MemorySegment m) { + throw new ContextException(); + } + + default void glMatrixLoadIdentityEXT(int mode) { + throw new ContextException(); + } + + default void glMatrixRotatefEXT(int mode, float angle, float x, float y, float z) { + throw new ContextException(); + } + + default void glMatrixRotatedEXT(int mode, double angle, double x, double y, double z) { + throw new ContextException(); + } + + default void glMatrixScalefEXT(int mode, float x, float y, float z) { + throw new ContextException(); + } + + default void glMatrixScaledEXT(int mode, double x, double y, double z) { + throw new ContextException(); + } + + default void glMatrixTranslatefEXT(int mode, float x, float y, float z) { + throw new ContextException(); } - public static void glMatrixTranslatedEXT(int mode, double x, double y, double z) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixTranslatedEXT).invokeExact(mode, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMatrixTranslatedEXT(int mode, double x, double y, double z) { + throw new ContextException(); } - public static void glMatrixFrustumEXT(int mode, double left, double right, double bottom, double top, double zNear, double zFar) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixFrustumEXT).invokeExact(mode, left, right, bottom, top, zNear, zFar); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMatrixFrustumEXT(int mode, double left, double right, double bottom, double top, double zNear, double zFar) { + throw new ContextException(); } - public static void glMatrixOrthoEXT(int mode, double left, double right, double bottom, double top, double zNear, double zFar) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixOrthoEXT).invokeExact(mode, left, right, bottom, top, zNear, zFar); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMatrixOrthoEXT(int mode, double left, double right, double bottom, double top, double zNear, double zFar) { + throw new ContextException(); } - public static void glMatrixPopEXT(int mode) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixPopEXT).invokeExact(mode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMatrixPopEXT(int mode) { + throw new ContextException(); } - public static void glMatrixPushEXT(int mode) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixPushEXT).invokeExact(mode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMatrixPushEXT(int mode) { + throw new ContextException(); } - public static void glClientAttribDefaultEXT(int mask) { - final var ext = getExtCapabilities(); - try { - check(ext.glClientAttribDefaultEXT).invokeExact(mask); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glClientAttribDefaultEXT(int mask) { + throw new ContextException(); } - public static void glPushClientAttribDefaultEXT(int mask) { - final var ext = getExtCapabilities(); - try { - check(ext.glPushClientAttribDefaultEXT).invokeExact(mask); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPushClientAttribDefaultEXT(int mask) { + throw new ContextException(); } - public static void glTextureParameterfEXT(int texture, int target, int pname, float param) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureParameterfEXT).invokeExact(texture, target, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureParameterfEXT(int texture, int target, int pname, float param) { + throw new ContextException(); } - public static void glTextureParameterfvEXT(int texture, int target, int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureParameterfvEXT).invokeExact(texture, target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureParameterfvEXT(int texture, int target, int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glTextureParameteriEXT(int texture, int target, int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureParameteriEXT).invokeExact(texture, target, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureParameteriEXT(int texture, int target, int pname, int param) { + throw new ContextException(); } - public static void glTextureParameterivEXT(int texture, int target, int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureParameterivEXT).invokeExact(texture, target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureParameterivEXT(int texture, int target, int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glTextureImage1DEXT(int texture, int target, int level, int internalformat, int width, int border, int format, int type, @NativeType("const void *") MemorySegment pixels) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureImage1DEXT).invokeExact(texture, target, level, internalformat, width, border, format, type, pixels); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureImage1DEXT(int texture, int target, int level, int internalformat, int width, int border, int format, int type, @NativeType("const void *") MemorySegment pixels) { + throw new ContextException(); } - public static void glTextureImage2DEXT(int texture, int target, int level, int internalformat, int width, int height, int border, int format, int type, @NativeType("const void *") MemorySegment pixels) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureImage2DEXT).invokeExact(texture, target, level, internalformat, width, height, border, format, type, pixels); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureImage2DEXT(int texture, int target, int level, int internalformat, int width, int height, int border, int format, int type, @NativeType("const void *") MemorySegment pixels) { + throw new ContextException(); } - public static void glTextureSubImage1DEXT(int texture, int target, int level, int xoffset, int width, int format, int type, @NativeType("const void *") MemorySegment pixels) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureSubImage1DEXT).invokeExact(texture, target, level, xoffset, width, format, type, pixels); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureSubImage1DEXT(int texture, int target, int level, int xoffset, int width, int format, int type, @NativeType("const void *") MemorySegment pixels) { + throw new ContextException(); } - public static void glTextureSubImage2DEXT(int texture, int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, @NativeType("const void *") MemorySegment pixels) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureSubImage2DEXT).invokeExact(texture, target, level, xoffset, yoffset, width, height, format, type, pixels); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureSubImage2DEXT(int texture, int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, @NativeType("const void *") MemorySegment pixels) { + throw new ContextException(); } - public static void glCopyTextureImage1DEXT(int texture, int target, int level, int internalformat, int x, int y, int width, int border) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyTextureImage1DEXT).invokeExact(texture, target, level, internalformat, x, y, width, border); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyTextureImage1DEXT(int texture, int target, int level, int internalformat, int x, int y, int width, int border) { + throw new ContextException(); } - public static void glCopyTextureImage2DEXT(int texture, int target, int level, int internalformat, int x, int y, int width, int height, int border) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyTextureImage2DEXT).invokeExact(texture, target, level, internalformat, x, y, width, height, border); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyTextureImage2DEXT(int texture, int target, int level, int internalformat, int x, int y, int width, int height, int border) { + throw new ContextException(); } - public static void glCopyTextureSubImage1DEXT(int texture, int target, int level, int xoffset, int x, int y, int width) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyTextureSubImage1DEXT).invokeExact(texture, target, level, xoffset, x, y, width); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyTextureSubImage1DEXT(int texture, int target, int level, int xoffset, int x, int y, int width) { + throw new ContextException(); } - public static void glCopyTextureSubImage2DEXT(int texture, int target, int level, int xoffset, int yoffset, int x, int y, int width, int height) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyTextureSubImage2DEXT).invokeExact(texture, target, level, xoffset, yoffset, x, y, width, height); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyTextureSubImage2DEXT(int texture, int target, int level, int xoffset, int yoffset, int x, int y, int width, int height) { + throw new ContextException(); } - public static void glGetTextureImageEXT(int texture, int target, int level, int format, int type, @NativeType("void *") MemorySegment pixels) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetTextureImageEXT).invokeExact(texture, target, level, format, type, pixels); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetTextureImageEXT(int texture, int target, int level, int format, int type, @NativeType("void *") MemorySegment pixels) { + throw new ContextException(); } - public static void glGetTextureParameterfvEXT(int texture, int target, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetTextureParameterfvEXT).invokeExact(texture, target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetTextureParameterfvEXT(int texture, int target, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetTextureParameterivEXT(int texture, int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetTextureParameterivEXT).invokeExact(texture, target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetTextureParameterivEXT(int texture, int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetTextureLevelParameterfvEXT(int texture, int target, int level, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetTextureLevelParameterfvEXT).invokeExact(texture, target, level, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetTextureLevelParameterfvEXT(int texture, int target, int level, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetTextureLevelParameterivEXT(int texture, int target, int level, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetTextureLevelParameterivEXT).invokeExact(texture, target, level, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetTextureLevelParameterivEXT(int texture, int target, int level, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glTextureImage3DEXT(int texture, int target, int level, int internalformat, int width, int height, int depth, int border, int format, int type, @NativeType("const void *") MemorySegment pixels) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureImage3DEXT).invokeExact(texture, target, level, internalformat, width, height, depth, border, format, type, pixels); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureImage3DEXT(int texture, int target, int level, int internalformat, int width, int height, int depth, int border, int format, int type, @NativeType("const void *") MemorySegment pixels) { + throw new ContextException(); } - public static void glTextureSubImage3DEXT(int texture, int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, @NativeType("const void *") MemorySegment pixels) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureSubImage3DEXT).invokeExact(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureSubImage3DEXT(int texture, int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, @NativeType("const void *") MemorySegment pixels) { + throw new ContextException(); } - public static void glCopyTextureSubImage3DEXT(int texture, int target, int level, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyTextureSubImage3DEXT).invokeExact(texture, target, level, xoffset, yoffset, zoffset, x, y, width, height); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyTextureSubImage3DEXT(int texture, int target, int level, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height) { + throw new ContextException(); } - public static void glBindMultiTextureEXT(int texunit, int target, int texture) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindMultiTextureEXT).invokeExact(texunit, target, texture); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBindMultiTextureEXT(int texunit, int target, int texture) { + throw new ContextException(); } - public static void glMultiTexCoordPointerEXT(int texunit, int size, int type, int stride, @NativeType("const void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoordPointerEXT).invokeExact(texunit, size, type, stride, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoordPointerEXT(int texunit, int size, int type, int stride, @NativeType("const void *") MemorySegment pointer) { + throw new ContextException(); } - public static void glMultiTexEnvfEXT(int texunit, int target, int pname, float param) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexEnvfEXT).invokeExact(texunit, target, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexEnvfEXT(int texunit, int target, int pname, float param) { + throw new ContextException(); } - public static void glMultiTexEnvfvEXT(int texunit, int target, int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexEnvfvEXT).invokeExact(texunit, target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexEnvfvEXT(int texunit, int target, int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glMultiTexEnviEXT(int texunit, int target, int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexEnviEXT).invokeExact(texunit, target, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexEnviEXT(int texunit, int target, int pname, int param) { + throw new ContextException(); } - public static void glMultiTexEnvivEXT(int texunit, int target, int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexEnvivEXT).invokeExact(texunit, target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexEnvivEXT(int texunit, int target, int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glMultiTexGendEXT(int texunit, int coord, int pname, double param) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexGendEXT).invokeExact(texunit, coord, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexGendEXT(int texunit, int coord, int pname, double param) { + throw new ContextException(); } - public static void glMultiTexGendvEXT(int texunit, int coord, int pname, @NativeType("const GLdouble *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexGendvEXT).invokeExact(texunit, coord, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexGendvEXT(int texunit, int coord, int pname, @NativeType("const GLdouble *") MemorySegment params) { + throw new ContextException(); } - public static void glMultiTexGenfEXT(int texunit, int coord, int pname, float param) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexGenfEXT).invokeExact(texunit, coord, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexGenfEXT(int texunit, int coord, int pname, float param) { + throw new ContextException(); } - public static void glMultiTexGenfvEXT(int texunit, int coord, int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexGenfvEXT).invokeExact(texunit, coord, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexGenfvEXT(int texunit, int coord, int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glMultiTexGeniEXT(int texunit, int coord, int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexGeniEXT).invokeExact(texunit, coord, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexGeniEXT(int texunit, int coord, int pname, int param) { + throw new ContextException(); } - public static void glMultiTexGenivEXT(int texunit, int coord, int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexGenivEXT).invokeExact(texunit, coord, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexGenivEXT(int texunit, int coord, int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetMultiTexEnvfvEXT(int texunit, int target, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMultiTexEnvfvEXT).invokeExact(texunit, target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMultiTexEnvfvEXT(int texunit, int target, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetMultiTexEnvivEXT(int texunit, int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMultiTexEnvivEXT).invokeExact(texunit, target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMultiTexEnvivEXT(int texunit, int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetMultiTexGendvEXT(int texunit, int coord, int pname, @NativeType("GLdouble *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMultiTexGendvEXT).invokeExact(texunit, coord, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMultiTexGendvEXT(int texunit, int coord, int pname, @NativeType("GLdouble *") MemorySegment params) { + throw new ContextException(); } - public static void glGetMultiTexGenfvEXT(int texunit, int coord, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMultiTexGenfvEXT).invokeExact(texunit, coord, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMultiTexGenfvEXT(int texunit, int coord, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetMultiTexGenivEXT(int texunit, int coord, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMultiTexGenivEXT).invokeExact(texunit, coord, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMultiTexGenivEXT(int texunit, int coord, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glMultiTexParameteriEXT(int texunit, int target, int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexParameteriEXT).invokeExact(texunit, target, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexParameteriEXT(int texunit, int target, int pname, int param) { + throw new ContextException(); } - public static void glMultiTexParameterivEXT(int texunit, int target, int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexParameterivEXT).invokeExact(texunit, target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexParameterivEXT(int texunit, int target, int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glMultiTexParameterfEXT(int texunit, int target, int pname, float param) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexParameterfEXT).invokeExact(texunit, target, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexParameterfEXT(int texunit, int target, int pname, float param) { + throw new ContextException(); } - public static void glMultiTexParameterfvEXT(int texunit, int target, int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexParameterfvEXT).invokeExact(texunit, target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexParameterfvEXT(int texunit, int target, int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glMultiTexImage1DEXT(int texunit, int target, int level, int internalformat, int width, int border, int format, int type, @NativeType("const void *") MemorySegment pixels) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexImage1DEXT).invokeExact(texunit, target, level, internalformat, width, border, format, type, pixels); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexImage1DEXT(int texunit, int target, int level, int internalformat, int width, int border, int format, int type, @NativeType("const void *") MemorySegment pixels) { + throw new ContextException(); } - public static void glMultiTexImage2DEXT(int texunit, int target, int level, int internalformat, int width, int height, int border, int format, int type, @NativeType("const void *") MemorySegment pixels) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexImage2DEXT).invokeExact(texunit, target, level, internalformat, width, height, border, format, type, pixels); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexImage2DEXT(int texunit, int target, int level, int internalformat, int width, int height, int border, int format, int type, @NativeType("const void *") MemorySegment pixels) { + throw new ContextException(); } - public static void glMultiTexSubImage1DEXT(int texunit, int target, int level, int xoffset, int width, int format, int type, @NativeType("const void *") MemorySegment pixels) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexSubImage1DEXT).invokeExact(texunit, target, level, xoffset, width, format, type, pixels); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexSubImage1DEXT(int texunit, int target, int level, int xoffset, int width, int format, int type, @NativeType("const void *") MemorySegment pixels) { + throw new ContextException(); } - public static void glMultiTexSubImage2DEXT(int texunit, int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, @NativeType("const void *") MemorySegment pixels) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexSubImage2DEXT).invokeExact(texunit, target, level, xoffset, yoffset, width, height, format, type, pixels); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexSubImage2DEXT(int texunit, int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, @NativeType("const void *") MemorySegment pixels) { + throw new ContextException(); } - public static void glCopyMultiTexImage1DEXT(int texunit, int target, int level, int internalformat, int x, int y, int width, int border) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyMultiTexImage1DEXT).invokeExact(texunit, target, level, internalformat, x, y, width, border); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyMultiTexImage1DEXT(int texunit, int target, int level, int internalformat, int x, int y, int width, int border) { + throw new ContextException(); } - public static void glCopyMultiTexImage2DEXT(int texunit, int target, int level, int internalformat, int x, int y, int width, int height, int border) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyMultiTexImage2DEXT).invokeExact(texunit, target, level, internalformat, x, y, width, height, border); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyMultiTexImage2DEXT(int texunit, int target, int level, int internalformat, int x, int y, int width, int height, int border) { + throw new ContextException(); } - public static void glCopyMultiTexSubImage1DEXT(int texunit, int target, int level, int xoffset, int x, int y, int width) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyMultiTexSubImage1DEXT).invokeExact(texunit, target, level, xoffset, x, y, width); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyMultiTexSubImage1DEXT(int texunit, int target, int level, int xoffset, int x, int y, int width) { + throw new ContextException(); } - public static void glCopyMultiTexSubImage2DEXT(int texunit, int target, int level, int xoffset, int yoffset, int x, int y, int width, int height) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyMultiTexSubImage2DEXT).invokeExact(texunit, target, level, xoffset, yoffset, x, y, width, height); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyMultiTexSubImage2DEXT(int texunit, int target, int level, int xoffset, int yoffset, int x, int y, int width, int height) { + throw new ContextException(); } - public static void glGetMultiTexImageEXT(int texunit, int target, int level, int format, int type, @NativeType("void *") MemorySegment pixels) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMultiTexImageEXT).invokeExact(texunit, target, level, format, type, pixels); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMultiTexImageEXT(int texunit, int target, int level, int format, int type, @NativeType("void *") MemorySegment pixels) { + throw new ContextException(); } - public static void glGetMultiTexParameterfvEXT(int texunit, int target, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMultiTexParameterfvEXT).invokeExact(texunit, target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMultiTexParameterfvEXT(int texunit, int target, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetMultiTexParameterivEXT(int texunit, int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMultiTexParameterivEXT).invokeExact(texunit, target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMultiTexParameterivEXT(int texunit, int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetMultiTexLevelParameterfvEXT(int texunit, int target, int level, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMultiTexLevelParameterfvEXT).invokeExact(texunit, target, level, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMultiTexLevelParameterfvEXT(int texunit, int target, int level, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetMultiTexLevelParameterivEXT(int texunit, int target, int level, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMultiTexLevelParameterivEXT).invokeExact(texunit, target, level, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMultiTexLevelParameterivEXT(int texunit, int target, int level, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glMultiTexImage3DEXT(int texunit, int target, int level, int internalformat, int width, int height, int depth, int border, int format, int type, @NativeType("const void *") MemorySegment pixels) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexImage3DEXT).invokeExact(texunit, target, level, internalformat, width, height, depth, border, format, type, pixels); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexImage3DEXT(int texunit, int target, int level, int internalformat, int width, int height, int depth, int border, int format, int type, @NativeType("const void *") MemorySegment pixels) { + throw new ContextException(); } - public static void glMultiTexSubImage3DEXT(int texunit, int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, @NativeType("const void *") MemorySegment pixels) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexSubImage3DEXT).invokeExact(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexSubImage3DEXT(int texunit, int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, @NativeType("const void *") MemorySegment pixels) { + throw new ContextException(); } - public static void glCopyMultiTexSubImage3DEXT(int texunit, int target, int level, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyMultiTexSubImage3DEXT).invokeExact(texunit, target, level, xoffset, yoffset, zoffset, x, y, width, height); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyMultiTexSubImage3DEXT(int texunit, int target, int level, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height) { + throw new ContextException(); } - public static void glEnableClientStateIndexedEXT(int array, int index) { - final var ext = getExtCapabilities(); - try { - check(ext.glEnableClientStateIndexedEXT).invokeExact(array, index); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEnableClientStateIndexedEXT(int array, int index) { + throw new ContextException(); } - public static void glDisableClientStateIndexedEXT(int array, int index) { - final var ext = getExtCapabilities(); - try { - check(ext.glDisableClientStateIndexedEXT).invokeExact(array, index); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDisableClientStateIndexedEXT(int array, int index) { + throw new ContextException(); } - public static void glGetFloatIndexedvEXT(int target, int index, @NativeType("GLfloat *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetFloatIndexedvEXT).invokeExact(target, index, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetFloatIndexedvEXT(int target, int index, @NativeType("GLfloat *") MemorySegment data) { + throw new ContextException(); } - public static void glGetDoubleIndexedvEXT(int target, int index, @NativeType("GLdouble *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetDoubleIndexedvEXT).invokeExact(target, index, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetDoubleIndexedvEXT(int target, int index, @NativeType("GLdouble *") MemorySegment data) { + throw new ContextException(); } - public static void glGetPointerIndexedvEXT(int target, int index, @NativeType("void **") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPointerIndexedvEXT).invokeExact(target, index, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPointerIndexedvEXT(int target, int index, @NativeType("void **") MemorySegment data) { + throw new ContextException(); } - public static void glEnableIndexedEXT(int target, int index) { - final var ext = getExtCapabilities(); - try { - check(ext.glEnableIndexedEXT).invokeExact(target, index); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEnableIndexedEXT(int target, int index) { + throw new ContextException(); } - public static void glDisableIndexedEXT(int target, int index) { - final var ext = getExtCapabilities(); - try { - check(ext.glDisableIndexedEXT).invokeExact(target, index); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDisableIndexedEXT(int target, int index) { + throw new ContextException(); } - public static boolean glIsEnabledIndexedEXT(int target, int index) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsEnabledIndexedEXT).invokeExact(target, index); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsEnabledIndexedEXT(int target, int index) { + throw new ContextException(); } - public static void glGetIntegerIndexedvEXT(int target, int index, @NativeType("GLint *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetIntegerIndexedvEXT).invokeExact(target, index, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetIntegerIndexedvEXT(int target, int index, @NativeType("GLint *") MemorySegment data) { + throw new ContextException(); } - public static void glGetBooleanIndexedvEXT(int target, int index, @NativeType("GLboolean *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetBooleanIndexedvEXT).invokeExact(target, index, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetBooleanIndexedvEXT(int target, int index, @NativeType("GLboolean *") MemorySegment data) { + throw new ContextException(); } - public static void glCompressedTextureImage3DEXT(int texture, int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, @NativeType("const void *") MemorySegment bits) { - final var ext = getExtCapabilities(); - try { - check(ext.glCompressedTextureImage3DEXT).invokeExact(texture, target, level, internalformat, width, height, depth, border, imageSize, bits); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCompressedTextureImage3DEXT(int texture, int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, @NativeType("const void *") MemorySegment bits) { + throw new ContextException(); } - public static void glCompressedTextureImage2DEXT(int texture, int target, int level, int internalformat, int width, int height, int border, int imageSize, @NativeType("const void *") MemorySegment bits) { - final var ext = getExtCapabilities(); - try { - check(ext.glCompressedTextureImage2DEXT).invokeExact(texture, target, level, internalformat, width, height, border, imageSize, bits); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCompressedTextureImage2DEXT(int texture, int target, int level, int internalformat, int width, int height, int border, int imageSize, @NativeType("const void *") MemorySegment bits) { + throw new ContextException(); } - public static void glCompressedTextureImage1DEXT(int texture, int target, int level, int internalformat, int width, int border, int imageSize, @NativeType("const void *") MemorySegment bits) { - final var ext = getExtCapabilities(); - try { - check(ext.glCompressedTextureImage1DEXT).invokeExact(texture, target, level, internalformat, width, border, imageSize, bits); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCompressedTextureImage1DEXT(int texture, int target, int level, int internalformat, int width, int border, int imageSize, @NativeType("const void *") MemorySegment bits) { + throw new ContextException(); } - public static void glCompressedTextureSubImage3DEXT(int texture, int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, @NativeType("const void *") MemorySegment bits) { - final var ext = getExtCapabilities(); - try { - check(ext.glCompressedTextureSubImage3DEXT).invokeExact(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, bits); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCompressedTextureSubImage3DEXT(int texture, int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, @NativeType("const void *") MemorySegment bits) { + throw new ContextException(); } - public static void glCompressedTextureSubImage2DEXT(int texture, int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, @NativeType("const void *") MemorySegment bits) { - final var ext = getExtCapabilities(); - try { - check(ext.glCompressedTextureSubImage2DEXT).invokeExact(texture, target, level, xoffset, yoffset, width, height, format, imageSize, bits); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCompressedTextureSubImage2DEXT(int texture, int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, @NativeType("const void *") MemorySegment bits) { + throw new ContextException(); } - public static void glCompressedTextureSubImage1DEXT(int texture, int target, int level, int xoffset, int width, int format, int imageSize, @NativeType("const void *") MemorySegment bits) { - final var ext = getExtCapabilities(); - try { - check(ext.glCompressedTextureSubImage1DEXT).invokeExact(texture, target, level, xoffset, width, format, imageSize, bits); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCompressedTextureSubImage1DEXT(int texture, int target, int level, int xoffset, int width, int format, int imageSize, @NativeType("const void *") MemorySegment bits) { + throw new ContextException(); } - public static void glGetCompressedTextureImageEXT(int texture, int target, int lod, @NativeType("void *") MemorySegment img) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetCompressedTextureImageEXT).invokeExact(texture, target, lod, img); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetCompressedTextureImageEXT(int texture, int target, int lod, @NativeType("void *") MemorySegment img) { + throw new ContextException(); } - public static void glCompressedMultiTexImage3DEXT(int texunit, int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, @NativeType("const void *") MemorySegment bits) { - final var ext = getExtCapabilities(); - try { - check(ext.glCompressedMultiTexImage3DEXT).invokeExact(texunit, target, level, internalformat, width, height, depth, border, imageSize, bits); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCompressedMultiTexImage3DEXT(int texunit, int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, @NativeType("const void *") MemorySegment bits) { + throw new ContextException(); } - public static void glCompressedMultiTexImage2DEXT(int texunit, int target, int level, int internalformat, int width, int height, int border, int imageSize, @NativeType("const void *") MemorySegment bits) { - final var ext = getExtCapabilities(); - try { - check(ext.glCompressedMultiTexImage2DEXT).invokeExact(texunit, target, level, internalformat, width, height, border, imageSize, bits); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCompressedMultiTexImage2DEXT(int texunit, int target, int level, int internalformat, int width, int height, int border, int imageSize, @NativeType("const void *") MemorySegment bits) { + throw new ContextException(); } - public static void glCompressedMultiTexImage1DEXT(int texunit, int target, int level, int internalformat, int width, int border, int imageSize, @NativeType("const void *") MemorySegment bits) { - final var ext = getExtCapabilities(); - try { - check(ext.glCompressedMultiTexImage1DEXT).invokeExact(texunit, target, level, internalformat, width, border, imageSize, bits); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCompressedMultiTexImage1DEXT(int texunit, int target, int level, int internalformat, int width, int border, int imageSize, @NativeType("const void *") MemorySegment bits) { + throw new ContextException(); } - public static void glCompressedMultiTexSubImage3DEXT(int texunit, int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, @NativeType("const void *") MemorySegment bits) { - final var ext = getExtCapabilities(); - try { - check(ext.glCompressedMultiTexSubImage3DEXT).invokeExact(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, bits); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCompressedMultiTexSubImage3DEXT(int texunit, int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, @NativeType("const void *") MemorySegment bits) { + throw new ContextException(); } - public static void glCompressedMultiTexSubImage2DEXT(int texunit, int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, @NativeType("const void *") MemorySegment bits) { - final var ext = getExtCapabilities(); - try { - check(ext.glCompressedMultiTexSubImage2DEXT).invokeExact(texunit, target, level, xoffset, yoffset, width, height, format, imageSize, bits); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCompressedMultiTexSubImage2DEXT(int texunit, int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, @NativeType("const void *") MemorySegment bits) { + throw new ContextException(); } - public static void glCompressedMultiTexSubImage1DEXT(int texunit, int target, int level, int xoffset, int width, int format, int imageSize, @NativeType("const void *") MemorySegment bits) { - final var ext = getExtCapabilities(); - try { - check(ext.glCompressedMultiTexSubImage1DEXT).invokeExact(texunit, target, level, xoffset, width, format, imageSize, bits); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCompressedMultiTexSubImage1DEXT(int texunit, int target, int level, int xoffset, int width, int format, int imageSize, @NativeType("const void *") MemorySegment bits) { + throw new ContextException(); } - public static void glGetCompressedMultiTexImageEXT(int texunit, int target, int lod, @NativeType("void *") MemorySegment img) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetCompressedMultiTexImageEXT).invokeExact(texunit, target, lod, img); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetCompressedMultiTexImageEXT(int texunit, int target, int lod, @NativeType("void *") MemorySegment img) { + throw new ContextException(); } - public static void glMatrixLoadTransposefEXT(int mode, @NativeType("const GLfloat *") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixLoadTransposefEXT).invokeExact(mode, m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMatrixLoadTransposefEXT(int mode, @NativeType("const GLfloat *") MemorySegment m) { + throw new ContextException(); } - public static void glMatrixLoadTransposedEXT(int mode, @NativeType("const GLdouble *") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixLoadTransposedEXT).invokeExact(mode, m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMatrixLoadTransposedEXT(int mode, @NativeType("const GLdouble *") MemorySegment m) { + throw new ContextException(); } - public static void glMatrixMultTransposefEXT(int mode, @NativeType("const GLfloat *") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixMultTransposefEXT).invokeExact(mode, m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMatrixMultTransposefEXT(int mode, @NativeType("const GLfloat *") MemorySegment m) { + throw new ContextException(); } - public static void glMatrixMultTransposedEXT(int mode, @NativeType("const GLdouble *") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixMultTransposedEXT).invokeExact(mode, m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMatrixMultTransposedEXT(int mode, @NativeType("const GLdouble *") MemorySegment m) { + throw new ContextException(); } - public static void glNamedBufferDataEXT(int buffer, long size, @NativeType("const void *") MemorySegment data, int usage) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedBufferDataEXT).invokeExact(buffer, size, data, usage); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedBufferDataEXT(int buffer, long size, @NativeType("const void *") MemorySegment data, int usage) { + throw new ContextException(); } - public static void glNamedBufferSubDataEXT(int buffer, long offset, long size, @NativeType("const void *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedBufferSubDataEXT).invokeExact(buffer, offset, size, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedBufferSubDataEXT(int buffer, long offset, long size, @NativeType("const void *") MemorySegment data) { + throw new ContextException(); } - public static @NativeType("void *") MemorySegment glMapNamedBufferEXT(int buffer, int access) { - final var ext = getExtCapabilities(); - try { - return (MemorySegment) - check(ext.glMapNamedBufferEXT).invokeExact(buffer, access); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + @NativeType("void *") default MemorySegment glMapNamedBufferEXT(int buffer, int access) { + throw new ContextException(); } - public static boolean glUnmapNamedBufferEXT(int buffer) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glUnmapNamedBufferEXT).invokeExact(buffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glUnmapNamedBufferEXT(int buffer) { + throw new ContextException(); } - public static void glGetNamedBufferParameterivEXT(int buffer, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetNamedBufferParameterivEXT).invokeExact(buffer, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetNamedBufferParameterivEXT(int buffer, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetNamedBufferPointervEXT(int buffer, int pname, @NativeType("void **") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetNamedBufferPointervEXT).invokeExact(buffer, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetNamedBufferPointervEXT(int buffer, int pname, @NativeType("void **") MemorySegment params) { + throw new ContextException(); } - public static void glGetNamedBufferSubDataEXT(int buffer, long offset, long size, @NativeType("void *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetNamedBufferSubDataEXT).invokeExact(buffer, offset, size, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetNamedBufferSubDataEXT(int buffer, long offset, long size, @NativeType("void *") MemorySegment data) { + throw new ContextException(); } - public static void glProgramUniform1fEXT(int program, int location, float v0) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform1fEXT).invokeExact(program, location, v0); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform1fEXT(int program, int location, float v0) { + throw new ContextException(); } - public static void glProgramUniform2fEXT(int program, int location, float v0, float v1) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform2fEXT).invokeExact(program, location, v0, v1); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform2fEXT(int program, int location, float v0, float v1) { + throw new ContextException(); } - public static void glProgramUniform3fEXT(int program, int location, float v0, float v1, float v2) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform3fEXT).invokeExact(program, location, v0, v1, v2); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform3fEXT(int program, int location, float v0, float v1, float v2) { + throw new ContextException(); } - public static void glProgramUniform4fEXT(int program, int location, float v0, float v1, float v2, float v3) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform4fEXT).invokeExact(program, location, v0, v1, v2, v3); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform4fEXT(int program, int location, float v0, float v1, float v2, float v3) { + throw new ContextException(); } - public static void glProgramUniform1iEXT(int program, int location, int v0) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform1iEXT).invokeExact(program, location, v0); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform1iEXT(int program, int location, int v0) { + throw new ContextException(); } - public static void glProgramUniform2iEXT(int program, int location, int v0, int v1) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform2iEXT).invokeExact(program, location, v0, v1); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform2iEXT(int program, int location, int v0, int v1) { + throw new ContextException(); } - public static void glProgramUniform3iEXT(int program, int location, int v0, int v1, int v2) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform3iEXT).invokeExact(program, location, v0, v1, v2); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform3iEXT(int program, int location, int v0, int v1, int v2) { + throw new ContextException(); } - public static void glProgramUniform4iEXT(int program, int location, int v0, int v1, int v2, int v3) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform4iEXT).invokeExact(program, location, v0, v1, v2, v3); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform4iEXT(int program, int location, int v0, int v1, int v2, int v3) { + throw new ContextException(); } - public static void glProgramUniform1fvEXT(int program, int location, int count, @NativeType("const GLfloat *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform1fvEXT).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform1fvEXT(int program, int location, int count, @NativeType("const GLfloat *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform2fvEXT(int program, int location, int count, @NativeType("const GLfloat *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform2fvEXT).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform2fvEXT(int program, int location, int count, @NativeType("const GLfloat *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform3fvEXT(int program, int location, int count, @NativeType("const GLfloat *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform3fvEXT).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform3fvEXT(int program, int location, int count, @NativeType("const GLfloat *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform4fvEXT(int program, int location, int count, @NativeType("const GLfloat *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform4fvEXT).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform4fvEXT(int program, int location, int count, @NativeType("const GLfloat *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform1ivEXT(int program, int location, int count, @NativeType("const GLint *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform1ivEXT).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform1ivEXT(int program, int location, int count, @NativeType("const GLint *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform2ivEXT(int program, int location, int count, @NativeType("const GLint *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform2ivEXT).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform2ivEXT(int program, int location, int count, @NativeType("const GLint *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform3ivEXT(int program, int location, int count, @NativeType("const GLint *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform3ivEXT).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform3ivEXT(int program, int location, int count, @NativeType("const GLint *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform4ivEXT(int program, int location, int count, @NativeType("const GLint *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform4ivEXT).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform4ivEXT(int program, int location, int count, @NativeType("const GLint *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniformMatrix2fvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLfloat *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformMatrix2fvEXT).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformMatrix2fvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLfloat *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniformMatrix3fvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLfloat *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformMatrix3fvEXT).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformMatrix3fvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLfloat *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniformMatrix4fvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLfloat *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformMatrix4fvEXT).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformMatrix4fvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLfloat *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniformMatrix2x3fvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLfloat *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformMatrix2x3fvEXT).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformMatrix2x3fvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLfloat *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniformMatrix3x2fvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLfloat *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformMatrix3x2fvEXT).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformMatrix3x2fvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLfloat *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniformMatrix2x4fvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLfloat *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformMatrix2x4fvEXT).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformMatrix2x4fvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLfloat *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniformMatrix4x2fvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLfloat *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformMatrix4x2fvEXT).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformMatrix4x2fvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLfloat *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniformMatrix3x4fvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLfloat *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformMatrix3x4fvEXT).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformMatrix3x4fvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLfloat *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniformMatrix4x3fvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLfloat *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformMatrix4x3fvEXT).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformMatrix4x3fvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLfloat *") MemorySegment value) { + throw new ContextException(); } - public static void glTextureBufferEXT(int texture, int target, int internalformat, int buffer) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureBufferEXT).invokeExact(texture, target, internalformat, buffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureBufferEXT(int texture, int target, int internalformat, int buffer) { + throw new ContextException(); } - public static void glMultiTexBufferEXT(int texunit, int target, int internalformat, int buffer) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexBufferEXT).invokeExact(texunit, target, internalformat, buffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexBufferEXT(int texunit, int target, int internalformat, int buffer) { + throw new ContextException(); } - public static void glTextureParameterIivEXT(int texture, int target, int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureParameterIivEXT).invokeExact(texture, target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureParameterIivEXT(int texture, int target, int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glTextureParameterIuivEXT(int texture, int target, int pname, @NativeType("const GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureParameterIuivEXT).invokeExact(texture, target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureParameterIuivEXT(int texture, int target, int pname, @NativeType("const GLuint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetTextureParameterIivEXT(int texture, int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetTextureParameterIivEXT).invokeExact(texture, target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetTextureParameterIivEXT(int texture, int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetTextureParameterIuivEXT(int texture, int target, int pname, @NativeType("GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetTextureParameterIuivEXT).invokeExact(texture, target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetTextureParameterIuivEXT(int texture, int target, int pname, @NativeType("GLuint *") MemorySegment params) { + throw new ContextException(); } - public static void glMultiTexParameterIivEXT(int texunit, int target, int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexParameterIivEXT).invokeExact(texunit, target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexParameterIivEXT(int texunit, int target, int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glMultiTexParameterIuivEXT(int texunit, int target, int pname, @NativeType("const GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexParameterIuivEXT).invokeExact(texunit, target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexParameterIuivEXT(int texunit, int target, int pname, @NativeType("const GLuint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetMultiTexParameterIivEXT(int texunit, int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMultiTexParameterIivEXT).invokeExact(texunit, target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMultiTexParameterIivEXT(int texunit, int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetMultiTexParameterIuivEXT(int texunit, int target, int pname, @NativeType("GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMultiTexParameterIuivEXT).invokeExact(texunit, target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMultiTexParameterIuivEXT(int texunit, int target, int pname, @NativeType("GLuint *") MemorySegment params) { + throw new ContextException(); } - public static void glProgramUniform1uiEXT(int program, int location, int v0) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform1uiEXT).invokeExact(program, location, v0); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform1uiEXT(int program, int location, int v0) { + throw new ContextException(); } - public static void glProgramUniform2uiEXT(int program, int location, int v0, int v1) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform2uiEXT).invokeExact(program, location, v0, v1); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform2uiEXT(int program, int location, int v0, int v1) { + throw new ContextException(); } - public static void glProgramUniform3uiEXT(int program, int location, int v0, int v1, int v2) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform3uiEXT).invokeExact(program, location, v0, v1, v2); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform3uiEXT(int program, int location, int v0, int v1, int v2) { + throw new ContextException(); } - public static void glProgramUniform4uiEXT(int program, int location, int v0, int v1, int v2, int v3) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform4uiEXT).invokeExact(program, location, v0, v1, v2, v3); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform4uiEXT(int program, int location, int v0, int v1, int v2, int v3) { + throw new ContextException(); } - public static void glProgramUniform1uivEXT(int program, int location, int count, @NativeType("const GLuint *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform1uivEXT).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform1uivEXT(int program, int location, int count, @NativeType("const GLuint *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform2uivEXT(int program, int location, int count, @NativeType("const GLuint *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform2uivEXT).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform2uivEXT(int program, int location, int count, @NativeType("const GLuint *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform3uivEXT(int program, int location, int count, @NativeType("const GLuint *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform3uivEXT).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform3uivEXT(int program, int location, int count, @NativeType("const GLuint *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform4uivEXT(int program, int location, int count, @NativeType("const GLuint *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform4uivEXT).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform4uivEXT(int program, int location, int count, @NativeType("const GLuint *") MemorySegment value) { + throw new ContextException(); } - public static void glNamedProgramLocalParameters4fvEXT(int program, int target, int index, int count, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedProgramLocalParameters4fvEXT).invokeExact(program, target, index, count, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedProgramLocalParameters4fvEXT(int program, int target, int index, int count, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glNamedProgramLocalParameterI4iEXT(int program, int target, int index, int x, int y, int z, int w) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedProgramLocalParameterI4iEXT).invokeExact(program, target, index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedProgramLocalParameterI4iEXT(int program, int target, int index, int x, int y, int z, int w) { + throw new ContextException(); } - public static void glNamedProgramLocalParameterI4ivEXT(int program, int target, int index, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedProgramLocalParameterI4ivEXT).invokeExact(program, target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedProgramLocalParameterI4ivEXT(int program, int target, int index, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glNamedProgramLocalParametersI4ivEXT(int program, int target, int index, int count, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedProgramLocalParametersI4ivEXT).invokeExact(program, target, index, count, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedProgramLocalParametersI4ivEXT(int program, int target, int index, int count, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glNamedProgramLocalParameterI4uiEXT(int program, int target, int index, int x, int y, int z, int w) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedProgramLocalParameterI4uiEXT).invokeExact(program, target, index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedProgramLocalParameterI4uiEXT(int program, int target, int index, int x, int y, int z, int w) { + throw new ContextException(); } - public static void glNamedProgramLocalParameterI4uivEXT(int program, int target, int index, @NativeType("const GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedProgramLocalParameterI4uivEXT).invokeExact(program, target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedProgramLocalParameterI4uivEXT(int program, int target, int index, @NativeType("const GLuint *") MemorySegment params) { + throw new ContextException(); } - public static void glNamedProgramLocalParametersI4uivEXT(int program, int target, int index, int count, @NativeType("const GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedProgramLocalParametersI4uivEXT).invokeExact(program, target, index, count, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedProgramLocalParametersI4uivEXT(int program, int target, int index, int count, @NativeType("const GLuint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetNamedProgramLocalParameterIivEXT(int program, int target, int index, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetNamedProgramLocalParameterIivEXT).invokeExact(program, target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetNamedProgramLocalParameterIivEXT(int program, int target, int index, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetNamedProgramLocalParameterIuivEXT(int program, int target, int index, @NativeType("GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetNamedProgramLocalParameterIuivEXT).invokeExact(program, target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetNamedProgramLocalParameterIuivEXT(int program, int target, int index, @NativeType("GLuint *") MemorySegment params) { + throw new ContextException(); } - public static void glEnableClientStateiEXT(int array, int index) { - final var ext = getExtCapabilities(); - try { - check(ext.glEnableClientStateiEXT).invokeExact(array, index); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEnableClientStateiEXT(int array, int index) { + throw new ContextException(); } - public static void glDisableClientStateiEXT(int array, int index) { - final var ext = getExtCapabilities(); - try { - check(ext.glDisableClientStateiEXT).invokeExact(array, index); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDisableClientStateiEXT(int array, int index) { + throw new ContextException(); } - public static void glGetFloati_vEXT(int pname, int index, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetFloati_vEXT).invokeExact(pname, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetFloati_vEXT(int pname, int index, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetDoublei_vEXT(int pname, int index, @NativeType("GLdouble *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetDoublei_vEXT).invokeExact(pname, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetDoublei_vEXT(int pname, int index, @NativeType("GLdouble *") MemorySegment params) { + throw new ContextException(); } - public static void glGetPointeri_vEXT(int pname, int index, @NativeType("void **") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPointeri_vEXT).invokeExact(pname, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPointeri_vEXT(int pname, int index, @NativeType("void **") MemorySegment params) { + throw new ContextException(); } - public static void glNamedProgramStringEXT(int program, int target, int format, int len, @NativeType("const void *") MemorySegment string) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedProgramStringEXT).invokeExact(program, target, format, len, string); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedProgramStringEXT(int program, int target, int format, int len, @NativeType("const void *") MemorySegment string) { + throw new ContextException(); } - public static void glNamedProgramLocalParameter4dEXT(int program, int target, int index, double x, double y, double z, double w) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedProgramLocalParameter4dEXT).invokeExact(program, target, index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedProgramLocalParameter4dEXT(int program, int target, int index, double x, double y, double z, double w) { + throw new ContextException(); } - public static void glNamedProgramLocalParameter4dvEXT(int program, int target, int index, @NativeType("const GLdouble *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedProgramLocalParameter4dvEXT).invokeExact(program, target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedProgramLocalParameter4dvEXT(int program, int target, int index, @NativeType("const GLdouble *") MemorySegment params) { + throw new ContextException(); } - public static void glNamedProgramLocalParameter4fEXT(int program, int target, int index, float x, float y, float z, float w) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedProgramLocalParameter4fEXT).invokeExact(program, target, index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedProgramLocalParameter4fEXT(int program, int target, int index, float x, float y, float z, float w) { + throw new ContextException(); } - public static void glNamedProgramLocalParameter4fvEXT(int program, int target, int index, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedProgramLocalParameter4fvEXT).invokeExact(program, target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedProgramLocalParameter4fvEXT(int program, int target, int index, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetNamedProgramLocalParameterdvEXT(int program, int target, int index, @NativeType("GLdouble *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetNamedProgramLocalParameterdvEXT).invokeExact(program, target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetNamedProgramLocalParameterdvEXT(int program, int target, int index, @NativeType("GLdouble *") MemorySegment params) { + throw new ContextException(); } - public static void glGetNamedProgramLocalParameterfvEXT(int program, int target, int index, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetNamedProgramLocalParameterfvEXT).invokeExact(program, target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetNamedProgramLocalParameterfvEXT(int program, int target, int index, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetNamedProgramivEXT(int program, int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetNamedProgramivEXT).invokeExact(program, target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetNamedProgramivEXT(int program, int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetNamedProgramStringEXT(int program, int target, int pname, @NativeType("void *") MemorySegment string) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetNamedProgramStringEXT).invokeExact(program, target, pname, string); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetNamedProgramStringEXT(int program, int target, int pname, @NativeType("void *") MemorySegment string) { + throw new ContextException(); } - public static void glNamedRenderbufferStorageEXT(int renderbuffer, int internalformat, int width, int height) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedRenderbufferStorageEXT).invokeExact(renderbuffer, internalformat, width, height); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedRenderbufferStorageEXT(int renderbuffer, int internalformat, int width, int height) { + throw new ContextException(); } - public static void glGetNamedRenderbufferParameterivEXT(int renderbuffer, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetNamedRenderbufferParameterivEXT).invokeExact(renderbuffer, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetNamedRenderbufferParameterivEXT(int renderbuffer, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glNamedRenderbufferStorageMultisampleEXT(int renderbuffer, int samples, int internalformat, int width, int height) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedRenderbufferStorageMultisampleEXT).invokeExact(renderbuffer, samples, internalformat, width, height); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedRenderbufferStorageMultisampleEXT(int renderbuffer, int samples, int internalformat, int width, int height) { + throw new ContextException(); } - public static void glNamedRenderbufferStorageMultisampleCoverageEXT(int renderbuffer, int coverageSamples, int colorSamples, int internalformat, int width, int height) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedRenderbufferStorageMultisampleCoverageEXT).invokeExact(renderbuffer, coverageSamples, colorSamples, internalformat, width, height); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedRenderbufferStorageMultisampleCoverageEXT(int renderbuffer, int coverageSamples, int colorSamples, int internalformat, int width, int height) { + throw new ContextException(); } - public static int glCheckNamedFramebufferStatusEXT(int framebuffer, int target) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glCheckNamedFramebufferStatusEXT).invokeExact(framebuffer, target); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glCheckNamedFramebufferStatusEXT(int framebuffer, int target) { + throw new ContextException(); } - public static void glNamedFramebufferTexture1DEXT(int framebuffer, int attachment, int textarget, int texture, int level) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedFramebufferTexture1DEXT).invokeExact(framebuffer, attachment, textarget, texture, level); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedFramebufferTexture1DEXT(int framebuffer, int attachment, int textarget, int texture, int level) { + throw new ContextException(); } - public static void glNamedFramebufferTexture2DEXT(int framebuffer, int attachment, int textarget, int texture, int level) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedFramebufferTexture2DEXT).invokeExact(framebuffer, attachment, textarget, texture, level); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedFramebufferTexture2DEXT(int framebuffer, int attachment, int textarget, int texture, int level) { + throw new ContextException(); } - public static void glNamedFramebufferTexture3DEXT(int framebuffer, int attachment, int textarget, int texture, int level, int zoffset) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedFramebufferTexture3DEXT).invokeExact(framebuffer, attachment, textarget, texture, level, zoffset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedFramebufferTexture3DEXT(int framebuffer, int attachment, int textarget, int texture, int level, int zoffset) { + throw new ContextException(); } - public static void glNamedFramebufferRenderbufferEXT(int framebuffer, int attachment, int renderbuffertarget, int renderbuffer) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedFramebufferRenderbufferEXT).invokeExact(framebuffer, attachment, renderbuffertarget, renderbuffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedFramebufferRenderbufferEXT(int framebuffer, int attachment, int renderbuffertarget, int renderbuffer) { + throw new ContextException(); } - public static void glGetNamedFramebufferAttachmentParameterivEXT(int framebuffer, int attachment, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetNamedFramebufferAttachmentParameterivEXT).invokeExact(framebuffer, attachment, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetNamedFramebufferAttachmentParameterivEXT(int framebuffer, int attachment, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGenerateTextureMipmapEXT(int texture, int target) { - final var ext = getExtCapabilities(); - try { - check(ext.glGenerateTextureMipmapEXT).invokeExact(texture, target); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGenerateTextureMipmapEXT(int texture, int target) { + throw new ContextException(); } - public static void glGenerateMultiTexMipmapEXT(int texunit, int target) { - final var ext = getExtCapabilities(); - try { - check(ext.glGenerateMultiTexMipmapEXT).invokeExact(texunit, target); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGenerateMultiTexMipmapEXT(int texunit, int target) { + throw new ContextException(); } - public static void glFramebufferDrawBufferEXT(int framebuffer, int mode) { - final var ext = getExtCapabilities(); - try { - check(ext.glFramebufferDrawBufferEXT).invokeExact(framebuffer, mode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFramebufferDrawBufferEXT(int framebuffer, int mode) { + throw new ContextException(); } - public static void glFramebufferDrawBuffersEXT(int framebuffer, int n, @NativeType("const GLenum *") MemorySegment bufs) { - final var ext = getExtCapabilities(); - try { - check(ext.glFramebufferDrawBuffersEXT).invokeExact(framebuffer, n, bufs); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFramebufferDrawBuffersEXT(int framebuffer, int n, @NativeType("const GLenum *") MemorySegment bufs) { + throw new ContextException(); } - public static void glFramebufferReadBufferEXT(int framebuffer, int mode) { - final var ext = getExtCapabilities(); - try { - check(ext.glFramebufferReadBufferEXT).invokeExact(framebuffer, mode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFramebufferReadBufferEXT(int framebuffer, int mode) { + throw new ContextException(); } - public static void glGetFramebufferParameterivEXT(int framebuffer, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetFramebufferParameterivEXT).invokeExact(framebuffer, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetFramebufferParameterivEXT(int framebuffer, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glNamedCopyBufferSubDataEXT(int readBuffer, int writeBuffer, long readOffset, long writeOffset, long size) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedCopyBufferSubDataEXT).invokeExact(readBuffer, writeBuffer, readOffset, writeOffset, size); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedCopyBufferSubDataEXT(int readBuffer, int writeBuffer, long readOffset, long writeOffset, long size) { + throw new ContextException(); } - public static void glNamedFramebufferTextureEXT(int framebuffer, int attachment, int texture, int level) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedFramebufferTextureEXT).invokeExact(framebuffer, attachment, texture, level); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedFramebufferTextureEXT(int framebuffer, int attachment, int texture, int level) { + throw new ContextException(); } - public static void glNamedFramebufferTextureLayerEXT(int framebuffer, int attachment, int texture, int level, int layer) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedFramebufferTextureLayerEXT).invokeExact(framebuffer, attachment, texture, level, layer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedFramebufferTextureLayerEXT(int framebuffer, int attachment, int texture, int level, int layer) { + throw new ContextException(); } - public static void glNamedFramebufferTextureFaceEXT(int framebuffer, int attachment, int texture, int level, int face) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedFramebufferTextureFaceEXT).invokeExact(framebuffer, attachment, texture, level, face); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedFramebufferTextureFaceEXT(int framebuffer, int attachment, int texture, int level, int face) { + throw new ContextException(); } - public static void glTextureRenderbufferEXT(int texture, int target, int renderbuffer) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureRenderbufferEXT).invokeExact(texture, target, renderbuffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureRenderbufferEXT(int texture, int target, int renderbuffer) { + throw new ContextException(); } - public static void glMultiTexRenderbufferEXT(int texunit, int target, int renderbuffer) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexRenderbufferEXT).invokeExact(texunit, target, renderbuffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexRenderbufferEXT(int texunit, int target, int renderbuffer) { + throw new ContextException(); } - public static void glVertexArrayVertexOffsetEXT(int vaobj, int buffer, int size, int type, int stride, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArrayVertexOffsetEXT).invokeExact(vaobj, buffer, size, type, stride, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArrayVertexOffsetEXT(int vaobj, int buffer, int size, int type, int stride, long offset) { + throw new ContextException(); } - public static void glVertexArrayColorOffsetEXT(int vaobj, int buffer, int size, int type, int stride, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArrayColorOffsetEXT).invokeExact(vaobj, buffer, size, type, stride, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArrayColorOffsetEXT(int vaobj, int buffer, int size, int type, int stride, long offset) { + throw new ContextException(); } - public static void glVertexArrayEdgeFlagOffsetEXT(int vaobj, int buffer, int stride, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArrayEdgeFlagOffsetEXT).invokeExact(vaobj, buffer, stride, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArrayEdgeFlagOffsetEXT(int vaobj, int buffer, int stride, long offset) { + throw new ContextException(); } - public static void glVertexArrayIndexOffsetEXT(int vaobj, int buffer, int type, int stride, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArrayIndexOffsetEXT).invokeExact(vaobj, buffer, type, stride, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArrayIndexOffsetEXT(int vaobj, int buffer, int type, int stride, long offset) { + throw new ContextException(); } - public static void glVertexArrayNormalOffsetEXT(int vaobj, int buffer, int type, int stride, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArrayNormalOffsetEXT).invokeExact(vaobj, buffer, type, stride, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArrayNormalOffsetEXT(int vaobj, int buffer, int type, int stride, long offset) { + throw new ContextException(); } - public static void glVertexArrayTexCoordOffsetEXT(int vaobj, int buffer, int size, int type, int stride, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArrayTexCoordOffsetEXT).invokeExact(vaobj, buffer, size, type, stride, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArrayTexCoordOffsetEXT(int vaobj, int buffer, int size, int type, int stride, long offset) { + throw new ContextException(); } - public static void glVertexArrayMultiTexCoordOffsetEXT(int vaobj, int buffer, int texunit, int size, int type, int stride, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArrayMultiTexCoordOffsetEXT).invokeExact(vaobj, buffer, texunit, size, type, stride, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArrayMultiTexCoordOffsetEXT(int vaobj, int buffer, int texunit, int size, int type, int stride, long offset) { + throw new ContextException(); } - public static void glVertexArrayFogCoordOffsetEXT(int vaobj, int buffer, int type, int stride, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArrayFogCoordOffsetEXT).invokeExact(vaobj, buffer, type, stride, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArrayFogCoordOffsetEXT(int vaobj, int buffer, int type, int stride, long offset) { + throw new ContextException(); } - public static void glVertexArraySecondaryColorOffsetEXT(int vaobj, int buffer, int size, int type, int stride, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArraySecondaryColorOffsetEXT).invokeExact(vaobj, buffer, size, type, stride, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArraySecondaryColorOffsetEXT(int vaobj, int buffer, int size, int type, int stride, long offset) { + throw new ContextException(); } - public static void glVertexArrayVertexAttribOffsetEXT(int vaobj, int buffer, int index, int size, int type, boolean normalized, int stride, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArrayVertexAttribOffsetEXT).invokeExact(vaobj, buffer, index, size, type, normalized, stride, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArrayVertexAttribOffsetEXT(int vaobj, int buffer, int index, int size, int type, boolean normalized, int stride, long offset) { + throw new ContextException(); } - public static void glVertexArrayVertexAttribIOffsetEXT(int vaobj, int buffer, int index, int size, int type, int stride, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArrayVertexAttribIOffsetEXT).invokeExact(vaobj, buffer, index, size, type, stride, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArrayVertexAttribIOffsetEXT(int vaobj, int buffer, int index, int size, int type, int stride, long offset) { + throw new ContextException(); } - public static void glEnableVertexArrayEXT(int vaobj, int array) { - final var ext = getExtCapabilities(); - try { - check(ext.glEnableVertexArrayEXT).invokeExact(vaobj, array); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEnableVertexArrayEXT(int vaobj, int array) { + throw new ContextException(); } - public static void glDisableVertexArrayEXT(int vaobj, int array) { - final var ext = getExtCapabilities(); - try { - check(ext.glDisableVertexArrayEXT).invokeExact(vaobj, array); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDisableVertexArrayEXT(int vaobj, int array) { + throw new ContextException(); } - public static void glEnableVertexArrayAttribEXT(int vaobj, int index) { - final var ext = getExtCapabilities(); - try { - check(ext.glEnableVertexArrayAttribEXT).invokeExact(vaobj, index); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEnableVertexArrayAttribEXT(int vaobj, int index) { + throw new ContextException(); } - public static void glDisableVertexArrayAttribEXT(int vaobj, int index) { - final var ext = getExtCapabilities(); - try { - check(ext.glDisableVertexArrayAttribEXT).invokeExact(vaobj, index); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDisableVertexArrayAttribEXT(int vaobj, int index) { + throw new ContextException(); } - public static void glGetVertexArrayIntegervEXT(int vaobj, int pname, @NativeType("GLint *") MemorySegment param) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVertexArrayIntegervEXT).invokeExact(vaobj, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVertexArrayIntegervEXT(int vaobj, int pname, @NativeType("GLint *") MemorySegment param) { + throw new ContextException(); } - public static void glGetVertexArrayPointervEXT(int vaobj, int pname, @NativeType("void **") MemorySegment param) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVertexArrayPointervEXT).invokeExact(vaobj, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVertexArrayPointervEXT(int vaobj, int pname, @NativeType("void **") MemorySegment param) { + throw new ContextException(); } - public static void glGetVertexArrayIntegeri_vEXT(int vaobj, int index, int pname, @NativeType("GLint *") MemorySegment param) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVertexArrayIntegeri_vEXT).invokeExact(vaobj, index, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVertexArrayIntegeri_vEXT(int vaobj, int index, int pname, @NativeType("GLint *") MemorySegment param) { + throw new ContextException(); } - public static void glGetVertexArrayPointeri_vEXT(int vaobj, int index, int pname, @NativeType("void **") MemorySegment param) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVertexArrayPointeri_vEXT).invokeExact(vaobj, index, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVertexArrayPointeri_vEXT(int vaobj, int index, int pname, @NativeType("void **") MemorySegment param) { + throw new ContextException(); } - public static void glMapNamedBufferRangeEXT(int buffer, long offset, long length, int access) { - final var ext = getExtCapabilities(); - try { - check(ext.glMapNamedBufferRangeEXT).invokeExact(buffer, offset, length, access); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMapNamedBufferRangeEXT(int buffer, long offset, long length, int access) { + throw new ContextException(); } - public static void glFlushMappedNamedBufferRangeEXT(int buffer, long offset, long length) { - final var ext = getExtCapabilities(); - try { - check(ext.glFlushMappedNamedBufferRangeEXT).invokeExact(buffer, offset, length); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFlushMappedNamedBufferRangeEXT(int buffer, long offset, long length) { + throw new ContextException(); } - public static void glNamedBufferStorageEXT(int buffer, long size, @NativeType("const void *") MemorySegment data, int flags) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedBufferStorageEXT).invokeExact(buffer, size, data, flags); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedBufferStorageEXT(int buffer, long size, @NativeType("const void *") MemorySegment data, int flags) { + throw new ContextException(); } - public static void glClearNamedBufferDataEXT(int buffer, int internalformat, int format, int type, @NativeType("const void *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glClearNamedBufferDataEXT).invokeExact(buffer, internalformat, format, type, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glClearNamedBufferDataEXT(int buffer, int internalformat, int format, int type, @NativeType("const void *") MemorySegment data) { + throw new ContextException(); } - public static void glClearNamedBufferSubDataEXT(int buffer, int internalformat, long offset, long size, int format, int type, @NativeType("const void *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glClearNamedBufferSubDataEXT).invokeExact(buffer, internalformat, offset, size, format, type, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glClearNamedBufferSubDataEXT(int buffer, int internalformat, long offset, long size, int format, int type, @NativeType("const void *") MemorySegment data) { + throw new ContextException(); } - public static void glNamedFramebufferParameteriEXT(int framebuffer, int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedFramebufferParameteriEXT).invokeExact(framebuffer, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedFramebufferParameteriEXT(int framebuffer, int pname, int param) { + throw new ContextException(); } - public static void glGetNamedFramebufferParameterivEXT(int framebuffer, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetNamedFramebufferParameterivEXT).invokeExact(framebuffer, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetNamedFramebufferParameterivEXT(int framebuffer, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glProgramUniform1dEXT(int program, int location, double x) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform1dEXT).invokeExact(program, location, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform1dEXT(int program, int location, double x) { + throw new ContextException(); } - public static void glProgramUniform2dEXT(int program, int location, double x, double y) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform2dEXT).invokeExact(program, location, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform2dEXT(int program, int location, double x, double y) { + throw new ContextException(); } - public static void glProgramUniform3dEXT(int program, int location, double x, double y, double z) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform3dEXT).invokeExact(program, location, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform3dEXT(int program, int location, double x, double y, double z) { + throw new ContextException(); } - public static void glProgramUniform4dEXT(int program, int location, double x, double y, double z, double w) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform4dEXT).invokeExact(program, location, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform4dEXT(int program, int location, double x, double y, double z, double w) { + throw new ContextException(); } - public static void glProgramUniform1dvEXT(int program, int location, int count, @NativeType("const GLdouble *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform1dvEXT).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform1dvEXT(int program, int location, int count, @NativeType("const GLdouble *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform2dvEXT(int program, int location, int count, @NativeType("const GLdouble *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform2dvEXT).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform2dvEXT(int program, int location, int count, @NativeType("const GLdouble *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform3dvEXT(int program, int location, int count, @NativeType("const GLdouble *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform3dvEXT).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform3dvEXT(int program, int location, int count, @NativeType("const GLdouble *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniform4dvEXT(int program, int location, int count, @NativeType("const GLdouble *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniform4dvEXT).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniform4dvEXT(int program, int location, int count, @NativeType("const GLdouble *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniformMatrix2dvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLdouble *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformMatrix2dvEXT).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformMatrix2dvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLdouble *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniformMatrix3dvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLdouble *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformMatrix3dvEXT).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformMatrix3dvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLdouble *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniformMatrix4dvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLdouble *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformMatrix4dvEXT).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformMatrix4dvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLdouble *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniformMatrix2x3dvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLdouble *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformMatrix2x3dvEXT).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformMatrix2x3dvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLdouble *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniformMatrix2x4dvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLdouble *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformMatrix2x4dvEXT).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformMatrix2x4dvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLdouble *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniformMatrix3x2dvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLdouble *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformMatrix3x2dvEXT).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformMatrix3x2dvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLdouble *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniformMatrix3x4dvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLdouble *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformMatrix3x4dvEXT).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformMatrix3x4dvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLdouble *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniformMatrix4x2dvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLdouble *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformMatrix4x2dvEXT).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformMatrix4x2dvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLdouble *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniformMatrix4x3dvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLdouble *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformMatrix4x3dvEXT).invokeExact(program, location, count, transpose, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformMatrix4x3dvEXT(int program, int location, int count, boolean transpose, @NativeType("const GLdouble *") MemorySegment value) { + throw new ContextException(); } - public static void glTextureBufferRangeEXT(int texture, int target, int internalformat, int buffer, long offset, long size) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureBufferRangeEXT).invokeExact(texture, target, internalformat, buffer, offset, size); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureBufferRangeEXT(int texture, int target, int internalformat, int buffer, long offset, long size) { + throw new ContextException(); } - public static void glTextureStorage1DEXT(int texture, int target, int levels, int internalformat, int width) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureStorage1DEXT).invokeExact(texture, target, levels, internalformat, width); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureStorage1DEXT(int texture, int target, int levels, int internalformat, int width) { + throw new ContextException(); } - public static void glTextureStorage2DEXT(int texture, int target, int levels, int internalformat, int width, int height) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureStorage2DEXT).invokeExact(texture, target, levels, internalformat, width, height); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureStorage2DEXT(int texture, int target, int levels, int internalformat, int width, int height) { + throw new ContextException(); } - public static void glTextureStorage3DEXT(int texture, int target, int levels, int internalformat, int width, int height, int depth) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureStorage3DEXT).invokeExact(texture, target, levels, internalformat, width, height, depth); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureStorage3DEXT(int texture, int target, int levels, int internalformat, int width, int height, int depth) { + throw new ContextException(); } - public static void glTextureStorage2DMultisampleEXT(int texture, int target, int samples, int internalformat, int width, int height, boolean fixedsamplelocations) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureStorage2DMultisampleEXT).invokeExact(texture, target, samples, internalformat, width, height, fixedsamplelocations); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureStorage2DMultisampleEXT(int texture, int target, int samples, int internalformat, int width, int height, boolean fixedsamplelocations) { + throw new ContextException(); } - public static void glTextureStorage3DMultisampleEXT(int texture, int target, int samples, int internalformat, int width, int height, int depth, boolean fixedsamplelocations) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureStorage3DMultisampleEXT).invokeExact(texture, target, samples, internalformat, width, height, depth, fixedsamplelocations); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureStorage3DMultisampleEXT(int texture, int target, int samples, int internalformat, int width, int height, int depth, boolean fixedsamplelocations) { + throw new ContextException(); } - public static void glVertexArrayBindVertexBufferEXT(int vaobj, int bindingindex, int buffer, long offset, int stride) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArrayBindVertexBufferEXT).invokeExact(vaobj, bindingindex, buffer, offset, stride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArrayBindVertexBufferEXT(int vaobj, int bindingindex, int buffer, long offset, int stride) { + throw new ContextException(); } - public static void glVertexArrayVertexAttribFormatEXT(int vaobj, int attribindex, int size, int type, boolean normalized, int relativeoffset) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArrayVertexAttribFormatEXT).invokeExact(vaobj, attribindex, size, type, normalized, relativeoffset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArrayVertexAttribFormatEXT(int vaobj, int attribindex, int size, int type, boolean normalized, int relativeoffset) { + throw new ContextException(); } - public static void glVertexArrayVertexAttribIFormatEXT(int vaobj, int attribindex, int size, int type, int relativeoffset) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArrayVertexAttribIFormatEXT).invokeExact(vaobj, attribindex, size, type, relativeoffset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArrayVertexAttribIFormatEXT(int vaobj, int attribindex, int size, int type, int relativeoffset) { + throw new ContextException(); } - public static void glVertexArrayVertexAttribLFormatEXT(int vaobj, int attribindex, int size, int type, int relativeoffset) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArrayVertexAttribLFormatEXT).invokeExact(vaobj, attribindex, size, type, relativeoffset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArrayVertexAttribLFormatEXT(int vaobj, int attribindex, int size, int type, int relativeoffset) { + throw new ContextException(); } - public static void glVertexArrayVertexAttribBindingEXT(int vaobj, int attribindex, int bindingindex) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArrayVertexAttribBindingEXT).invokeExact(vaobj, attribindex, bindingindex); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArrayVertexAttribBindingEXT(int vaobj, int attribindex, int bindingindex) { + throw new ContextException(); } - public static void glVertexArrayVertexBindingDivisorEXT(int vaobj, int bindingindex, int divisor) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArrayVertexBindingDivisorEXT).invokeExact(vaobj, bindingindex, divisor); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArrayVertexBindingDivisorEXT(int vaobj, int bindingindex, int divisor) { + throw new ContextException(); } - public static void glVertexArrayVertexAttribLOffsetEXT(int vaobj, int buffer, int index, int size, int type, int stride, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArrayVertexAttribLOffsetEXT).invokeExact(vaobj, buffer, index, size, type, stride, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArrayVertexAttribLOffsetEXT(int vaobj, int buffer, int index, int size, int type, int stride, long offset) { + throw new ContextException(); } - public static void glTexturePageCommitmentEXT(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, boolean commit) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexturePageCommitmentEXT).invokeExact(texture, level, xoffset, yoffset, zoffset, width, height, depth, commit); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexturePageCommitmentEXT(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, boolean commit) { + throw new ContextException(); } - public static void glVertexArrayVertexAttribDivisorEXT(int vaobj, int index, int divisor) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArrayVertexAttribDivisorEXT).invokeExact(vaobj, index, divisor); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArrayVertexAttribDivisorEXT(int vaobj, int index, int divisor) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDrawBuffers2.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDrawBuffers2.java index 459b550c..2f98ef87 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDrawBuffers2.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDrawBuffers2.java @@ -16,28 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_draw_buffers2} */ -public final class GLEXTDrawBuffers2 { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_draw_buffers2) return; - ext.glColorMaskIndexedEXT = load.invoke("glColorMaskIndexedEXT", ofVoid(JAVA_INT, JAVA_BYTE, JAVA_BYTE, JAVA_BYTE, JAVA_BYTE)); - } +public interface GLEXTDrawBuffers2 { - public static void glColorMaskIndexedEXT(int index, boolean r, boolean g, boolean b, boolean a) { - final var ext = getExtCapabilities(); - try { - check(ext.glColorMaskIndexedEXT).invokeExact(index, r, g, b, a); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glColorMaskIndexedEXT(int index, boolean r, boolean g, boolean b, boolean a) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDrawInstanced.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDrawInstanced.java index ad79bd07..bd5498df 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDrawInstanced.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDrawInstanced.java @@ -16,36 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_draw_instanced} */ -public final class GLEXTDrawInstanced { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_draw_instanced) return; - ext.glDrawArraysInstancedEXT = load.invoke("glDrawArraysInstancedEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glDrawElementsInstancedEXT = load.invoke("glDrawElementsInstancedEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT)); - } +public interface GLEXTDrawInstanced { - public static void glDrawArraysInstancedEXT(int mode, int start, int count, int primcount) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawArraysInstancedEXT).invokeExact(mode, start, count, primcount); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDrawArraysInstancedEXT(int mode, int start, int count, int primcount) { + throw new ContextException(); } - public static void glDrawElementsInstancedEXT(int mode, int count, int type, @NativeType("const void *") MemorySegment indices, int primcount) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawElementsInstancedEXT).invokeExact(mode, count, type, indices, primcount); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDrawElementsInstancedEXT(int mode, int count, int type, @NativeType("const void *") MemorySegment indices, int primcount) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDrawRangedElements.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDrawRangedElements.java index b56c77fb..583bc9a9 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDrawRangedElements.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTDrawRangedElements.java @@ -16,30 +16,19 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_draw_range_elements} */ -public final class GLEXTDrawRangedElements { - public static final int GL_MAX_ELEMENTS_VERTICES_EXT = 0x80E8; - public static final int GL_MAX_ELEMENTS_INDICES_EXT = 0x80E9; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_draw_range_elements) return; - ext.glDrawRangeElementsEXT = load.invoke("glDrawRangeElementsEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLEXTDrawRangedElements { + int GL_MAX_ELEMENTS_VERTICES_EXT = 0x80E8; + int GL_MAX_ELEMENTS_INDICES_EXT = 0x80E9; - public static void glDrawRangeElementsEXT(int mode, int start, int end, int count, int type, @NativeType("const void *") MemorySegment indices) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawRangeElementsEXT).invokeExact(mode, start, end, count, type, indices); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDrawRangeElementsEXT(int mode, int start, int end, int count, int type, @NativeType("const void *") MemorySegment indices) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTEGLImageStorage.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTEGLImageStorage.java index 5f0d9b54..ccc7d3f4 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTEGLImageStorage.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTEGLImageStorage.java @@ -16,36 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_EGL_image_storage} */ -public final class GLEXTEGLImageStorage { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_EGL_image_storage) return; - ext.glEGLImageTargetTexStorageEXT = load.invoke("glEGLImageTargetTexStorageEXT", ofVoid(JAVA_INT, ADDRESS, ADDRESS)); - ext.glEGLImageTargetTextureStorageEXT = load.invoke("glEGLImageTargetTextureStorageEXT", ofVoid(JAVA_INT, ADDRESS, ADDRESS)); - } +public interface GLEXTEGLImageStorage { - public static void glEGLImageTargetTexStorageEXT(int target, @NativeType("GLeglImageOES") MemorySegment image, @NativeType("const GLint*") MemorySegment attrib_list) { - final var ext = getExtCapabilities(); - try { - check(ext.glEGLImageTargetTexStorageEXT).invokeExact(target, image, attrib_list); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEGLImageTargetTexStorageEXT(int target, @NativeType("GLeglImageOES") MemorySegment image, @NativeType("const GLint*") MemorySegment attrib_list) { + throw new ContextException(); } - public static void glEGLImageTargetTextureStorageEXT(int texture, @NativeType("GLeglImageOES") MemorySegment image, @NativeType("const GLint*") MemorySegment attrib_list) { - final var ext = getExtCapabilities(); - try { - check(ext.glEGLImageTargetTextureStorageEXT).invokeExact(texture, image, attrib_list); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEGLImageTargetTextureStorageEXT(int texture, @NativeType("GLeglImageOES") MemorySegment image, @NativeType("const GLint*") MemorySegment attrib_list) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTExternalBuffer.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTExternalBuffer.java index 99d76dc8..fde1998e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTExternalBuffer.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTExternalBuffer.java @@ -16,36 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_external_buffer} */ -public final class GLEXTExternalBuffer { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_external_buffer) return; - ext.glBufferStorageExternalEXT = load.invoke("glBufferStorageExternalEXT", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, ADDRESS, JAVA_INT)); - ext.glNamedBufferStorageExternalEXT = load.invoke("glNamedBufferStorageExternalEXT", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, ADDRESS, JAVA_INT)); - } +public interface GLEXTExternalBuffer { - public static void glBufferStorageExternalEXT(int target, long offset, long size, @NativeType("GLeglClientBufferEXT") MemorySegment clientBuffer, int flags) { - final var ext = getExtCapabilities(); - try { - check(ext.glBufferStorageExternalEXT).invokeExact(target, offset, size, clientBuffer, flags); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBufferStorageExternalEXT(int target, long offset, long size, @NativeType("GLeglClientBufferEXT") MemorySegment clientBuffer, int flags) { + throw new ContextException(); } - public static void glNamedBufferStorageExternalEXT(int buffer, long offset, long size, @NativeType("GLeglClientBufferEXT") MemorySegment clientBuffer, int flags) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedBufferStorageExternalEXT).invokeExact(buffer, offset, size, clientBuffer, flags); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedBufferStorageExternalEXT(int buffer, long offset, long size, @NativeType("GLeglClientBufferEXT") MemorySegment clientBuffer, int flags) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFogCoord.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFogCoord.java index 504a14d3..efcbd435 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFogCoord.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFogCoord.java @@ -16,68 +16,41 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_fog_coord} */ -public final class GLEXTFogCoord { - public static final int GL_FOG_COORDINATE_SOURCE_EXT = 0x8450; - public static final int GL_FOG_COORDINATE_EXT = 0x8451; - public static final int GL_FRAGMENT_DEPTH_EXT = 0x8452; - public static final int GL_CURRENT_FOG_COORDINATE_EXT = 0x8453; - public static final int GL_FOG_COORDINATE_ARRAY_TYPE_EXT = 0x8454; - public static final int GL_FOG_COORDINATE_ARRAY_STRIDE_EXT = 0x8455; - public static final int GL_FOG_COORDINATE_ARRAY_POINTER_EXT = 0x8456; - public static final int GL_FOG_COORDINATE_ARRAY_EXT = 0x8457; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_fog_coord) return; - ext.glFogCoordfEXT = load.invoke("glFogCoordfEXT", ofVoid(JAVA_FLOAT)); - ext.glFogCoordfvEXT = load.invoke("glFogCoordfvEXT", ofVoid(ADDRESS)); - ext.glFogCoorddEXT = load.invoke("glFogCoorddEXT", ofVoid(JAVA_DOUBLE)); - ext.glFogCoorddvEXT = load.invoke("glFogCoorddvEXT", ofVoid(ADDRESS)); - ext.glFogCoordPointerEXT = load.invoke("glFogCoordPointerEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static void glFogCoordfEXT(float coord) { - final var ext = getExtCapabilities(); - try { - check(ext.glFogCoordfEXT).invokeExact(coord); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLEXTFogCoord { + int GL_FOG_COORDINATE_SOURCE_EXT = 0x8450; + int GL_FOG_COORDINATE_EXT = 0x8451; + int GL_FRAGMENT_DEPTH_EXT = 0x8452; + int GL_CURRENT_FOG_COORDINATE_EXT = 0x8453; + int GL_FOG_COORDINATE_ARRAY_TYPE_EXT = 0x8454; + int GL_FOG_COORDINATE_ARRAY_STRIDE_EXT = 0x8455; + int GL_FOG_COORDINATE_ARRAY_POINTER_EXT = 0x8456; + int GL_FOG_COORDINATE_ARRAY_EXT = 0x8457; + + default void glFogCoordfEXT(float coord) { + throw new ContextException(); } - public static void glFogCoordfvEXT(@NativeType("const GLfloat *") MemorySegment coord) { - final var ext = getExtCapabilities(); - try { - check(ext.glFogCoordfvEXT).invokeExact(coord); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFogCoordfvEXT(@NativeType("const GLfloat *") MemorySegment coord) { + throw new ContextException(); } - public static void glFogCoorddEXT(double coord) { - final var ext = getExtCapabilities(); - try { - check(ext.glFogCoorddEXT).invokeExact(coord); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFogCoorddEXT(double coord) { + throw new ContextException(); } - public static void glFogCoorddvEXT(@NativeType("const GLdouble *") MemorySegment coord) { - final var ext = getExtCapabilities(); - try { - check(ext.glFogCoorddvEXT).invokeExact(coord); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFogCoorddvEXT(@NativeType("const GLdouble *") MemorySegment coord) { + throw new ContextException(); } - public static void glFogCoordPointerEXT(int type, int stride, @NativeType("const void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glFogCoordPointerEXT).invokeExact(type, stride, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFogCoordPointerEXT(int type, int stride, @NativeType("const void *") MemorySegment pointer) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFramebufferBlit.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFramebufferBlit.java index 44ff831f..2aaf062b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFramebufferBlit.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFramebufferBlit.java @@ -16,32 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_framebuffer_blit} */ -public final class GLEXTFramebufferBlit { - public static final int GL_READ_FRAMEBUFFER_EXT = 0x8CA8; - public static final int GL_DRAW_FRAMEBUFFER_EXT = 0x8CA9; - public static final int GL_DRAW_FRAMEBUFFER_BINDING_EXT = 0x8CA6; - public static final int GL_READ_FRAMEBUFFER_BINDING_EXT = 0x8CAA; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_framebuffer_blit) return; - ext.glBlitFramebufferEXT = load.invoke("glBlitFramebufferEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLEXTFramebufferBlit { + int GL_READ_FRAMEBUFFER_EXT = 0x8CA8; + int GL_DRAW_FRAMEBUFFER_EXT = 0x8CA9; + int GL_DRAW_FRAMEBUFFER_BINDING_EXT = 0x8CA6; + int GL_READ_FRAMEBUFFER_BINDING_EXT = 0x8CAA; - public static void glBlitFramebufferEXT(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, int mask, int filter) { - final var ext = getExtCapabilities(); - try { - check(ext.glBlitFramebufferEXT).invokeExact(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBlitFramebufferEXT(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, int mask, int filter) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFramebufferBlitLayers.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFramebufferBlitLayers.java index 583ad66f..97c7ae36 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFramebufferBlitLayers.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFramebufferBlitLayers.java @@ -16,36 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_framebuffer_blit_layers} */ -public final class GLEXTFramebufferBlitLayers { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_framebuffer_blit_layers) return; - ext.glBlitFramebufferLayersEXT = load.invoke("glBlitFramebufferLayersEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glBlitFramebufferLayerEXT = load.invoke("glBlitFramebufferLayerEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLEXTFramebufferBlitLayers { - public static void glBlitFramebufferLayersEXT(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, int mask, int filter) { - final var ext = getExtCapabilities(); - try { - check(ext.glBlitFramebufferLayersEXT).invokeExact(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBlitFramebufferLayersEXT(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, int mask, int filter) { + throw new ContextException(); } - public static void glBlitFramebufferLayerEXT(int srcX0, int srcY0, int srcX1, int srcY1, int srcLayer, int dstX0, int dstY0, int dstX1, int dstY1, int dstLayer, int mask, int filter) { - final var ext = getExtCapabilities(); - try { - check(ext.glBlitFramebufferLayerEXT).invokeExact(srcX0, srcY0, srcX1, srcY1, srcLayer, dstX0, dstY0, dstX1, dstY1, dstLayer, mask, filter); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBlitFramebufferLayerEXT(int srcX0, int srcY0, int srcX1, int srcY1, int srcLayer, int dstX0, int dstY0, int dstX1, int dstY1, int dstLayer, int mask, int filter) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFramebufferMultisample.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFramebufferMultisample.java index c444ff59..6cf1fa12 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFramebufferMultisample.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFramebufferMultisample.java @@ -16,31 +16,20 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_framebuffer_multisample} */ -public final class GLEXTFramebufferMultisample { - public static final int GL_RENDERBUFFER_SAMPLES_EXT = 0x8CAB; - public static final int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT = 0x8D56; - public static final int GL_MAX_SAMPLES_EXT = 0x8D57; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_framebuffer_multisample) return; - ext.glRenderbufferStorageMultisampleEXT = load.invoke("glRenderbufferStorageMultisampleEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLEXTFramebufferMultisample { + int GL_RENDERBUFFER_SAMPLES_EXT = 0x8CAB; + int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT = 0x8D56; + int GL_MAX_SAMPLES_EXT = 0x8D57; - public static void glRenderbufferStorageMultisampleEXT(int target, int samples, int internalformat, int width, int height) { - final var ext = getExtCapabilities(); - try { - check(ext.glRenderbufferStorageMultisampleEXT).invokeExact(target, samples, internalformat, width, height); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glRenderbufferStorageMultisampleEXT(int target, int samples, int internalformat, int width, int height) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFramebufferMultisampleBlitScaled.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFramebufferMultisampleBlitScaled.java index 8f1ee6c1..112f975e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFramebufferMultisampleBlitScaled.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFramebufferMultisampleBlitScaled.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_framebuffer_multisample_blit_scaled} */ -public final class GLEXTFramebufferMultisampleBlitScaled { - public static final int GL_SCALED_RESOLVE_FASTEST_EXT = 0x90BA; - public static final int GL_SCALED_RESOLVE_NICEST_EXT = 0x90BB; +public interface GLEXTFramebufferMultisampleBlitScaled { + int GL_SCALED_RESOLVE_FASTEST_EXT = 0x90BA; + int GL_SCALED_RESOLVE_NICEST_EXT = 0x90BB; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFramebufferObject.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFramebufferObject.java index ec1c2705..ebf658e2 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFramebufferObject.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTFramebufferObject.java @@ -16,210 +16,132 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_framebuffer_object} */ -public final class GLEXTFramebufferObject { - public static final int GL_INVALID_FRAMEBUFFER_OPERATION_EXT = 0x0506; - public static final int GL_MAX_RENDERBUFFER_SIZE_EXT = 0x84E8; - public static final int GL_FRAMEBUFFER_BINDING_EXT = 0x8CA6; - public static final int GL_RENDERBUFFER_BINDING_EXT = 0x8CA7; - public static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT = 0x8CD0; - public static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT = 0x8CD1; - public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT = 0x8CD2; - public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT = 0x8CD3; - public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT = 0x8CD4; - public static final int GL_FRAMEBUFFER_COMPLETE_EXT = 0x8CD5; - public static final int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT = 0x8CD6; - public static final int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT = 0x8CD7; - public static final int GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT = 0x8CD9; - public static final int GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT = 0x8CDA; - public static final int GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT = 0x8CDB; - public static final int GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT = 0x8CDC; - public static final int GL_FRAMEBUFFER_UNSUPPORTED_EXT = 0x8CDD; - public static final int GL_MAX_COLOR_ATTACHMENTS_EXT = 0x8CDF; - public static final int GL_COLOR_ATTACHMENT0_EXT = 0x8CE0; - public static final int GL_COLOR_ATTACHMENT1_EXT = 0x8CE1; - public static final int GL_COLOR_ATTACHMENT2_EXT = 0x8CE2; - public static final int GL_COLOR_ATTACHMENT3_EXT = 0x8CE3; - public static final int GL_COLOR_ATTACHMENT4_EXT = 0x8CE4; - public static final int GL_COLOR_ATTACHMENT5_EXT = 0x8CE5; - public static final int GL_COLOR_ATTACHMENT6_EXT = 0x8CE6; - public static final int GL_COLOR_ATTACHMENT7_EXT = 0x8CE7; - public static final int GL_COLOR_ATTACHMENT8_EXT = 0x8CE8; - public static final int GL_COLOR_ATTACHMENT9_EXT = 0x8CE9; - public static final int GL_COLOR_ATTACHMENT10_EXT = 0x8CEA; - public static final int GL_COLOR_ATTACHMENT11_EXT = 0x8CEB; - public static final int GL_COLOR_ATTACHMENT12_EXT = 0x8CEC; - public static final int GL_COLOR_ATTACHMENT13_EXT = 0x8CED; - public static final int GL_COLOR_ATTACHMENT14_EXT = 0x8CEE; - public static final int GL_COLOR_ATTACHMENT15_EXT = 0x8CEF; - public static final int GL_DEPTH_ATTACHMENT_EXT = 0x8D00; - public static final int GL_STENCIL_ATTACHMENT_EXT = 0x8D20; - public static final int GL_FRAMEBUFFER_EXT = 0x8D40; - public static final int GL_RENDERBUFFER_EXT = 0x8D41; - public static final int GL_RENDERBUFFER_WIDTH_EXT = 0x8D42; - public static final int GL_RENDERBUFFER_HEIGHT_EXT = 0x8D43; - public static final int GL_RENDERBUFFER_INTERNAL_FORMAT_EXT = 0x8D44; - public static final int GL_STENCIL_INDEX1_EXT = 0x8D46; - public static final int GL_STENCIL_INDEX4_EXT = 0x8D47; - public static final int GL_STENCIL_INDEX8_EXT = 0x8D48; - public static final int GL_STENCIL_INDEX16_EXT = 0x8D49; - public static final int GL_RENDERBUFFER_RED_SIZE_EXT = 0x8D50; - public static final int GL_RENDERBUFFER_GREEN_SIZE_EXT = 0x8D51; - public static final int GL_RENDERBUFFER_BLUE_SIZE_EXT = 0x8D52; - public static final int GL_RENDERBUFFER_ALPHA_SIZE_EXT = 0x8D53; - public static final int GL_RENDERBUFFER_DEPTH_SIZE_EXT = 0x8D54; - public static final int GL_RENDERBUFFER_STENCIL_SIZE_EXT = 0x8D55; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_framebuffer_object) return; - ext.glIsRenderbufferEXT = load.invoke("glIsRenderbufferEXT", of(JAVA_BYTE, JAVA_INT)); - ext.glBindRenderbufferEXT = load.invoke("glBindRenderbufferEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glDeleteRenderbuffersEXT = load.invoke("glDeleteRenderbuffersEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glGenRenderbuffersEXT = load.invoke("glGenRenderbuffersEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glRenderbufferStorageEXT = load.invoke("glRenderbufferStorageEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetRenderbufferParameterivEXT = load.invoke("glGetRenderbufferParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glIsFramebufferEXT = load.invoke("glIsFramebufferEXT", of(JAVA_BYTE, JAVA_INT)); - ext.glBindFramebufferEXT = load.invoke("glBindFramebufferEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glDeleteFramebuffersEXT = load.invoke("glDeleteFramebuffersEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glGenFramebuffersEXT = load.invoke("glGenFramebuffersEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glCheckFramebufferStatusEXT = load.invoke("glCheckFramebufferStatusEXT", of(JAVA_INT, JAVA_INT)); - ext.glFramebufferTexture1DEXT = load.invoke("glFramebufferTexture1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glFramebufferTexture2DEXT = load.invoke("glFramebufferTexture2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glFramebufferTexture3DEXT = load.invoke("glFramebufferTexture3DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glFramebufferRenderbufferEXT = load.invoke("glFramebufferRenderbufferEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetFramebufferAttachmentParameterivEXT = load.invoke("glGetFramebufferAttachmentParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGenerateMipmapEXT = load.invoke("glGenerateMipmapEXT", ofVoid(JAVA_INT)); - } - - public static boolean glIsRenderbufferEXT(int renderbuffer) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsRenderbufferEXT).invokeExact(renderbuffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glBindRenderbufferEXT(int target, int renderbuffer) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindRenderbufferEXT).invokeExact(target, renderbuffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glDeleteRenderbuffersEXT(int n, @NativeType("const GLuint *") MemorySegment renderbuffers) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteRenderbuffersEXT).invokeExact(n, renderbuffers); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glGenRenderbuffersEXT(int n, @NativeType("GLuint *") MemorySegment renderbuffers) { - final var ext = getExtCapabilities(); - try { - check(ext.glGenRenderbuffersEXT).invokeExact(n, renderbuffers); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glRenderbufferStorageEXT(int target, int internalformat, int width, int height) { - final var ext = getExtCapabilities(); - try { - check(ext.glRenderbufferStorageEXT).invokeExact(target, internalformat, width, height); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glGetRenderbufferParameterivEXT(int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetRenderbufferParameterivEXT).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static boolean glIsFramebufferEXT(int framebuffer) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsFramebufferEXT).invokeExact(framebuffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glBindFramebufferEXT(int target, int framebuffer) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindFramebufferEXT).invokeExact(target, framebuffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glDeleteFramebuffersEXT(int n, @NativeType("const GLuint *") MemorySegment framebuffers) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteFramebuffersEXT).invokeExact(n, framebuffers); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glGenFramebuffersEXT(int n, @NativeType("GLuint *") MemorySegment framebuffers) { - final var ext = getExtCapabilities(); - try { - check(ext.glGenFramebuffersEXT).invokeExact(n, framebuffers); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static int glCheckFramebufferStatusEXT(int target) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glCheckFramebufferStatusEXT).invokeExact(target); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glFramebufferTexture1DEXT(int target, int attachment, int textarget, int texture, int level) { - final var ext = getExtCapabilities(); - try { - check(ext.glFramebufferTexture1DEXT).invokeExact(target, attachment, textarget, texture, level); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLEXTFramebufferObject { + int GL_INVALID_FRAMEBUFFER_OPERATION_EXT = 0x0506; + int GL_MAX_RENDERBUFFER_SIZE_EXT = 0x84E8; + int GL_FRAMEBUFFER_BINDING_EXT = 0x8CA6; + int GL_RENDERBUFFER_BINDING_EXT = 0x8CA7; + int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT = 0x8CD0; + int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT = 0x8CD1; + int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT = 0x8CD2; + int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT = 0x8CD3; + int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT = 0x8CD4; + int GL_FRAMEBUFFER_COMPLETE_EXT = 0x8CD5; + int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT = 0x8CD6; + int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT = 0x8CD7; + int GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT = 0x8CD9; + int GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT = 0x8CDA; + int GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT = 0x8CDB; + int GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT = 0x8CDC; + int GL_FRAMEBUFFER_UNSUPPORTED_EXT = 0x8CDD; + int GL_MAX_COLOR_ATTACHMENTS_EXT = 0x8CDF; + int GL_COLOR_ATTACHMENT0_EXT = 0x8CE0; + int GL_COLOR_ATTACHMENT1_EXT = 0x8CE1; + int GL_COLOR_ATTACHMENT2_EXT = 0x8CE2; + int GL_COLOR_ATTACHMENT3_EXT = 0x8CE3; + int GL_COLOR_ATTACHMENT4_EXT = 0x8CE4; + int GL_COLOR_ATTACHMENT5_EXT = 0x8CE5; + int GL_COLOR_ATTACHMENT6_EXT = 0x8CE6; + int GL_COLOR_ATTACHMENT7_EXT = 0x8CE7; + int GL_COLOR_ATTACHMENT8_EXT = 0x8CE8; + int GL_COLOR_ATTACHMENT9_EXT = 0x8CE9; + int GL_COLOR_ATTACHMENT10_EXT = 0x8CEA; + int GL_COLOR_ATTACHMENT11_EXT = 0x8CEB; + int GL_COLOR_ATTACHMENT12_EXT = 0x8CEC; + int GL_COLOR_ATTACHMENT13_EXT = 0x8CED; + int GL_COLOR_ATTACHMENT14_EXT = 0x8CEE; + int GL_COLOR_ATTACHMENT15_EXT = 0x8CEF; + int GL_DEPTH_ATTACHMENT_EXT = 0x8D00; + int GL_STENCIL_ATTACHMENT_EXT = 0x8D20; + int GL_FRAMEBUFFER_EXT = 0x8D40; + int GL_RENDERBUFFER_EXT = 0x8D41; + int GL_RENDERBUFFER_WIDTH_EXT = 0x8D42; + int GL_RENDERBUFFER_HEIGHT_EXT = 0x8D43; + int GL_RENDERBUFFER_INTERNAL_FORMAT_EXT = 0x8D44; + int GL_STENCIL_INDEX1_EXT = 0x8D46; + int GL_STENCIL_INDEX4_EXT = 0x8D47; + int GL_STENCIL_INDEX8_EXT = 0x8D48; + int GL_STENCIL_INDEX16_EXT = 0x8D49; + int GL_RENDERBUFFER_RED_SIZE_EXT = 0x8D50; + int GL_RENDERBUFFER_GREEN_SIZE_EXT = 0x8D51; + int GL_RENDERBUFFER_BLUE_SIZE_EXT = 0x8D52; + int GL_RENDERBUFFER_ALPHA_SIZE_EXT = 0x8D53; + int GL_RENDERBUFFER_DEPTH_SIZE_EXT = 0x8D54; + int GL_RENDERBUFFER_STENCIL_SIZE_EXT = 0x8D55; + + default boolean glIsRenderbufferEXT(int renderbuffer) { + throw new ContextException(); + } + + default void glBindRenderbufferEXT(int target, int renderbuffer) { + throw new ContextException(); + } + + default void glDeleteRenderbuffersEXT(int n, @NativeType("const GLuint *") MemorySegment renderbuffers) { + throw new ContextException(); + } + + default void glGenRenderbuffersEXT(int n, @NativeType("GLuint *") MemorySegment renderbuffers) { + throw new ContextException(); + } + + default void glRenderbufferStorageEXT(int target, int internalformat, int width, int height) { + throw new ContextException(); + } + + default void glGetRenderbufferParameterivEXT(int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); + } + + default boolean glIsFramebufferEXT(int framebuffer) { + throw new ContextException(); + } + + default void glBindFramebufferEXT(int target, int framebuffer) { + throw new ContextException(); + } + + default void glDeleteFramebuffersEXT(int n, @NativeType("const GLuint *") MemorySegment framebuffers) { + throw new ContextException(); + } + + default void glGenFramebuffersEXT(int n, @NativeType("GLuint *") MemorySegment framebuffers) { + throw new ContextException(); + } + + default int glCheckFramebufferStatusEXT(int target) { + throw new ContextException(); + } + + default void glFramebufferTexture1DEXT(int target, int attachment, int textarget, int texture, int level) { + throw new ContextException(); } - public static void glFramebufferTexture2DEXT(int target, int attachment, int textarget, int texture, int level) { - final var ext = getExtCapabilities(); - try { - check(ext.glFramebufferTexture2DEXT).invokeExact(target, attachment, textarget, texture, level); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFramebufferTexture2DEXT(int target, int attachment, int textarget, int texture, int level) { + throw new ContextException(); } - public static void glFramebufferTexture3DEXT(int target, int attachment, int textarget, int texture, int level, int zoffset) { - final var ext = getExtCapabilities(); - try { - check(ext.glFramebufferTexture3DEXT).invokeExact(target, attachment, textarget, texture, level, zoffset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFramebufferTexture3DEXT(int target, int attachment, int textarget, int texture, int level, int zoffset) { + throw new ContextException(); } - public static void glFramebufferRenderbufferEXT(int target, int attachment, int renderbuffertarget, int renderbuffer) { - final var ext = getExtCapabilities(); - try { - check(ext.glFramebufferRenderbufferEXT).invokeExact(target, attachment, renderbuffertarget, renderbuffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFramebufferRenderbufferEXT(int target, int attachment, int renderbuffertarget, int renderbuffer) { + throw new ContextException(); } - public static void glGetFramebufferAttachmentParameterivEXT(int target, int attachment, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetFramebufferAttachmentParameterivEXT).invokeExact(target, attachment, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetFramebufferAttachmentParameterivEXT(int target, int attachment, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGenerateMipmapEXT(int target) { - final var ext = getExtCapabilities(); - try { - check(ext.glGenerateMipmapEXT).invokeExact(target); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGenerateMipmapEXT(int target) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTGeometryShader4.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTGeometryShader4.java index 18cf7b24..2ee9320d 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTGeometryShader4.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTGeometryShader4.java @@ -16,48 +16,37 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_geometry_shader4} */ -public final class GLEXTGeometryShader4 { - public static final int GL_GEOMETRY_SHADER_EXT = 0x8DD9; - public static final int GL_GEOMETRY_VERTICES_OUT_EXT = 0x8DDA; - public static final int GL_GEOMETRY_INPUT_TYPE_EXT = 0x8DDB; - public static final int GL_GEOMETRY_OUTPUT_TYPE_EXT = 0x8DDC; - public static final int GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT = 0x8C29; - public static final int GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT = 0x8DDD; - public static final int GL_MAX_VERTEX_VARYING_COMPONENTS_EXT = 0x8DDE; - public static final int GL_MAX_VARYING_COMPONENTS_EXT = 0x8B4B; - public static final int GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT = 0x8DDF; - public static final int GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT = 0x8DE0; - public static final int GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT = 0x8DE1; - public static final int GL_LINES_ADJACENCY_EXT = 0x000A; - public static final int GL_LINE_STRIP_ADJACENCY_EXT = 0x000B; - public static final int GL_TRIANGLES_ADJACENCY_EXT = 0x000C; - public static final int GL_TRIANGLE_STRIP_ADJACENCY_EXT = 0x000D; - public static final int GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT = 0x8DA8; - public static final int GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT = 0x8DA9; - public static final int GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT = 0x8DA7; - public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT = 0x8CD4; - public static final int GL_PROGRAM_POINT_SIZE_EXT = 0x8642; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_geometry_shader4) return; - ext.glProgramParameteriEXT = load.invoke("glProgramParameteriEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLEXTGeometryShader4 { + int GL_GEOMETRY_SHADER_EXT = 0x8DD9; + int GL_GEOMETRY_VERTICES_OUT_EXT = 0x8DDA; + int GL_GEOMETRY_INPUT_TYPE_EXT = 0x8DDB; + int GL_GEOMETRY_OUTPUT_TYPE_EXT = 0x8DDC; + int GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT = 0x8C29; + int GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT = 0x8DDD; + int GL_MAX_VERTEX_VARYING_COMPONENTS_EXT = 0x8DDE; + int GL_MAX_VARYING_COMPONENTS_EXT = 0x8B4B; + int GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT = 0x8DDF; + int GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT = 0x8DE0; + int GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT = 0x8DE1; + int GL_LINES_ADJACENCY_EXT = 0x000A; + int GL_LINE_STRIP_ADJACENCY_EXT = 0x000B; + int GL_TRIANGLES_ADJACENCY_EXT = 0x000C; + int GL_TRIANGLE_STRIP_ADJACENCY_EXT = 0x000D; + int GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT = 0x8DA8; + int GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT = 0x8DA9; + int GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT = 0x8DA7; + int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT = 0x8CD4; + int GL_PROGRAM_POINT_SIZE_EXT = 0x8642; - public static void glProgramParameteriEXT(int program, int pname, int value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramParameteriEXT).invokeExact(program, pname, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramParameteriEXT(int program, int pname, int value) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTGpuProgramParameters.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTGpuProgramParameters.java index 0ddf4f41..5b3399ef 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTGpuProgramParameters.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTGpuProgramParameters.java @@ -16,36 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_gpu_program_parameters} */ -public final class GLEXTGpuProgramParameters { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_gpu_program_parameters) return; - ext.glProgramEnvParameters4fvEXT = load.invoke("glProgramEnvParameters4fvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramLocalParameters4fvEXT = load.invoke("glProgramLocalParameters4fvEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLEXTGpuProgramParameters { - public static void glProgramEnvParameters4fvEXT(int target, int index, int count, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramEnvParameters4fvEXT).invokeExact(target, index, count, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramEnvParameters4fvEXT(int target, int index, int count, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glProgramLocalParameters4fvEXT(int target, int index, int count, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramLocalParameters4fvEXT).invokeExact(target, index, count, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramLocalParameters4fvEXT(int target, int index, int count, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTGpuShader4.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTGpuShader4.java index 11c322ec..59e25c46 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTGpuShader4.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTGpuShader4.java @@ -16,321 +16,177 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_gpu_shader4} */ -public final class GLEXTGpuShader4 { - public static final int GL_SAMPLER_1D_ARRAY_EXT = 0x8DC0; - public static final int GL_SAMPLER_2D_ARRAY_EXT = 0x8DC1; - public static final int GL_SAMPLER_BUFFER_EXT = 0x8DC2; - public static final int GL_SAMPLER_1D_ARRAY_SHADOW_EXT = 0x8DC3; - public static final int GL_SAMPLER_2D_ARRAY_SHADOW_EXT = 0x8DC4; - public static final int GL_SAMPLER_CUBE_SHADOW_EXT = 0x8DC5; - public static final int GL_UNSIGNED_INT_VEC2_EXT = 0x8DC6; - public static final int GL_UNSIGNED_INT_VEC3_EXT = 0x8DC7; - public static final int GL_UNSIGNED_INT_VEC4_EXT = 0x8DC8; - public static final int GL_INT_SAMPLER_1D_EXT = 0x8DC9; - public static final int GL_INT_SAMPLER_2D_EXT = 0x8DCA; - public static final int GL_INT_SAMPLER_3D_EXT = 0x8DCB; - public static final int GL_INT_SAMPLER_CUBE_EXT = 0x8DCC; - public static final int GL_INT_SAMPLER_2D_RECT_EXT = 0x8DCD; - public static final int GL_INT_SAMPLER_1D_ARRAY_EXT = 0x8DCE; - public static final int GL_INT_SAMPLER_2D_ARRAY_EXT = 0x8DCF; - public static final int GL_INT_SAMPLER_BUFFER_EXT = 0x8DD0; - public static final int GL_UNSIGNED_INT_SAMPLER_1D_EXT = 0x8DD1; - public static final int GL_UNSIGNED_INT_SAMPLER_2D_EXT = 0x8DD2; - public static final int GL_UNSIGNED_INT_SAMPLER_3D_EXT = 0x8DD3; - public static final int GL_UNSIGNED_INT_SAMPLER_CUBE_EXT = 0x8DD4; - public static final int GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT = 0x8DD5; - public static final int GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT = 0x8DD6; - public static final int GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT = 0x8DD7; - public static final int GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT = 0x8DD8; - public static final int GL_MIN_PROGRAM_TEXEL_OFFSET_EXT = 0x8904; - public static final int GL_MAX_PROGRAM_TEXEL_OFFSET_EXT = 0x8905; - public static final int GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT = 0x88FD; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_gpu_shader4) return; - ext.glGetUniformuivEXT = load.invoke("glGetUniformuivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glBindFragDataLocationEXT = load.invoke("glBindFragDataLocationEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetFragDataLocationEXT = load.invoke("glGetFragDataLocationEXT", of(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform1uiEXT = load.invoke("glUniform1uiEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glUniform2uiEXT = load.invoke("glUniform2uiEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glUniform3uiEXT = load.invoke("glUniform3uiEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glUniform4uiEXT = load.invoke("glUniform4uiEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glUniform1uivEXT = load.invoke("glUniform1uivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform2uivEXT = load.invoke("glUniform2uivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform3uivEXT = load.invoke("glUniform3uivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glUniform4uivEXT = load.invoke("glUniform4uivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVertexAttribI1iEXT = load.invoke("glVertexAttribI1iEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glVertexAttribI2iEXT = load.invoke("glVertexAttribI2iEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glVertexAttribI3iEXT = load.invoke("glVertexAttribI3iEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glVertexAttribI4iEXT = load.invoke("glVertexAttribI4iEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glVertexAttribI1uiEXT = load.invoke("glVertexAttribI1uiEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glVertexAttribI2uiEXT = load.invoke("glVertexAttribI2uiEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glVertexAttribI3uiEXT = load.invoke("glVertexAttribI3uiEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glVertexAttribI4uiEXT = load.invoke("glVertexAttribI4uiEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glVertexAttribI1ivEXT = load.invoke("glVertexAttribI1ivEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribI2ivEXT = load.invoke("glVertexAttribI2ivEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribI3ivEXT = load.invoke("glVertexAttribI3ivEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribI4ivEXT = load.invoke("glVertexAttribI4ivEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribI1uivEXT = load.invoke("glVertexAttribI1uivEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribI2uivEXT = load.invoke("glVertexAttribI2uivEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribI3uivEXT = load.invoke("glVertexAttribI3uivEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribI4uivEXT = load.invoke("glVertexAttribI4uivEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribI4bvEXT = load.invoke("glVertexAttribI4bvEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribI4svEXT = load.invoke("glVertexAttribI4svEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribI4ubvEXT = load.invoke("glVertexAttribI4ubvEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribI4usvEXT = load.invoke("glVertexAttribI4usvEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribIPointerEXT = load.invoke("glVertexAttribIPointerEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVertexAttribIivEXT = load.invoke("glGetVertexAttribIivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVertexAttribIuivEXT = load.invoke("glGetVertexAttribIuivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static void glGetUniformuivEXT(int program, int location, @NativeType("GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetUniformuivEXT).invokeExact(program, location, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glBindFragDataLocationEXT(int program, int color, @NativeType("const GLchar *") MemorySegment name) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindFragDataLocationEXT).invokeExact(program, color, name); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static int glGetFragDataLocationEXT(int program, @NativeType("const GLchar *") MemorySegment name) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glGetFragDataLocationEXT).invokeExact(program, name); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform1uiEXT(int location, int v0) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform1uiEXT).invokeExact(location, v0); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform2uiEXT(int location, int v0, int v1) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform2uiEXT).invokeExact(location, v0, v1); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform3uiEXT(int location, int v0, int v1, int v2) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform3uiEXT).invokeExact(location, v0, v1, v2); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform4uiEXT(int location, int v0, int v1, int v2, int v3) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform4uiEXT).invokeExact(location, v0, v1, v2, v3); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform1uivEXT(int location, int count, @NativeType("const GLuint *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform1uivEXT).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform2uivEXT(int location, int count, @NativeType("const GLuint *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform2uivEXT).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glUniform3uivEXT(int location, int count, @NativeType("const GLuint *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform3uivEXT).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLEXTGpuShader4 { + int GL_SAMPLER_1D_ARRAY_EXT = 0x8DC0; + int GL_SAMPLER_2D_ARRAY_EXT = 0x8DC1; + int GL_SAMPLER_BUFFER_EXT = 0x8DC2; + int GL_SAMPLER_1D_ARRAY_SHADOW_EXT = 0x8DC3; + int GL_SAMPLER_2D_ARRAY_SHADOW_EXT = 0x8DC4; + int GL_SAMPLER_CUBE_SHADOW_EXT = 0x8DC5; + int GL_UNSIGNED_INT_VEC2_EXT = 0x8DC6; + int GL_UNSIGNED_INT_VEC3_EXT = 0x8DC7; + int GL_UNSIGNED_INT_VEC4_EXT = 0x8DC8; + int GL_INT_SAMPLER_1D_EXT = 0x8DC9; + int GL_INT_SAMPLER_2D_EXT = 0x8DCA; + int GL_INT_SAMPLER_3D_EXT = 0x8DCB; + int GL_INT_SAMPLER_CUBE_EXT = 0x8DCC; + int GL_INT_SAMPLER_2D_RECT_EXT = 0x8DCD; + int GL_INT_SAMPLER_1D_ARRAY_EXT = 0x8DCE; + int GL_INT_SAMPLER_2D_ARRAY_EXT = 0x8DCF; + int GL_INT_SAMPLER_BUFFER_EXT = 0x8DD0; + int GL_UNSIGNED_INT_SAMPLER_1D_EXT = 0x8DD1; + int GL_UNSIGNED_INT_SAMPLER_2D_EXT = 0x8DD2; + int GL_UNSIGNED_INT_SAMPLER_3D_EXT = 0x8DD3; + int GL_UNSIGNED_INT_SAMPLER_CUBE_EXT = 0x8DD4; + int GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT = 0x8DD5; + int GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT = 0x8DD6; + int GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT = 0x8DD7; + int GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT = 0x8DD8; + int GL_MIN_PROGRAM_TEXEL_OFFSET_EXT = 0x8904; + int GL_MAX_PROGRAM_TEXEL_OFFSET_EXT = 0x8905; + int GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT = 0x88FD; + + default void glGetUniformuivEXT(int program, int location, @NativeType("GLuint *") MemorySegment params) { + throw new ContextException(); + } + + default void glBindFragDataLocationEXT(int program, int color, @NativeType("const GLchar *") MemorySegment name) { + throw new ContextException(); + } + + default int glGetFragDataLocationEXT(int program, @NativeType("const GLchar *") MemorySegment name) { + throw new ContextException(); + } + + default void glUniform1uiEXT(int location, int v0) { + throw new ContextException(); + } + + default void glUniform2uiEXT(int location, int v0, int v1) { + throw new ContextException(); + } + + default void glUniform3uiEXT(int location, int v0, int v1, int v2) { + throw new ContextException(); + } + + default void glUniform4uiEXT(int location, int v0, int v1, int v2, int v3) { + throw new ContextException(); + } + + default void glUniform1uivEXT(int location, int count, @NativeType("const GLuint *") MemorySegment value) { + throw new ContextException(); + } + + default void glUniform2uivEXT(int location, int count, @NativeType("const GLuint *") MemorySegment value) { + throw new ContextException(); + } + + default void glUniform3uivEXT(int location, int count, @NativeType("const GLuint *") MemorySegment value) { + throw new ContextException(); } - public static void glUniform4uivEXT(int location, int count, @NativeType("const GLuint *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniform4uivEXT).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniform4uivEXT(int location, int count, @NativeType("const GLuint *") MemorySegment value) { + throw new ContextException(); } - public static void glVertexAttribI1iEXT(int index, int x) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribI1iEXT).invokeExact(index, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribI1iEXT(int index, int x) { + throw new ContextException(); } - public static void glVertexAttribI2iEXT(int index, int x, int y) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribI2iEXT).invokeExact(index, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribI2iEXT(int index, int x, int y) { + throw new ContextException(); } - public static void glVertexAttribI3iEXT(int index, int x, int y, int z) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribI3iEXT).invokeExact(index, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribI3iEXT(int index, int x, int y, int z) { + throw new ContextException(); } - public static void glVertexAttribI4iEXT(int index, int x, int y, int z, int w) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribI4iEXT).invokeExact(index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribI4iEXT(int index, int x, int y, int z, int w) { + throw new ContextException(); } - public static void glVertexAttribI1uiEXT(int index, int x) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribI1uiEXT).invokeExact(index, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribI1uiEXT(int index, int x) { + throw new ContextException(); } - public static void glVertexAttribI2uiEXT(int index, int x, int y) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribI2uiEXT).invokeExact(index, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribI2uiEXT(int index, int x, int y) { + throw new ContextException(); } - public static void glVertexAttribI3uiEXT(int index, int x, int y, int z) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribI3uiEXT).invokeExact(index, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribI3uiEXT(int index, int x, int y, int z) { + throw new ContextException(); } - public static void glVertexAttribI4uiEXT(int index, int x, int y, int z, int w) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribI4uiEXT).invokeExact(index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribI4uiEXT(int index, int x, int y, int z, int w) { + throw new ContextException(); } - public static void glVertexAttribI1ivEXT(int index, @NativeType("const GLint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribI1ivEXT).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribI1ivEXT(int index, @NativeType("const GLint *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribI2ivEXT(int index, @NativeType("const GLint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribI2ivEXT).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribI2ivEXT(int index, @NativeType("const GLint *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribI3ivEXT(int index, @NativeType("const GLint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribI3ivEXT).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribI3ivEXT(int index, @NativeType("const GLint *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribI4ivEXT(int index, @NativeType("const GLint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribI4ivEXT).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribI4ivEXT(int index, @NativeType("const GLint *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribI1uivEXT(int index, @NativeType("const GLuint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribI1uivEXT).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribI1uivEXT(int index, @NativeType("const GLuint *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribI2uivEXT(int index, @NativeType("const GLuint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribI2uivEXT).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribI2uivEXT(int index, @NativeType("const GLuint *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribI3uivEXT(int index, @NativeType("const GLuint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribI3uivEXT).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribI3uivEXT(int index, @NativeType("const GLuint *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribI4uivEXT(int index, @NativeType("const GLuint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribI4uivEXT).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribI4uivEXT(int index, @NativeType("const GLuint *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribI4bvEXT(int index, @NativeType("const GLbyte *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribI4bvEXT).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribI4bvEXT(int index, @NativeType("const GLbyte *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribI4svEXT(int index, @NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribI4svEXT).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribI4svEXT(int index, @NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribI4ubvEXT(int index, @NativeType("const GLubyte *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribI4ubvEXT).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribI4ubvEXT(int index, @NativeType("const GLubyte *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribI4usvEXT(int index, @NativeType("const GLushort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribI4usvEXT).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribI4usvEXT(int index, @NativeType("const GLushort *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribIPointerEXT(int index, int size, int type, int stride, @NativeType("const void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribIPointerEXT).invokeExact(index, size, type, stride, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribIPointerEXT(int index, int size, int type, int stride, @NativeType("const void *") MemorySegment pointer) { + throw new ContextException(); } - public static void glGetVertexAttribIivEXT(int index, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVertexAttribIivEXT).invokeExact(index, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVertexAttribIivEXT(int index, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetVertexAttribIuivEXT(int index, int pname, @NativeType("GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVertexAttribIuivEXT).invokeExact(index, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVertexAttribIuivEXT(int index, int pname, @NativeType("GLuint *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTHistogram.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTHistogram.java index a3ae7104..37785031 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTHistogram.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTHistogram.java @@ -16,114 +16,67 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_histogram} */ -public final class GLEXTHistogram { - public static final int GL_HISTOGRAM_EXT = 0x8024; - public static final int GL_PROXY_HISTOGRAM_EXT = 0x8025; - public static final int GL_HISTOGRAM_WIDTH_EXT = 0x8026; - public static final int GL_HISTOGRAM_FORMAT_EXT = 0x8027; - public static final int GL_HISTOGRAM_RED_SIZE_EXT = 0x8028; - public static final int GL_HISTOGRAM_GREEN_SIZE_EXT = 0x8029; - public static final int GL_HISTOGRAM_BLUE_SIZE_EXT = 0x802A; - public static final int GL_HISTOGRAM_ALPHA_SIZE_EXT = 0x802B; - public static final int GL_HISTOGRAM_LUMINANCE_SIZE_EXT = 0x802C; - public static final int GL_HISTOGRAM_SINK_EXT = 0x802D; - public static final int GL_MINMAX_EXT = 0x802E; - public static final int GL_MINMAX_FORMAT_EXT = 0x802F; - public static final int GL_MINMAX_SINK_EXT = 0x8030; - public static final int GL_TABLE_TOO_LARGE_EXT = 0x8031; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_histogram) return; - ext.glGetHistogramEXT = load.invoke("glGetHistogramEXT", ofVoid(JAVA_INT, JAVA_BYTE, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetHistogramParameterfvEXT = load.invoke("glGetHistogramParameterfvEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetHistogramParameterivEXT = load.invoke("glGetHistogramParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMinmaxEXT = load.invoke("glGetMinmaxEXT", ofVoid(JAVA_INT, JAVA_BYTE, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMinmaxParameterfvEXT = load.invoke("glGetMinmaxParameterfvEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMinmaxParameterivEXT = load.invoke("glGetMinmaxParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glHistogramEXT = load.invoke("glHistogramEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE)); - ext.glMinmaxEXT = load.invoke("glMinmaxEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_BYTE)); - ext.glResetHistogramEXT = load.invoke("glResetHistogramEXT", ofVoid(JAVA_INT)); - ext.glResetMinmaxEXT = load.invoke("glResetMinmaxEXT", ofVoid(JAVA_INT)); - } +public interface GLEXTHistogram { + int GL_HISTOGRAM_EXT = 0x8024; + int GL_PROXY_HISTOGRAM_EXT = 0x8025; + int GL_HISTOGRAM_WIDTH_EXT = 0x8026; + int GL_HISTOGRAM_FORMAT_EXT = 0x8027; + int GL_HISTOGRAM_RED_SIZE_EXT = 0x8028; + int GL_HISTOGRAM_GREEN_SIZE_EXT = 0x8029; + int GL_HISTOGRAM_BLUE_SIZE_EXT = 0x802A; + int GL_HISTOGRAM_ALPHA_SIZE_EXT = 0x802B; + int GL_HISTOGRAM_LUMINANCE_SIZE_EXT = 0x802C; + int GL_HISTOGRAM_SINK_EXT = 0x802D; + int GL_MINMAX_EXT = 0x802E; + int GL_MINMAX_FORMAT_EXT = 0x802F; + int GL_MINMAX_SINK_EXT = 0x8030; + int GL_TABLE_TOO_LARGE_EXT = 0x8031; - public static void glGetHistogramEXT(int target, boolean reset, int format, int type, @NativeType("void *") MemorySegment values) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetHistogramEXT).invokeExact(target, reset, format, type, values); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetHistogramEXT(int target, boolean reset, int format, int type, @NativeType("void *") MemorySegment values) { + throw new ContextException(); } - public static void glGetHistogramParameterfvEXT(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetHistogramParameterfvEXT).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetHistogramParameterfvEXT(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetHistogramParameterivEXT(int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetHistogramParameterivEXT).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetHistogramParameterivEXT(int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetMinmaxEXT(int target, boolean reset, int format, int type, @NativeType("void *") MemorySegment values) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMinmaxEXT).invokeExact(target, reset, format, type, values); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMinmaxEXT(int target, boolean reset, int format, int type, @NativeType("void *") MemorySegment values) { + throw new ContextException(); } - public static void glGetMinmaxParameterfvEXT(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMinmaxParameterfvEXT).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMinmaxParameterfvEXT(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetMinmaxParameterivEXT(int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMinmaxParameterivEXT).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMinmaxParameterivEXT(int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glHistogramEXT(int target, int width, int internalformat, boolean sink) { - final var ext = getExtCapabilities(); - try { - check(ext.glHistogramEXT).invokeExact(target, width, internalformat, sink); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glHistogramEXT(int target, int width, int internalformat, boolean sink) { + throw new ContextException(); } - public static void glMinmaxEXT(int target, int internalformat, boolean sink) { - final var ext = getExtCapabilities(); - try { - check(ext.glMinmaxEXT).invokeExact(target, internalformat, sink); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMinmaxEXT(int target, int internalformat, boolean sink) { + throw new ContextException(); } - public static void glResetHistogramEXT(int target) { - final var ext = getExtCapabilities(); - try { - check(ext.glResetHistogramEXT).invokeExact(target); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glResetHistogramEXT(int target) { + throw new ContextException(); } - public static void glResetMinmaxEXT(int target) { - final var ext = getExtCapabilities(); - try { - check(ext.glResetMinmaxEXT).invokeExact(target); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glResetMinmaxEXT(int target) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTIndexArrayFormats.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTIndexArrayFormats.java index b2141943..73be6aef 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTIndexArrayFormats.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTIndexArrayFormats.java @@ -16,24 +16,20 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_index_array_formats} */ -public final class GLEXTIndexArrayFormats { - public static final int GL_IUI_V2F_EXT = 0x81AD; - public static final int GL_IUI_V3F_EXT = 0x81AE; - public static final int GL_IUI_N3F_V2F_EXT = 0x81AF; - public static final int GL_IUI_N3F_V3F_EXT = 0x81B0; - public static final int GL_T2F_IUI_V2F_EXT = 0x81B1; - public static final int GL_T2F_IUI_V3F_EXT = 0x81B2; - public static final int GL_T2F_IUI_N3F_V2F_EXT = 0x81B3; - public static final int GL_T2F_IUI_N3F_V3F_EXT = 0x81B4; +public interface GLEXTIndexArrayFormats { + int GL_IUI_V2F_EXT = 0x81AD; + int GL_IUI_V3F_EXT = 0x81AE; + int GL_IUI_N3F_V2F_EXT = 0x81AF; + int GL_IUI_N3F_V3F_EXT = 0x81B0; + int GL_T2F_IUI_V2F_EXT = 0x81B1; + int GL_T2F_IUI_V3F_EXT = 0x81B2; + int GL_T2F_IUI_N3F_V2F_EXT = 0x81B3; + int GL_T2F_IUI_N3F_V3F_EXT = 0x81B4; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTIndexFunc.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTIndexFunc.java index 36239c4e..ed89902e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTIndexFunc.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTIndexFunc.java @@ -16,31 +16,20 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_index_func} */ -public final class GLEXTIndexFunc { - public static final int GL_INDEX_TEST_EXT = 0x81B5; - public static final int GL_INDEX_TEST_FUNC_EXT = 0x81B6; - public static final int GL_INDEX_TEST_REF_EXT = 0x81B7; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_index_func) return; - ext.glIndexFuncEXT = load.invoke("glIndexFuncEXT", ofVoid(JAVA_INT, JAVA_FLOAT)); - } +public interface GLEXTIndexFunc { + int GL_INDEX_TEST_EXT = 0x81B5; + int GL_INDEX_TEST_FUNC_EXT = 0x81B6; + int GL_INDEX_TEST_REF_EXT = 0x81B7; - public static void glIndexFuncEXT(int func, float ref) { - final var ext = getExtCapabilities(); - try { - check(ext.glIndexFuncEXT).invokeExact(func, ref); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glIndexFuncEXT(int func, float ref) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTIndexMaterial.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTIndexMaterial.java index 12351e30..629c7f1e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTIndexMaterial.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTIndexMaterial.java @@ -16,31 +16,20 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_index_material} */ -public final class GLEXTIndexMaterial { - public static final int GL_INDEX_MATERIAL_EXT = 0x81B8; - public static final int GL_INDEX_MATERIAL_PARAMETER_EXT = 0x81B9; - public static final int GL_INDEX_MATERIAL_FACE_EXT = 0x81BA; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_index_material) return; - ext.glIndexMaterialEXT = load.invoke("glIndexMaterialEXT", ofVoid(JAVA_INT, JAVA_INT)); - } +public interface GLEXTIndexMaterial { + int GL_INDEX_MATERIAL_EXT = 0x81B8; + int GL_INDEX_MATERIAL_PARAMETER_EXT = 0x81B9; + int GL_INDEX_MATERIAL_FACE_EXT = 0x81BA; - public static void glIndexMaterialEXT(int face, int mode) { - final var ext = getExtCapabilities(); - try { - check(ext.glIndexMaterialEXT).invokeExact(face, mode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glIndexMaterialEXT(int face, int mode) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTLightTexture.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTLightTexture.java index 290a3618..8c5206a4 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTLightTexture.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTLightTexture.java @@ -16,53 +16,34 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_light_texture} */ -public final class GLEXTLightTexture { - public static final int GL_FRAGMENT_MATERIAL_EXT = 0x8349; - public static final int GL_FRAGMENT_NORMAL_EXT = 0x834A; - public static final int GL_FRAGMENT_COLOR_EXT = 0x834C; - public static final int GL_ATTENUATION_EXT = 0x834D; - public static final int GL_SHADOW_ATTENUATION_EXT = 0x834E; - public static final int GL_TEXTURE_APPLICATION_MODE_EXT = 0x834F; - public static final int GL_TEXTURE_LIGHT_EXT = 0x8350; - public static final int GL_TEXTURE_MATERIAL_FACE_EXT = 0x8351; - public static final int GL_TEXTURE_MATERIAL_PARAMETER_EXT = 0x8352; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_light_texture) return; - ext.glApplyTextureEXT = load.invoke("glApplyTextureEXT", ofVoid(JAVA_INT)); - ext.glTextureLightEXT = load.invoke("glTextureLightEXT", ofVoid(JAVA_INT)); - ext.glTextureMaterialEXT = load.invoke("glTextureMaterialEXT", ofVoid(JAVA_INT, JAVA_INT)); - } +public interface GLEXTLightTexture { + int GL_FRAGMENT_MATERIAL_EXT = 0x8349; + int GL_FRAGMENT_NORMAL_EXT = 0x834A; + int GL_FRAGMENT_COLOR_EXT = 0x834C; + int GL_ATTENUATION_EXT = 0x834D; + int GL_SHADOW_ATTENUATION_EXT = 0x834E; + int GL_TEXTURE_APPLICATION_MODE_EXT = 0x834F; + int GL_TEXTURE_LIGHT_EXT = 0x8350; + int GL_TEXTURE_MATERIAL_FACE_EXT = 0x8351; + int GL_TEXTURE_MATERIAL_PARAMETER_EXT = 0x8352; - public static void glApplyTextureEXT(int mode) { - final var ext = getExtCapabilities(); - try { - check(ext.glApplyTextureEXT).invokeExact(mode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glApplyTextureEXT(int mode) { + throw new ContextException(); } - public static void glTextureLightEXT(int pname) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureLightEXT).invokeExact(pname); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureLightEXT(int pname) { + throw new ContextException(); } - public static void glTextureMaterialEXT(int face, int mode) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureMaterialEXT).invokeExact(face, mode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureMaterialEXT(int face, int mode) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTMemoryObject.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTMemoryObject.java index 1063fc39..5cefb7ca 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTMemoryObject.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTMemoryObject.java @@ -16,184 +16,100 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_memory_object} */ -public final class GLEXTMemoryObject { - public static final int GL_TEXTURE_TILING_EXT = 0x9580; - public static final int GL_DEDICATED_MEMORY_OBJECT_EXT = 0x9581; - public static final int GL_PROTECTED_MEMORY_OBJECT_EXT = 0x959B; - public static final int GL_NUM_TILING_TYPES_EXT = 0x9582; - public static final int GL_TILING_TYPES_EXT = 0x9583; - public static final int GL_OPTIMAL_TILING_EXT = 0x9584; - public static final int GL_LINEAR_TILING_EXT = 0x9585; - public static final int GL_NUM_DEVICE_UUIDS_EXT = 0x9596; - public static final int GL_DEVICE_UUID_EXT = 0x9597; - public static final int GL_DRIVER_UUID_EXT = 0x9598; - public static final int GL_UUID_SIZE_EXT = 16; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_memory_object) return; - ext.glGetUnsignedBytevEXT = load.invoke("glGetUnsignedBytevEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glGetUnsignedBytei_vEXT = load.invoke("glGetUnsignedBytei_vEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glDeleteMemoryObjectsEXT = load.invoke("glDeleteMemoryObjectsEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glIsMemoryObjectEXT = load.invoke("glIsMemoryObjectEXT", of(JAVA_BYTE, JAVA_INT)); - ext.glCreateMemoryObjectsEXT = load.invoke("glCreateMemoryObjectsEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glMemoryObjectParameterivEXT = load.invoke("glMemoryObjectParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMemoryObjectParameterivEXT = load.invoke("glGetMemoryObjectParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glTexStorageMem2DEXT = load.invoke("glTexStorageMem2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glTexStorageMem2DMultisampleEXT = load.invoke("glTexStorageMem2DMultisampleEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, JAVA_INT, JAVA_LONG)); - ext.glTexStorageMem3DEXT = load.invoke("glTexStorageMem3DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glTexStorageMem3DMultisampleEXT = load.invoke("glTexStorageMem3DMultisampleEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, JAVA_INT, JAVA_LONG)); - ext.glBufferStorageMemEXT = load.invoke("glBufferStorageMemEXT", ofVoid(JAVA_INT, JAVA_LONG, JAVA_INT, JAVA_LONG)); - ext.glTextureStorageMem2DEXT = load.invoke("glTextureStorageMem2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glTextureStorageMem2DMultisampleEXT = load.invoke("glTextureStorageMem2DMultisampleEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, JAVA_INT, JAVA_LONG)); - ext.glTextureStorageMem3DEXT = load.invoke("glTextureStorageMem3DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glTextureStorageMem3DMultisampleEXT = load.invoke("glTextureStorageMem3DMultisampleEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, JAVA_INT, JAVA_LONG)); - ext.glNamedBufferStorageMemEXT = load.invoke("glNamedBufferStorageMemEXT", ofVoid(JAVA_INT, JAVA_LONG, JAVA_INT, JAVA_LONG)); - ext.glTexStorageMem1DEXT = load.invoke("glTexStorageMem1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glTextureStorageMem1DEXT = load.invoke("glTextureStorageMem1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG)); - } - - public static void glGetUnsignedBytevEXT(int pname, @NativeType("GLubyte *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetUnsignedBytevEXT).invokeExact(pname, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glGetUnsignedBytei_vEXT(int target, int index, @NativeType("GLubyte *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetUnsignedBytei_vEXT).invokeExact(target, index, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glDeleteMemoryObjectsEXT(int n, @NativeType("const GLuint *") MemorySegment memoryObjects) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteMemoryObjectsEXT).invokeExact(n, memoryObjects); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static boolean glIsMemoryObjectEXT(int memoryObject) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsMemoryObjectEXT).invokeExact(memoryObject); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glCreateMemoryObjectsEXT(int n, @NativeType("GLuint *") MemorySegment memoryObjects) { - final var ext = getExtCapabilities(); - try { - check(ext.glCreateMemoryObjectsEXT).invokeExact(n, memoryObjects); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMemoryObjectParameterivEXT(int memoryObject, int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glMemoryObjectParameterivEXT).invokeExact(memoryObject, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glGetMemoryObjectParameterivEXT(int memoryObject, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMemoryObjectParameterivEXT).invokeExact(memoryObject, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glTexStorageMem2DEXT(int target, int levels, int internalFormat, int width, int height, int memory, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexStorageMem2DEXT).invokeExact(target, levels, internalFormat, width, height, memory, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glTexStorageMem2DMultisampleEXT(int target, int samples, int internalFormat, int width, int height, boolean fixedSampleLocations, int memory, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexStorageMem2DMultisampleEXT).invokeExact(target, samples, internalFormat, width, height, fixedSampleLocations, memory, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glTexStorageMem3DEXT(int target, int levels, int internalFormat, int width, int height, int depth, int memory, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexStorageMem3DEXT).invokeExact(target, levels, internalFormat, width, height, depth, memory, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glTexStorageMem3DMultisampleEXT(int target, int samples, int internalFormat, int width, int height, int depth, boolean fixedSampleLocations, int memory, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexStorageMem3DMultisampleEXT).invokeExact(target, samples, internalFormat, width, height, depth, fixedSampleLocations, memory, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } +public interface GLEXTMemoryObject { + int GL_TEXTURE_TILING_EXT = 0x9580; + int GL_DEDICATED_MEMORY_OBJECT_EXT = 0x9581; + int GL_PROTECTED_MEMORY_OBJECT_EXT = 0x959B; + int GL_NUM_TILING_TYPES_EXT = 0x9582; + int GL_TILING_TYPES_EXT = 0x9583; + int GL_OPTIMAL_TILING_EXT = 0x9584; + int GL_LINEAR_TILING_EXT = 0x9585; + int GL_NUM_DEVICE_UUIDS_EXT = 0x9596; + int GL_DEVICE_UUID_EXT = 0x9597; + int GL_DRIVER_UUID_EXT = 0x9598; + int GL_UUID_SIZE_EXT = 16; + + default void glGetUnsignedBytevEXT(int pname, @NativeType("GLubyte *") MemorySegment data) { + throw new ContextException(); + } + + default void glGetUnsignedBytei_vEXT(int target, int index, @NativeType("GLubyte *") MemorySegment data) { + throw new ContextException(); + } + + default void glDeleteMemoryObjectsEXT(int n, @NativeType("const GLuint *") MemorySegment memoryObjects) { + throw new ContextException(); + } + + default boolean glIsMemoryObjectEXT(int memoryObject) { + throw new ContextException(); + } + + default void glCreateMemoryObjectsEXT(int n, @NativeType("GLuint *") MemorySegment memoryObjects) { + throw new ContextException(); + } + + default void glMemoryObjectParameterivEXT(int memoryObject, int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); + } + + default void glGetMemoryObjectParameterivEXT(int memoryObject, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); + } + + default void glTexStorageMem2DEXT(int target, int levels, int internalFormat, int width, int height, int memory, long offset) { + throw new ContextException(); + } + + default void glTexStorageMem2DMultisampleEXT(int target, int samples, int internalFormat, int width, int height, boolean fixedSampleLocations, int memory, long offset) { + throw new ContextException(); + } + + default void glTexStorageMem3DEXT(int target, int levels, int internalFormat, int width, int height, int depth, int memory, long offset) { + throw new ContextException(); + } + + default void glTexStorageMem3DMultisampleEXT(int target, int samples, int internalFormat, int width, int height, int depth, boolean fixedSampleLocations, int memory, long offset) { + throw new ContextException(); + } - public static void glBufferStorageMemEXT(int target, long size, int memory, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glBufferStorageMemEXT).invokeExact(target, size, memory, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBufferStorageMemEXT(int target, long size, int memory, long offset) { + throw new ContextException(); } - public static void glTextureStorageMem2DEXT(int texture, int levels, int internalFormat, int width, int height, int memory, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureStorageMem2DEXT).invokeExact(texture, levels, internalFormat, width, height, memory, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureStorageMem2DEXT(int texture, int levels, int internalFormat, int width, int height, int memory, long offset) { + throw new ContextException(); } - public static void glTextureStorageMem2DMultisampleEXT(int texture, int samples, int internalFormat, int width, int height, boolean fixedSampleLocations, int memory, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureStorageMem2DMultisampleEXT).invokeExact(texture, samples, internalFormat, width, height, fixedSampleLocations, memory, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureStorageMem2DMultisampleEXT(int texture, int samples, int internalFormat, int width, int height, boolean fixedSampleLocations, int memory, long offset) { + throw new ContextException(); } - public static void glTextureStorageMem3DEXT(int texture, int levels, int internalFormat, int width, int height, int depth, int memory, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureStorageMem3DEXT).invokeExact(texture, levels, internalFormat, width, height, depth, memory, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureStorageMem3DEXT(int texture, int levels, int internalFormat, int width, int height, int depth, int memory, long offset) { + throw new ContextException(); } - public static void glTextureStorageMem3DMultisampleEXT(int texture, int samples, int internalFormat, int width, int height, int depth, boolean fixedSampleLocations, int memory, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureStorageMem3DMultisampleEXT).invokeExact(texture, samples, internalFormat, width, height, depth, fixedSampleLocations, memory, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureStorageMem3DMultisampleEXT(int texture, int samples, int internalFormat, int width, int height, int depth, boolean fixedSampleLocations, int memory, long offset) { + throw new ContextException(); } - public static void glNamedBufferStorageMemEXT(int buffer, long size, int memory, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedBufferStorageMemEXT).invokeExact(buffer, size, memory, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedBufferStorageMemEXT(int buffer, long size, int memory, long offset) { + throw new ContextException(); } - public static void glTexStorageMem1DEXT(int target, int levels, int internalFormat, int width, int memory, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexStorageMem1DEXT).invokeExact(target, levels, internalFormat, width, memory, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexStorageMem1DEXT(int target, int levels, int internalFormat, int width, int memory, long offset) { + throw new ContextException(); } - public static void glTextureStorageMem1DEXT(int texture, int levels, int internalFormat, int width, int memory, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureStorageMem1DEXT).invokeExact(texture, levels, internalFormat, width, memory, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureStorageMem1DEXT(int texture, int levels, int internalFormat, int width, int memory, long offset) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTMemoryObjectFd.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTMemoryObjectFd.java index 0c70e4f1..d61430c8 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTMemoryObjectFd.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTMemoryObjectFd.java @@ -16,29 +16,18 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_memory_object_fd} */ -public final class GLEXTMemoryObjectFd { - public static final int GL_HANDLE_TYPE_OPAQUE_FD_EXT = 0x9586; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_memory_object_fd) return; - ext.glImportMemoryFdEXT = load.invoke("glImportMemoryFdEXT", ofVoid(JAVA_INT, JAVA_LONG, JAVA_INT, JAVA_INT)); - } +public interface GLEXTMemoryObjectFd { + int GL_HANDLE_TYPE_OPAQUE_FD_EXT = 0x9586; - public static void glImportMemoryFdEXT(int memory, long size, int handleType, int fd) { - final var ext = getExtCapabilities(); - try { - check(ext.glImportMemoryFdEXT).invokeExact(memory, size, handleType, fd); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glImportMemoryFdEXT(int memory, long size, int handleType, int fd) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTMemoryObjectWin32.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTMemoryObjectWin32.java index 1f3c4110..4a55e0ba 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTMemoryObjectWin32.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTMemoryObjectWin32.java @@ -16,45 +16,30 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_memory_object_win32} */ -public final class GLEXTMemoryObjectWin32 { - public static final int GL_HANDLE_TYPE_OPAQUE_WIN32_EXT = 0x9587; - public static final int GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT = 0x9588; - public static final int GL_DEVICE_LUID_EXT = 0x9599; - public static final int GL_DEVICE_NODE_MASK_EXT = 0x959A; - public static final int GL_LUID_SIZE_EXT = 8; - public static final int GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT = 0x9589; - public static final int GL_HANDLE_TYPE_D3D12_RESOURCE_EXT = 0x958A; - public static final int GL_HANDLE_TYPE_D3D11_IMAGE_EXT = 0x958B; - public static final int GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT = 0x958C; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_memory_object_win32) return; - ext.glImportMemoryWin32HandleEXT = load.invoke("glImportMemoryWin32HandleEXT", ofVoid(JAVA_INT, JAVA_LONG, JAVA_INT, ADDRESS)); - ext.glImportMemoryWin32NameEXT = load.invoke("glImportMemoryWin32NameEXT", ofVoid(JAVA_INT, JAVA_LONG, JAVA_INT, ADDRESS)); - } +public interface GLEXTMemoryObjectWin32 { + int GL_HANDLE_TYPE_OPAQUE_WIN32_EXT = 0x9587; + int GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT = 0x9588; + int GL_DEVICE_LUID_EXT = 0x9599; + int GL_DEVICE_NODE_MASK_EXT = 0x959A; + int GL_LUID_SIZE_EXT = 8; + int GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT = 0x9589; + int GL_HANDLE_TYPE_D3D12_RESOURCE_EXT = 0x958A; + int GL_HANDLE_TYPE_D3D11_IMAGE_EXT = 0x958B; + int GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT = 0x958C; - public static void glImportMemoryWin32HandleEXT(int memory, long size, int handleType, @NativeType("void *") MemorySegment handle) { - final var ext = getExtCapabilities(); - try { - check(ext.glImportMemoryWin32HandleEXT).invokeExact(memory, size, handleType, handle); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glImportMemoryWin32HandleEXT(int memory, long size, int handleType, @NativeType("void *") MemorySegment handle) { + throw new ContextException(); } - public static void glImportMemoryWin32NameEXT(int memory, long size, int handleType, @NativeType("const void *") MemorySegment name) { - final var ext = getExtCapabilities(); - try { - check(ext.glImportMemoryWin32NameEXT).invokeExact(memory, size, handleType, name); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glImportMemoryWin32NameEXT(int memory, long size, int handleType, @NativeType("const void *") MemorySegment name) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTMultiDrawArrays.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTMultiDrawArrays.java index 3989033f..15d7b0fc 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTMultiDrawArrays.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTMultiDrawArrays.java @@ -16,36 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_multi_draw_arrays} */ -public final class GLEXTMultiDrawArrays { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_multi_draw_arrays) return; - ext.glMultiDrawArraysEXT = load.invoke("glMultiDrawArraysEXT", ofVoid(JAVA_INT, ADDRESS, ADDRESS, JAVA_INT)); - ext.glMultiDrawElementsEXT = load.invoke("glMultiDrawElementsEXT", ofVoid(JAVA_INT, ADDRESS, JAVA_INT, ADDRESS, JAVA_INT)); - } +public interface GLEXTMultiDrawArrays { - public static void glMultiDrawArraysEXT(int mode, @NativeType("const GLint *") MemorySegment first, @NativeType("const GLsizei *") MemorySegment count, int primcount) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiDrawArraysEXT).invokeExact(mode, first, count, primcount); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiDrawArraysEXT(int mode, @NativeType("const GLint *") MemorySegment first, @NativeType("const GLsizei *") MemorySegment count, int primcount) { + throw new ContextException(); } - public static void glMultiDrawElementsEXT(int mode, @NativeType("const GLsizei *") MemorySegment count, int type, @NativeType("const void *const*") MemorySegment indices, int primcount) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiDrawElementsEXT).invokeExact(mode, count, type, indices, primcount); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiDrawElementsEXT(int mode, @NativeType("const GLsizei *") MemorySegment count, int type, @NativeType("const void *const*") MemorySegment indices, int primcount) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTMultisample.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTMultisample.java index 6523fbd9..0b960d2c 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTMultisample.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTMultisample.java @@ -16,53 +16,38 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_multisample} */ -public final class GLEXTMultisample { - public static final int GL_MULTISAMPLE_EXT = 0x809D; - public static final int GL_SAMPLE_ALPHA_TO_MASK_EXT = 0x809E; - public static final int GL_SAMPLE_ALPHA_TO_ONE_EXT = 0x809F; - public static final int GL_SAMPLE_MASK_EXT = 0x80A0; - public static final int GL_1PASS_EXT = 0x80A1; - public static final int GL_2PASS_0_EXT = 0x80A2; - public static final int GL_2PASS_1_EXT = 0x80A3; - public static final int GL_4PASS_0_EXT = 0x80A4; - public static final int GL_4PASS_1_EXT = 0x80A5; - public static final int GL_4PASS_2_EXT = 0x80A6; - public static final int GL_4PASS_3_EXT = 0x80A7; - public static final int GL_SAMPLE_BUFFERS_EXT = 0x80A8; - public static final int GL_SAMPLES_EXT = 0x80A9; - public static final int GL_SAMPLE_MASK_VALUE_EXT = 0x80AA; - public static final int GL_SAMPLE_MASK_INVERT_EXT = 0x80AB; - public static final int GL_SAMPLE_PATTERN_EXT = 0x80AC; - public static final int GL_MULTISAMPLE_BIT_EXT = 0x20000000; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_multisample) return; - ext.glSampleMaskEXT = load.invoke("glSampleMaskEXT", ofVoid(JAVA_FLOAT, JAVA_BYTE)); - ext.glSamplePatternEXT = load.invoke("glSamplePatternEXT", ofVoid(JAVA_INT)); - } +public interface GLEXTMultisample { + int GL_MULTISAMPLE_EXT = 0x809D; + int GL_SAMPLE_ALPHA_TO_MASK_EXT = 0x809E; + int GL_SAMPLE_ALPHA_TO_ONE_EXT = 0x809F; + int GL_SAMPLE_MASK_EXT = 0x80A0; + int GL_1PASS_EXT = 0x80A1; + int GL_2PASS_0_EXT = 0x80A2; + int GL_2PASS_1_EXT = 0x80A3; + int GL_4PASS_0_EXT = 0x80A4; + int GL_4PASS_1_EXT = 0x80A5; + int GL_4PASS_2_EXT = 0x80A6; + int GL_4PASS_3_EXT = 0x80A7; + int GL_SAMPLE_BUFFERS_EXT = 0x80A8; + int GL_SAMPLES_EXT = 0x80A9; + int GL_SAMPLE_MASK_VALUE_EXT = 0x80AA; + int GL_SAMPLE_MASK_INVERT_EXT = 0x80AB; + int GL_SAMPLE_PATTERN_EXT = 0x80AC; + int GL_MULTISAMPLE_BIT_EXT = 0x20000000; - public static void glSampleMaskEXT(float value, boolean invert) { - final var ext = getExtCapabilities(); - try { - check(ext.glSampleMaskEXT).invokeExact(value, invert); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSampleMaskEXT(float value, boolean invert) { + throw new ContextException(); } - public static void glSamplePatternEXT(int pattern) { - final var ext = getExtCapabilities(); - try { - check(ext.glSamplePatternEXT).invokeExact(pattern); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSamplePatternEXT(int pattern) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPackedDepthStencil.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPackedDepthStencil.java index d9499cff..8589c8f3 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPackedDepthStencil.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPackedDepthStencil.java @@ -16,20 +16,16 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_packed_depth_stencil} */ -public final class GLEXTPackedDepthStencil { - public static final int GL_DEPTH_STENCIL_EXT = 0x84F9; - public static final int GL_UNSIGNED_INT_24_8_EXT = 0x84FA; - public static final int GL_DEPTH24_STENCIL8_EXT = 0x88F0; - public static final int GL_TEXTURE_STENCIL_SIZE_EXT = 0x88F1; +public interface GLEXTPackedDepthStencil { + int GL_DEPTH_STENCIL_EXT = 0x84F9; + int GL_UNSIGNED_INT_24_8_EXT = 0x84FA; + int GL_DEPTH24_STENCIL8_EXT = 0x88F0; + int GL_TEXTURE_STENCIL_SIZE_EXT = 0x88F1; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPackedFloat.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPackedFloat.java index c9424fc7..45236fd5 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPackedFloat.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPackedFloat.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_packed_float} */ -public final class GLEXTPackedFloat { - public static final int GL_R11F_G11F_B10F_EXT = 0x8C3A; - public static final int GL_UNSIGNED_INT_10F_11F_11F_REV_EXT = 0x8C3B; - public static final int GL_RGBA_SIGNED_COMPONENTS_EXT = 0x8C3C; +public interface GLEXTPackedFloat { + int GL_R11F_G11F_B10F_EXT = 0x8C3A; + int GL_UNSIGNED_INT_10F_11F_11F_REV_EXT = 0x8C3B; + int GL_RGBA_SIGNED_COMPONENTS_EXT = 0x8C3C; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPackedPixels.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPackedPixels.java index b8a22606..eef6ed88 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPackedPixels.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPackedPixels.java @@ -16,21 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_packed_pixels} */ -public final class GLEXTPackedPixels { - public static final int GL_UNSIGNED_BYTE_3_3_2_EXT = 0x8032; - public static final int GL_UNSIGNED_SHORT_4_4_4_4_EXT = 0x8033; - public static final int GL_UNSIGNED_SHORT_5_5_5_1_EXT = 0x8034; - public static final int GL_UNSIGNED_INT_8_8_8_8_EXT = 0x8035; - public static final int GL_UNSIGNED_INT_10_10_10_2_EXT = 0x8036; +public interface GLEXTPackedPixels { + int GL_UNSIGNED_BYTE_3_3_2_EXT = 0x8032; + int GL_UNSIGNED_SHORT_4_4_4_4_EXT = 0x8033; + int GL_UNSIGNED_SHORT_5_5_5_1_EXT = 0x8034; + int GL_UNSIGNED_INT_8_8_8_8_EXT = 0x8035; + int GL_UNSIGNED_INT_10_10_10_2_EXT = 0x8036; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPalettedTexture.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPalettedTexture.java index 8efe224e..a4dd8df4 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPalettedTexture.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPalettedTexture.java @@ -16,59 +16,36 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_paletted_texture} */ -public final class GLEXTPalettedTexture { - public static final int GL_COLOR_INDEX1_EXT = 0x80E2; - public static final int GL_COLOR_INDEX2_EXT = 0x80E3; - public static final int GL_COLOR_INDEX4_EXT = 0x80E4; - public static final int GL_COLOR_INDEX8_EXT = 0x80E5; - public static final int GL_COLOR_INDEX12_EXT = 0x80E6; - public static final int GL_COLOR_INDEX16_EXT = 0x80E7; - public static final int GL_TEXTURE_INDEX_SIZE_EXT = 0x80ED; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_paletted_texture) return; - ext.glColorTableEXT = load.invoke("glColorTableEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetColorTableEXT = load.invoke("glGetColorTableEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetColorTableParameterivEXT = load.invoke("glGetColorTableParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetColorTableParameterfvEXT = load.invoke("glGetColorTableParameterfvEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static void glColorTableEXT(int target, int internalFormat, int width, int format, int type, @NativeType("const void *") MemorySegment table) { - final var ext = getExtCapabilities(); - try { - check(ext.glColorTableEXT).invokeExact(target, internalFormat, width, format, type, table); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLEXTPalettedTexture { + int GL_COLOR_INDEX1_EXT = 0x80E2; + int GL_COLOR_INDEX2_EXT = 0x80E3; + int GL_COLOR_INDEX4_EXT = 0x80E4; + int GL_COLOR_INDEX8_EXT = 0x80E5; + int GL_COLOR_INDEX12_EXT = 0x80E6; + int GL_COLOR_INDEX16_EXT = 0x80E7; + int GL_TEXTURE_INDEX_SIZE_EXT = 0x80ED; + + default void glColorTableEXT(int target, int internalFormat, int width, int format, int type, @NativeType("const void *") MemorySegment table) { + throw new ContextException(); } - public static void glGetColorTableEXT(int target, int format, int type, @NativeType("void *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetColorTableEXT).invokeExact(target, format, type, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetColorTableEXT(int target, int format, int type, @NativeType("void *") MemorySegment data) { + throw new ContextException(); } - public static void glGetColorTableParameterivEXT(int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetColorTableParameterivEXT).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetColorTableParameterivEXT(int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetColorTableParameterfvEXT(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetColorTableParameterfvEXT).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetColorTableParameterfvEXT(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPixelBufferObject.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPixelBufferObject.java index 1652e0e4..e8d90fab 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPixelBufferObject.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPixelBufferObject.java @@ -16,20 +16,16 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_pixel_buffer_object} */ -public final class GLEXTPixelBufferObject { - public static final int GL_PIXEL_PACK_BUFFER_EXT = 0x88EB; - public static final int GL_PIXEL_UNPACK_BUFFER_EXT = 0x88EC; - public static final int GL_PIXEL_PACK_BUFFER_BINDING_EXT = 0x88ED; - public static final int GL_PIXEL_UNPACK_BUFFER_BINDING_EXT = 0x88EF; +public interface GLEXTPixelBufferObject { + int GL_PIXEL_PACK_BUFFER_EXT = 0x88EB; + int GL_PIXEL_UNPACK_BUFFER_EXT = 0x88EC; + int GL_PIXEL_PACK_BUFFER_BINDING_EXT = 0x88ED; + int GL_PIXEL_UNPACK_BUFFER_BINDING_EXT = 0x88EF; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPixelTransform.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPixelTransform.java index f953f74c..8d5f646a 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPixelTransform.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPixelTransform.java @@ -16,77 +16,46 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_pixel_transform} */ -public final class GLEXTPixelTransform { - public static final int GL_PIXEL_TRANSFORM_2D_EXT = 0x8330; - public static final int GL_PIXEL_MAG_FILTER_EXT = 0x8331; - public static final int GL_PIXEL_MIN_FILTER_EXT = 0x8332; - public static final int GL_PIXEL_CUBIC_WEIGHT_EXT = 0x8333; - public static final int GL_CUBIC_EXT = 0x8334; - public static final int GL_AVERAGE_EXT = 0x8335; - public static final int GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT = 0x8336; - public static final int GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT = 0x8337; - public static final int GL_PIXEL_TRANSFORM_2D_MATRIX_EXT = 0x8338; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_pixel_transform) return; - ext.glPixelTransformParameteriEXT = load.invoke("glPixelTransformParameteriEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glPixelTransformParameterfEXT = load.invoke("glPixelTransformParameterfEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_FLOAT)); - ext.glPixelTransformParameterivEXT = load.invoke("glPixelTransformParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glPixelTransformParameterfvEXT = load.invoke("glPixelTransformParameterfvEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetPixelTransformParameterivEXT = load.invoke("glGetPixelTransformParameterivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetPixelTransformParameterfvEXT = load.invoke("glGetPixelTransformParameterfvEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static void glPixelTransformParameteriEXT(int target, int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glPixelTransformParameteriEXT).invokeExact(target, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLEXTPixelTransform { + int GL_PIXEL_TRANSFORM_2D_EXT = 0x8330; + int GL_PIXEL_MAG_FILTER_EXT = 0x8331; + int GL_PIXEL_MIN_FILTER_EXT = 0x8332; + int GL_PIXEL_CUBIC_WEIGHT_EXT = 0x8333; + int GL_CUBIC_EXT = 0x8334; + int GL_AVERAGE_EXT = 0x8335; + int GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT = 0x8336; + int GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT = 0x8337; + int GL_PIXEL_TRANSFORM_2D_MATRIX_EXT = 0x8338; + + default void glPixelTransformParameteriEXT(int target, int pname, int param) { + throw new ContextException(); } - public static void glPixelTransformParameterfEXT(int target, int pname, float param) { - final var ext = getExtCapabilities(); - try { - check(ext.glPixelTransformParameterfEXT).invokeExact(target, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPixelTransformParameterfEXT(int target, int pname, float param) { + throw new ContextException(); } - public static void glPixelTransformParameterivEXT(int target, int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glPixelTransformParameterivEXT).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPixelTransformParameterivEXT(int target, int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glPixelTransformParameterfvEXT(int target, int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glPixelTransformParameterfvEXT).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPixelTransformParameterfvEXT(int target, int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetPixelTransformParameterivEXT(int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPixelTransformParameterivEXT).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPixelTransformParameterivEXT(int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetPixelTransformParameterfvEXT(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPixelTransformParameterfvEXT).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPixelTransformParameterfvEXT(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPointParameters.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPointParameters.java index f3e9e1b9..d6588055 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPointParameters.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPointParameters.java @@ -16,40 +16,25 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_point_parameters} */ -public final class GLEXTPointParameters { - public static final int GL_POINT_SIZE_MIN_EXT = 0x8126; - public static final int GL_POINT_SIZE_MAX_EXT = 0x8127; - public static final int GL_POINT_FADE_THRESHOLD_SIZE_EXT = 0x8128; - public static final int GL_DISTANCE_ATTENUATION_EXT = 0x8129; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_point_parameters) return; - ext.glPointParameterfEXT = load.invoke("glPointParameterfEXT", ofVoid(JAVA_INT, JAVA_FLOAT)); - ext.glPointParameterfvEXT = load.invoke("glPointParameterfvEXT", ofVoid(JAVA_INT, ADDRESS)); - } +public interface GLEXTPointParameters { + int GL_POINT_SIZE_MIN_EXT = 0x8126; + int GL_POINT_SIZE_MAX_EXT = 0x8127; + int GL_POINT_FADE_THRESHOLD_SIZE_EXT = 0x8128; + int GL_DISTANCE_ATTENUATION_EXT = 0x8129; - public static void glPointParameterfEXT(int pname, float param) { - final var ext = getExtCapabilities(); - try { - check(ext.glPointParameterfEXT).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPointParameterfEXT(int pname, float param) { + throw new ContextException(); } - public static void glPointParameterfvEXT(int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glPointParameterfvEXT).invokeExact(pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPointParameterfvEXT(int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPolygonOffset.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPolygonOffset.java index caba52c5..a919dcf4 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPolygonOffset.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPolygonOffset.java @@ -16,31 +16,20 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_polygon_offset} */ -public final class GLEXTPolygonOffset { - public static final int GL_POLYGON_OFFSET_EXT = 0x8037; - public static final int GL_POLYGON_OFFSET_FACTOR_EXT = 0x8038; - public static final int GL_POLYGON_OFFSET_BIAS_EXT = 0x8039; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_polygon_offset) return; - ext.glPolygonOffsetEXT = load.invoke("glPolygonOffsetEXT", ofVoid(JAVA_FLOAT, JAVA_FLOAT)); - } +public interface GLEXTPolygonOffset { + int GL_POLYGON_OFFSET_EXT = 0x8037; + int GL_POLYGON_OFFSET_FACTOR_EXT = 0x8038; + int GL_POLYGON_OFFSET_BIAS_EXT = 0x8039; - public static void glPolygonOffsetEXT(float factor, float bias) { - final var ext = getExtCapabilities(); - try { - check(ext.glPolygonOffsetEXT).invokeExact(factor, bias); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPolygonOffsetEXT(float factor, float bias) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPolygonOffsetClamp.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPolygonOffsetClamp.java index 542a5292..b97edfe6 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPolygonOffsetClamp.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTPolygonOffsetClamp.java @@ -16,29 +16,18 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_polygon_offset_clamp} */ -public final class GLEXTPolygonOffsetClamp { - public static final int GL_POLYGON_OFFSET_CLAMP_EXT = 0x8E1B; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_polygon_offset_clamp) return; - ext.glPolygonOffsetClampEXT = load.invoke("glPolygonOffsetClampEXT", ofVoid(JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - } +public interface GLEXTPolygonOffsetClamp { + int GL_POLYGON_OFFSET_CLAMP_EXT = 0x8E1B; - public static void glPolygonOffsetClampEXT(float factor, float units, float clamp) { - final var ext = getExtCapabilities(); - try { - check(ext.glPolygonOffsetClampEXT).invokeExact(factor, units, clamp); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPolygonOffsetClampEXT(float factor, float units, float clamp) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTProvokingVertex.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTProvokingVertex.java index a33550a0..e3b565be 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTProvokingVertex.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTProvokingVertex.java @@ -16,32 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_provoking_vertex} */ -public final class GLEXTProvokingVertex { - public static final int GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT = 0x8E4C; - public static final int GL_FIRST_VERTEX_CONVENTION_EXT = 0x8E4D; - public static final int GL_LAST_VERTEX_CONVENTION_EXT = 0x8E4E; - public static final int GL_PROVOKING_VERTEX_EXT = 0x8E4F; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_provoking_vertex) return; - ext.glProvokingVertexEXT = load.invoke("glProvokingVertexEXT", ofVoid(JAVA_INT)); - } +public interface GLEXTProvokingVertex { + int GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT = 0x8E4C; + int GL_FIRST_VERTEX_CONVENTION_EXT = 0x8E4D; + int GL_LAST_VERTEX_CONVENTION_EXT = 0x8E4E; + int GL_PROVOKING_VERTEX_EXT = 0x8E4F; - public static void glProvokingVertexEXT(int mode) { - final var ext = getExtCapabilities(); - try { - check(ext.glProvokingVertexEXT).invokeExact(mode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProvokingVertexEXT(int mode) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTRasterMultisample.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTRasterMultisample.java index aa73e81e..83daa7cf 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTRasterMultisample.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTRasterMultisample.java @@ -16,34 +16,23 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_raster_multisample} */ -public final class GLEXTRasterMultisample { - public static final int GL_RASTER_MULTISAMPLE_EXT = 0x9327; - public static final int GL_RASTER_SAMPLES_EXT = 0x9328; - public static final int GL_MAX_RASTER_SAMPLES_EXT = 0x9329; - public static final int GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT = 0x932A; - public static final int GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT = 0x932B; - public static final int GL_EFFECTIVE_RASTER_SAMPLES_EXT = 0x932C; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_raster_multisample) return; - ext.glRasterSamplesEXT = load.invoke("glRasterSamplesEXT", ofVoid(JAVA_INT, JAVA_BYTE)); - } +public interface GLEXTRasterMultisample { + int GL_RASTER_MULTISAMPLE_EXT = 0x9327; + int GL_RASTER_SAMPLES_EXT = 0x9328; + int GL_MAX_RASTER_SAMPLES_EXT = 0x9329; + int GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT = 0x932A; + int GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT = 0x932B; + int GL_EFFECTIVE_RASTER_SAMPLES_EXT = 0x932C; - public static void glRasterSamplesEXT(int samples, boolean fixedsamplelocations) { - final var ext = getExtCapabilities(); - try { - check(ext.glRasterSamplesEXT).invokeExact(samples, fixedsamplelocations); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glRasterSamplesEXT(int samples, boolean fixedsamplelocations) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTRescaleNormal.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTRescaleNormal.java index 29e22b98..ed1f47e6 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTRescaleNormal.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTRescaleNormal.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_rescale_normal} */ -public final class GLEXTRescaleNormal { - public static final int GL_RESCALE_NORMAL_EXT = 0x803A; +public interface GLEXTRescaleNormal { + int GL_RESCALE_NORMAL_EXT = 0x803A; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSecondaryColor.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSecondaryColor.java index 1d622f29..7992557e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSecondaryColor.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSecondaryColor.java @@ -16,163 +16,88 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_secondary_color} */ -public final class GLEXTSecondaryColor { - public static final int GL_COLOR_SUM_EXT = 0x8458; - public static final int GL_CURRENT_SECONDARY_COLOR_EXT = 0x8459; - public static final int GL_SECONDARY_COLOR_ARRAY_SIZE_EXT = 0x845A; - public static final int GL_SECONDARY_COLOR_ARRAY_TYPE_EXT = 0x845B; - public static final int GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT = 0x845C; - public static final int GL_SECONDARY_COLOR_ARRAY_POINTER_EXT = 0x845D; - public static final int GL_SECONDARY_COLOR_ARRAY_EXT = 0x845E; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_secondary_color) return; - ext.glSecondaryColor3bEXT = load.invoke("glSecondaryColor3bEXT", ofVoid(JAVA_BYTE, JAVA_BYTE, JAVA_BYTE)); - ext.glSecondaryColor3bvEXT = load.invoke("glSecondaryColor3bvEXT", ofVoid(ADDRESS)); - ext.glSecondaryColor3dEXT = load.invoke("glSecondaryColor3dEXT", ofVoid(JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glSecondaryColor3dvEXT = load.invoke("glSecondaryColor3dvEXT", ofVoid(ADDRESS)); - ext.glSecondaryColor3fEXT = load.invoke("glSecondaryColor3fEXT", ofVoid(JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glSecondaryColor3fvEXT = load.invoke("glSecondaryColor3fvEXT", ofVoid(ADDRESS)); - ext.glSecondaryColor3iEXT = load.invoke("glSecondaryColor3iEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glSecondaryColor3ivEXT = load.invoke("glSecondaryColor3ivEXT", ofVoid(ADDRESS)); - ext.glSecondaryColor3sEXT = load.invoke("glSecondaryColor3sEXT", ofVoid(JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glSecondaryColor3svEXT = load.invoke("glSecondaryColor3svEXT", ofVoid(ADDRESS)); - ext.glSecondaryColor3ubEXT = load.invoke("glSecondaryColor3ubEXT", ofVoid(JAVA_BYTE, JAVA_BYTE, JAVA_BYTE)); - ext.glSecondaryColor3ubvEXT = load.invoke("glSecondaryColor3ubvEXT", ofVoid(ADDRESS)); - ext.glSecondaryColor3uiEXT = load.invoke("glSecondaryColor3uiEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glSecondaryColor3uivEXT = load.invoke("glSecondaryColor3uivEXT", ofVoid(ADDRESS)); - ext.glSecondaryColor3usEXT = load.invoke("glSecondaryColor3usEXT", ofVoid(JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glSecondaryColor3usvEXT = load.invoke("glSecondaryColor3usvEXT", ofVoid(ADDRESS)); - ext.glSecondaryColorPointerEXT = load.invoke("glSecondaryColorPointerEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static void glSecondaryColor3bEXT(byte red, byte green, byte blue) { - final var ext = getExtCapabilities(); - try { - check(ext.glSecondaryColor3bEXT).invokeExact(red, green, blue); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glSecondaryColor3bvEXT(@NativeType("const GLbyte *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glSecondaryColor3bvEXT).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glSecondaryColor3dEXT(double red, double green, double blue) { - final var ext = getExtCapabilities(); - try { - check(ext.glSecondaryColor3dEXT).invokeExact(red, green, blue); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glSecondaryColor3dvEXT(@NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glSecondaryColor3dvEXT).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glSecondaryColor3fEXT(float red, float green, float blue) { - final var ext = getExtCapabilities(); - try { - check(ext.glSecondaryColor3fEXT).invokeExact(red, green, blue); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glSecondaryColor3fvEXT(@NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glSecondaryColor3fvEXT).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glSecondaryColor3iEXT(int red, int green, int blue) { - final var ext = getExtCapabilities(); - try { - check(ext.glSecondaryColor3iEXT).invokeExact(red, green, blue); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glSecondaryColor3ivEXT(@NativeType("const GLint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glSecondaryColor3ivEXT).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glSecondaryColor3sEXT(short red, short green, short blue) { - final var ext = getExtCapabilities(); - try { - check(ext.glSecondaryColor3sEXT).invokeExact(red, green, blue); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glSecondaryColor3svEXT(@NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glSecondaryColor3svEXT).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glSecondaryColor3ubEXT(byte red, byte green, byte blue) { - final var ext = getExtCapabilities(); - try { - check(ext.glSecondaryColor3ubEXT).invokeExact(red, green, blue); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glSecondaryColor3ubvEXT(@NativeType("const GLubyte *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glSecondaryColor3ubvEXT).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLEXTSecondaryColor { + int GL_COLOR_SUM_EXT = 0x8458; + int GL_CURRENT_SECONDARY_COLOR_EXT = 0x8459; + int GL_SECONDARY_COLOR_ARRAY_SIZE_EXT = 0x845A; + int GL_SECONDARY_COLOR_ARRAY_TYPE_EXT = 0x845B; + int GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT = 0x845C; + int GL_SECONDARY_COLOR_ARRAY_POINTER_EXT = 0x845D; + int GL_SECONDARY_COLOR_ARRAY_EXT = 0x845E; + + default void glSecondaryColor3bEXT(byte red, byte green, byte blue) { + throw new ContextException(); + } + + default void glSecondaryColor3bvEXT(@NativeType("const GLbyte *") MemorySegment v) { + throw new ContextException(); + } + + default void glSecondaryColor3dEXT(double red, double green, double blue) { + throw new ContextException(); + } + + default void glSecondaryColor3dvEXT(@NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); + } + + default void glSecondaryColor3fEXT(float red, float green, float blue) { + throw new ContextException(); + } + + default void glSecondaryColor3fvEXT(@NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); + } + + default void glSecondaryColor3iEXT(int red, int green, int blue) { + throw new ContextException(); + } + + default void glSecondaryColor3ivEXT(@NativeType("const GLint *") MemorySegment v) { + throw new ContextException(); + } + + default void glSecondaryColor3sEXT(short red, short green, short blue) { + throw new ContextException(); + } + + default void glSecondaryColor3svEXT(@NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); + } + + default void glSecondaryColor3ubEXT(byte red, byte green, byte blue) { + throw new ContextException(); + } + + default void glSecondaryColor3ubvEXT(@NativeType("const GLubyte *") MemorySegment v) { + throw new ContextException(); } - public static void glSecondaryColor3uiEXT(int red, int green, int blue) { - final var ext = getExtCapabilities(); - try { - check(ext.glSecondaryColor3uiEXT).invokeExact(red, green, blue); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSecondaryColor3uiEXT(int red, int green, int blue) { + throw new ContextException(); } - public static void glSecondaryColor3uivEXT(@NativeType("const GLuint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glSecondaryColor3uivEXT).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSecondaryColor3uivEXT(@NativeType("const GLuint *") MemorySegment v) { + throw new ContextException(); } - public static void glSecondaryColor3usEXT(short red, short green, short blue) { - final var ext = getExtCapabilities(); - try { - check(ext.glSecondaryColor3usEXT).invokeExact(red, green, blue); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSecondaryColor3usEXT(short red, short green, short blue) { + throw new ContextException(); } - public static void glSecondaryColor3usvEXT(@NativeType("const GLushort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glSecondaryColor3usvEXT).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSecondaryColor3usvEXT(@NativeType("const GLushort *") MemorySegment v) { + throw new ContextException(); } - public static void glSecondaryColorPointerEXT(int size, int type, int stride, @NativeType("const void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glSecondaryColorPointerEXT).invokeExact(size, type, stride, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSecondaryColorPointerEXT(int size, int type, int stride, @NativeType("const void *") MemorySegment pointer) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSemaphore.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSemaphore.java index 2c63bec0..39d6b0d3 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSemaphore.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSemaphore.java @@ -16,86 +16,50 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_semaphore} */ -public final class GLEXTSemaphore { - public static final int GL_LAYOUT_GENERAL_EXT = 0x958D; - public static final int GL_LAYOUT_COLOR_ATTACHMENT_EXT = 0x958E; - public static final int GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT = 0x958F; - public static final int GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT = 0x9590; - public static final int GL_LAYOUT_SHADER_READ_ONLY_EXT = 0x9591; - public static final int GL_LAYOUT_TRANSFER_SRC_EXT = 0x9592; - public static final int GL_LAYOUT_TRANSFER_DST_EXT = 0x9593; - public static final int GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT = 0x9530; - public static final int GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT = 0x9531; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_semaphore) return; - ext.glGenSemaphoresEXT = load.invoke("glGenSemaphoresEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glDeleteSemaphoresEXT = load.invoke("glDeleteSemaphoresEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glIsSemaphoreEXT = load.invoke("glIsSemaphoreEXT", of(JAVA_BYTE, JAVA_INT)); - ext.glSemaphoreParameterui64vEXT = load.invoke("glSemaphoreParameterui64vEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetSemaphoreParameterui64vEXT = load.invoke("glGetSemaphoreParameterui64vEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glWaitSemaphoreEXT = load.invoke("glWaitSemaphoreEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, ADDRESS, ADDRESS)); - ext.glSignalSemaphoreEXT = load.invoke("glSignalSemaphoreEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, ADDRESS, ADDRESS)); - } +public interface GLEXTSemaphore { + int GL_LAYOUT_GENERAL_EXT = 0x958D; + int GL_LAYOUT_COLOR_ATTACHMENT_EXT = 0x958E; + int GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT = 0x958F; + int GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT = 0x9590; + int GL_LAYOUT_SHADER_READ_ONLY_EXT = 0x9591; + int GL_LAYOUT_TRANSFER_SRC_EXT = 0x9592; + int GL_LAYOUT_TRANSFER_DST_EXT = 0x9593; + int GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT = 0x9530; + int GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT = 0x9531; - public static void glGenSemaphoresEXT(int n, @NativeType("GLuint *") MemorySegment semaphores) { - final var ext = getExtCapabilities(); - try { - check(ext.glGenSemaphoresEXT).invokeExact(n, semaphores); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGenSemaphoresEXT(int n, @NativeType("GLuint *") MemorySegment semaphores) { + throw new ContextException(); } - public static void glDeleteSemaphoresEXT(int n, @NativeType("const GLuint *") MemorySegment semaphores) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteSemaphoresEXT).invokeExact(n, semaphores); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDeleteSemaphoresEXT(int n, @NativeType("const GLuint *") MemorySegment semaphores) { + throw new ContextException(); } - public static boolean glIsSemaphoreEXT(int semaphore) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsSemaphoreEXT).invokeExact(semaphore); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsSemaphoreEXT(int semaphore) { + throw new ContextException(); } - public static void glSemaphoreParameterui64vEXT(int semaphore, int pname, @NativeType("const GLuint64 *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glSemaphoreParameterui64vEXT).invokeExact(semaphore, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSemaphoreParameterui64vEXT(int semaphore, int pname, @NativeType("const GLuint64 *") MemorySegment params) { + throw new ContextException(); } - public static void glGetSemaphoreParameterui64vEXT(int semaphore, int pname, @NativeType("GLuint64 *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetSemaphoreParameterui64vEXT).invokeExact(semaphore, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetSemaphoreParameterui64vEXT(int semaphore, int pname, @NativeType("GLuint64 *") MemorySegment params) { + throw new ContextException(); } - public static void glWaitSemaphoreEXT(int semaphore, int numBufferBarriers, @NativeType("const GLuint *") MemorySegment buffers, int numTextureBarriers, @NativeType("const GLuint *") MemorySegment textures, @NativeType("const GLenum *") MemorySegment srcLayouts) { - final var ext = getExtCapabilities(); - try { - check(ext.glWaitSemaphoreEXT).invokeExact(semaphore, numBufferBarriers, buffers, numTextureBarriers, textures, srcLayouts); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWaitSemaphoreEXT(int semaphore, int numBufferBarriers, @NativeType("const GLuint *") MemorySegment buffers, int numTextureBarriers, @NativeType("const GLuint *") MemorySegment textures, @NativeType("const GLenum *") MemorySegment srcLayouts) { + throw new ContextException(); } - public static void glSignalSemaphoreEXT(int semaphore, int numBufferBarriers, @NativeType("const GLuint *") MemorySegment buffers, int numTextureBarriers, @NativeType("const GLuint *") MemorySegment textures, @NativeType("const GLenum *") MemorySegment dstLayouts) { - final var ext = getExtCapabilities(); - try { - check(ext.glSignalSemaphoreEXT).invokeExact(semaphore, numBufferBarriers, buffers, numTextureBarriers, textures, dstLayouts); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSignalSemaphoreEXT(int semaphore, int numBufferBarriers, @NativeType("const GLuint *") MemorySegment buffers, int numTextureBarriers, @NativeType("const GLuint *") MemorySegment textures, @NativeType("const GLenum *") MemorySegment dstLayouts) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSemaphoreFd.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSemaphoreFd.java index 87c76872..b3408acf 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSemaphoreFd.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSemaphoreFd.java @@ -16,28 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_semaphore_fd} */ -public final class GLEXTSemaphoreFd { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_semaphore_fd) return; - ext.glImportSemaphoreFdEXT = load.invoke("glImportSemaphoreFdEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLEXTSemaphoreFd { - public static void glImportSemaphoreFdEXT(int semaphore, int handleType, int fd) { - final var ext = getExtCapabilities(); - try { - check(ext.glImportSemaphoreFdEXT).invokeExact(semaphore, handleType, fd); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glImportSemaphoreFdEXT(int semaphore, int handleType, int fd) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSemaphoreWin32.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSemaphoreWin32.java index 2ff6618a..50d36bc1 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSemaphoreWin32.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSemaphoreWin32.java @@ -16,38 +16,23 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_semaphore_win32} */ -public final class GLEXTSemaphoreWin32 { - public static final int GL_HANDLE_TYPE_D3D12_FENCE_EXT = 0x9594; - public static final int GL_D3D12_FENCE_VALUE_EXT = 0x9595; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_semaphore_win32) return; - ext.glImportSemaphoreWin32HandleEXT = load.invoke("glImportSemaphoreWin32HandleEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glImportSemaphoreWin32NameEXT = load.invoke("glImportSemaphoreWin32NameEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLEXTSemaphoreWin32 { + int GL_HANDLE_TYPE_D3D12_FENCE_EXT = 0x9594; + int GL_D3D12_FENCE_VALUE_EXT = 0x9595; - public static void glImportSemaphoreWin32HandleEXT(int semaphore, int handleType, @NativeType("void * ") MemorySegment handle) { - final var ext = getExtCapabilities(); - try { - check(ext.glImportSemaphoreWin32HandleEXT).invokeExact(semaphore, handleType, handle); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glImportSemaphoreWin32HandleEXT(int semaphore, int handleType, @NativeType("void * ") MemorySegment handle) { + throw new ContextException(); } - public static void glImportSemaphoreWin32NameEXT(int semaphore, int handleType, @NativeType("const void *") MemorySegment name) { - final var ext = getExtCapabilities(); - try { - check(ext.glImportSemaphoreWin32NameEXT).invokeExact(semaphore, handleType, name); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glImportSemaphoreWin32NameEXT(int semaphore, int handleType, @NativeType("const void *") MemorySegment name) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSeparateShaderObjects.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSeparateShaderObjects.java index 2b001c3a..8321ccd4 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSeparateShaderObjects.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSeparateShaderObjects.java @@ -16,46 +16,26 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_separate_shader_objects} */ -public final class GLEXTSeparateShaderObjects { - public static final int GL_ACTIVE_PROGRAM_EXT = 0x8B8D; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_separate_shader_objects) return; - ext.glUseShaderProgramEXT = load.invoke("glUseShaderProgramEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glActiveProgramEXT = load.invoke("glActiveProgramEXT", ofVoid(JAVA_INT)); - ext.glCreateShaderProgramEXT = load.invoke("glCreateShaderProgramEXT", of(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLEXTSeparateShaderObjects { + int GL_ACTIVE_PROGRAM_EXT = 0x8B8D; - public static void glUseShaderProgramEXT(int type, int program) { - final var ext = getExtCapabilities(); - try { - check(ext.glUseShaderProgramEXT).invokeExact(type, program); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUseShaderProgramEXT(int type, int program) { + throw new ContextException(); } - public static void glActiveProgramEXT(int program) { - final var ext = getExtCapabilities(); - try { - check(ext.glActiveProgramEXT).invokeExact(program); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glActiveProgramEXT(int program) { + throw new ContextException(); } - public static int glCreateShaderProgramEXT(int type, @NativeType("const GLchar *") MemorySegment string) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glCreateShaderProgramEXT).invokeExact(type, string); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glCreateShaderProgramEXT(int type, @NativeType("const GLchar *") MemorySegment string) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSeparateSpecularColor.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSeparateSpecularColor.java index 1032c587..6d5634a1 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSeparateSpecularColor.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSeparateSpecularColor.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_separate_specular_color} */ -public final class GLEXTSeparateSpecularColor { - public static final int GL_LIGHT_MODEL_COLOR_CONTROL_EXT = 0x81F8; - public static final int GL_SINGLE_COLOR_EXT = 0x81F9; - public static final int GL_SEPARATE_SPECULAR_COLOR_EXT = 0x81FA; +public interface GLEXTSeparateSpecularColor { + int GL_LIGHT_MODEL_COLOR_CONTROL_EXT = 0x81F8; + int GL_SINGLE_COLOR_EXT = 0x81F9; + int GL_SEPARATE_SPECULAR_COLOR_EXT = 0x81FA; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTShaderFramebufferFetch.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTShaderFramebufferFetch.java index 83accc83..4641b2b7 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTShaderFramebufferFetch.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTShaderFramebufferFetch.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_shader_framebuffer_fetch} */ -public final class GLEXTShaderFramebufferFetch { - public static final int GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT = 0x8A52; +public interface GLEXTShaderFramebufferFetch { + int GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT = 0x8A52; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTShaderFramebufferFetchNonCoherent.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTShaderFramebufferFetchNonCoherent.java index 48476f95..bb9484be 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTShaderFramebufferFetchNonCoherent.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTShaderFramebufferFetchNonCoherent.java @@ -16,28 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_shader_framebuffer_fetch_non_coherent} */ -public final class GLEXTShaderFramebufferFetchNonCoherent { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_shader_framebuffer_fetch_non_coherent) return; - ext.glFramebufferFetchBarrierEXT = load.invoke("glFramebufferFetchBarrierEXT", ofVoid()); - } +public interface GLEXTShaderFramebufferFetchNonCoherent { - public static void glFramebufferFetchBarrierEXT() { - final var ext = getExtCapabilities(); - try { - check(ext.glFramebufferFetchBarrierEXT).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFramebufferFetchBarrierEXT() { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTShaderImageLoadStore.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTShaderImageLoadStore.java index 646cd6dd..7af60a0a 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTShaderImageLoadStore.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTShaderImageLoadStore.java @@ -16,91 +16,76 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_shader_image_load_store} */ -public final class GLEXTShaderImageLoadStore { - public static final int GL_MAX_IMAGE_UNITS_EXT = 0x8F38; - public static final int GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT = 0x8F39; - public static final int GL_IMAGE_BINDING_NAME_EXT = 0x8F3A; - public static final int GL_IMAGE_BINDING_LEVEL_EXT = 0x8F3B; - public static final int GL_IMAGE_BINDING_LAYERED_EXT = 0x8F3C; - public static final int GL_IMAGE_BINDING_LAYER_EXT = 0x8F3D; - public static final int GL_IMAGE_BINDING_ACCESS_EXT = 0x8F3E; - public static final int GL_IMAGE_1D_EXT = 0x904C; - public static final int GL_IMAGE_2D_EXT = 0x904D; - public static final int GL_IMAGE_3D_EXT = 0x904E; - public static final int GL_IMAGE_2D_RECT_EXT = 0x904F; - public static final int GL_IMAGE_CUBE_EXT = 0x9050; - public static final int GL_IMAGE_BUFFER_EXT = 0x9051; - public static final int GL_IMAGE_1D_ARRAY_EXT = 0x9052; - public static final int GL_IMAGE_2D_ARRAY_EXT = 0x9053; - public static final int GL_IMAGE_CUBE_MAP_ARRAY_EXT = 0x9054; - public static final int GL_IMAGE_2D_MULTISAMPLE_EXT = 0x9055; - public static final int GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x9056; - public static final int GL_INT_IMAGE_1D_EXT = 0x9057; - public static final int GL_INT_IMAGE_2D_EXT = 0x9058; - public static final int GL_INT_IMAGE_3D_EXT = 0x9059; - public static final int GL_INT_IMAGE_2D_RECT_EXT = 0x905A; - public static final int GL_INT_IMAGE_CUBE_EXT = 0x905B; - public static final int GL_INT_IMAGE_BUFFER_EXT = 0x905C; - public static final int GL_INT_IMAGE_1D_ARRAY_EXT = 0x905D; - public static final int GL_INT_IMAGE_2D_ARRAY_EXT = 0x905E; - public static final int GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT = 0x905F; - public static final int GL_INT_IMAGE_2D_MULTISAMPLE_EXT = 0x9060; - public static final int GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x9061; - public static final int GL_UNSIGNED_INT_IMAGE_1D_EXT = 0x9062; - public static final int GL_UNSIGNED_INT_IMAGE_2D_EXT = 0x9063; - public static final int GL_UNSIGNED_INT_IMAGE_3D_EXT = 0x9064; - public static final int GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT = 0x9065; - public static final int GL_UNSIGNED_INT_IMAGE_CUBE_EXT = 0x9066; - public static final int GL_UNSIGNED_INT_IMAGE_BUFFER_EXT = 0x9067; - public static final int GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT = 0x9068; - public static final int GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT = 0x9069; - public static final int GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT = 0x906A; - public static final int GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT = 0x906B; - public static final int GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x906C; - public static final int GL_MAX_IMAGE_SAMPLES_EXT = 0x906D; - public static final int GL_IMAGE_BINDING_FORMAT_EXT = 0x906E; - public static final int GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT = 0x00000001; - public static final int GL_ELEMENT_ARRAY_BARRIER_BIT_EXT = 0x00000002; - public static final int GL_UNIFORM_BARRIER_BIT_EXT = 0x00000004; - public static final int GL_TEXTURE_FETCH_BARRIER_BIT_EXT = 0x00000008; - public static final int GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT = 0x00000020; - public static final int GL_COMMAND_BARRIER_BIT_EXT = 0x00000040; - public static final int GL_PIXEL_BUFFER_BARRIER_BIT_EXT = 0x00000080; - public static final int GL_TEXTURE_UPDATE_BARRIER_BIT_EXT = 0x00000100; - public static final int GL_BUFFER_UPDATE_BARRIER_BIT_EXT = 0x00000200; - public static final int GL_FRAMEBUFFER_BARRIER_BIT_EXT = 0x00000400; - public static final int GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT = 0x00000800; - public static final int GL_ATOMIC_COUNTER_BARRIER_BIT_EXT = 0x00001000; - public static final int GL_ALL_BARRIER_BITS_EXT = 0xFFFFFFFF; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_shader_image_load_store) return; - ext.glBindImageTextureEXT = load.invoke("glBindImageTextureEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMemoryBarrierEXT = load.invoke("glMemoryBarrierEXT", ofVoid(JAVA_INT)); - } +public interface GLEXTShaderImageLoadStore { + int GL_MAX_IMAGE_UNITS_EXT = 0x8F38; + int GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT = 0x8F39; + int GL_IMAGE_BINDING_NAME_EXT = 0x8F3A; + int GL_IMAGE_BINDING_LEVEL_EXT = 0x8F3B; + int GL_IMAGE_BINDING_LAYERED_EXT = 0x8F3C; + int GL_IMAGE_BINDING_LAYER_EXT = 0x8F3D; + int GL_IMAGE_BINDING_ACCESS_EXT = 0x8F3E; + int GL_IMAGE_1D_EXT = 0x904C; + int GL_IMAGE_2D_EXT = 0x904D; + int GL_IMAGE_3D_EXT = 0x904E; + int GL_IMAGE_2D_RECT_EXT = 0x904F; + int GL_IMAGE_CUBE_EXT = 0x9050; + int GL_IMAGE_BUFFER_EXT = 0x9051; + int GL_IMAGE_1D_ARRAY_EXT = 0x9052; + int GL_IMAGE_2D_ARRAY_EXT = 0x9053; + int GL_IMAGE_CUBE_MAP_ARRAY_EXT = 0x9054; + int GL_IMAGE_2D_MULTISAMPLE_EXT = 0x9055; + int GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x9056; + int GL_INT_IMAGE_1D_EXT = 0x9057; + int GL_INT_IMAGE_2D_EXT = 0x9058; + int GL_INT_IMAGE_3D_EXT = 0x9059; + int GL_INT_IMAGE_2D_RECT_EXT = 0x905A; + int GL_INT_IMAGE_CUBE_EXT = 0x905B; + int GL_INT_IMAGE_BUFFER_EXT = 0x905C; + int GL_INT_IMAGE_1D_ARRAY_EXT = 0x905D; + int GL_INT_IMAGE_2D_ARRAY_EXT = 0x905E; + int GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT = 0x905F; + int GL_INT_IMAGE_2D_MULTISAMPLE_EXT = 0x9060; + int GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x9061; + int GL_UNSIGNED_INT_IMAGE_1D_EXT = 0x9062; + int GL_UNSIGNED_INT_IMAGE_2D_EXT = 0x9063; + int GL_UNSIGNED_INT_IMAGE_3D_EXT = 0x9064; + int GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT = 0x9065; + int GL_UNSIGNED_INT_IMAGE_CUBE_EXT = 0x9066; + int GL_UNSIGNED_INT_IMAGE_BUFFER_EXT = 0x9067; + int GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT = 0x9068; + int GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT = 0x9069; + int GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT = 0x906A; + int GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT = 0x906B; + int GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x906C; + int GL_MAX_IMAGE_SAMPLES_EXT = 0x906D; + int GL_IMAGE_BINDING_FORMAT_EXT = 0x906E; + int GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT = 0x00000001; + int GL_ELEMENT_ARRAY_BARRIER_BIT_EXT = 0x00000002; + int GL_UNIFORM_BARRIER_BIT_EXT = 0x00000004; + int GL_TEXTURE_FETCH_BARRIER_BIT_EXT = 0x00000008; + int GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT = 0x00000020; + int GL_COMMAND_BARRIER_BIT_EXT = 0x00000040; + int GL_PIXEL_BUFFER_BARRIER_BIT_EXT = 0x00000080; + int GL_TEXTURE_UPDATE_BARRIER_BIT_EXT = 0x00000100; + int GL_BUFFER_UPDATE_BARRIER_BIT_EXT = 0x00000200; + int GL_FRAMEBUFFER_BARRIER_BIT_EXT = 0x00000400; + int GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT = 0x00000800; + int GL_ATOMIC_COUNTER_BARRIER_BIT_EXT = 0x00001000; + int GL_ALL_BARRIER_BITS_EXT = 0xFFFFFFFF; - public static void glBindImageTextureEXT(int index, int texture, int level, boolean layered, int layer, int access, int format) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindImageTextureEXT).invokeExact(index, texture, level, layered, layer, access, format); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBindImageTextureEXT(int index, int texture, int level, boolean layered, int layer, int access, int format) { + throw new ContextException(); } - public static void glMemoryBarrierEXT(int barriers) { - final var ext = getExtCapabilities(); - try { - check(ext.glMemoryBarrierEXT).invokeExact(barriers); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMemoryBarrierEXT(int barriers) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSharedTexturePalette.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSharedTexturePalette.java index 27b4544a..a6ab8c6d 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSharedTexturePalette.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSharedTexturePalette.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_shared_texture_palette} */ -public final class GLEXTSharedTexturePalette { - public static final int GL_SHARED_TEXTURE_PALETTE_EXT = 0x81FB; +public interface GLEXTSharedTexturePalette { + int GL_SHARED_TEXTURE_PALETTE_EXT = 0x81FB; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSrgb.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSrgb.java index 496cdbd6..a5131ce7 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSrgb.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSrgb.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_framebuffer_sRGB} */ -public final class GLEXTSrgb { - public static final int GL_FRAMEBUFFER_SRGB_EXT = 0x8DB9; - public static final int GL_FRAMEBUFFER_SRGB_CAPABLE_EXT = 0x8DBA; +public interface GLEXTSrgb { + int GL_FRAMEBUFFER_SRGB_EXT = 0x8DB9; + int GL_FRAMEBUFFER_SRGB_CAPABLE_EXT = 0x8DBA; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTStencilClearTag.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTStencilClearTag.java index dc830384..94e01bb8 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTStencilClearTag.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTStencilClearTag.java @@ -16,30 +16,19 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_stencil_clear_tag} */ -public final class GLEXTStencilClearTag { - public static final int GL_STENCIL_TAG_BITS_EXT = 0x88F2; - public static final int GL_STENCIL_CLEAR_TAG_VALUE_EXT = 0x88F3; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_stencil_clear_tag) return; - ext.glStencilClearTagEXT = load.invoke("glStencilClearTagEXT", ofVoid(JAVA_INT, JAVA_INT)); - } +public interface GLEXTStencilClearTag { + int GL_STENCIL_TAG_BITS_EXT = 0x88F2; + int GL_STENCIL_CLEAR_TAG_VALUE_EXT = 0x88F3; - public static void glStencilClearTagEXT(int stencilTagBits, int stencilClearTag) { - final var ext = getExtCapabilities(); - try { - check(ext.glStencilClearTagEXT).invokeExact(stencilTagBits, stencilClearTag); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glStencilClearTagEXT(int stencilTagBits, int stencilClearTag) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTStencilTwoSide.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTStencilTwoSide.java index f8912ca0..a74a2730 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTStencilTwoSide.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTStencilTwoSide.java @@ -16,30 +16,19 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_stencil_two_side} */ -public final class GLEXTStencilTwoSide { - public static final int GL_STENCIL_TEST_TWO_SIDE_EXT = 0x8910; - public static final int GL_ACTIVE_STENCIL_FACE_EXT = 0x8911; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_stencil_two_side) return; - ext.glActiveStencilFaceEXT = load.invoke("glActiveStencilFaceEXT", ofVoid(JAVA_INT)); - } +public interface GLEXTStencilTwoSide { + int GL_STENCIL_TEST_TWO_SIDE_EXT = 0x8910; + int GL_ACTIVE_STENCIL_FACE_EXT = 0x8911; - public static void glActiveStencilFaceEXT(int face) { - final var ext = getExtCapabilities(); - try { - check(ext.glActiveStencilFaceEXT).invokeExact(face); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glActiveStencilFaceEXT(int face) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTStencilWrap.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTStencilWrap.java index 93a1b2b9..08e50d3c 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTStencilWrap.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTStencilWrap.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_stencil_wrap} */ -public final class GLEXTStencilWrap { - public static final int GL_INCR_WRAP_EXT = 0x8507; - public static final int GL_DECR_WRAP_EXT = 0x8508; +public interface GLEXTStencilWrap { + int GL_INCR_WRAP_EXT = 0x8507; + int GL_DECR_WRAP_EXT = 0x8508; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSubtexture.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSubtexture.java index fd362640..fef4e596 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSubtexture.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTSubtexture.java @@ -16,36 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_subtexture} */ -public final class GLEXTSubtexture { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_subtexture) return; - ext.glTexSubImage1DEXT = load.invoke("glTexSubImage1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glTexSubImage2DEXT = load.invoke("glTexSubImage2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLEXTSubtexture { - public static void glTexSubImage1DEXT(int target, int level, int xoffset, int width, int format, int type, @NativeType("const void *") MemorySegment pixels) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexSubImage1DEXT).invokeExact(target, level, xoffset, width, format, type, pixels); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexSubImage1DEXT(int target, int level, int xoffset, int width, int format, int type, @NativeType("const void *") MemorySegment pixels) { + throw new ContextException(); } - public static void glTexSubImage2DEXT(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, @NativeType("const void *") MemorySegment pixels) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexSubImage2DEXT).invokeExact(target, level, xoffset, yoffset, width, height, format, type, pixels); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexSubImage2DEXT(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, @NativeType("const void *") MemorySegment pixels) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTexture.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTexture.java index 2ae29a64..25311ba8 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTexture.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTexture.java @@ -16,59 +16,55 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture} */ -public final class GLEXTTexture { - public static final int GL_ALPHA4_EXT = 0x803B; - public static final int GL_ALPHA8_EXT = 0x803C; - public static final int GL_ALPHA12_EXT = 0x803D; - public static final int GL_ALPHA16_EXT = 0x803E; - public static final int GL_LUMINANCE4_EXT = 0x803F; - public static final int GL_LUMINANCE8_EXT = 0x8040; - public static final int GL_LUMINANCE12_EXT = 0x8041; - public static final int GL_LUMINANCE16_EXT = 0x8042; - public static final int GL_LUMINANCE4_ALPHA4_EXT = 0x8043; - public static final int GL_LUMINANCE6_ALPHA2_EXT = 0x8044; - public static final int GL_LUMINANCE8_ALPHA8_EXT = 0x8045; - public static final int GL_LUMINANCE12_ALPHA4_EXT = 0x8046; - public static final int GL_LUMINANCE12_ALPHA12_EXT = 0x8047; - public static final int GL_LUMINANCE16_ALPHA16_EXT = 0x8048; - public static final int GL_INTENSITY_EXT = 0x8049; - public static final int GL_INTENSITY4_EXT = 0x804A; - public static final int GL_INTENSITY8_EXT = 0x804B; - public static final int GL_INTENSITY12_EXT = 0x804C; - public static final int GL_INTENSITY16_EXT = 0x804D; - public static final int GL_RGB2_EXT = 0x804E; - public static final int GL_RGB4_EXT = 0x804F; - public static final int GL_RGB5_EXT = 0x8050; - public static final int GL_RGB8_EXT = 0x8051; - public static final int GL_RGB10_EXT = 0x8052; - public static final int GL_RGB12_EXT = 0x8053; - public static final int GL_RGB16_EXT = 0x8054; - public static final int GL_RGBA2_EXT = 0x8055; - public static final int GL_RGBA4_EXT = 0x8056; - public static final int GL_RGB5_A1_EXT = 0x8057; - public static final int GL_RGBA8_EXT = 0x8058; - public static final int GL_RGB10_A2_EXT = 0x8059; - public static final int GL_RGBA12_EXT = 0x805A; - public static final int GL_RGBA16_EXT = 0x805B; - public static final int GL_TEXTURE_RED_SIZE_EXT = 0x805C; - public static final int GL_TEXTURE_GREEN_SIZE_EXT = 0x805D; - public static final int GL_TEXTURE_BLUE_SIZE_EXT = 0x805E; - public static final int GL_TEXTURE_ALPHA_SIZE_EXT = 0x805F; - public static final int GL_TEXTURE_LUMINANCE_SIZE_EXT = 0x8060; - public static final int GL_TEXTURE_INTENSITY_SIZE_EXT = 0x8061; - public static final int GL_REPLACE_EXT = 0x8062; - public static final int GL_PROXY_TEXTURE_1D_EXT = 0x8063; - public static final int GL_PROXY_TEXTURE_2D_EXT = 0x8064; - public static final int GL_TEXTURE_TOO_LARGE_EXT = 0x8065; +public interface GLEXTTexture { + int GL_ALPHA4_EXT = 0x803B; + int GL_ALPHA8_EXT = 0x803C; + int GL_ALPHA12_EXT = 0x803D; + int GL_ALPHA16_EXT = 0x803E; + int GL_LUMINANCE4_EXT = 0x803F; + int GL_LUMINANCE8_EXT = 0x8040; + int GL_LUMINANCE12_EXT = 0x8041; + int GL_LUMINANCE16_EXT = 0x8042; + int GL_LUMINANCE4_ALPHA4_EXT = 0x8043; + int GL_LUMINANCE6_ALPHA2_EXT = 0x8044; + int GL_LUMINANCE8_ALPHA8_EXT = 0x8045; + int GL_LUMINANCE12_ALPHA4_EXT = 0x8046; + int GL_LUMINANCE12_ALPHA12_EXT = 0x8047; + int GL_LUMINANCE16_ALPHA16_EXT = 0x8048; + int GL_INTENSITY_EXT = 0x8049; + int GL_INTENSITY4_EXT = 0x804A; + int GL_INTENSITY8_EXT = 0x804B; + int GL_INTENSITY12_EXT = 0x804C; + int GL_INTENSITY16_EXT = 0x804D; + int GL_RGB2_EXT = 0x804E; + int GL_RGB4_EXT = 0x804F; + int GL_RGB5_EXT = 0x8050; + int GL_RGB8_EXT = 0x8051; + int GL_RGB10_EXT = 0x8052; + int GL_RGB12_EXT = 0x8053; + int GL_RGB16_EXT = 0x8054; + int GL_RGBA2_EXT = 0x8055; + int GL_RGBA4_EXT = 0x8056; + int GL_RGB5_A1_EXT = 0x8057; + int GL_RGBA8_EXT = 0x8058; + int GL_RGB10_A2_EXT = 0x8059; + int GL_RGBA12_EXT = 0x805A; + int GL_RGBA16_EXT = 0x805B; + int GL_TEXTURE_RED_SIZE_EXT = 0x805C; + int GL_TEXTURE_GREEN_SIZE_EXT = 0x805D; + int GL_TEXTURE_BLUE_SIZE_EXT = 0x805E; + int GL_TEXTURE_ALPHA_SIZE_EXT = 0x805F; + int GL_TEXTURE_LUMINANCE_SIZE_EXT = 0x8060; + int GL_TEXTURE_INTENSITY_SIZE_EXT = 0x8061; + int GL_REPLACE_EXT = 0x8062; + int GL_PROXY_TEXTURE_1D_EXT = 0x8063; + int GL_PROXY_TEXTURE_2D_EXT = 0x8064; + int GL_TEXTURE_TOO_LARGE_EXT = 0x8065; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTexture3D.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTexture3D.java index 486e30dc..76db0b3d 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTexture3D.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTexture3D.java @@ -16,45 +16,30 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture3D} */ -public final class GLEXTTexture3D { - public static final int GL_PACK_SKIP_IMAGES_EXT = 0x806B; - public static final int GL_PACK_IMAGE_HEIGHT_EXT = 0x806C; - public static final int GL_UNPACK_SKIP_IMAGES_EXT = 0x806D; - public static final int GL_UNPACK_IMAGE_HEIGHT_EXT = 0x806E; - public static final int GL_TEXTURE_3D_EXT = 0x806F; - public static final int GL_PROXY_TEXTURE_3D_EXT = 0x8070; - public static final int GL_TEXTURE_DEPTH_EXT = 0x8071; - public static final int GL_TEXTURE_WRAP_R_EXT = 0x8072; - public static final int GL_MAX_3D_TEXTURE_SIZE_EXT = 0x8073; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_texture3D) return; - ext.glTexImage3DEXT = load.invoke("glTexImage3DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glTexSubImage3DEXT = load.invoke("glTexSubImage3DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLEXTTexture3D { + int GL_PACK_SKIP_IMAGES_EXT = 0x806B; + int GL_PACK_IMAGE_HEIGHT_EXT = 0x806C; + int GL_UNPACK_SKIP_IMAGES_EXT = 0x806D; + int GL_UNPACK_IMAGE_HEIGHT_EXT = 0x806E; + int GL_TEXTURE_3D_EXT = 0x806F; + int GL_PROXY_TEXTURE_3D_EXT = 0x8070; + int GL_TEXTURE_DEPTH_EXT = 0x8071; + int GL_TEXTURE_WRAP_R_EXT = 0x8072; + int GL_MAX_3D_TEXTURE_SIZE_EXT = 0x8073; - public static void glTexImage3DEXT(int target, int level, int internalformat, int width, int height, int depth, int border, int format, int type, @NativeType("const void *") MemorySegment pixels) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexImage3DEXT).invokeExact(target, level, internalformat, width, height, depth, border, format, type, pixels); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexImage3DEXT(int target, int level, int internalformat, int width, int height, int depth, int border, int format, int type, @NativeType("const void *") MemorySegment pixels) { + throw new ContextException(); } - public static void glTexSubImage3DEXT(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, @NativeType("const void *") MemorySegment pixels) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexSubImage3DEXT).invokeExact(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexSubImage3DEXT(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, @NativeType("const void *") MemorySegment pixels) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureArray.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureArray.java index e6dab75e..033731cf 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureArray.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureArray.java @@ -16,36 +16,25 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_array} */ -public final class GLEXTTextureArray { - public static final int GL_TEXTURE_1D_ARRAY_EXT = 0x8C18; - public static final int GL_PROXY_TEXTURE_1D_ARRAY_EXT = 0x8C19; - public static final int GL_TEXTURE_2D_ARRAY_EXT = 0x8C1A; - public static final int GL_PROXY_TEXTURE_2D_ARRAY_EXT = 0x8C1B; - public static final int GL_TEXTURE_BINDING_1D_ARRAY_EXT = 0x8C1C; - public static final int GL_TEXTURE_BINDING_2D_ARRAY_EXT = 0x8C1D; - public static final int GL_MAX_ARRAY_TEXTURE_LAYERS_EXT = 0x88FF; - public static final int GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT = 0x884E; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_texture_array) return; - ext.glFramebufferTextureLayerEXT = load.invoke("glFramebufferTextureLayerEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLEXTTextureArray { + int GL_TEXTURE_1D_ARRAY_EXT = 0x8C18; + int GL_PROXY_TEXTURE_1D_ARRAY_EXT = 0x8C19; + int GL_TEXTURE_2D_ARRAY_EXT = 0x8C1A; + int GL_PROXY_TEXTURE_2D_ARRAY_EXT = 0x8C1B; + int GL_TEXTURE_BINDING_1D_ARRAY_EXT = 0x8C1C; + int GL_TEXTURE_BINDING_2D_ARRAY_EXT = 0x8C1D; + int GL_MAX_ARRAY_TEXTURE_LAYERS_EXT = 0x88FF; + int GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT = 0x884E; - public static void glFramebufferTextureLayerEXT(int target, int attachment, int texture, int level, int layer) { - final var ext = getExtCapabilities(); - try { - check(ext.glFramebufferTextureLayerEXT).invokeExact(target, attachment, texture, level, layer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFramebufferTextureLayerEXT(int target, int attachment, int texture, int level, int layer) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureBufferObject.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureBufferObject.java index 38ffce42..52b8470f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureBufferObject.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureBufferObject.java @@ -16,33 +16,22 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_buffer_object} */ -public final class GLEXTTextureBufferObject { - public static final int GL_TEXTURE_BUFFER_EXT = 0x8C2A; - public static final int GL_MAX_TEXTURE_BUFFER_SIZE_EXT = 0x8C2B; - public static final int GL_TEXTURE_BINDING_BUFFER_EXT = 0x8C2C; - public static final int GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT = 0x8C2D; - public static final int GL_TEXTURE_BUFFER_FORMAT_EXT = 0x8C2E; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_texture_buffer_object) return; - ext.glTexBufferEXT = load.invoke("glTexBufferEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLEXTTextureBufferObject { + int GL_TEXTURE_BUFFER_EXT = 0x8C2A; + int GL_MAX_TEXTURE_BUFFER_SIZE_EXT = 0x8C2B; + int GL_TEXTURE_BINDING_BUFFER_EXT = 0x8C2C; + int GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT = 0x8C2D; + int GL_TEXTURE_BUFFER_FORMAT_EXT = 0x8C2E; - public static void glTexBufferEXT(int target, int internalformat, int buffer) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexBufferEXT).invokeExact(target, internalformat, buffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexBufferEXT(int target, int internalformat, int buffer) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureCompressionLatc.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureCompressionLatc.java index 112d1d66..c6a36922 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureCompressionLatc.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureCompressionLatc.java @@ -16,20 +16,16 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_compression_latc} */ -public final class GLEXTTextureCompressionLatc { - public static final int GL_COMPRESSED_LUMINANCE_LATC1_EXT = 0x8C70; - public static final int GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT = 0x8C71; - public static final int GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT = 0x8C72; - public static final int GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT = 0x8C73; +public interface GLEXTTextureCompressionLatc { + int GL_COMPRESSED_LUMINANCE_LATC1_EXT = 0x8C70; + int GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT = 0x8C71; + int GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT = 0x8C72; + int GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT = 0x8C73; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureCompressionRgtc.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureCompressionRgtc.java index 61e04e58..a9758dc3 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureCompressionRgtc.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureCompressionRgtc.java @@ -16,20 +16,16 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_compression_rgtc} */ -public final class GLEXTTextureCompressionRgtc { - public static final int GL_COMPRESSED_RED_RGTC1_EXT = 0x8DBB; - public static final int GL_COMPRESSED_SIGNED_RED_RGTC1_EXT = 0x8DBC; - public static final int GL_COMPRESSED_RED_GREEN_RGTC2_EXT = 0x8DBD; - public static final int GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT = 0x8DBE; +public interface GLEXTTextureCompressionRgtc { + int GL_COMPRESSED_RED_RGTC1_EXT = 0x8DBB; + int GL_COMPRESSED_SIGNED_RED_RGTC1_EXT = 0x8DBC; + int GL_COMPRESSED_RED_GREEN_RGTC2_EXT = 0x8DBD; + int GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT = 0x8DBE; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureCompressionS3tc.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureCompressionS3tc.java index 82de3d5f..2759be90 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureCompressionS3tc.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureCompressionS3tc.java @@ -16,20 +16,16 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_compression_s3tc} */ -public final class GLEXTTextureCompressionS3tc { - public static final int GL_COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0; - public static final int GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1; - public static final int GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2; - public static final int GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3; +public interface GLEXTTextureCompressionS3tc { + int GL_COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0; + int GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1; + int GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2; + int GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureCubeMap.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureCubeMap.java index 22511a64..495762f9 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureCubeMap.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureCubeMap.java @@ -16,28 +16,24 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_cube_map} */ -public final class GLEXTTextureCubeMap { - public static final int GL_NORMAL_MAP_EXT = 0x8511; - public static final int GL_REFLECTION_MAP_EXT = 0x8512; - public static final int GL_TEXTURE_CUBE_MAP_EXT = 0x8513; - public static final int GL_TEXTURE_BINDING_CUBE_MAP_EXT = 0x8514; - public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT = 0x8515; - public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT = 0x8516; - public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT = 0x8517; - public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT = 0x8518; - public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT = 0x8519; - public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT = 0x851A; - public static final int GL_PROXY_TEXTURE_CUBE_MAP_EXT = 0x851B; - public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT = 0x851C; +public interface GLEXTTextureCubeMap { + int GL_NORMAL_MAP_EXT = 0x8511; + int GL_REFLECTION_MAP_EXT = 0x8512; + int GL_TEXTURE_CUBE_MAP_EXT = 0x8513; + int GL_TEXTURE_BINDING_CUBE_MAP_EXT = 0x8514; + int GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT = 0x8515; + int GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT = 0x8516; + int GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT = 0x8517; + int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT = 0x8518; + int GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT = 0x8519; + int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT = 0x851A; + int GL_PROXY_TEXTURE_CUBE_MAP_EXT = 0x851B; + int GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT = 0x851C; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureEnvCombine.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureEnvCombine.java index 5e127443..54ae1757 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureEnvCombine.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureEnvCombine.java @@ -16,37 +16,33 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_env_combine} */ -public final class GLEXTTextureEnvCombine { - public static final int GL_COMBINE_EXT = 0x8570; - public static final int GL_COMBINE_RGB_EXT = 0x8571; - public static final int GL_COMBINE_ALPHA_EXT = 0x8572; - public static final int GL_RGB_SCALE_EXT = 0x8573; - public static final int GL_ADD_SIGNED_EXT = 0x8574; - public static final int GL_INTERPOLATE_EXT = 0x8575; - public static final int GL_CONSTANT_EXT = 0x8576; - public static final int GL_PRIMARY_COLOR_EXT = 0x8577; - public static final int GL_PREVIOUS_EXT = 0x8578; - public static final int GL_SOURCE0_RGB_EXT = 0x8580; - public static final int GL_SOURCE1_RGB_EXT = 0x8581; - public static final int GL_SOURCE2_RGB_EXT = 0x8582; - public static final int GL_SOURCE0_ALPHA_EXT = 0x8588; - public static final int GL_SOURCE1_ALPHA_EXT = 0x8589; - public static final int GL_SOURCE2_ALPHA_EXT = 0x858A; - public static final int GL_OPERAND0_RGB_EXT = 0x8590; - public static final int GL_OPERAND1_RGB_EXT = 0x8591; - public static final int GL_OPERAND2_RGB_EXT = 0x8592; - public static final int GL_OPERAND0_ALPHA_EXT = 0x8598; - public static final int GL_OPERAND1_ALPHA_EXT = 0x8599; - public static final int GL_OPERAND2_ALPHA_EXT = 0x859A; +public interface GLEXTTextureEnvCombine { + int GL_COMBINE_EXT = 0x8570; + int GL_COMBINE_RGB_EXT = 0x8571; + int GL_COMBINE_ALPHA_EXT = 0x8572; + int GL_RGB_SCALE_EXT = 0x8573; + int GL_ADD_SIGNED_EXT = 0x8574; + int GL_INTERPOLATE_EXT = 0x8575; + int GL_CONSTANT_EXT = 0x8576; + int GL_PRIMARY_COLOR_EXT = 0x8577; + int GL_PREVIOUS_EXT = 0x8578; + int GL_SOURCE0_RGB_EXT = 0x8580; + int GL_SOURCE1_RGB_EXT = 0x8581; + int GL_SOURCE2_RGB_EXT = 0x8582; + int GL_SOURCE0_ALPHA_EXT = 0x8588; + int GL_SOURCE1_ALPHA_EXT = 0x8589; + int GL_SOURCE2_ALPHA_EXT = 0x858A; + int GL_OPERAND0_RGB_EXT = 0x8590; + int GL_OPERAND1_RGB_EXT = 0x8591; + int GL_OPERAND2_RGB_EXT = 0x8592; + int GL_OPERAND0_ALPHA_EXT = 0x8598; + int GL_OPERAND1_ALPHA_EXT = 0x8599; + int GL_OPERAND2_ALPHA_EXT = 0x859A; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureEnvDot3.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureEnvDot3.java index d2760d3c..d53769f9 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureEnvDot3.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureEnvDot3.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_env_dot3} */ -public final class GLEXTTextureEnvDot3 { - public static final int GL_DOT3_RGB_EXT = 0x8740; - public static final int GL_DOT3_RGBA_EXT = 0x8741; +public interface GLEXTTextureEnvDot3 { + int GL_DOT3_RGB_EXT = 0x8740; + int GL_DOT3_RGBA_EXT = 0x8741; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureFilterAnisotropic.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureFilterAnisotropic.java index 8c08803e..43dd691e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureFilterAnisotropic.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureFilterAnisotropic.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_filter_anisotropic} */ -public final class GLEXTTextureFilterAnisotropic { - public static final int GL_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE; - public static final int GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF; +public interface GLEXTTextureFilterAnisotropic { + int GL_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE; + int GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureFilterMinmax.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureFilterMinmax.java index 3661ffe8..54b5f568 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureFilterMinmax.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureFilterMinmax.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_filter_minmax} */ -public final class GLEXTTextureFilterMinmax { - public static final int GL_TEXTURE_REDUCTION_MODE_EXT = 0x9366; - public static final int GL_WEIGHTED_AVERAGE_EXT = 0x9367; +public interface GLEXTTextureFilterMinmax { + int GL_TEXTURE_REDUCTION_MODE_EXT = 0x9366; + int GL_WEIGHTED_AVERAGE_EXT = 0x9367; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureInteger.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureInteger.java index 9ceef17a..541fe216 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureInteger.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureInteger.java @@ -16,115 +16,84 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_integer} */ -public final class GLEXTTextureInteger { - public static final int GL_RGBA32UI_EXT = 0x8D70; - public static final int GL_RGB32UI_EXT = 0x8D71; - public static final int GL_ALPHA32UI_EXT = 0x8D72; - public static final int GL_INTENSITY32UI_EXT = 0x8D73; - public static final int GL_LUMINANCE32UI_EXT = 0x8D74; - public static final int GL_LUMINANCE_ALPHA32UI_EXT = 0x8D75; - public static final int GL_RGBA16UI_EXT = 0x8D76; - public static final int GL_RGB16UI_EXT = 0x8D77; - public static final int GL_ALPHA16UI_EXT = 0x8D78; - public static final int GL_INTENSITY16UI_EXT = 0x8D79; - public static final int GL_LUMINANCE16UI_EXT = 0x8D7A; - public static final int GL_LUMINANCE_ALPHA16UI_EXT = 0x8D7B; - public static final int GL_RGBA8UI_EXT = 0x8D7C; - public static final int GL_RGB8UI_EXT = 0x8D7D; - public static final int GL_ALPHA8UI_EXT = 0x8D7E; - public static final int GL_INTENSITY8UI_EXT = 0x8D7F; - public static final int GL_LUMINANCE8UI_EXT = 0x8D80; - public static final int GL_LUMINANCE_ALPHA8UI_EXT = 0x8D81; - public static final int GL_RGBA32I_EXT = 0x8D82; - public static final int GL_RGB32I_EXT = 0x8D83; - public static final int GL_ALPHA32I_EXT = 0x8D84; - public static final int GL_INTENSITY32I_EXT = 0x8D85; - public static final int GL_LUMINANCE32I_EXT = 0x8D86; - public static final int GL_LUMINANCE_ALPHA32I_EXT = 0x8D87; - public static final int GL_RGBA16I_EXT = 0x8D88; - public static final int GL_RGB16I_EXT = 0x8D89; - public static final int GL_ALPHA16I_EXT = 0x8D8A; - public static final int GL_INTENSITY16I_EXT = 0x8D8B; - public static final int GL_LUMINANCE16I_EXT = 0x8D8C; - public static final int GL_LUMINANCE_ALPHA16I_EXT = 0x8D8D; - public static final int GL_RGBA8I_EXT = 0x8D8E; - public static final int GL_RGB8I_EXT = 0x8D8F; - public static final int GL_ALPHA8I_EXT = 0x8D90; - public static final int GL_INTENSITY8I_EXT = 0x8D91; - public static final int GL_LUMINANCE8I_EXT = 0x8D92; - public static final int GL_LUMINANCE_ALPHA8I_EXT = 0x8D93; - public static final int GL_RED_INTEGER_EXT = 0x8D94; - public static final int GL_GREEN_INTEGER_EXT = 0x8D95; - public static final int GL_BLUE_INTEGER_EXT = 0x8D96; - public static final int GL_ALPHA_INTEGER_EXT = 0x8D97; - public static final int GL_RGB_INTEGER_EXT = 0x8D98; - public static final int GL_RGBA_INTEGER_EXT = 0x8D99; - public static final int GL_BGR_INTEGER_EXT = 0x8D9A; - public static final int GL_BGRA_INTEGER_EXT = 0x8D9B; - public static final int GL_LUMINANCE_INTEGER_EXT = 0x8D9C; - public static final int GL_LUMINANCE_ALPHA_INTEGER_EXT = 0x8D9D; - public static final int GL_RGBA_INTEGER_MODE_EXT = 0x8D9E; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_texture_integer) return; - ext.glTexParameterIivEXT = load.invoke("glTexParameterIivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glTexParameterIuivEXT = load.invoke("glTexParameterIuivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetTexParameterIivEXT = load.invoke("glGetTexParameterIivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetTexParameterIuivEXT = load.invoke("glGetTexParameterIuivEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glClearColorIiEXT = load.invoke("glClearColorIiEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glClearColorIuiEXT = load.invoke("glClearColorIuiEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLEXTTextureInteger { + int GL_RGBA32UI_EXT = 0x8D70; + int GL_RGB32UI_EXT = 0x8D71; + int GL_ALPHA32UI_EXT = 0x8D72; + int GL_INTENSITY32UI_EXT = 0x8D73; + int GL_LUMINANCE32UI_EXT = 0x8D74; + int GL_LUMINANCE_ALPHA32UI_EXT = 0x8D75; + int GL_RGBA16UI_EXT = 0x8D76; + int GL_RGB16UI_EXT = 0x8D77; + int GL_ALPHA16UI_EXT = 0x8D78; + int GL_INTENSITY16UI_EXT = 0x8D79; + int GL_LUMINANCE16UI_EXT = 0x8D7A; + int GL_LUMINANCE_ALPHA16UI_EXT = 0x8D7B; + int GL_RGBA8UI_EXT = 0x8D7C; + int GL_RGB8UI_EXT = 0x8D7D; + int GL_ALPHA8UI_EXT = 0x8D7E; + int GL_INTENSITY8UI_EXT = 0x8D7F; + int GL_LUMINANCE8UI_EXT = 0x8D80; + int GL_LUMINANCE_ALPHA8UI_EXT = 0x8D81; + int GL_RGBA32I_EXT = 0x8D82; + int GL_RGB32I_EXT = 0x8D83; + int GL_ALPHA32I_EXT = 0x8D84; + int GL_INTENSITY32I_EXT = 0x8D85; + int GL_LUMINANCE32I_EXT = 0x8D86; + int GL_LUMINANCE_ALPHA32I_EXT = 0x8D87; + int GL_RGBA16I_EXT = 0x8D88; + int GL_RGB16I_EXT = 0x8D89; + int GL_ALPHA16I_EXT = 0x8D8A; + int GL_INTENSITY16I_EXT = 0x8D8B; + int GL_LUMINANCE16I_EXT = 0x8D8C; + int GL_LUMINANCE_ALPHA16I_EXT = 0x8D8D; + int GL_RGBA8I_EXT = 0x8D8E; + int GL_RGB8I_EXT = 0x8D8F; + int GL_ALPHA8I_EXT = 0x8D90; + int GL_INTENSITY8I_EXT = 0x8D91; + int GL_LUMINANCE8I_EXT = 0x8D92; + int GL_LUMINANCE_ALPHA8I_EXT = 0x8D93; + int GL_RED_INTEGER_EXT = 0x8D94; + int GL_GREEN_INTEGER_EXT = 0x8D95; + int GL_BLUE_INTEGER_EXT = 0x8D96; + int GL_ALPHA_INTEGER_EXT = 0x8D97; + int GL_RGB_INTEGER_EXT = 0x8D98; + int GL_RGBA_INTEGER_EXT = 0x8D99; + int GL_BGR_INTEGER_EXT = 0x8D9A; + int GL_BGRA_INTEGER_EXT = 0x8D9B; + int GL_LUMINANCE_INTEGER_EXT = 0x8D9C; + int GL_LUMINANCE_ALPHA_INTEGER_EXT = 0x8D9D; + int GL_RGBA_INTEGER_MODE_EXT = 0x8D9E; - public static void glTexParameterIivEXT(int target, int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexParameterIivEXT).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexParameterIivEXT(int target, int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glTexParameterIuivEXT(int target, int pname, @NativeType("const GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexParameterIuivEXT).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexParameterIuivEXT(int target, int pname, @NativeType("const GLuint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetTexParameterIivEXT(int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetTexParameterIivEXT).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetTexParameterIivEXT(int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetTexParameterIuivEXT(int target, int pname, @NativeType("GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetTexParameterIuivEXT).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetTexParameterIuivEXT(int target, int pname, @NativeType("GLuint *") MemorySegment params) { + throw new ContextException(); } - public static void glClearColorIiEXT(int red, int green, int blue, int alpha) { - final var ext = getExtCapabilities(); - try { - check(ext.glClearColorIiEXT).invokeExact(red, green, blue, alpha); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glClearColorIiEXT(int red, int green, int blue, int alpha) { + throw new ContextException(); } - public static void glClearColorIuiEXT(int red, int green, int blue, int alpha) { - final var ext = getExtCapabilities(); - try { - check(ext.glClearColorIuiEXT).invokeExact(red, green, blue, alpha); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glClearColorIuiEXT(int red, int green, int blue, int alpha) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureLodBias.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureLodBias.java index 4387d6e7..9f06f325 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureLodBias.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureLodBias.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_lod_bias} */ -public final class GLEXTTextureLodBias { - public static final int GL_MAX_TEXTURE_LOD_BIAS_EXT = 0x84FD; - public static final int GL_TEXTURE_FILTER_CONTROL_EXT = 0x8500; - public static final int GL_TEXTURE_LOD_BIAS_EXT = 0x8501; +public interface GLEXTTextureLodBias { + int GL_MAX_TEXTURE_LOD_BIAS_EXT = 0x84FD; + int GL_TEXTURE_FILTER_CONTROL_EXT = 0x8500; + int GL_TEXTURE_LOD_BIAS_EXT = 0x8501; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureMirrorClamp.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureMirrorClamp.java index 7cd56c74..5b46ba1c 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureMirrorClamp.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureMirrorClamp.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_mirror_clamp} */ -public final class GLEXTTextureMirrorClamp { - public static final int GL_MIRROR_CLAMP_EXT = 0x8742; - public static final int GL_MIRROR_CLAMP_TO_EDGE_EXT = 0x8743; - public static final int GL_MIRROR_CLAMP_TO_BORDER_EXT = 0x8912; +public interface GLEXTTextureMirrorClamp { + int GL_MIRROR_CLAMP_EXT = 0x8742; + int GL_MIRROR_CLAMP_TO_EDGE_EXT = 0x8743; + int GL_MIRROR_CLAMP_TO_BORDER_EXT = 0x8912; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureObject.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureObject.java index b1ea171d..a6d6cd51 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureObject.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureObject.java @@ -16,75 +16,42 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_object} */ -public final class GLEXTTextureObject { - public static final int GL_TEXTURE_PRIORITY_EXT = 0x8066; - public static final int GL_TEXTURE_RESIDENT_EXT = 0x8067; - public static final int GL_TEXTURE_1D_BINDING_EXT = 0x8068; - public static final int GL_TEXTURE_2D_BINDING_EXT = 0x8069; - public static final int GL_TEXTURE_3D_BINDING_EXT = 0x806A; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_texture_object) return; - ext.glAreTexturesResidentEXT = load.invoke("glAreTexturesResidentEXT", of(JAVA_BYTE, JAVA_INT, ADDRESS, ADDRESS)); - ext.glBindTextureEXT = load.invoke("glBindTextureEXT", ofVoid(JAVA_INT, JAVA_INT)); - ext.glDeleteTexturesEXT = load.invoke("glDeleteTexturesEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glGenTexturesEXT = load.invoke("glGenTexturesEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glIsTextureEXT = load.invoke("glIsTextureEXT", of(JAVA_BYTE, JAVA_INT)); - ext.glPrioritizeTexturesEXT = load.invoke("glPrioritizeTexturesEXT", ofVoid(JAVA_INT, ADDRESS, ADDRESS)); - } - - public static boolean glAreTexturesResidentEXT(int n, @NativeType("const GLuint *") MemorySegment textures, @NativeType("GLboolean *") MemorySegment residences) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glAreTexturesResidentEXT).invokeExact(n, textures, residences); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLEXTTextureObject { + int GL_TEXTURE_PRIORITY_EXT = 0x8066; + int GL_TEXTURE_RESIDENT_EXT = 0x8067; + int GL_TEXTURE_1D_BINDING_EXT = 0x8068; + int GL_TEXTURE_2D_BINDING_EXT = 0x8069; + int GL_TEXTURE_3D_BINDING_EXT = 0x806A; + + default boolean glAreTexturesResidentEXT(int n, @NativeType("const GLuint *") MemorySegment textures, @NativeType("GLboolean *") MemorySegment residences) { + throw new ContextException(); } - public static void glBindTextureEXT(int target, int texture) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindTextureEXT).invokeExact(target, texture); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBindTextureEXT(int target, int texture) { + throw new ContextException(); } - public static void glDeleteTexturesEXT(int n, @NativeType("const GLuint *") MemorySegment textures) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteTexturesEXT).invokeExact(n, textures); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDeleteTexturesEXT(int n, @NativeType("const GLuint *") MemorySegment textures) { + throw new ContextException(); } - public static void glGenTexturesEXT(int n, @NativeType("GLuint *") MemorySegment textures) { - final var ext = getExtCapabilities(); - try { - check(ext.glGenTexturesEXT).invokeExact(n, textures); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGenTexturesEXT(int n, @NativeType("GLuint *") MemorySegment textures) { + throw new ContextException(); } - public static boolean glIsTextureEXT(int texture) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsTextureEXT).invokeExact(texture); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsTextureEXT(int texture) { + throw new ContextException(); } - public static void glPrioritizeTexturesEXT(int n, @NativeType("const GLuint *") MemorySegment textures, @NativeType("const GLclampf *") MemorySegment priorities) { - final var ext = getExtCapabilities(); - try { - check(ext.glPrioritizeTexturesEXT).invokeExact(n, textures, priorities); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPrioritizeTexturesEXT(int n, @NativeType("const GLuint *") MemorySegment textures, @NativeType("const GLclampf *") MemorySegment priorities) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTexturePerturbNormal.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTexturePerturbNormal.java index 2b005b58..8d8873d0 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTexturePerturbNormal.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTexturePerturbNormal.java @@ -16,30 +16,19 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_perturb_normal} */ -public final class GLEXTTexturePerturbNormal { - public static final int GL_PERTURB_EXT = 0x85AE; - public static final int GL_TEXTURE_NORMAL_EXT = 0x85AF; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_texture_perturb_normal) return; - ext.glTextureNormalEXT = load.invoke("glTextureNormalEXT", ofVoid(JAVA_INT)); - } +public interface GLEXTTexturePerturbNormal { + int GL_PERTURB_EXT = 0x85AE; + int GL_TEXTURE_NORMAL_EXT = 0x85AF; - public static void glTextureNormalEXT(int mode) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureNormalEXT).invokeExact(mode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureNormalEXT(int mode) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSharedExponent.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSharedExponent.java index 4630c092..2e6d904f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSharedExponent.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSharedExponent.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_shared_exponent} */ -public final class GLEXTTextureSharedExponent { - public static final int GL_RGB9_E5_EXT = 0x8C3D; - public static final int GL_UNSIGNED_INT_5_9_9_9_REV_EXT = 0x8C3E; - public static final int GL_TEXTURE_SHARED_SIZE_EXT = 0x8C3F; +public interface GLEXTTextureSharedExponent { + int GL_RGB9_E5_EXT = 0x8C3D; + int GL_UNSIGNED_INT_5_9_9_9_REV_EXT = 0x8C3E; + int GL_TEXTURE_SHARED_SIZE_EXT = 0x8C3F; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSnorm.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSnorm.java index 9d0cb635..c8a3a9db 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSnorm.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSnorm.java @@ -16,32 +16,28 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_snorm} */ -public final class GLEXTTextureSnorm { - public static final int GL_ALPHA_SNORM = 0x9010; - public static final int GL_LUMINANCE_SNORM = 0x9011; - public static final int GL_LUMINANCE_ALPHA_SNORM = 0x9012; - public static final int GL_INTENSITY_SNORM = 0x9013; - public static final int GL_ALPHA8_SNORM = 0x9014; - public static final int GL_LUMINANCE8_SNORM = 0x9015; - public static final int GL_LUMINANCE8_ALPHA8_SNORM = 0x9016; - public static final int GL_INTENSITY8_SNORM = 0x9017; - public static final int GL_ALPHA16_SNORM = 0x9018; - public static final int GL_LUMINANCE16_SNORM = 0x9019; - public static final int GL_LUMINANCE16_ALPHA16_SNORM = 0x901A; - public static final int GL_INTENSITY16_SNORM = 0x901B; - public static final int GL_RED_SNORM = 0x8F90; - public static final int GL_RG_SNORM = 0x8F91; - public static final int GL_RGB_SNORM = 0x8F92; - public static final int GL_RGBA_SNORM = 0x8F93; +public interface GLEXTTextureSnorm { + int GL_ALPHA_SNORM = 0x9010; + int GL_LUMINANCE_SNORM = 0x9011; + int GL_LUMINANCE_ALPHA_SNORM = 0x9012; + int GL_INTENSITY_SNORM = 0x9013; + int GL_ALPHA8_SNORM = 0x9014; + int GL_LUMINANCE8_SNORM = 0x9015; + int GL_LUMINANCE8_ALPHA8_SNORM = 0x9016; + int GL_INTENSITY8_SNORM = 0x9017; + int GL_ALPHA16_SNORM = 0x9018; + int GL_LUMINANCE16_SNORM = 0x9019; + int GL_LUMINANCE16_ALPHA16_SNORM = 0x901A; + int GL_INTENSITY16_SNORM = 0x901B; + int GL_RED_SNORM = 0x8F90; + int GL_RG_SNORM = 0x8F91; + int GL_RGB_SNORM = 0x8F92; + int GL_RGBA_SNORM = 0x8F93; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSrgb.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSrgb.java index d235182e..2d46c8b0 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSrgb.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSrgb.java @@ -16,32 +16,28 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_sRGB} */ -public final class GLEXTTextureSrgb { - public static final int GL_SRGB_EXT = 0x8C40; - public static final int GL_SRGB8_EXT = 0x8C41; - public static final int GL_SRGB_ALPHA_EXT = 0x8C42; - public static final int GL_SRGB8_ALPHA8_EXT = 0x8C43; - public static final int GL_SLUMINANCE_ALPHA_EXT = 0x8C44; - public static final int GL_SLUMINANCE8_ALPHA8_EXT = 0x8C45; - public static final int GL_SLUMINANCE_EXT = 0x8C46; - public static final int GL_SLUMINANCE8_EXT = 0x8C47; - public static final int GL_COMPRESSED_SRGB_EXT = 0x8C48; - public static final int GL_COMPRESSED_SRGB_ALPHA_EXT = 0x8C49; - public static final int GL_COMPRESSED_SLUMINANCE_EXT = 0x8C4A; - public static final int GL_COMPRESSED_SLUMINANCE_ALPHA_EXT = 0x8C4B; - public static final int GL_COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8C4C; - public static final int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8C4D; - public static final int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8C4E; - public static final int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8C4F; +public interface GLEXTTextureSrgb { + int GL_SRGB_EXT = 0x8C40; + int GL_SRGB8_EXT = 0x8C41; + int GL_SRGB_ALPHA_EXT = 0x8C42; + int GL_SRGB8_ALPHA8_EXT = 0x8C43; + int GL_SLUMINANCE_ALPHA_EXT = 0x8C44; + int GL_SLUMINANCE8_ALPHA8_EXT = 0x8C45; + int GL_SLUMINANCE_EXT = 0x8C46; + int GL_SLUMINANCE8_EXT = 0x8C47; + int GL_COMPRESSED_SRGB_EXT = 0x8C48; + int GL_COMPRESSED_SRGB_ALPHA_EXT = 0x8C49; + int GL_COMPRESSED_SLUMINANCE_EXT = 0x8C4A; + int GL_COMPRESSED_SLUMINANCE_ALPHA_EXT = 0x8C4B; + int GL_COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8C4C; + int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8C4D; + int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8C4E; + int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8C4F; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSrgbDecode.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSrgbDecode.java index 9528acf6..32da9731 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSrgbDecode.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSrgbDecode.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_sRGB_decode} */ -public final class GLEXTTextureSrgbDecode { - public static final int GL_TEXTURE_SRGB_DECODE_EXT = 0x8A48; - public static final int GL_DECODE_EXT = 0x8A49; - public static final int GL_SKIP_DECODE_EXT = 0x8A4A; +public interface GLEXTTextureSrgbDecode { + int GL_TEXTURE_SRGB_DECODE_EXT = 0x8A48; + int GL_DECODE_EXT = 0x8A49; + int GL_SKIP_DECODE_EXT = 0x8A4A; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSrgbR8.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSrgbR8.java index 8db954d1..491d38de 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSrgbR8.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSrgbR8.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_sRGB_R8} */ -public final class GLEXTTextureSrgbR8 { - public static final int GL_SR8_EXT = 0x8FBD; +public interface GLEXTTextureSrgbR8 { + int GL_SR8_EXT = 0x8FBD; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSrgbRGB.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSrgbRGB.java index 32424b0c..486848a2 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSrgbRGB.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSrgbRGB.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_sRGB_RG8} */ -public final class GLEXTTextureSrgbRGB { - public static final int GL_SRG8_EXT = 0x8FBE; +public interface GLEXTTextureSrgbRGB { + int GL_SRG8_EXT = 0x8FBE; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureStorage.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureStorage.java index 757893be..18c4004a 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureStorage.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureStorage.java @@ -16,62 +16,43 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_storage} */ -public final class GLEXTTextureStorage { - public static final int GL_TEXTURE_IMMUTABLE_FORMAT_EXT = 0x912F; - public static final int GL_RGBA32F_EXT = 0x8814; - public static final int GL_RGB32F_EXT = 0x8815; - public static final int GL_ALPHA32F_EXT = 0x8816; - public static final int GL_LUMINANCE32F_EXT = 0x8818; - public static final int GL_LUMINANCE_ALPHA32F_EXT = 0x8819; - public static final int GL_RGBA16F_EXT = 0x881A; - public static final int GL_RGB16F_EXT = 0x881B; - public static final int GL_ALPHA16F_EXT = 0x881C; - public static final int GL_LUMINANCE16F_EXT = 0x881E; - public static final int GL_LUMINANCE_ALPHA16F_EXT = 0x881F; - public static final int GL_BGRA8_EXT = 0x93A1; - public static final int GL_R8_EXT = 0x8229; - public static final int GL_RG8_EXT = 0x822B; - public static final int GL_R32F_EXT = 0x822E; - public static final int GL_RG32F_EXT = 0x8230; - public static final int GL_R16F_EXT = 0x822D; - public static final int GL_RG16F_EXT = 0x822F; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_texture_storage) return; - ext.glTexStorage1DEXT = load.invoke("glTexStorage1DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glTexStorage2DEXT = load.invoke("glTexStorage2DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glTexStorage3DEXT = load.invoke("glTexStorage3DEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLEXTTextureStorage { + int GL_TEXTURE_IMMUTABLE_FORMAT_EXT = 0x912F; + int GL_RGBA32F_EXT = 0x8814; + int GL_RGB32F_EXT = 0x8815; + int GL_ALPHA32F_EXT = 0x8816; + int GL_LUMINANCE32F_EXT = 0x8818; + int GL_LUMINANCE_ALPHA32F_EXT = 0x8819; + int GL_RGBA16F_EXT = 0x881A; + int GL_RGB16F_EXT = 0x881B; + int GL_ALPHA16F_EXT = 0x881C; + int GL_LUMINANCE16F_EXT = 0x881E; + int GL_LUMINANCE_ALPHA16F_EXT = 0x881F; + int GL_BGRA8_EXT = 0x93A1; + int GL_R8_EXT = 0x8229; + int GL_RG8_EXT = 0x822B; + int GL_R32F_EXT = 0x822E; + int GL_RG32F_EXT = 0x8230; + int GL_R16F_EXT = 0x822D; + int GL_RG16F_EXT = 0x822F; - public static void glTexStorage1DEXT(int target, int levels, int internalformat, int width) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexStorage1DEXT).invokeExact(target, levels, internalformat, width); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexStorage1DEXT(int target, int levels, int internalformat, int width) { + throw new ContextException(); } - public static void glTexStorage2DEXT(int target, int levels, int internalformat, int width, int height) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexStorage2DEXT).invokeExact(target, levels, internalformat, width, height); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexStorage2DEXT(int target, int levels, int internalformat, int width, int height) { + throw new ContextException(); } - public static void glTexStorage3DEXT(int target, int levels, int internalformat, int width, int height, int depth) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexStorage3DEXT).invokeExact(target, levels, internalformat, width, height, depth); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexStorage3DEXT(int target, int levels, int internalformat, int width, int height, int depth) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSwizzle.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSwizzle.java index 6c20fb0b..bbe9f549 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSwizzle.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTextureSwizzle.java @@ -16,21 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_texture_swizzle} */ -public final class GLEXTTextureSwizzle { - public static final int GL_TEXTURE_SWIZZLE_R_EXT = 0x8E42; - public static final int GL_TEXTURE_SWIZZLE_G_EXT = 0x8E43; - public static final int GL_TEXTURE_SWIZZLE_B_EXT = 0x8E44; - public static final int GL_TEXTURE_SWIZZLE_A_EXT = 0x8E45; - public static final int GL_TEXTURE_SWIZZLE_RGBA_EXT = 0x8E46; +public interface GLEXTTextureSwizzle { + int GL_TEXTURE_SWIZZLE_R_EXT = 0x8E42; + int GL_TEXTURE_SWIZZLE_G_EXT = 0x8E43; + int GL_TEXTURE_SWIZZLE_B_EXT = 0x8E44; + int GL_TEXTURE_SWIZZLE_A_EXT = 0x8E45; + int GL_TEXTURE_SWIZZLE_RGBA_EXT = 0x8E46; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTimerQuery.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTimerQuery.java index 7b4cd363..274151ef 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTimerQuery.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTimerQuery.java @@ -16,37 +16,22 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_timer_query} */ -public final class GLEXTTimerQuery { - public static final int GL_TIME_ELAPSED_EXT = 0x88BF; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_timer_query) return; - ext.glGetQueryObjecti64vEXT = load.invoke("glGetQueryObjecti64vEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetQueryObjectui64vEXT = load.invoke("glGetQueryObjectui64vEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLEXTTimerQuery { + int GL_TIME_ELAPSED_EXT = 0x88BF; - public static void glGetQueryObjecti64vEXT(int id, int pname, @NativeType("GLint64 *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetQueryObjecti64vEXT).invokeExact(id, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetQueryObjecti64vEXT(int id, int pname, @NativeType("GLint64 *") MemorySegment params) { + throw new ContextException(); } - public static void glGetQueryObjectui64vEXT(int id, int pname, @NativeType("GLuint64 *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetQueryObjectui64vEXT).invokeExact(id, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetQueryObjectui64vEXT(int id, int pname, @NativeType("GLuint64 *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTransformFeedback.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTransformFeedback.java index 168f9066..251a3e82 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTransformFeedback.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTTransformFeedback.java @@ -16,91 +16,56 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_transform_feedback} */ -public final class GLEXTTransformFeedback { - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_EXT = 0x8C8E; - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT = 0x8C84; - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT = 0x8C85; - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT = 0x8C8F; - public static final int GL_INTERLEAVED_ATTRIBS_EXT = 0x8C8C; - public static final int GL_SEPARATE_ATTRIBS_EXT = 0x8C8D; - public static final int GL_PRIMITIVES_GENERATED_EXT = 0x8C87; - public static final int GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT = 0x8C88; - public static final int GL_RASTERIZER_DISCARD_EXT = 0x8C89; - public static final int GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT = 0x8C8A; - public static final int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT = 0x8C8B; - public static final int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT = 0x8C80; - public static final int GL_TRANSFORM_FEEDBACK_VARYINGS_EXT = 0x8C83; - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT = 0x8C7F; - public static final int GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT = 0x8C76; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_transform_feedback) return; - ext.glBeginTransformFeedbackEXT = load.invoke("glBeginTransformFeedbackEXT", ofVoid(JAVA_INT)); - ext.glEndTransformFeedbackEXT = load.invoke("glEndTransformFeedbackEXT", ofVoid()); - ext.glBindBufferRangeEXT = load.invoke("glBindBufferRangeEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG)); - ext.glBindBufferOffsetEXT = load.invoke("glBindBufferOffsetEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glBindBufferBaseEXT = load.invoke("glBindBufferBaseEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glTransformFeedbackVaryingsEXT = load.invoke("glTransformFeedbackVaryingsEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT)); - ext.glGetTransformFeedbackVaryingEXT = load.invoke("glGetTransformFeedbackVaryingEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, ADDRESS, ADDRESS, ADDRESS)); - } +public interface GLEXTTransformFeedback { + int GL_TRANSFORM_FEEDBACK_BUFFER_EXT = 0x8C8E; + int GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT = 0x8C84; + int GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT = 0x8C85; + int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT = 0x8C8F; + int GL_INTERLEAVED_ATTRIBS_EXT = 0x8C8C; + int GL_SEPARATE_ATTRIBS_EXT = 0x8C8D; + int GL_PRIMITIVES_GENERATED_EXT = 0x8C87; + int GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT = 0x8C88; + int GL_RASTERIZER_DISCARD_EXT = 0x8C89; + int GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT = 0x8C8A; + int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT = 0x8C8B; + int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT = 0x8C80; + int GL_TRANSFORM_FEEDBACK_VARYINGS_EXT = 0x8C83; + int GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT = 0x8C7F; + int GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT = 0x8C76; - public static void glBeginTransformFeedbackEXT(int primitiveMode) { - final var ext = getExtCapabilities(); - try { - check(ext.glBeginTransformFeedbackEXT).invokeExact(primitiveMode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBeginTransformFeedbackEXT(int primitiveMode) { + throw new ContextException(); } - public static void glEndTransformFeedbackEXT() { - final var ext = getExtCapabilities(); - try { - check(ext.glEndTransformFeedbackEXT).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEndTransformFeedbackEXT() { + throw new ContextException(); } - public static void glBindBufferRangeEXT(int target, int index, int buffer, long offset, long size) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindBufferRangeEXT).invokeExact(target, index, buffer, offset, size); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBindBufferRangeEXT(int target, int index, int buffer, long offset, long size) { + throw new ContextException(); } - public static void glBindBufferOffsetEXT(int target, int index, int buffer, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindBufferOffsetEXT).invokeExact(target, index, buffer, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBindBufferOffsetEXT(int target, int index, int buffer, long offset) { + throw new ContextException(); } - public static void glBindBufferBaseEXT(int target, int index, int buffer) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindBufferBaseEXT).invokeExact(target, index, buffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBindBufferBaseEXT(int target, int index, int buffer) { + throw new ContextException(); } - public static void glTransformFeedbackVaryingsEXT(int program, int count, @NativeType("const GLchar *const*") MemorySegment varyings, int bufferMode) { - final var ext = getExtCapabilities(); - try { - check(ext.glTransformFeedbackVaryingsEXT).invokeExact(program, count, varyings, bufferMode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTransformFeedbackVaryingsEXT(int program, int count, @NativeType("const GLchar *const*") MemorySegment varyings, int bufferMode) { + throw new ContextException(); } - public static void glGetTransformFeedbackVaryingEXT(int program, int index, int bufSize, @NativeType("GLsizei *") MemorySegment length, @NativeType("GLsizei *") MemorySegment size, @NativeType("GLenum *") MemorySegment type, @NativeType("GLchar *") MemorySegment name) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetTransformFeedbackVaryingEXT).invokeExact(program, index, bufSize, length, size, type, name); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetTransformFeedbackVaryingEXT(int program, int index, int bufSize, @NativeType("GLsizei *") MemorySegment length, @NativeType("GLsizei *") MemorySegment size, @NativeType("GLenum *") MemorySegment type, @NativeType("GLchar *") MemorySegment name) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTVertexArray.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTVertexArray.java index 25f135ff..a24e1054 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTVertexArray.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTVertexArray.java @@ -16,124 +16,81 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_vertex_array} */ -public final class GLEXTVertexArray { - public static final int GL_VERTEX_ARRAY_EXT = 0x8074; - public static final int GL_NORMAL_ARRAY_EXT = 0x8075; - public static final int GL_COLOR_ARRAY_EXT = 0x8076; - public static final int GL_INDEX_ARRAY_EXT = 0x8077; - public static final int GL_TEXTURE_COORD_ARRAY_EXT = 0x8078; - public static final int GL_EDGE_FLAG_ARRAY_EXT = 0x8079; - public static final int GL_VERTEX_ARRAY_SIZE_EXT = 0x807A; - public static final int GL_VERTEX_ARRAY_TYPE_EXT = 0x807B; - public static final int GL_VERTEX_ARRAY_STRIDE_EXT = 0x807C; - public static final int GL_VERTEX_ARRAY_COUNT_EXT = 0x807D; - public static final int GL_NORMAL_ARRAY_TYPE_EXT = 0x807E; - public static final int GL_NORMAL_ARRAY_STRIDE_EXT = 0x807F; - public static final int GL_NORMAL_ARRAY_COUNT_EXT = 0x8080; - public static final int GL_COLOR_ARRAY_SIZE_EXT = 0x8081; - public static final int GL_COLOR_ARRAY_TYPE_EXT = 0x8082; - public static final int GL_COLOR_ARRAY_STRIDE_EXT = 0x8083; - public static final int GL_COLOR_ARRAY_COUNT_EXT = 0x8084; - public static final int GL_INDEX_ARRAY_TYPE_EXT = 0x8085; - public static final int GL_INDEX_ARRAY_STRIDE_EXT = 0x8086; - public static final int GL_INDEX_ARRAY_COUNT_EXT = 0x8087; - public static final int GL_TEXTURE_COORD_ARRAY_SIZE_EXT = 0x8088; - public static final int GL_TEXTURE_COORD_ARRAY_TYPE_EXT = 0x8089; - public static final int GL_TEXTURE_COORD_ARRAY_STRIDE_EXT = 0x808A; - public static final int GL_TEXTURE_COORD_ARRAY_COUNT_EXT = 0x808B; - public static final int GL_EDGE_FLAG_ARRAY_STRIDE_EXT = 0x808C; - public static final int GL_EDGE_FLAG_ARRAY_COUNT_EXT = 0x808D; - public static final int GL_VERTEX_ARRAY_POINTER_EXT = 0x808E; - public static final int GL_NORMAL_ARRAY_POINTER_EXT = 0x808F; - public static final int GL_COLOR_ARRAY_POINTER_EXT = 0x8090; - public static final int GL_INDEX_ARRAY_POINTER_EXT = 0x8091; - public static final int GL_TEXTURE_COORD_ARRAY_POINTER_EXT = 0x8092; - public static final int GL_EDGE_FLAG_ARRAY_POINTER_EXT = 0x8093; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_vertex_array) return; - ext.glArrayElementEXT = load.invoke("glArrayElementEXT", ofVoid(JAVA_INT)); - ext.glColorPointerEXT = load.invoke("glColorPointerEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glDrawArraysEXT = load.invoke("glDrawArraysEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glEdgeFlagPointerEXT = load.invoke("glEdgeFlagPointerEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetPointervEXT = load.invoke("glGetPointervEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glIndexPointerEXT = load.invoke("glIndexPointerEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glNormalPointerEXT = load.invoke("glNormalPointerEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glTexCoordPointerEXT = load.invoke("glTexCoordPointerEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVertexPointerEXT = load.invoke("glVertexPointerEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLEXTVertexArray { + int GL_VERTEX_ARRAY_EXT = 0x8074; + int GL_NORMAL_ARRAY_EXT = 0x8075; + int GL_COLOR_ARRAY_EXT = 0x8076; + int GL_INDEX_ARRAY_EXT = 0x8077; + int GL_TEXTURE_COORD_ARRAY_EXT = 0x8078; + int GL_EDGE_FLAG_ARRAY_EXT = 0x8079; + int GL_VERTEX_ARRAY_SIZE_EXT = 0x807A; + int GL_VERTEX_ARRAY_TYPE_EXT = 0x807B; + int GL_VERTEX_ARRAY_STRIDE_EXT = 0x807C; + int GL_VERTEX_ARRAY_COUNT_EXT = 0x807D; + int GL_NORMAL_ARRAY_TYPE_EXT = 0x807E; + int GL_NORMAL_ARRAY_STRIDE_EXT = 0x807F; + int GL_NORMAL_ARRAY_COUNT_EXT = 0x8080; + int GL_COLOR_ARRAY_SIZE_EXT = 0x8081; + int GL_COLOR_ARRAY_TYPE_EXT = 0x8082; + int GL_COLOR_ARRAY_STRIDE_EXT = 0x8083; + int GL_COLOR_ARRAY_COUNT_EXT = 0x8084; + int GL_INDEX_ARRAY_TYPE_EXT = 0x8085; + int GL_INDEX_ARRAY_STRIDE_EXT = 0x8086; + int GL_INDEX_ARRAY_COUNT_EXT = 0x8087; + int GL_TEXTURE_COORD_ARRAY_SIZE_EXT = 0x8088; + int GL_TEXTURE_COORD_ARRAY_TYPE_EXT = 0x8089; + int GL_TEXTURE_COORD_ARRAY_STRIDE_EXT = 0x808A; + int GL_TEXTURE_COORD_ARRAY_COUNT_EXT = 0x808B; + int GL_EDGE_FLAG_ARRAY_STRIDE_EXT = 0x808C; + int GL_EDGE_FLAG_ARRAY_COUNT_EXT = 0x808D; + int GL_VERTEX_ARRAY_POINTER_EXT = 0x808E; + int GL_NORMAL_ARRAY_POINTER_EXT = 0x808F; + int GL_COLOR_ARRAY_POINTER_EXT = 0x8090; + int GL_INDEX_ARRAY_POINTER_EXT = 0x8091; + int GL_TEXTURE_COORD_ARRAY_POINTER_EXT = 0x8092; + int GL_EDGE_FLAG_ARRAY_POINTER_EXT = 0x8093; - public static void glArrayElementEXT(int i) { - final var ext = getExtCapabilities(); - try { - check(ext.glArrayElementEXT).invokeExact(i); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glArrayElementEXT(int i) { + throw new ContextException(); } - public static void glColorPointerEXT(int size, int type, int stride, int count, @NativeType("const void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glColorPointerEXT).invokeExact(size, type, stride, count, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glColorPointerEXT(int size, int type, int stride, int count, @NativeType("const void *") MemorySegment pointer) { + throw new ContextException(); } - public static void glDrawArraysEXT(int mode, int first, int count) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawArraysEXT).invokeExact(mode, first, count); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDrawArraysEXT(int mode, int first, int count) { + throw new ContextException(); } - public static void glEdgeFlagPointerEXT(int stride, int count, @NativeType("const GLboolean *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glEdgeFlagPointerEXT).invokeExact(stride, count, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEdgeFlagPointerEXT(int stride, int count, @NativeType("const GLboolean *") MemorySegment pointer) { + throw new ContextException(); } - public static void glGetPointervEXT(int pname, @NativeType("void **") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPointervEXT).invokeExact(pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPointervEXT(int pname, @NativeType("void **") MemorySegment params) { + throw new ContextException(); } - public static void glIndexPointerEXT(int type, int stride, int count, @NativeType("const void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glIndexPointerEXT).invokeExact(type, stride, count, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glIndexPointerEXT(int type, int stride, int count, @NativeType("const void *") MemorySegment pointer) { + throw new ContextException(); } - public static void glNormalPointerEXT(int type, int stride, int count, @NativeType("const void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glNormalPointerEXT).invokeExact(type, stride, count, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNormalPointerEXT(int type, int stride, int count, @NativeType("const void *") MemorySegment pointer) { + throw new ContextException(); } - public static void glTexCoordPointerEXT(int size, int type, int stride, int count, @NativeType("const void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoordPointerEXT).invokeExact(size, type, stride, count, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoordPointerEXT(int size, int type, int stride, int count, @NativeType("const void *") MemorySegment pointer) { + throw new ContextException(); } - public static void glVertexPointerEXT(int size, int type, int stride, int count, @NativeType("const void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexPointerEXT).invokeExact(size, type, stride, count, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexPointerEXT(int size, int type, int stride, int count, @NativeType("const void *") MemorySegment pointer) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTVertexAttrib64bit.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTVertexAttrib64bit.java index dc7eac02..78ba059f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTVertexAttrib64bit.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTVertexAttrib64bit.java @@ -16,112 +16,65 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_vertex_attrib_64bit} */ -public final class GLEXTVertexAttrib64bit { - public static final int GL_DOUBLE_VEC2_EXT = 0x8FFC; - public static final int GL_DOUBLE_VEC3_EXT = 0x8FFD; - public static final int GL_DOUBLE_VEC4_EXT = 0x8FFE; - public static final int GL_DOUBLE_MAT2_EXT = 0x8F46; - public static final int GL_DOUBLE_MAT3_EXT = 0x8F47; - public static final int GL_DOUBLE_MAT4_EXT = 0x8F48; - public static final int GL_DOUBLE_MAT2x3_EXT = 0x8F49; - public static final int GL_DOUBLE_MAT2x4_EXT = 0x8F4A; - public static final int GL_DOUBLE_MAT3x2_EXT = 0x8F4B; - public static final int GL_DOUBLE_MAT3x4_EXT = 0x8F4C; - public static final int GL_DOUBLE_MAT4x2_EXT = 0x8F4D; - public static final int GL_DOUBLE_MAT4x3_EXT = 0x8F4E; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_vertex_attrib_64bit) return; - ext.glVertexAttribL1dEXT = load.invoke("glVertexAttribL1dEXT", ofVoid(JAVA_INT, JAVA_DOUBLE)); - ext.glVertexAttribL2dEXT = load.invoke("glVertexAttribL2dEXT", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glVertexAttribL3dEXT = load.invoke("glVertexAttribL3dEXT", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glVertexAttribL4dEXT = load.invoke("glVertexAttribL4dEXT", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glVertexAttribL1dvEXT = load.invoke("glVertexAttribL1dvEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribL2dvEXT = load.invoke("glVertexAttribL2dvEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribL3dvEXT = load.invoke("glVertexAttribL3dvEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribL4dvEXT = load.invoke("glVertexAttribL4dvEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribLPointerEXT = load.invoke("glVertexAttribLPointerEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVertexAttribLdvEXT = load.invoke("glGetVertexAttribLdvEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLEXTVertexAttrib64bit { + int GL_DOUBLE_VEC2_EXT = 0x8FFC; + int GL_DOUBLE_VEC3_EXT = 0x8FFD; + int GL_DOUBLE_VEC4_EXT = 0x8FFE; + int GL_DOUBLE_MAT2_EXT = 0x8F46; + int GL_DOUBLE_MAT3_EXT = 0x8F47; + int GL_DOUBLE_MAT4_EXT = 0x8F48; + int GL_DOUBLE_MAT2x3_EXT = 0x8F49; + int GL_DOUBLE_MAT2x4_EXT = 0x8F4A; + int GL_DOUBLE_MAT3x2_EXT = 0x8F4B; + int GL_DOUBLE_MAT3x4_EXT = 0x8F4C; + int GL_DOUBLE_MAT4x2_EXT = 0x8F4D; + int GL_DOUBLE_MAT4x3_EXT = 0x8F4E; - public static void glVertexAttribL1dEXT(int index, double x) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL1dEXT).invokeExact(index, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL1dEXT(int index, double x) { + throw new ContextException(); } - public static void glVertexAttribL2dEXT(int index, double x, double y) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL2dEXT).invokeExact(index, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL2dEXT(int index, double x, double y) { + throw new ContextException(); } - public static void glVertexAttribL3dEXT(int index, double x, double y, double z) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL3dEXT).invokeExact(index, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL3dEXT(int index, double x, double y, double z) { + throw new ContextException(); } - public static void glVertexAttribL4dEXT(int index, double x, double y, double z, double w) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL4dEXT).invokeExact(index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL4dEXT(int index, double x, double y, double z, double w) { + throw new ContextException(); } - public static void glVertexAttribL1dvEXT(int index, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL1dvEXT).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL1dvEXT(int index, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribL2dvEXT(int index, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL2dvEXT).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL2dvEXT(int index, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribL3dvEXT(int index, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL3dvEXT).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL3dvEXT(int index, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribL4dvEXT(int index, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL4dvEXT).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL4dvEXT(int index, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribLPointerEXT(int index, int size, int type, int stride, @NativeType("const void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribLPointerEXT).invokeExact(index, size, type, stride, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribLPointerEXT(int index, int size, int type, int stride, @NativeType("const void *") MemorySegment pointer) { + throw new ContextException(); } - public static void glGetVertexAttribLdvEXT(int index, int pname, @NativeType("GLdouble *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVertexAttribLdvEXT).invokeExact(index, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVertexAttribLdvEXT(int index, int pname, @NativeType("GLdouble *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTVertexShader.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTVertexShader.java index 3821f511..015addef 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTVertexShader.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTVertexShader.java @@ -16,474 +16,291 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_vertex_shader} */ -public final class GLEXTVertexShader { - public static final int GL_VERTEX_SHADER_EXT = 0x8780; - public static final int GL_VERTEX_SHADER_BINDING_EXT = 0x8781; - public static final int GL_OP_INDEX_EXT = 0x8782; - public static final int GL_OP_NEGATE_EXT = 0x8783; - public static final int GL_OP_DOT3_EXT = 0x8784; - public static final int GL_OP_DOT4_EXT = 0x8785; - public static final int GL_OP_MUL_EXT = 0x8786; - public static final int GL_OP_ADD_EXT = 0x8787; - public static final int GL_OP_MADD_EXT = 0x8788; - public static final int GL_OP_FRAC_EXT = 0x8789; - public static final int GL_OP_MAX_EXT = 0x878A; - public static final int GL_OP_MIN_EXT = 0x878B; - public static final int GL_OP_SET_GE_EXT = 0x878C; - public static final int GL_OP_SET_LT_EXT = 0x878D; - public static final int GL_OP_CLAMP_EXT = 0x878E; - public static final int GL_OP_FLOOR_EXT = 0x878F; - public static final int GL_OP_ROUND_EXT = 0x8790; - public static final int GL_OP_EXP_BASE_2_EXT = 0x8791; - public static final int GL_OP_LOG_BASE_2_EXT = 0x8792; - public static final int GL_OP_POWER_EXT = 0x8793; - public static final int GL_OP_RECIP_EXT = 0x8794; - public static final int GL_OP_RECIP_SQRT_EXT = 0x8795; - public static final int GL_OP_SUB_EXT = 0x8796; - public static final int GL_OP_CROSS_PRODUCT_EXT = 0x8797; - public static final int GL_OP_MULTIPLY_MATRIX_EXT = 0x8798; - public static final int GL_OP_MOV_EXT = 0x8799; - public static final int GL_OUTPUT_VERTEX_EXT = 0x879A; - public static final int GL_OUTPUT_COLOR0_EXT = 0x879B; - public static final int GL_OUTPUT_COLOR1_EXT = 0x879C; - public static final int GL_OUTPUT_TEXTURE_COORD0_EXT = 0x879D; - public static final int GL_OUTPUT_TEXTURE_COORD1_EXT = 0x879E; - public static final int GL_OUTPUT_TEXTURE_COORD2_EXT = 0x879F; - public static final int GL_OUTPUT_TEXTURE_COORD3_EXT = 0x87A0; - public static final int GL_OUTPUT_TEXTURE_COORD4_EXT = 0x87A1; - public static final int GL_OUTPUT_TEXTURE_COORD5_EXT = 0x87A2; - public static final int GL_OUTPUT_TEXTURE_COORD6_EXT = 0x87A3; - public static final int GL_OUTPUT_TEXTURE_COORD7_EXT = 0x87A4; - public static final int GL_OUTPUT_TEXTURE_COORD8_EXT = 0x87A5; - public static final int GL_OUTPUT_TEXTURE_COORD9_EXT = 0x87A6; - public static final int GL_OUTPUT_TEXTURE_COORD10_EXT = 0x87A7; - public static final int GL_OUTPUT_TEXTURE_COORD11_EXT = 0x87A8; - public static final int GL_OUTPUT_TEXTURE_COORD12_EXT = 0x87A9; - public static final int GL_OUTPUT_TEXTURE_COORD13_EXT = 0x87AA; - public static final int GL_OUTPUT_TEXTURE_COORD14_EXT = 0x87AB; - public static final int GL_OUTPUT_TEXTURE_COORD15_EXT = 0x87AC; - public static final int GL_OUTPUT_TEXTURE_COORD16_EXT = 0x87AD; - public static final int GL_OUTPUT_TEXTURE_COORD17_EXT = 0x87AE; - public static final int GL_OUTPUT_TEXTURE_COORD18_EXT = 0x87AF; - public static final int GL_OUTPUT_TEXTURE_COORD19_EXT = 0x87B0; - public static final int GL_OUTPUT_TEXTURE_COORD20_EXT = 0x87B1; - public static final int GL_OUTPUT_TEXTURE_COORD21_EXT = 0x87B2; - public static final int GL_OUTPUT_TEXTURE_COORD22_EXT = 0x87B3; - public static final int GL_OUTPUT_TEXTURE_COORD23_EXT = 0x87B4; - public static final int GL_OUTPUT_TEXTURE_COORD24_EXT = 0x87B5; - public static final int GL_OUTPUT_TEXTURE_COORD25_EXT = 0x87B6; - public static final int GL_OUTPUT_TEXTURE_COORD26_EXT = 0x87B7; - public static final int GL_OUTPUT_TEXTURE_COORD27_EXT = 0x87B8; - public static final int GL_OUTPUT_TEXTURE_COORD28_EXT = 0x87B9; - public static final int GL_OUTPUT_TEXTURE_COORD29_EXT = 0x87BA; - public static final int GL_OUTPUT_TEXTURE_COORD30_EXT = 0x87BB; - public static final int GL_OUTPUT_TEXTURE_COORD31_EXT = 0x87BC; - public static final int GL_OUTPUT_FOG_EXT = 0x87BD; - public static final int GL_SCALAR_EXT = 0x87BE; - public static final int GL_VECTOR_EXT = 0x87BF; - public static final int GL_MATRIX_EXT = 0x87C0; - public static final int GL_VARIANT_EXT = 0x87C1; - public static final int GL_INVARIANT_EXT = 0x87C2; - public static final int GL_LOCAL_CONSTANT_EXT = 0x87C3; - public static final int GL_LOCAL_EXT = 0x87C4; - public static final int GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87C5; - public static final int GL_MAX_VERTEX_SHADER_VARIANTS_EXT = 0x87C6; - public static final int GL_MAX_VERTEX_SHADER_INVARIANTS_EXT = 0x87C7; - public static final int GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87C8; - public static final int GL_MAX_VERTEX_SHADER_LOCALS_EXT = 0x87C9; - public static final int GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CA; - public static final int GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT = 0x87CB; - public static final int GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87CC; - public static final int GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT = 0x87CD; - public static final int GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT = 0x87CE; - public static final int GL_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CF; - public static final int GL_VERTEX_SHADER_VARIANTS_EXT = 0x87D0; - public static final int GL_VERTEX_SHADER_INVARIANTS_EXT = 0x87D1; - public static final int GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87D2; - public static final int GL_VERTEX_SHADER_LOCALS_EXT = 0x87D3; - public static final int GL_VERTEX_SHADER_OPTIMIZED_EXT = 0x87D4; - public static final int GL_X_EXT = 0x87D5; - public static final int GL_Y_EXT = 0x87D6; - public static final int GL_Z_EXT = 0x87D7; - public static final int GL_W_EXT = 0x87D8; - public static final int GL_NEGATIVE_X_EXT = 0x87D9; - public static final int GL_NEGATIVE_Y_EXT = 0x87DA; - public static final int GL_NEGATIVE_Z_EXT = 0x87DB; - public static final int GL_NEGATIVE_W_EXT = 0x87DC; - public static final int GL_ZERO_EXT = 0x87DD; - public static final int GL_ONE_EXT = 0x87DE; - public static final int GL_NEGATIVE_ONE_EXT = 0x87DF; - public static final int GL_NORMALIZED_RANGE_EXT = 0x87E0; - public static final int GL_FULL_RANGE_EXT = 0x87E1; - public static final int GL_CURRENT_VERTEX_EXT = 0x87E2; - public static final int GL_MVP_MATRIX_EXT = 0x87E3; - public static final int GL_VARIANT_VALUE_EXT = 0x87E4; - public static final int GL_VARIANT_DATATYPE_EXT = 0x87E5; - public static final int GL_VARIANT_ARRAY_STRIDE_EXT = 0x87E6; - public static final int GL_VARIANT_ARRAY_TYPE_EXT = 0x87E7; - public static final int GL_VARIANT_ARRAY_EXT = 0x87E8; - public static final int GL_VARIANT_ARRAY_POINTER_EXT = 0x87E9; - public static final int GL_INVARIANT_VALUE_EXT = 0x87EA; - public static final int GL_INVARIANT_DATATYPE_EXT = 0x87EB; - public static final int GL_LOCAL_CONSTANT_VALUE_EXT = 0x87EC; - public static final int GL_LOCAL_CONSTANT_DATATYPE_EXT = 0x87ED; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_vertex_shader) return; - ext.glBeginVertexShaderEXT = load.invoke("glBeginVertexShaderEXT", ofVoid()); - ext.glEndVertexShaderEXT = load.invoke("glEndVertexShaderEXT", ofVoid()); - ext.glBindVertexShaderEXT = load.invoke("glBindVertexShaderEXT", ofVoid(JAVA_INT)); - ext.glGenVertexShadersEXT = load.invoke("glGenVertexShadersEXT", of(JAVA_INT, JAVA_INT)); - ext.glDeleteVertexShaderEXT = load.invoke("glDeleteVertexShaderEXT", ofVoid(JAVA_INT)); - ext.glShaderOp1EXT = load.invoke("glShaderOp1EXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glShaderOp2EXT = load.invoke("glShaderOp2EXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glShaderOp3EXT = load.invoke("glShaderOp3EXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glSwizzleEXT = load.invoke("glSwizzleEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glWriteMaskEXT = load.invoke("glWriteMaskEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glInsertComponentEXT = load.invoke("glInsertComponentEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glExtractComponentEXT = load.invoke("glExtractComponentEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGenSymbolsEXT = load.invoke("glGenSymbolsEXT", of(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glSetInvariantEXT = load.invoke("glSetInvariantEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glSetLocalConstantEXT = load.invoke("glSetLocalConstantEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVariantbvEXT = load.invoke("glVariantbvEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVariantsvEXT = load.invoke("glVariantsvEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVariantivEXT = load.invoke("glVariantivEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVariantfvEXT = load.invoke("glVariantfvEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVariantdvEXT = load.invoke("glVariantdvEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVariantubvEXT = load.invoke("glVariantubvEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVariantusvEXT = load.invoke("glVariantusvEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVariantuivEXT = load.invoke("glVariantuivEXT", ofVoid(JAVA_INT, ADDRESS)); - ext.glVariantPointerEXT = load.invoke("glVariantPointerEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glEnableVariantClientStateEXT = load.invoke("glEnableVariantClientStateEXT", ofVoid(JAVA_INT)); - ext.glDisableVariantClientStateEXT = load.invoke("glDisableVariantClientStateEXT", ofVoid(JAVA_INT)); - ext.glBindLightParameterEXT = load.invoke("glBindLightParameterEXT", of(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glBindMaterialParameterEXT = load.invoke("glBindMaterialParameterEXT", of(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glBindTexGenParameterEXT = load.invoke("glBindTexGenParameterEXT", of(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glBindTextureUnitParameterEXT = load.invoke("glBindTextureUnitParameterEXT", of(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glBindParameterEXT = load.invoke("glBindParameterEXT", of(JAVA_INT, JAVA_INT)); - ext.glIsVariantEnabledEXT = load.invoke("glIsVariantEnabledEXT", of(JAVA_BYTE, JAVA_INT, JAVA_INT)); - ext.glGetVariantBooleanvEXT = load.invoke("glGetVariantBooleanvEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVariantIntegervEXT = load.invoke("glGetVariantIntegervEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVariantFloatvEXT = load.invoke("glGetVariantFloatvEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVariantPointervEXT = load.invoke("glGetVariantPointervEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetInvariantBooleanvEXT = load.invoke("glGetInvariantBooleanvEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetInvariantIntegervEXT = load.invoke("glGetInvariantIntegervEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetInvariantFloatvEXT = load.invoke("glGetInvariantFloatvEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetLocalConstantBooleanvEXT = load.invoke("glGetLocalConstantBooleanvEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetLocalConstantIntegervEXT = load.invoke("glGetLocalConstantIntegervEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetLocalConstantFloatvEXT = load.invoke("glGetLocalConstantFloatvEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static void glBeginVertexShaderEXT() { - final var ext = getExtCapabilities(); - try { - check(ext.glBeginVertexShaderEXT).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glEndVertexShaderEXT() { - final var ext = getExtCapabilities(); - try { - check(ext.glEndVertexShaderEXT).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glBindVertexShaderEXT(int id) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindVertexShaderEXT).invokeExact(id); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static int glGenVertexShadersEXT(int range) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glGenVertexShadersEXT).invokeExact(range); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glDeleteVertexShaderEXT(int id) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteVertexShaderEXT).invokeExact(id); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glShaderOp1EXT(int op, int res, int arg1) { - final var ext = getExtCapabilities(); - try { - check(ext.glShaderOp1EXT).invokeExact(op, res, arg1); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glShaderOp2EXT(int op, int res, int arg1, int arg2) { - final var ext = getExtCapabilities(); - try { - check(ext.glShaderOp2EXT).invokeExact(op, res, arg1, arg2); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glShaderOp3EXT(int op, int res, int arg1, int arg2, int arg3) { - final var ext = getExtCapabilities(); - try { - check(ext.glShaderOp3EXT).invokeExact(op, res, arg1, arg2, arg3); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glSwizzleEXT(int res, int in, int outX, int outY, int outZ, int outW) { - final var ext = getExtCapabilities(); - try { - check(ext.glSwizzleEXT).invokeExact(res, in, outX, outY, outZ, outW); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glWriteMaskEXT(int res, int in, int outX, int outY, int outZ, int outW) { - final var ext = getExtCapabilities(); - try { - check(ext.glWriteMaskEXT).invokeExact(res, in, outX, outY, outZ, outW); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLEXTVertexShader { + int GL_VERTEX_SHADER_EXT = 0x8780; + int GL_VERTEX_SHADER_BINDING_EXT = 0x8781; + int GL_OP_INDEX_EXT = 0x8782; + int GL_OP_NEGATE_EXT = 0x8783; + int GL_OP_DOT3_EXT = 0x8784; + int GL_OP_DOT4_EXT = 0x8785; + int GL_OP_MUL_EXT = 0x8786; + int GL_OP_ADD_EXT = 0x8787; + int GL_OP_MADD_EXT = 0x8788; + int GL_OP_FRAC_EXT = 0x8789; + int GL_OP_MAX_EXT = 0x878A; + int GL_OP_MIN_EXT = 0x878B; + int GL_OP_SET_GE_EXT = 0x878C; + int GL_OP_SET_LT_EXT = 0x878D; + int GL_OP_CLAMP_EXT = 0x878E; + int GL_OP_FLOOR_EXT = 0x878F; + int GL_OP_ROUND_EXT = 0x8790; + int GL_OP_EXP_BASE_2_EXT = 0x8791; + int GL_OP_LOG_BASE_2_EXT = 0x8792; + int GL_OP_POWER_EXT = 0x8793; + int GL_OP_RECIP_EXT = 0x8794; + int GL_OP_RECIP_SQRT_EXT = 0x8795; + int GL_OP_SUB_EXT = 0x8796; + int GL_OP_CROSS_PRODUCT_EXT = 0x8797; + int GL_OP_MULTIPLY_MATRIX_EXT = 0x8798; + int GL_OP_MOV_EXT = 0x8799; + int GL_OUTPUT_VERTEX_EXT = 0x879A; + int GL_OUTPUT_COLOR0_EXT = 0x879B; + int GL_OUTPUT_COLOR1_EXT = 0x879C; + int GL_OUTPUT_TEXTURE_COORD0_EXT = 0x879D; + int GL_OUTPUT_TEXTURE_COORD1_EXT = 0x879E; + int GL_OUTPUT_TEXTURE_COORD2_EXT = 0x879F; + int GL_OUTPUT_TEXTURE_COORD3_EXT = 0x87A0; + int GL_OUTPUT_TEXTURE_COORD4_EXT = 0x87A1; + int GL_OUTPUT_TEXTURE_COORD5_EXT = 0x87A2; + int GL_OUTPUT_TEXTURE_COORD6_EXT = 0x87A3; + int GL_OUTPUT_TEXTURE_COORD7_EXT = 0x87A4; + int GL_OUTPUT_TEXTURE_COORD8_EXT = 0x87A5; + int GL_OUTPUT_TEXTURE_COORD9_EXT = 0x87A6; + int GL_OUTPUT_TEXTURE_COORD10_EXT = 0x87A7; + int GL_OUTPUT_TEXTURE_COORD11_EXT = 0x87A8; + int GL_OUTPUT_TEXTURE_COORD12_EXT = 0x87A9; + int GL_OUTPUT_TEXTURE_COORD13_EXT = 0x87AA; + int GL_OUTPUT_TEXTURE_COORD14_EXT = 0x87AB; + int GL_OUTPUT_TEXTURE_COORD15_EXT = 0x87AC; + int GL_OUTPUT_TEXTURE_COORD16_EXT = 0x87AD; + int GL_OUTPUT_TEXTURE_COORD17_EXT = 0x87AE; + int GL_OUTPUT_TEXTURE_COORD18_EXT = 0x87AF; + int GL_OUTPUT_TEXTURE_COORD19_EXT = 0x87B0; + int GL_OUTPUT_TEXTURE_COORD20_EXT = 0x87B1; + int GL_OUTPUT_TEXTURE_COORD21_EXT = 0x87B2; + int GL_OUTPUT_TEXTURE_COORD22_EXT = 0x87B3; + int GL_OUTPUT_TEXTURE_COORD23_EXT = 0x87B4; + int GL_OUTPUT_TEXTURE_COORD24_EXT = 0x87B5; + int GL_OUTPUT_TEXTURE_COORD25_EXT = 0x87B6; + int GL_OUTPUT_TEXTURE_COORD26_EXT = 0x87B7; + int GL_OUTPUT_TEXTURE_COORD27_EXT = 0x87B8; + int GL_OUTPUT_TEXTURE_COORD28_EXT = 0x87B9; + int GL_OUTPUT_TEXTURE_COORD29_EXT = 0x87BA; + int GL_OUTPUT_TEXTURE_COORD30_EXT = 0x87BB; + int GL_OUTPUT_TEXTURE_COORD31_EXT = 0x87BC; + int GL_OUTPUT_FOG_EXT = 0x87BD; + int GL_SCALAR_EXT = 0x87BE; + int GL_VECTOR_EXT = 0x87BF; + int GL_MATRIX_EXT = 0x87C0; + int GL_VARIANT_EXT = 0x87C1; + int GL_INVARIANT_EXT = 0x87C2; + int GL_LOCAL_CONSTANT_EXT = 0x87C3; + int GL_LOCAL_EXT = 0x87C4; + int GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87C5; + int GL_MAX_VERTEX_SHADER_VARIANTS_EXT = 0x87C6; + int GL_MAX_VERTEX_SHADER_INVARIANTS_EXT = 0x87C7; + int GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87C8; + int GL_MAX_VERTEX_SHADER_LOCALS_EXT = 0x87C9; + int GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CA; + int GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT = 0x87CB; + int GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87CC; + int GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT = 0x87CD; + int GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT = 0x87CE; + int GL_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CF; + int GL_VERTEX_SHADER_VARIANTS_EXT = 0x87D0; + int GL_VERTEX_SHADER_INVARIANTS_EXT = 0x87D1; + int GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87D2; + int GL_VERTEX_SHADER_LOCALS_EXT = 0x87D3; + int GL_VERTEX_SHADER_OPTIMIZED_EXT = 0x87D4; + int GL_X_EXT = 0x87D5; + int GL_Y_EXT = 0x87D6; + int GL_Z_EXT = 0x87D7; + int GL_W_EXT = 0x87D8; + int GL_NEGATIVE_X_EXT = 0x87D9; + int GL_NEGATIVE_Y_EXT = 0x87DA; + int GL_NEGATIVE_Z_EXT = 0x87DB; + int GL_NEGATIVE_W_EXT = 0x87DC; + int GL_ZERO_EXT = 0x87DD; + int GL_ONE_EXT = 0x87DE; + int GL_NEGATIVE_ONE_EXT = 0x87DF; + int GL_NORMALIZED_RANGE_EXT = 0x87E0; + int GL_FULL_RANGE_EXT = 0x87E1; + int GL_CURRENT_VERTEX_EXT = 0x87E2; + int GL_MVP_MATRIX_EXT = 0x87E3; + int GL_VARIANT_VALUE_EXT = 0x87E4; + int GL_VARIANT_DATATYPE_EXT = 0x87E5; + int GL_VARIANT_ARRAY_STRIDE_EXT = 0x87E6; + int GL_VARIANT_ARRAY_TYPE_EXT = 0x87E7; + int GL_VARIANT_ARRAY_EXT = 0x87E8; + int GL_VARIANT_ARRAY_POINTER_EXT = 0x87E9; + int GL_INVARIANT_VALUE_EXT = 0x87EA; + int GL_INVARIANT_DATATYPE_EXT = 0x87EB; + int GL_LOCAL_CONSTANT_VALUE_EXT = 0x87EC; + int GL_LOCAL_CONSTANT_DATATYPE_EXT = 0x87ED; + + default void glBeginVertexShaderEXT() { + throw new ContextException(); + } + + default void glEndVertexShaderEXT() { + throw new ContextException(); + } + + default void glBindVertexShaderEXT(int id) { + throw new ContextException(); + } + + default int glGenVertexShadersEXT(int range) { + throw new ContextException(); + } + + default void glDeleteVertexShaderEXT(int id) { + throw new ContextException(); + } + + default void glShaderOp1EXT(int op, int res, int arg1) { + throw new ContextException(); + } + + default void glShaderOp2EXT(int op, int res, int arg1, int arg2) { + throw new ContextException(); + } + + default void glShaderOp3EXT(int op, int res, int arg1, int arg2, int arg3) { + throw new ContextException(); + } + + default void glSwizzleEXT(int res, int in, int outX, int outY, int outZ, int outW) { + throw new ContextException(); + } + + default void glWriteMaskEXT(int res, int in, int outX, int outY, int outZ, int outW) { + throw new ContextException(); } - public static void glInsertComponentEXT(int res, int src, int num) { - final var ext = getExtCapabilities(); - try { - check(ext.glInsertComponentEXT).invokeExact(res, src, num); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glInsertComponentEXT(int res, int src, int num) { + throw new ContextException(); } - public static void glExtractComponentEXT(int res, int src, int num) { - final var ext = getExtCapabilities(); - try { - check(ext.glExtractComponentEXT).invokeExact(res, src, num); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glExtractComponentEXT(int res, int src, int num) { + throw new ContextException(); } - public static int glGenSymbolsEXT(int datatype, int storagetype, int range, int components) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glGenSymbolsEXT).invokeExact(datatype, storagetype, range, components); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glGenSymbolsEXT(int datatype, int storagetype, int range, int components) { + throw new ContextException(); } - public static void glSetInvariantEXT(int id, int type, @NativeType("const void *") MemorySegment addr) { - final var ext = getExtCapabilities(); - try { - check(ext.glSetInvariantEXT).invokeExact(id, type, addr); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSetInvariantEXT(int id, int type, @NativeType("const void *") MemorySegment addr) { + throw new ContextException(); } - public static void glSetLocalConstantEXT(int id, int type, @NativeType("const void *") MemorySegment addr) { - final var ext = getExtCapabilities(); - try { - check(ext.glSetLocalConstantEXT).invokeExact(id, type, addr); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSetLocalConstantEXT(int id, int type, @NativeType("const void *") MemorySegment addr) { + throw new ContextException(); } - public static void glVariantbvEXT(int id, @NativeType("const GLbyte *") MemorySegment addr) { - final var ext = getExtCapabilities(); - try { - check(ext.glVariantbvEXT).invokeExact(id, addr); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVariantbvEXT(int id, @NativeType("const GLbyte *") MemorySegment addr) { + throw new ContextException(); } - public static void glVariantsvEXT(int id, @NativeType("const GLshort *") MemorySegment addr) { - final var ext = getExtCapabilities(); - try { - check(ext.glVariantsvEXT).invokeExact(id, addr); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVariantsvEXT(int id, @NativeType("const GLshort *") MemorySegment addr) { + throw new ContextException(); } - public static void glVariantivEXT(int id, @NativeType("const GLint *") MemorySegment addr) { - final var ext = getExtCapabilities(); - try { - check(ext.glVariantivEXT).invokeExact(id, addr); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVariantivEXT(int id, @NativeType("const GLint *") MemorySegment addr) { + throw new ContextException(); } - public static void glVariantfvEXT(int id, @NativeType("const GLfloat *") MemorySegment addr) { - final var ext = getExtCapabilities(); - try { - check(ext.glVariantfvEXT).invokeExact(id, addr); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVariantfvEXT(int id, @NativeType("const GLfloat *") MemorySegment addr) { + throw new ContextException(); } - public static void glVariantdvEXT(int id, @NativeType("const GLdouble *") MemorySegment addr) { - final var ext = getExtCapabilities(); - try { - check(ext.glVariantdvEXT).invokeExact(id, addr); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVariantdvEXT(int id, @NativeType("const GLdouble *") MemorySegment addr) { + throw new ContextException(); } - public static void glVariantubvEXT(int id, @NativeType("const GLubyte *") MemorySegment addr) { - final var ext = getExtCapabilities(); - try { - check(ext.glVariantubvEXT).invokeExact(id, addr); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVariantubvEXT(int id, @NativeType("const GLubyte *") MemorySegment addr) { + throw new ContextException(); } - public static void glVariantusvEXT(int id, @NativeType("const GLushort *") MemorySegment addr) { - final var ext = getExtCapabilities(); - try { - check(ext.glVariantusvEXT).invokeExact(id, addr); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVariantusvEXT(int id, @NativeType("const GLushort *") MemorySegment addr) { + throw new ContextException(); } - public static void glVariantuivEXT(int id, @NativeType("const GLuint *") MemorySegment addr) { - final var ext = getExtCapabilities(); - try { - check(ext.glVariantuivEXT).invokeExact(id, addr); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVariantuivEXT(int id, @NativeType("const GLuint *") MemorySegment addr) { + throw new ContextException(); } - public static void glVariantPointerEXT(int id, int type, int stride, @NativeType("const void *") MemorySegment addr) { - final var ext = getExtCapabilities(); - try { - check(ext.glVariantPointerEXT).invokeExact(id, type, stride, addr); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVariantPointerEXT(int id, int type, int stride, @NativeType("const void *") MemorySegment addr) { + throw new ContextException(); } - public static void glEnableVariantClientStateEXT(int id) { - final var ext = getExtCapabilities(); - try { - check(ext.glEnableVariantClientStateEXT).invokeExact(id); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEnableVariantClientStateEXT(int id) { + throw new ContextException(); } - public static void glDisableVariantClientStateEXT(int id) { - final var ext = getExtCapabilities(); - try { - check(ext.glDisableVariantClientStateEXT).invokeExact(id); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDisableVariantClientStateEXT(int id) { + throw new ContextException(); } - public static int glBindLightParameterEXT(int light, int value) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glBindLightParameterEXT).invokeExact(light, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glBindLightParameterEXT(int light, int value) { + throw new ContextException(); } - public static int glBindMaterialParameterEXT(int face, int value) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glBindMaterialParameterEXT).invokeExact(face, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glBindMaterialParameterEXT(int face, int value) { + throw new ContextException(); } - public static int glBindTexGenParameterEXT(int unit, int coord, int value) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glBindTexGenParameterEXT).invokeExact(unit, coord, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glBindTexGenParameterEXT(int unit, int coord, int value) { + throw new ContextException(); } - public static int glBindTextureUnitParameterEXT(int unit, int value) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glBindTextureUnitParameterEXT).invokeExact(unit, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glBindTextureUnitParameterEXT(int unit, int value) { + throw new ContextException(); } - public static int glBindParameterEXT(int value) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glBindParameterEXT).invokeExact(value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glBindParameterEXT(int value) { + throw new ContextException(); } - public static boolean glIsVariantEnabledEXT(int id, int cap) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsVariantEnabledEXT).invokeExact(id, cap); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsVariantEnabledEXT(int id, int cap) { + throw new ContextException(); } - public static void glGetVariantBooleanvEXT(int id, int value, @NativeType("GLboolean *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVariantBooleanvEXT).invokeExact(id, value, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVariantBooleanvEXT(int id, int value, @NativeType("GLboolean *") MemorySegment data) { + throw new ContextException(); } - public static void glGetVariantIntegervEXT(int id, int value, @NativeType("GLint *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVariantIntegervEXT).invokeExact(id, value, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVariantIntegervEXT(int id, int value, @NativeType("GLint *") MemorySegment data) { + throw new ContextException(); } - public static void glGetVariantFloatvEXT(int id, int value, @NativeType("GLfloat *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVariantFloatvEXT).invokeExact(id, value, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVariantFloatvEXT(int id, int value, @NativeType("GLfloat *") MemorySegment data) { + throw new ContextException(); } - public static void glGetVariantPointervEXT(int id, int value, @NativeType("void **") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVariantPointervEXT).invokeExact(id, value, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVariantPointervEXT(int id, int value, @NativeType("void **") MemorySegment data) { + throw new ContextException(); } - public static void glGetInvariantBooleanvEXT(int id, int value, @NativeType("GLboolean *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetInvariantBooleanvEXT).invokeExact(id, value, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetInvariantBooleanvEXT(int id, int value, @NativeType("GLboolean *") MemorySegment data) { + throw new ContextException(); } - public static void glGetInvariantIntegervEXT(int id, int value, @NativeType("GLint *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetInvariantIntegervEXT).invokeExact(id, value, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetInvariantIntegervEXT(int id, int value, @NativeType("GLint *") MemorySegment data) { + throw new ContextException(); } - public static void glGetInvariantFloatvEXT(int id, int value, @NativeType("GLfloat *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetInvariantFloatvEXT).invokeExact(id, value, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetInvariantFloatvEXT(int id, int value, @NativeType("GLfloat *") MemorySegment data) { + throw new ContextException(); } - public static void glGetLocalConstantBooleanvEXT(int id, int value, @NativeType("GLboolean *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetLocalConstantBooleanvEXT).invokeExact(id, value, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetLocalConstantBooleanvEXT(int id, int value, @NativeType("GLboolean *") MemorySegment data) { + throw new ContextException(); } - public static void glGetLocalConstantIntegervEXT(int id, int value, @NativeType("GLint *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetLocalConstantIntegervEXT).invokeExact(id, value, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetLocalConstantIntegervEXT(int id, int value, @NativeType("GLint *") MemorySegment data) { + throw new ContextException(); } - public static void glGetLocalConstantFloatvEXT(int id, int value, @NativeType("GLfloat *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetLocalConstantFloatvEXT).invokeExact(id, value, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetLocalConstantFloatvEXT(int id, int value, @NativeType("GLfloat *") MemorySegment data) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTVertexWeighting.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTVertexWeighting.java index e735722a..6281637a 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTVertexWeighting.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTVertexWeighting.java @@ -16,57 +16,38 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_vertex_weighting} */ -public final class GLEXTVertexWeighting { - public static final int GL_MODELVIEW0_STACK_DEPTH_EXT = 0x0BA3; - public static final int GL_MODELVIEW1_STACK_DEPTH_EXT = 0x8502; - public static final int GL_MODELVIEW0_MATRIX_EXT = 0x0BA6; - public static final int GL_MODELVIEW1_MATRIX_EXT = 0x8506; - public static final int GL_VERTEX_WEIGHTING_EXT = 0x8509; - public static final int GL_MODELVIEW0_EXT = 0x1700; - public static final int GL_MODELVIEW1_EXT = 0x850A; - public static final int GL_CURRENT_VERTEX_WEIGHT_EXT = 0x850B; - public static final int GL_VERTEX_WEIGHT_ARRAY_EXT = 0x850C; - public static final int GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT = 0x850D; - public static final int GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT = 0x850E; - public static final int GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT = 0x850F; - public static final int GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT = 0x8510; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_vertex_weighting) return; - ext.glVertexWeightfEXT = load.invoke("glVertexWeightfEXT", ofVoid(JAVA_FLOAT)); - ext.glVertexWeightfvEXT = load.invoke("glVertexWeightfvEXT", ofVoid(ADDRESS)); - ext.glVertexWeightPointerEXT = load.invoke("glVertexWeightPointerEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLEXTVertexWeighting { + int GL_MODELVIEW0_STACK_DEPTH_EXT = 0x0BA3; + int GL_MODELVIEW1_STACK_DEPTH_EXT = 0x8502; + int GL_MODELVIEW0_MATRIX_EXT = 0x0BA6; + int GL_MODELVIEW1_MATRIX_EXT = 0x8506; + int GL_VERTEX_WEIGHTING_EXT = 0x8509; + int GL_MODELVIEW0_EXT = 0x1700; + int GL_MODELVIEW1_EXT = 0x850A; + int GL_CURRENT_VERTEX_WEIGHT_EXT = 0x850B; + int GL_VERTEX_WEIGHT_ARRAY_EXT = 0x850C; + int GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT = 0x850D; + int GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT = 0x850E; + int GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT = 0x850F; + int GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT = 0x8510; - public static void glVertexWeightfEXT(float weight) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexWeightfEXT).invokeExact(weight); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexWeightfEXT(float weight) { + throw new ContextException(); } - public static void glVertexWeightfvEXT(@NativeType("const GLfloat *") MemorySegment weight) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexWeightfvEXT).invokeExact(weight); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexWeightfvEXT(@NativeType("const GLfloat *") MemorySegment weight) { + throw new ContextException(); } - public static void glVertexWeightPointerEXT(int size, int type, int stride, @NativeType("const void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexWeightPointerEXT).invokeExact(size, type, stride, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexWeightPointerEXT(int size, int type, int stride, @NativeType("const void *") MemorySegment pointer) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTWin32KeyedMutex.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTWin32KeyedMutex.java index f0bf68ad..7e54f46f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTWin32KeyedMutex.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTWin32KeyedMutex.java @@ -16,38 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_win32_keyed_mutex} */ -public final class GLEXTWin32KeyedMutex { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_win32_keyed_mutex) return; - ext.glAcquireKeyedMutexWin32EXT = load.invoke("glAcquireKeyedMutexWin32EXT", of(JAVA_BYTE, JAVA_INT, JAVA_LONG, JAVA_INT)); - ext.glReleaseKeyedMutexWin32EXT = load.invoke("glReleaseKeyedMutexWin32EXT", of(JAVA_BYTE, JAVA_INT, JAVA_LONG)); - } +public interface GLEXTWin32KeyedMutex { - public static boolean glAcquireKeyedMutexWin32EXT(int memory, long key, int timeout) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glAcquireKeyedMutexWin32EXT).invokeExact(memory, key, timeout); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glAcquireKeyedMutexWin32EXT(int memory, long key, int timeout) { + throw new ContextException(); } - public static boolean glReleaseKeyedMutexWin32EXT(int memory, long key) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glReleaseKeyedMutexWin32EXT).invokeExact(memory, key); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glReleaseKeyedMutexWin32EXT(int memory, long key) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTWindowRectangles.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTWindowRectangles.java index d6389d67..a9853ba9 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTWindowRectangles.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTWindowRectangles.java @@ -16,34 +16,23 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_window_rectangles} */ -public final class GLEXTWindowRectangles { - public static final int GL_INCLUSIVE_EXT = 0x8F10; - public static final int GL_EXCLUSIVE_EXT = 0x8F11; - public static final int GL_WINDOW_RECTANGLE_EXT = 0x8F12; - public static final int GL_WINDOW_RECTANGLE_MODE_EXT = 0x8F13; - public static final int GL_MAX_WINDOW_RECTANGLES_EXT = 0x8F14; - public static final int GL_NUM_WINDOW_RECTANGLES_EXT = 0x8F15; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_window_rectangles) return; - ext.glWindowRectanglesEXT = load.invoke("glWindowRectanglesEXT", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLEXTWindowRectangles { + int GL_INCLUSIVE_EXT = 0x8F10; + int GL_EXCLUSIVE_EXT = 0x8F11; + int GL_WINDOW_RECTANGLE_EXT = 0x8F12; + int GL_WINDOW_RECTANGLE_MODE_EXT = 0x8F13; + int GL_MAX_WINDOW_RECTANGLES_EXT = 0x8F14; + int GL_NUM_WINDOW_RECTANGLES_EXT = 0x8F15; - public static void glWindowRectanglesEXT(int mode, int count, @NativeType("const GLint *") MemorySegment box) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowRectanglesEXT).invokeExact(mode, count, box); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowRectanglesEXT(int mode, int count, @NativeType("const GLint *") MemorySegment box) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTX11SyncObject.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTX11SyncObject.java index 2b3196b5..7de660f1 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTX11SyncObject.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ext/GLEXTX11SyncObject.java @@ -16,30 +16,18 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ext; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_EXT_x11_sync_object} */ -public final class GLEXTX11SyncObject { - public static final int GL_SYNC_X11_FENCE_EXT = 0x90E1; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_EXT_x11_sync_object) return; - ext.glImportSyncEXT = load.invoke("glImportSyncEXT", of(ADDRESS, JAVA_INT, JAVA_LONG, JAVA_INT)); - } +public interface GLEXTX11SyncObject { + int GL_SYNC_X11_FENCE_EXT = 0x90E1; - public static @NativeType("GLsync") MemorySegment glImportSyncEXT(int external_sync_type, long external_sync, int flags) { - final var ext = getExtCapabilities(); - try { - return (MemorySegment) - check(ext.glImportSyncEXT).invokeExact(external_sync_type, external_sync, flags); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + @NativeType("GLsync") default MemorySegment glImportSyncEXT(int external_sync_type, long external_sync, int flags) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMCullVertex.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMCullVertex.java index 88f82176..0b4caeb8 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMCullVertex.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMCullVertex.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ibm; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_IBM_cull_vertex} */ -public final class GLIBMCullVertex { - public static final int GL_CULL_VERTEX_IBM = 103050; +public interface GLIBMCullVertex { + int GL_CULL_VERTEX_IBM = 103050; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMMultimodeDrawArrays.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMMultimodeDrawArrays.java index ceb448c4..6fbdc1a7 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMMultimodeDrawArrays.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMMultimodeDrawArrays.java @@ -16,36 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ibm; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_IBM_multimode_draw_arrays} */ -public final class GLIBMMultimodeDrawArrays { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_IBM_multimode_draw_arrays) return; - ext.glMultiModeDrawArraysIBM = load.invoke("glMultiModeDrawArraysIBM", ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_INT, JAVA_INT)); - ext.glMultiModeDrawElementsIBM = load.invoke("glMultiModeDrawElementsIBM", ofVoid(ADDRESS, ADDRESS, JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT)); - } +public interface GLIBMMultimodeDrawArrays { - public static void glMultiModeDrawArraysIBM(@NativeType("const GLenum *") MemorySegment mode, @NativeType("const GLint *") MemorySegment first, @NativeType("const GLsizei *") MemorySegment count, int primcount, int modestride) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiModeDrawArraysIBM).invokeExact(mode, first, count, primcount, modestride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiModeDrawArraysIBM(@NativeType("const GLenum *") MemorySegment mode, @NativeType("const GLint *") MemorySegment first, @NativeType("const GLsizei *") MemorySegment count, int primcount, int modestride) { + throw new ContextException(); } - public static void glMultiModeDrawElementsIBM(@NativeType("const GLenum *") MemorySegment mode, @NativeType("const GLsizei *") MemorySegment count, int type, @NativeType("const void *const*") MemorySegment indices, int primcount, int modestride) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiModeDrawElementsIBM).invokeExact(mode, count, type, indices, primcount, modestride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiModeDrawElementsIBM(@NativeType("const GLenum *") MemorySegment mode, @NativeType("const GLsizei *") MemorySegment count, int type, @NativeType("const void *const*") MemorySegment indices, int primcount, int modestride) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMRasterposClip.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMRasterposClip.java index b9b66632..37f929f2 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMRasterposClip.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMRasterposClip.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ibm; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_IBM_rasterpos_clip} */ -public final class GLIBMRasterposClip { - public static final int GL_RASTER_POSITION_UNCLIPPED_IBM = 0x19262; +public interface GLIBMRasterposClip { + int GL_RASTER_POSITION_UNCLIPPED_IBM = 0x19262; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMStaticData.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMStaticData.java index 6a72f818..95bfe2ea 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMStaticData.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMStaticData.java @@ -16,30 +16,19 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ibm; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_IBM_static_data} */ -public final class GLIBMStaticData { - public static final int GL_ALL_STATIC_DATA_IBM = 103060; - public static final int GL_STATIC_VERTEX_ARRAY_IBM = 103061; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_IBM_static_data) return; - ext.glFlushStaticDataIBM = load.invoke("glFlushStaticDataIBM", ofVoid(JAVA_INT)); - } +public interface GLIBMStaticData { + int GL_ALL_STATIC_DATA_IBM = 103060; + int GL_STATIC_VERTEX_ARRAY_IBM = 103061; - public static void glFlushStaticDataIBM(int target) { - final var ext = getExtCapabilities(); - try { - check(ext.glFlushStaticDataIBM).invokeExact(target); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFlushStaticDataIBM(int target) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMTextureMirroredRepeat.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMTextureMirroredRepeat.java index 7453cc46..46ee8635 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMTextureMirroredRepeat.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMTextureMirroredRepeat.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ibm; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_IBM_texture_mirrored_repeat} */ -public final class GLIBMTextureMirroredRepeat { - public static final int GL_MIRRORED_REPEAT_IBM = 0x8370; +public interface GLIBMTextureMirroredRepeat { + int GL_MIRRORED_REPEAT_IBM = 0x8370; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMVertexArrayLists.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMVertexArrayLists.java index 9c25f714..cec28212 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMVertexArrayLists.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/ibm/GLIBMVertexArrayLists.java @@ -16,100 +16,61 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.ibm; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_IBM_vertex_array_lists} */ -public final class GLIBMVertexArrayLists { - public static final int GL_VERTEX_ARRAY_LIST_IBM = 103070; - public static final int GL_NORMAL_ARRAY_LIST_IBM = 103071; - public static final int GL_COLOR_ARRAY_LIST_IBM = 103072; - public static final int GL_INDEX_ARRAY_LIST_IBM = 103073; - public static final int GL_TEXTURE_COORD_ARRAY_LIST_IBM = 103074; - public static final int GL_EDGE_FLAG_ARRAY_LIST_IBM = 103075; - public static final int GL_FOG_COORDINATE_ARRAY_LIST_IBM = 103076; - public static final int GL_SECONDARY_COLOR_ARRAY_LIST_IBM = 103077; - public static final int GL_VERTEX_ARRAY_LIST_STRIDE_IBM = 103080; - public static final int GL_NORMAL_ARRAY_LIST_STRIDE_IBM = 103081; - public static final int GL_COLOR_ARRAY_LIST_STRIDE_IBM = 103082; - public static final int GL_INDEX_ARRAY_LIST_STRIDE_IBM = 103083; - public static final int GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM = 103084; - public static final int GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM = 103085; - public static final int GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM = 103086; - public static final int GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM = 103087; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_IBM_vertex_array_lists) return; - ext.glColorPointerListIBM = load.invoke("glColorPointerListIBM", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT)); - ext.glSecondaryColorPointerListIBM = load.invoke("glSecondaryColorPointerListIBM", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT)); - ext.glEdgeFlagPointerListIBM = load.invoke("glEdgeFlagPointerListIBM", ofVoid(JAVA_INT, ADDRESS, JAVA_INT)); - ext.glFogCoordPointerListIBM = load.invoke("glFogCoordPointerListIBM", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT)); - ext.glIndexPointerListIBM = load.invoke("glIndexPointerListIBM", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT)); - ext.glNormalPointerListIBM = load.invoke("glNormalPointerListIBM", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT)); - ext.glTexCoordPointerListIBM = load.invoke("glTexCoordPointerListIBM", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT)); - ext.glVertexPointerListIBM = load.invoke("glVertexPointerListIBM", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT)); - } +public interface GLIBMVertexArrayLists { + int GL_VERTEX_ARRAY_LIST_IBM = 103070; + int GL_NORMAL_ARRAY_LIST_IBM = 103071; + int GL_COLOR_ARRAY_LIST_IBM = 103072; + int GL_INDEX_ARRAY_LIST_IBM = 103073; + int GL_TEXTURE_COORD_ARRAY_LIST_IBM = 103074; + int GL_EDGE_FLAG_ARRAY_LIST_IBM = 103075; + int GL_FOG_COORDINATE_ARRAY_LIST_IBM = 103076; + int GL_SECONDARY_COLOR_ARRAY_LIST_IBM = 103077; + int GL_VERTEX_ARRAY_LIST_STRIDE_IBM = 103080; + int GL_NORMAL_ARRAY_LIST_STRIDE_IBM = 103081; + int GL_COLOR_ARRAY_LIST_STRIDE_IBM = 103082; + int GL_INDEX_ARRAY_LIST_STRIDE_IBM = 103083; + int GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM = 103084; + int GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM = 103085; + int GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM = 103086; + int GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM = 103087; - public static void glColorPointerListIBM(int size, int type, int stride, @NativeType("const void **") MemorySegment pointer, int ptrstride) { - final var ext = getExtCapabilities(); - try { - check(ext.glColorPointerListIBM).invokeExact(size, type, stride, pointer, ptrstride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glColorPointerListIBM(int size, int type, int stride, @NativeType("const void **") MemorySegment pointer, int ptrstride) { + throw new ContextException(); } - public static void glSecondaryColorPointerListIBM(int size, int type, int stride, @NativeType("const void **") MemorySegment pointer, int ptrstride) { - final var ext = getExtCapabilities(); - try { - check(ext.glSecondaryColorPointerListIBM).invokeExact(size, type, stride, pointer, ptrstride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSecondaryColorPointerListIBM(int size, int type, int stride, @NativeType("const void **") MemorySegment pointer, int ptrstride) { + throw new ContextException(); } - public static void glEdgeFlagPointerListIBM(int stride, @NativeType("const GLboolean **") MemorySegment pointer, int ptrstride) { - final var ext = getExtCapabilities(); - try { - check(ext.glEdgeFlagPointerListIBM).invokeExact(stride, pointer, ptrstride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEdgeFlagPointerListIBM(int stride, @NativeType("const GLboolean **") MemorySegment pointer, int ptrstride) { + throw new ContextException(); } - public static void glFogCoordPointerListIBM(int type, int stride, @NativeType("const void **") MemorySegment pointer, int ptrstride) { - final var ext = getExtCapabilities(); - try { - check(ext.glFogCoordPointerListIBM).invokeExact(type, stride, pointer, ptrstride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFogCoordPointerListIBM(int type, int stride, @NativeType("const void **") MemorySegment pointer, int ptrstride) { + throw new ContextException(); } - public static void glIndexPointerListIBM(int type, int stride, @NativeType("const void **") MemorySegment pointer, int ptrstride) { - final var ext = getExtCapabilities(); - try { - check(ext.glIndexPointerListIBM).invokeExact(type, stride, pointer, ptrstride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glIndexPointerListIBM(int type, int stride, @NativeType("const void **") MemorySegment pointer, int ptrstride) { + throw new ContextException(); } - public static void glNormalPointerListIBM(int type, int stride, @NativeType("const void **") MemorySegment pointer, int ptrstride) { - final var ext = getExtCapabilities(); - try { - check(ext.glNormalPointerListIBM).invokeExact(type, stride, pointer, ptrstride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNormalPointerListIBM(int type, int stride, @NativeType("const void **") MemorySegment pointer, int ptrstride) { + throw new ContextException(); } - public static void glTexCoordPointerListIBM(int size, int type, int stride, @NativeType("const void **") MemorySegment pointer, int ptrstride) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoordPointerListIBM).invokeExact(size, type, stride, pointer, ptrstride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoordPointerListIBM(int size, int type, int stride, @NativeType("const void **") MemorySegment pointer, int ptrstride) { + throw new ContextException(); } - public static void glVertexPointerListIBM(int size, int type, int stride, @NativeType("const void **") MemorySegment pointer, int ptrstride) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexPointerListIBM).invokeExact(size, type, stride, pointer, ptrstride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexPointerListIBM(int size, int type, int stride, @NativeType("const void **") MemorySegment pointer, int ptrstride) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELBlackholeRender.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELBlackholeRender.java index af961380..77df1847 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELBlackholeRender.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELBlackholeRender.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.intel; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_INTEL_blackhole_render} */ -public final class GLINTELBlackholeRender { - public static final int GL_BLACKHOLE_RENDER_INTEL = 0x83FC; +public interface GLINTELBlackholeRender { + int GL_BLACKHOLE_RENDER_INTEL = 0x83FC; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELConservativeRasterization.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELConservativeRasterization.java index b020fa7d..ac4fad1a 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELConservativeRasterization.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELConservativeRasterization.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.intel; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_INTEL_conservative_rasterization} */ -public final class GLINTELConservativeRasterization { - public static final int GL_CONSERVATIVE_RASTERIZATION_INTEL = 0x83FE; +public interface GLINTELConservativeRasterization { + int GL_CONSERVATIVE_RASTERIZATION_INTEL = 0x83FE; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELFramebufferCMAA.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELFramebufferCMAA.java index aaf88e98..56ff7fe0 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELFramebufferCMAA.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELFramebufferCMAA.java @@ -16,28 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.intel; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_INTEL_framebuffer_CMAA} */ -public final class GLINTELFramebufferCMAA { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_INTEL_framebuffer_CMAA) return; - ext.glApplyFramebufferAttachmentCMAAINTEL = load.invoke("glApplyFramebufferAttachmentCMAAINTEL", ofVoid()); - } +public interface GLINTELFramebufferCMAA { - public static void glApplyFramebufferAttachmentCMAAINTEL() { - final var ext = getExtCapabilities(); - try { - check(ext.glApplyFramebufferAttachmentCMAAINTEL).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glApplyFramebufferAttachmentCMAAINTEL() { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELMapTexture.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELMapTexture.java index f5aab922..080103db 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELMapTexture.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELMapTexture.java @@ -16,49 +16,29 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.intel; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_INTEL_map_texture} */ -public final class GLINTELMapTexture { - public static final int GL_TEXTURE_MEMORY_LAYOUT_INTEL = 0x83FF; - public static final int GL_LAYOUT_DEFAULT_INTEL = 0; - public static final int GL_LAYOUT_LINEAR_INTEL = 1; - public static final int GL_LAYOUT_LINEAR_CPU_CACHED_INTEL = 2; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_INTEL_map_texture) return; - ext.glSyncTextureINTEL = load.invoke("glSyncTextureINTEL", ofVoid(JAVA_INT)); - ext.glUnmapTexture2DINTEL = load.invoke("glUnmapTexture2DINTEL", ofVoid(JAVA_INT, JAVA_INT)); - ext.glMapTexture2DINTEL = load.invoke("glMapTexture2DINTEL", of(ADDRESS, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - } +public interface GLINTELMapTexture { + int GL_TEXTURE_MEMORY_LAYOUT_INTEL = 0x83FF; + int GL_LAYOUT_DEFAULT_INTEL = 0; + int GL_LAYOUT_LINEAR_INTEL = 1; + int GL_LAYOUT_LINEAR_CPU_CACHED_INTEL = 2; - public static void glSyncTextureINTEL(int texture) { - final var ext = getExtCapabilities(); - try { - check(ext.glSyncTextureINTEL).invokeExact(texture); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSyncTextureINTEL(int texture) { + throw new ContextException(); } - public static void glUnmapTexture2DINTEL(int texture, int level) { - final var ext = getExtCapabilities(); - try { - check(ext.glUnmapTexture2DINTEL).invokeExact(texture, level); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUnmapTexture2DINTEL(int texture, int level) { + throw new ContextException(); } - public static @NativeType("void*") MemorySegment glMapTexture2DINTEL(int texture, int level, int access, @NativeType("GLint *") MemorySegment stride, @NativeType("GLenum *") MemorySegment layout) { - final var ext = getExtCapabilities(); - try { - return (MemorySegment) - check(ext.glMapTexture2DINTEL).invokeExact(texture, level, access, stride, layout); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + @NativeType("void*") default MemorySegment glMapTexture2DINTEL(int texture, int level, int access, @NativeType("GLint *") MemorySegment stride, @NativeType("GLenum *") MemorySegment layout) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELParallelArrays.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELParallelArrays.java index bc0965b6..fcf5f56d 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELParallelArrays.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELParallelArrays.java @@ -16,57 +16,34 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.intel; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_INTEL_parallel_arrays} */ -public final class GLINTELParallelArrays { - public static final int GL_PARALLEL_ARRAYS_INTEL = 0x83F4; - public static final int GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F5; - public static final int GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F6; - public static final int GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F7; - public static final int GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F8; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_INTEL_parallel_arrays) return; - ext.glVertexPointervINTEL = load.invoke("glVertexPointervINTEL", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glNormalPointervINTEL = load.invoke("glNormalPointervINTEL", ofVoid(JAVA_INT, ADDRESS)); - ext.glColorPointervINTEL = load.invoke("glColorPointervINTEL", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glTexCoordPointervINTEL = load.invoke("glTexCoordPointervINTEL", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static void glVertexPointervINTEL(int size, int type, @NativeType("const void **") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexPointervINTEL).invokeExact(size, type, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLINTELParallelArrays { + int GL_PARALLEL_ARRAYS_INTEL = 0x83F4; + int GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F5; + int GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F6; + int GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F7; + int GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F8; + + default void glVertexPointervINTEL(int size, int type, @NativeType("const void **") MemorySegment pointer) { + throw new ContextException(); } - public static void glNormalPointervINTEL(int type, @NativeType("const void **") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glNormalPointervINTEL).invokeExact(type, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNormalPointervINTEL(int type, @NativeType("const void **") MemorySegment pointer) { + throw new ContextException(); } - public static void glColorPointervINTEL(int size, int type, @NativeType("const void **") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glColorPointervINTEL).invokeExact(size, type, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glColorPointervINTEL(int size, int type, @NativeType("const void **") MemorySegment pointer) { + throw new ContextException(); } - public static void glTexCoordPointervINTEL(int size, int type, @NativeType("const void **") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoordPointervINTEL).invokeExact(size, type, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoordPointervINTEL(int size, int type, @NativeType("const void **") MemorySegment pointer) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELPerformanceQuery.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELPerformanceQuery.java index 2c68714f..16d33809 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELPerformanceQuery.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/intel/GLINTELPerformanceQuery.java @@ -16,120 +16,73 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.intel; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_INTEL_performance_query} */ -public final class GLINTELPerformanceQuery { - public static final int GL_PERFQUERY_SINGLE_CONTEXT_INTEL = 0x00000000; - public static final int GL_PERFQUERY_GLOBAL_CONTEXT_INTEL = 0x00000001; - public static final int GL_PERFQUERY_WAIT_INTEL = 0x83FB; - public static final int GL_PERFQUERY_FLUSH_INTEL = 0x83FA; - public static final int GL_PERFQUERY_DONOT_FLUSH_INTEL = 0x83F9; - public static final int GL_PERFQUERY_COUNTER_EVENT_INTEL = 0x94F0; - public static final int GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL = 0x94F1; - public static final int GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL = 0x94F2; - public static final int GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL = 0x94F3; - public static final int GL_PERFQUERY_COUNTER_RAW_INTEL = 0x94F4; - public static final int GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL = 0x94F5; - public static final int GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL = 0x94F8; - public static final int GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL = 0x94F9; - public static final int GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL = 0x94FA; - public static final int GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL = 0x94FB; - public static final int GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL = 0x94FC; - public static final int GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL = 0x94FD; - public static final int GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL = 0x94FE; - public static final int GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL = 0x94FF; - public static final int GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL = 0x9500; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_INTEL_performance_query) return; - ext.glBeginPerfQueryINTEL = load.invoke("glBeginPerfQueryINTEL", ofVoid(JAVA_INT)); - ext.glCreatePerfQueryINTEL = load.invoke("glCreatePerfQueryINTEL", ofVoid(JAVA_INT, ADDRESS)); - ext.glDeletePerfQueryINTEL = load.invoke("glDeletePerfQueryINTEL", ofVoid(JAVA_INT)); - ext.glEndPerfQueryINTEL = load.invoke("glEndPerfQueryINTEL", ofVoid(JAVA_INT)); - ext.glGetFirstPerfQueryIdINTEL = load.invoke("glGetFirstPerfQueryIdINTEL", ofVoid(ADDRESS)); - ext.glGetNextPerfQueryIdINTEL = load.invoke("glGetNextPerfQueryIdINTEL", ofVoid(JAVA_INT, ADDRESS)); - ext.glGetPerfCounterInfoINTEL = load.invoke("glGetPerfCounterInfoINTEL", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS)); - ext.glGetPerfQueryDataINTEL = load.invoke("glGetPerfQueryDataINTEL", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - ext.glGetPerfQueryIdByNameINTEL = load.invoke("glGetPerfQueryIdByNameINTEL", ofVoid(ADDRESS, ADDRESS)); - ext.glGetPerfQueryInfoINTEL = load.invoke("glGetPerfQueryInfoINTEL", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS)); - } +public interface GLINTELPerformanceQuery { + int GL_PERFQUERY_SINGLE_CONTEXT_INTEL = 0x00000000; + int GL_PERFQUERY_GLOBAL_CONTEXT_INTEL = 0x00000001; + int GL_PERFQUERY_WAIT_INTEL = 0x83FB; + int GL_PERFQUERY_FLUSH_INTEL = 0x83FA; + int GL_PERFQUERY_DONOT_FLUSH_INTEL = 0x83F9; + int GL_PERFQUERY_COUNTER_EVENT_INTEL = 0x94F0; + int GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL = 0x94F1; + int GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL = 0x94F2; + int GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL = 0x94F3; + int GL_PERFQUERY_COUNTER_RAW_INTEL = 0x94F4; + int GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL = 0x94F5; + int GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL = 0x94F8; + int GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL = 0x94F9; + int GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL = 0x94FA; + int GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL = 0x94FB; + int GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL = 0x94FC; + int GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL = 0x94FD; + int GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL = 0x94FE; + int GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL = 0x94FF; + int GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL = 0x9500; - public static void glBeginPerfQueryINTEL(int queryHandle) { - final var ext = getExtCapabilities(); - try { - check(ext.glBeginPerfQueryINTEL).invokeExact(queryHandle); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBeginPerfQueryINTEL(int queryHandle) { + throw new ContextException(); } - public static void glCreatePerfQueryINTEL(int queryId, @NativeType("GLuint *") MemorySegment queryHandle) { - final var ext = getExtCapabilities(); - try { - check(ext.glCreatePerfQueryINTEL).invokeExact(queryId, queryHandle); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCreatePerfQueryINTEL(int queryId, @NativeType("GLuint *") MemorySegment queryHandle) { + throw new ContextException(); } - public static void glDeletePerfQueryINTEL(int queryHandle) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeletePerfQueryINTEL).invokeExact(queryHandle); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDeletePerfQueryINTEL(int queryHandle) { + throw new ContextException(); } - public static void glEndPerfQueryINTEL(int queryHandle) { - final var ext = getExtCapabilities(); - try { - check(ext.glEndPerfQueryINTEL).invokeExact(queryHandle); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEndPerfQueryINTEL(int queryHandle) { + throw new ContextException(); } - public static void glGetFirstPerfQueryIdINTEL(@NativeType("GLuint *") MemorySegment queryId) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetFirstPerfQueryIdINTEL).invokeExact(queryId); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetFirstPerfQueryIdINTEL(@NativeType("GLuint *") MemorySegment queryId) { + throw new ContextException(); } - public static void glGetNextPerfQueryIdINTEL(int queryId, @NativeType("GLuint *") MemorySegment nextQueryId) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetNextPerfQueryIdINTEL).invokeExact(queryId, nextQueryId); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetNextPerfQueryIdINTEL(int queryId, @NativeType("GLuint *") MemorySegment nextQueryId) { + throw new ContextException(); } - public static void glGetPerfCounterInfoINTEL(int queryId, int counterId, int counterNameLength, @NativeType("GLchar *") MemorySegment counterName, int counterDescLength, @NativeType("GLchar *") MemorySegment counterDesc, @NativeType("GLuint *") MemorySegment counterOffset, @NativeType("GLuint *") MemorySegment counterDataSize, @NativeType("GLuint *") MemorySegment counterTypeEnum, @NativeType("GLuint *") MemorySegment counterDataTypeEnum, @NativeType("GLuint64 *") MemorySegment rawCounterMaxValue) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPerfCounterInfoINTEL).invokeExact(queryId, counterId, counterNameLength, counterName, counterDescLength, counterDesc, counterOffset, counterDataSize, counterTypeEnum, counterDataTypeEnum, rawCounterMaxValue); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPerfCounterInfoINTEL(int queryId, int counterId, int counterNameLength, @NativeType("GLchar *") MemorySegment counterName, int counterDescLength, @NativeType("GLchar *") MemorySegment counterDesc, @NativeType("GLuint *") MemorySegment counterOffset, @NativeType("GLuint *") MemorySegment counterDataSize, @NativeType("GLuint *") MemorySegment counterTypeEnum, @NativeType("GLuint *") MemorySegment counterDataTypeEnum, @NativeType("GLuint64 *") MemorySegment rawCounterMaxValue) { + throw new ContextException(); } - public static void glGetPerfQueryDataINTEL(int queryHandle, int flags, int dataSize, @NativeType("void *") MemorySegment data, @NativeType("GLuint *") MemorySegment bytesWritten) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPerfQueryDataINTEL).invokeExact(queryHandle, flags, dataSize, data, bytesWritten); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPerfQueryDataINTEL(int queryHandle, int flags, int dataSize, @NativeType("void *") MemorySegment data, @NativeType("GLuint *") MemorySegment bytesWritten) { + throw new ContextException(); } - public static void glGetPerfQueryIdByNameINTEL(@NativeType("GLchar *") MemorySegment queryName, @NativeType("GLuint *") MemorySegment queryId) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPerfQueryIdByNameINTEL).invokeExact(queryName, queryId); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPerfQueryIdByNameINTEL(@NativeType("GLchar *") MemorySegment queryName, @NativeType("GLuint *") MemorySegment queryId) { + throw new ContextException(); } - public static void glGetPerfQueryInfoINTEL(int queryId, int queryNameLength, @NativeType("GLchar *") MemorySegment queryName, @NativeType("GLuint *") MemorySegment dataSize, @NativeType("GLuint *") MemorySegment noCounters, @NativeType("GLuint *") MemorySegment noInstances, @NativeType("GLuint *") MemorySegment capsMask) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPerfQueryInfoINTEL).invokeExact(queryId, queryNameLength, queryName, dataSize, noCounters, noInstances, capsMask); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPerfQueryInfoINTEL(int queryId, int queryNameLength, @NativeType("GLchar *") MemorySegment queryName, @NativeType("GLuint *") MemorySegment dataSize, @NativeType("GLuint *") MemorySegment noCounters, @NativeType("GLuint *") MemorySegment noInstances, @NativeType("GLuint *") MemorySegment capsMask) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRBlendEquationAdvanced.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRBlendEquationAdvanced.java index 3bf60770..b295dd7d 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRBlendEquationAdvanced.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRBlendEquationAdvanced.java @@ -16,43 +16,32 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.khr; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_KHR_blend_equation_advanced} */ -public final class GLKHRBlendEquationAdvanced { - public static final int GL_MULTIPLY_KHR = 0x9294; - public static final int GL_SCREEN_KHR = 0x9295; - public static final int GL_OVERLAY_KHR = 0x9296; - public static final int GL_DARKEN_KHR = 0x9297; - public static final int GL_LIGHTEN_KHR = 0x9298; - public static final int GL_COLORDODGE_KHR = 0x9299; - public static final int GL_COLORBURN_KHR = 0x929A; - public static final int GL_HARDLIGHT_KHR = 0x929B; - public static final int GL_SOFTLIGHT_KHR = 0x929C; - public static final int GL_DIFFERENCE_KHR = 0x929E; - public static final int GL_EXCLUSION_KHR = 0x92A0; - public static final int GL_HSL_HUE_KHR = 0x92AD; - public static final int GL_HSL_SATURATION_KHR = 0x92AE; - public static final int GL_HSL_COLOR_KHR = 0x92AF; - public static final int GL_HSL_LUMINOSITY_KHR = 0x92B0; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_KHR_blend_equation_advanced) return; - ext.glBlendBarrierKHR = load.invoke("glBlendBarrierKHR", ofVoid()); - } +public interface GLKHRBlendEquationAdvanced { + int GL_MULTIPLY_KHR = 0x9294; + int GL_SCREEN_KHR = 0x9295; + int GL_OVERLAY_KHR = 0x9296; + int GL_DARKEN_KHR = 0x9297; + int GL_LIGHTEN_KHR = 0x9298; + int GL_COLORDODGE_KHR = 0x9299; + int GL_COLORBURN_KHR = 0x929A; + int GL_HARDLIGHT_KHR = 0x929B; + int GL_SOFTLIGHT_KHR = 0x929C; + int GL_DIFFERENCE_KHR = 0x929E; + int GL_EXCLUSION_KHR = 0x92A0; + int GL_HSL_HUE_KHR = 0x92AD; + int GL_HSL_SATURATION_KHR = 0x92AE; + int GL_HSL_COLOR_KHR = 0x92AF; + int GL_HSL_LUMINOSITY_KHR = 0x92B0; - public static void glBlendBarrierKHR() { - final var ext = getExtCapabilities(); - try { - check(ext.glBlendBarrierKHR).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBlendBarrierKHR() { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRBlendEquationAdvancedCoherent.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRBlendEquationAdvancedCoherent.java index 538c6a6d..ab8cb34f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRBlendEquationAdvancedCoherent.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRBlendEquationAdvancedCoherent.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.khr; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_KHR_blend_equation_advanced_coherent} */ -public final class GLKHRBlendEquationAdvancedCoherent { - public static final int GL_BLEND_ADVANCED_COHERENT_KHR = 0x9285; +public interface GLKHRBlendEquationAdvancedCoherent { + int GL_BLEND_ADVANCED_COHERENT_KHR = 0x9285; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRNoError.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRNoError.java index a5fcb12d..97a2ea1a 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRNoError.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRNoError.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.khr; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_KHR_no_error} */ -public final class GLKHRNoError { - public static final int GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR = 0x00000008; +public interface GLKHRNoError { + int GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR = 0x00000008; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRParallelShaderCompile.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRParallelShaderCompile.java index bbe7b1fa..e8c3c99f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRParallelShaderCompile.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRParallelShaderCompile.java @@ -16,30 +16,19 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.khr; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_KHR_parallel_shader_compile} */ -public final class GLKHRParallelShaderCompile { - public static final int GL_MAX_SHADER_COMPILER_THREADS_KHR = 0x91B0; - public static final int GL_COMPLETION_STATUS_KHR = 0x91B1; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_KHR_parallel_shader_compile) return; - ext.glMaxShaderCompilerThreadsKHR = load.invoke("glMaxShaderCompilerThreadsKHR", ofVoid(JAVA_INT)); - } +public interface GLKHRParallelShaderCompile { + int GL_MAX_SHADER_COMPILER_THREADS_KHR = 0x91B0; + int GL_COMPLETION_STATUS_KHR = 0x91B1; - public static void glMaxShaderCompilerThreadsKHR(int count) { - final var ext = getExtCapabilities(); - try { - check(ext.glMaxShaderCompilerThreadsKHR).invokeExact(count); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMaxShaderCompilerThreadsKHR(int count) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRRobustness.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRRobustness.java index 40713187..46d73b91 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRRobustness.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRRobustness.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.khr; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_KHR_robustness} */ -public final class GLKHRRobustness { - public static final int GL_CONTEXT_ROBUST_ACCESS = 0x90F3; +public interface GLKHRRobustness { + int GL_CONTEXT_ROBUST_ACCESS = 0x90F3; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRShaderSubgroup.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRShaderSubgroup.java index 14c62d3e..2c0aadfc 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRShaderSubgroup.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRShaderSubgroup.java @@ -16,28 +16,24 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.khr; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_KHR_shader_subgroup} */ -public final class GLKHRShaderSubgroup { - public static final int GL_SUBGROUP_SIZE_KHR = 0x9532; - public static final int GL_SUBGROUP_SUPPORTED_STAGES_KHR = 0x9533; - public static final int GL_SUBGROUP_SUPPORTED_FEATURES_KHR = 0x9534; - public static final int GL_SUBGROUP_QUAD_ALL_STAGES_KHR = 0x9535; - public static final int GL_SUBGROUP_FEATURE_BASIC_BIT_KHR = 0x00000001; - public static final int GL_SUBGROUP_FEATURE_VOTE_BIT_KHR = 0x00000002; - public static final int GL_SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR = 0x00000004; - public static final int GL_SUBGROUP_FEATURE_BALLOT_BIT_KHR = 0x00000008; - public static final int GL_SUBGROUP_FEATURE_SHUFFLE_BIT_KHR = 0x00000010; - public static final int GL_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR = 0x00000020; - public static final int GL_SUBGROUP_FEATURE_CLUSTERED_BIT_KHR = 0x00000040; - public static final int GL_SUBGROUP_FEATURE_QUAD_BIT_KHR = 0x00000080; +public interface GLKHRShaderSubgroup { + int GL_SUBGROUP_SIZE_KHR = 0x9532; + int GL_SUBGROUP_SUPPORTED_STAGES_KHR = 0x9533; + int GL_SUBGROUP_SUPPORTED_FEATURES_KHR = 0x9534; + int GL_SUBGROUP_QUAD_ALL_STAGES_KHR = 0x9535; + int GL_SUBGROUP_FEATURE_BASIC_BIT_KHR = 0x00000001; + int GL_SUBGROUP_FEATURE_VOTE_BIT_KHR = 0x00000002; + int GL_SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR = 0x00000004; + int GL_SUBGROUP_FEATURE_BALLOT_BIT_KHR = 0x00000008; + int GL_SUBGROUP_FEATURE_SHUFFLE_BIT_KHR = 0x00000010; + int GL_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR = 0x00000020; + int GL_SUBGROUP_FEATURE_CLUSTERED_BIT_KHR = 0x00000040; + int GL_SUBGROUP_FEATURE_QUAD_BIT_KHR = 0x00000080; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRTextureCompressionAstcHdr.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRTextureCompressionAstcHdr.java index f5b77d63..7f4bc273 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRTextureCompressionAstcHdr.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/khr/GLKHRTextureCompressionAstcHdr.java @@ -16,44 +16,40 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.khr; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_KHR_texture_compression_astc_hdr} */ -public final class GLKHRTextureCompressionAstcHdr { - public static final int GL_COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0; - public static final int GL_COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1; - public static final int GL_COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2; - public static final int GL_COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3; - public static final int GL_COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4; - public static final int GL_COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5; - public static final int GL_COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6; - public static final int GL_COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7; - public static final int GL_COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8; - public static final int GL_COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9; - public static final int GL_COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA; - public static final int GL_COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB; - public static final int GL_COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC; - public static final int GL_COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD; - public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0; - public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1; - public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2; - public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3; - public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4; - public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5; - public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6; - public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7; - public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8; - public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9; - public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA; - public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB; - public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC; - public static final int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD; +public interface GLKHRTextureCompressionAstcHdr { + int GL_COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0; + int GL_COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1; + int GL_COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2; + int GL_COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3; + int GL_COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4; + int GL_COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5; + int GL_COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6; + int GL_COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7; + int GL_COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8; + int GL_COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9; + int GL_COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA; + int GL_COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB; + int GL_COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC; + int GL_COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD; + int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0; + int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1; + int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2; + int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3; + int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4; + int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5; + int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6; + int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7; + int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8; + int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9; + int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA; + int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB; + int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC; + int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAFramebufferFlipX.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAFramebufferFlipX.java index 90f63a3c..d67fb1db 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAFramebufferFlipX.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAFramebufferFlipX.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.mesa; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_MESA_framebuffer_flip_x} */ -public final class GLMESAFramebufferFlipX { - public static final int GL_FRAMEBUFFER_FLIP_X_MESA = 0x8BBC; +public interface GLMESAFramebufferFlipX { + int GL_FRAMEBUFFER_FLIP_X_MESA = 0x8BBC; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAFramebufferFlipY.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAFramebufferFlipY.java index d8508292..d487ead1 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAFramebufferFlipY.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAFramebufferFlipY.java @@ -16,37 +16,22 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.mesa; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_MESA_framebuffer_flip_y} */ -public final class GLMESAFramebufferFlipY { - public static final int GL_FRAMEBUFFER_FLIP_Y_MESA = 0x8BBB; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_MESA_framebuffer_flip_y) return; - ext.glFramebufferParameteriMESA = load.invoke("glFramebufferParameteriMESA", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetFramebufferParameterivMESA = load.invoke("glGetFramebufferParameterivMESA", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLMESAFramebufferFlipY { + int GL_FRAMEBUFFER_FLIP_Y_MESA = 0x8BBB; - public static void glFramebufferParameteriMESA(int target, int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glFramebufferParameteriMESA).invokeExact(target, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFramebufferParameteriMESA(int target, int pname, int param) { + throw new ContextException(); } - public static void glGetFramebufferParameterivMESA(int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetFramebufferParameterivMESA).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetFramebufferParameterivMESA(int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAFramebufferSwapXY.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAFramebufferSwapXY.java index d28d6cee..d9970ebe 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAFramebufferSwapXY.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAFramebufferSwapXY.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.mesa; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_MESA_framebuffer_swap_xy} */ -public final class GLMESAFramebufferSwapXY { - public static final int GL_FRAMEBUFFER_SWAP_XY_MESA = 0x8BBD; +public interface GLMESAFramebufferSwapXY { + int GL_FRAMEBUFFER_SWAP_XY_MESA = 0x8BBD; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAPackInvert.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAPackInvert.java index c3681b87..c8a4eaa0 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAPackInvert.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAPackInvert.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.mesa; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_MESA_pack_invert} */ -public final class GLMESAPackInvert { - public static final int GL_PACK_INVERT_MESA = 0x8758; +public interface GLMESAPackInvert { + int GL_PACK_INVERT_MESA = 0x8758; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAProgramBinaryFormats.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAProgramBinaryFormats.java index f4174332..8db6bac3 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAProgramBinaryFormats.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAProgramBinaryFormats.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.mesa; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_MESA_program_binary_formats} */ -public final class GLMESAProgramBinaryFormats { - public static final int GL_PROGRAM_BINARY_FORMAT_MESA = 0x875F; +public interface GLMESAProgramBinaryFormats { + int GL_PROGRAM_BINARY_FORMAT_MESA = 0x875F; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAResizeBuffers.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAResizeBuffers.java index f036b4da..0fa7e57f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAResizeBuffers.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAResizeBuffers.java @@ -16,28 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.mesa; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_MESA_resize_buffers} */ -public final class GLMESAResizeBuffers { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_MESA_resize_buffers) return; - ext.glResizeBuffersMESA = load.invoke("glResizeBuffersMESA", ofVoid()); - } +public interface GLMESAResizeBuffers { - public static void glResizeBuffersMESA() { - final var ext = getExtCapabilities(); - try { - check(ext.glResizeBuffersMESA).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glResizeBuffersMESA() { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESATileRasterOrder.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESATileRasterOrder.java index 1b0308fc..a4a217db 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESATileRasterOrder.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESATileRasterOrder.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.mesa; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_MESA_tile_raster_order} */ -public final class GLMESATileRasterOrder { - public static final int GL_TILE_RASTER_ORDER_FIXED_MESA = 0x8BB8; - public static final int GL_TILE_RASTER_ORDER_INCREASING_X_MESA = 0x8BB9; - public static final int GL_TILE_RASTER_ORDER_INCREASING_Y_MESA = 0x8BBA; +public interface GLMESATileRasterOrder { + int GL_TILE_RASTER_ORDER_FIXED_MESA = 0x8BB8; + int GL_TILE_RASTER_ORDER_INCREASING_X_MESA = 0x8BB9; + int GL_TILE_RASTER_ORDER_INCREASING_Y_MESA = 0x8BBA; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAWindowPos.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAWindowPos.java index aa1e4b21..d9c034ad 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAWindowPos.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAWindowPos.java @@ -16,212 +16,109 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.mesa; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_MESA_window_pos} */ -public final class GLMESAWindowPos { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_MESA_window_pos) return; - ext.glWindowPos2dMESA = load.invoke("glWindowPos2dMESA", ofVoid(JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glWindowPos2dvMESA = load.invoke("glWindowPos2dvMESA", ofVoid(ADDRESS)); - ext.glWindowPos2fMESA = load.invoke("glWindowPos2fMESA", ofVoid(JAVA_FLOAT, JAVA_FLOAT)); - ext.glWindowPos2fvMESA = load.invoke("glWindowPos2fvMESA", ofVoid(ADDRESS)); - ext.glWindowPos2iMESA = load.invoke("glWindowPos2iMESA", ofVoid(JAVA_INT, JAVA_INT)); - ext.glWindowPos2ivMESA = load.invoke("glWindowPos2ivMESA", ofVoid(ADDRESS)); - ext.glWindowPos2sMESA = load.invoke("glWindowPos2sMESA", ofVoid(JAVA_SHORT, JAVA_SHORT)); - ext.glWindowPos2svMESA = load.invoke("glWindowPos2svMESA", ofVoid(ADDRESS)); - ext.glWindowPos3dMESA = load.invoke("glWindowPos3dMESA", ofVoid(JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glWindowPos3dvMESA = load.invoke("glWindowPos3dvMESA", ofVoid(ADDRESS)); - ext.glWindowPos3fMESA = load.invoke("glWindowPos3fMESA", ofVoid(JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glWindowPos3fvMESA = load.invoke("glWindowPos3fvMESA", ofVoid(ADDRESS)); - ext.glWindowPos3iMESA = load.invoke("glWindowPos3iMESA", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glWindowPos3ivMESA = load.invoke("glWindowPos3ivMESA", ofVoid(ADDRESS)); - ext.glWindowPos3sMESA = load.invoke("glWindowPos3sMESA", ofVoid(JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glWindowPos3svMESA = load.invoke("glWindowPos3svMESA", ofVoid(ADDRESS)); - ext.glWindowPos4dMESA = load.invoke("glWindowPos4dMESA", ofVoid(JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glWindowPos4dvMESA = load.invoke("glWindowPos4dvMESA", ofVoid(ADDRESS)); - ext.glWindowPos4fMESA = load.invoke("glWindowPos4fMESA", ofVoid(JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glWindowPos4fvMESA = load.invoke("glWindowPos4fvMESA", ofVoid(ADDRESS)); - ext.glWindowPos4iMESA = load.invoke("glWindowPos4iMESA", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glWindowPos4ivMESA = load.invoke("glWindowPos4ivMESA", ofVoid(ADDRESS)); - ext.glWindowPos4sMESA = load.invoke("glWindowPos4sMESA", ofVoid(JAVA_SHORT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glWindowPos4svMESA = load.invoke("glWindowPos4svMESA", ofVoid(ADDRESS)); - } - - public static void glWindowPos2dMESA(double x, double y) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos2dMESA).invokeExact(x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glWindowPos2dvMESA(@NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos2dvMESA).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glWindowPos2fMESA(float x, float y) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos2fMESA).invokeExact(x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glWindowPos2fvMESA(@NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos2fvMESA).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glWindowPos2iMESA(int x, int y) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos2iMESA).invokeExact(x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLMESAWindowPos { + + default void glWindowPos2dMESA(double x, double y) { + throw new ContextException(); + } + + default void glWindowPos2dvMESA(@NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); + } + + default void glWindowPos2fMESA(float x, float y) { + throw new ContextException(); } - - public static void glWindowPos2ivMESA(@NativeType("const GLint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos2ivMESA).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + + default void glWindowPos2fvMESA(@NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); + } + + default void glWindowPos2iMESA(int x, int y) { + throw new ContextException(); + } + + default void glWindowPos2ivMESA(@NativeType("const GLint *") MemorySegment v) { + throw new ContextException(); } - public static void glWindowPos2sMESA(short x, short y) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos2sMESA).invokeExact(x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos2sMESA(short x, short y) { + throw new ContextException(); } - public static void glWindowPos2svMESA(@NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos2svMESA).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos2svMESA(@NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } - public static void glWindowPos3dMESA(double x, double y, double z) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos3dMESA).invokeExact(x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos3dMESA(double x, double y, double z) { + throw new ContextException(); } - public static void glWindowPos3dvMESA(@NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos3dvMESA).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos3dvMESA(@NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glWindowPos3fMESA(float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos3fMESA).invokeExact(x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos3fMESA(float x, float y, float z) { + throw new ContextException(); } - public static void glWindowPos3fvMESA(@NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos3fvMESA).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos3fvMESA(@NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glWindowPos3iMESA(int x, int y, int z) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos3iMESA).invokeExact(x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos3iMESA(int x, int y, int z) { + throw new ContextException(); } - public static void glWindowPos3ivMESA(@NativeType("const GLint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos3ivMESA).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos3ivMESA(@NativeType("const GLint *") MemorySegment v) { + throw new ContextException(); } - public static void glWindowPos3sMESA(short x, short y, short z) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos3sMESA).invokeExact(x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos3sMESA(short x, short y, short z) { + throw new ContextException(); } - public static void glWindowPos3svMESA(@NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos3svMESA).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos3svMESA(@NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } - public static void glWindowPos4dMESA(double x, double y, double z, double w) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos4dMESA).invokeExact(x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos4dMESA(double x, double y, double z, double w) { + throw new ContextException(); } - public static void glWindowPos4dvMESA(@NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos4dvMESA).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos4dvMESA(@NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glWindowPos4fMESA(float x, float y, float z, float w) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos4fMESA).invokeExact(x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos4fMESA(float x, float y, float z, float w) { + throw new ContextException(); } - public static void glWindowPos4fvMESA(@NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos4fvMESA).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos4fvMESA(@NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glWindowPos4iMESA(int x, int y, int z, int w) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos4iMESA).invokeExact(x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos4iMESA(int x, int y, int z, int w) { + throw new ContextException(); } - public static void glWindowPos4ivMESA(@NativeType("const GLint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos4ivMESA).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos4ivMESA(@NativeType("const GLint *") MemorySegment v) { + throw new ContextException(); } - public static void glWindowPos4sMESA(short x, short y, short z, short w) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos4sMESA).invokeExact(x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos4sMESA(short x, short y, short z, short w) { + throw new ContextException(); } - public static void glWindowPos4svMESA(@NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glWindowPos4svMESA).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWindowPos4svMESA(@NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAXTextureStack.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAXTextureStack.java index c42d2b31..49ccafa4 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAXTextureStack.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAXTextureStack.java @@ -16,22 +16,18 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.mesa; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_MESAX_texture_stack} */ -public final class GLMESAXTextureStack { - public static final int GL_TEXTURE_1D_STACK_MESAX = 0x8759; - public static final int GL_TEXTURE_2D_STACK_MESAX = 0x875A; - public static final int GL_PROXY_TEXTURE_1D_STACK_MESAX = 0x875B; - public static final int GL_PROXY_TEXTURE_2D_STACK_MESAX = 0x875C; - public static final int GL_TEXTURE_1D_STACK_BINDING_MESAX = 0x875D; - public static final int GL_TEXTURE_2D_STACK_BINDING_MESAX = 0x875E; +public interface GLMESAXTextureStack { + int GL_TEXTURE_1D_STACK_MESAX = 0x8759; + int GL_TEXTURE_2D_STACK_MESAX = 0x875A; + int GL_PROXY_TEXTURE_1D_STACK_MESAX = 0x875B; + int GL_PROXY_TEXTURE_2D_STACK_MESAX = 0x875C; + int GL_TEXTURE_1D_STACK_BINDING_MESAX = 0x875D; + int GL_TEXTURE_2D_STACK_BINDING_MESAX = 0x875E; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAYcbcrTexture.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAYcbcrTexture.java index 8ea9bfad..77fd18a1 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAYcbcrTexture.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/mesa/GLMESAYcbcrTexture.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.mesa; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_MESA_ycbcr_texture} */ -public final class GLMESAYcbcrTexture { - public static final int GL_UNSIGNED_SHORT_8_8_MESA = 0x85BA; - public static final int GL_UNSIGNED_SHORT_8_8_REV_MESA = 0x85BB; - public static final int GL_YCBCR_MESA = 0x8757; +public interface GLMESAYcbcrTexture { + int GL_UNSIGNED_SHORT_8_8_MESA = 0x85BA; + int GL_UNSIGNED_SHORT_8_8_REV_MESA = 0x85BB; + int GL_YCBCR_MESA = 0x8757; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVAlphaToCoverageDitherControl.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVAlphaToCoverageDitherControl.java index 02b9e996..6e70fd69 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVAlphaToCoverageDitherControl.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVAlphaToCoverageDitherControl.java @@ -16,32 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_alpha_to_coverage_dither_control} */ -public final class GLNVAlphaToCoverageDitherControl { - public static final int GL_ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV = 0x934D; - public static final int GL_ALPHA_TO_COVERAGE_DITHER_ENABLE_NV = 0x934E; - public static final int GL_ALPHA_TO_COVERAGE_DITHER_DISABLE_NV = 0x934F; - public static final int GL_ALPHA_TO_COVERAGE_DITHER_MODE_NV = 0x92BF; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_alpha_to_coverage_dither_control) return; - ext.glAlphaToCoverageDitherControlNV = load.invoke("glAlphaToCoverageDitherControlNV", ofVoid(JAVA_INT)); - } +public interface GLNVAlphaToCoverageDitherControl { + int GL_ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV = 0x934D; + int GL_ALPHA_TO_COVERAGE_DITHER_ENABLE_NV = 0x934E; + int GL_ALPHA_TO_COVERAGE_DITHER_DISABLE_NV = 0x934F; + int GL_ALPHA_TO_COVERAGE_DITHER_MODE_NV = 0x92BF; - public static void glAlphaToCoverageDitherControlNV(int mode) { - final var ext = getExtCapabilities(); - try { - check(ext.glAlphaToCoverageDitherControlNV).invokeExact(mode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glAlphaToCoverageDitherControlNV(int mode) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVBindlessMultiDrawIndirect.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVBindlessMultiDrawIndirect.java index 22530da7..86a137aa 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVBindlessMultiDrawIndirect.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVBindlessMultiDrawIndirect.java @@ -16,36 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_bindless_multi_draw_indirect} */ -public final class GLNVBindlessMultiDrawIndirect { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_bindless_multi_draw_indirect) return; - ext.glMultiDrawArraysIndirectBindlessNV = load.invoke("glMultiDrawArraysIndirectBindlessNV", ofVoid(JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMultiDrawElementsIndirectBindlessNV = load.invoke("glMultiDrawElementsIndirectBindlessNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLNVBindlessMultiDrawIndirect { - public static void glMultiDrawArraysIndirectBindlessNV(int mode, @NativeType("const void *") MemorySegment indirect, int drawCount, int stride, int vertexBufferCount) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiDrawArraysIndirectBindlessNV).invokeExact(mode, indirect, drawCount, stride, vertexBufferCount); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiDrawArraysIndirectBindlessNV(int mode, @NativeType("const void *") MemorySegment indirect, int drawCount, int stride, int vertexBufferCount) { + throw new ContextException(); } - public static void glMultiDrawElementsIndirectBindlessNV(int mode, int type, @NativeType("const void *") MemorySegment indirect, int drawCount, int stride, int vertexBufferCount) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiDrawElementsIndirectBindlessNV).invokeExact(mode, type, indirect, drawCount, stride, vertexBufferCount); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiDrawElementsIndirectBindlessNV(int mode, int type, @NativeType("const void *") MemorySegment indirect, int drawCount, int stride, int vertexBufferCount) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVBindlessMultiDrawIndirectCount.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVBindlessMultiDrawIndirectCount.java index 9dd1a783..b110ced7 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVBindlessMultiDrawIndirectCount.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVBindlessMultiDrawIndirectCount.java @@ -16,36 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_bindless_multi_draw_indirect_count} */ -public final class GLNVBindlessMultiDrawIndirectCount { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_bindless_multi_draw_indirect_count) return; - ext.glMultiDrawArraysIndirectBindlessCountNV = load.invoke("glMultiDrawArraysIndirectBindlessCountNV", ofVoid(JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMultiDrawElementsIndirectBindlessCountNV = load.invoke("glMultiDrawElementsIndirectBindlessCountNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLNVBindlessMultiDrawIndirectCount { - public static void glMultiDrawArraysIndirectBindlessCountNV(int mode, @NativeType("const void *") MemorySegment indirect, int drawCount, int maxDrawCount, int stride, int vertexBufferCount) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiDrawArraysIndirectBindlessCountNV).invokeExact(mode, indirect, drawCount, maxDrawCount, stride, vertexBufferCount); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiDrawArraysIndirectBindlessCountNV(int mode, @NativeType("const void *") MemorySegment indirect, int drawCount, int maxDrawCount, int stride, int vertexBufferCount) { + throw new ContextException(); } - public static void glMultiDrawElementsIndirectBindlessCountNV(int mode, int type, @NativeType("const void *") MemorySegment indirect, int drawCount, int maxDrawCount, int stride, int vertexBufferCount) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiDrawElementsIndirectBindlessCountNV).invokeExact(mode, type, indirect, drawCount, maxDrawCount, stride, vertexBufferCount); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiDrawElementsIndirectBindlessCountNV(int mode, int type, @NativeType("const void *") MemorySegment indirect, int drawCount, int maxDrawCount, int stride, int vertexBufferCount) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVBindlessTexture.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVBindlessTexture.java index e43b91d3..77cb3db9 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVBindlessTexture.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVBindlessTexture.java @@ -16,129 +16,65 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_bindless_texture} */ -public final class GLNVBindlessTexture { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_bindless_texture) return; - ext.glGetTextureHandleNV = load.invoke("glGetTextureHandleNV", of(JAVA_LONG, JAVA_INT)); - ext.glGetTextureSamplerHandleNV = load.invoke("glGetTextureSamplerHandleNV", of(JAVA_LONG, JAVA_INT, JAVA_INT)); - ext.glMakeTextureHandleResidentNV = load.invoke("glMakeTextureHandleResidentNV", ofVoid(JAVA_LONG)); - ext.glMakeTextureHandleNonResidentNV = load.invoke("glMakeTextureHandleNonResidentNV", ofVoid(JAVA_LONG)); - ext.glGetImageHandleNV = load.invoke("glGetImageHandleNV", of(JAVA_LONG, JAVA_INT, JAVA_INT, JAVA_BYTE, JAVA_INT, JAVA_INT)); - ext.glMakeImageHandleResidentNV = load.invoke("glMakeImageHandleResidentNV", ofVoid(JAVA_LONG, JAVA_INT)); - ext.glMakeImageHandleNonResidentNV = load.invoke("glMakeImageHandleNonResidentNV", ofVoid(JAVA_LONG)); - ext.glUniformHandleui64NV = load.invoke("glUniformHandleui64NV", ofVoid(JAVA_INT, JAVA_LONG)); - ext.glUniformHandleui64vNV = load.invoke("glUniformHandleui64vNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniformHandleui64NV = load.invoke("glProgramUniformHandleui64NV", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glProgramUniformHandleui64vNV = load.invoke("glProgramUniformHandleui64vNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glIsTextureHandleResidentNV = load.invoke("glIsTextureHandleResidentNV", of(JAVA_BYTE, JAVA_LONG)); - ext.glIsImageHandleResidentNV = load.invoke("glIsImageHandleResidentNV", of(JAVA_BYTE, JAVA_LONG)); - } +public interface GLNVBindlessTexture { - public static long glGetTextureHandleNV(int texture) { - final var ext = getExtCapabilities(); - try { - return (long) - check(ext.glGetTextureHandleNV).invokeExact(texture); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default long glGetTextureHandleNV(int texture) { + throw new ContextException(); } - public static long glGetTextureSamplerHandleNV(int texture, int sampler) { - final var ext = getExtCapabilities(); - try { - return (long) - check(ext.glGetTextureSamplerHandleNV).invokeExact(texture, sampler); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default long glGetTextureSamplerHandleNV(int texture, int sampler) { + throw new ContextException(); } - public static void glMakeTextureHandleResidentNV(long handle) { - final var ext = getExtCapabilities(); - try { - check(ext.glMakeTextureHandleResidentNV).invokeExact(handle); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMakeTextureHandleResidentNV(long handle) { + throw new ContextException(); } - public static void glMakeTextureHandleNonResidentNV(long handle) { - final var ext = getExtCapabilities(); - try { - check(ext.glMakeTextureHandleNonResidentNV).invokeExact(handle); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMakeTextureHandleNonResidentNV(long handle) { + throw new ContextException(); } - public static long glGetImageHandleNV(int texture, int level, boolean layered, int layer, int format) { - final var ext = getExtCapabilities(); - try { - return (long) - check(ext.glGetImageHandleNV).invokeExact(texture, level, layered, layer, format); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default long glGetImageHandleNV(int texture, int level, boolean layered, int layer, int format) { + throw new ContextException(); } - public static void glMakeImageHandleResidentNV(long handle, int access) { - final var ext = getExtCapabilities(); - try { - check(ext.glMakeImageHandleResidentNV).invokeExact(handle, access); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMakeImageHandleResidentNV(long handle, int access) { + throw new ContextException(); } - public static void glMakeImageHandleNonResidentNV(long handle) { - final var ext = getExtCapabilities(); - try { - check(ext.glMakeImageHandleNonResidentNV).invokeExact(handle); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMakeImageHandleNonResidentNV(long handle) { + throw new ContextException(); } - public static void glUniformHandleui64NV(int location, long value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniformHandleui64NV).invokeExact(location, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniformHandleui64NV(int location, long value) { + throw new ContextException(); } - public static void glUniformHandleui64vNV(int location, int count, @NativeType("const GLuint64 *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniformHandleui64vNV).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniformHandleui64vNV(int location, int count, @NativeType("const GLuint64 *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniformHandleui64NV(int program, int location, long value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformHandleui64NV).invokeExact(program, location, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformHandleui64NV(int program, int location, long value) { + throw new ContextException(); } - public static void glProgramUniformHandleui64vNV(int program, int location, int count, @NativeType("const GLuint64 *") MemorySegment values) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformHandleui64vNV).invokeExact(program, location, count, values); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformHandleui64vNV(int program, int location, int count, @NativeType("const GLuint64 *") MemorySegment values) { + throw new ContextException(); } - public static boolean glIsTextureHandleResidentNV(long handle) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsTextureHandleResidentNV).invokeExact(handle); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsTextureHandleResidentNV(long handle) { + throw new ContextException(); } - public static boolean glIsImageHandleResidentNV(long handle) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsImageHandleResidentNV).invokeExact(handle); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsImageHandleResidentNV(long handle) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVBlendEquationAdvanced.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVBlendEquationAdvanced.java index 4e0e6cd8..f37f20fc 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVBlendEquationAdvanced.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVBlendEquationAdvanced.java @@ -16,85 +16,70 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_blend_equation_advanced} */ -public final class GLNVBlendEquationAdvanced { - public static final int GL_BLEND_OVERLAP_NV = 0x9281; - public static final int GL_BLEND_PREMULTIPLIED_SRC_NV = 0x9280; - public static final int GL_BLUE_NV = 0x1905; - public static final int GL_COLORBURN_NV = 0x929A; - public static final int GL_COLORDODGE_NV = 0x9299; - public static final int GL_CONJOINT_NV = 0x9284; - public static final int GL_CONTRAST_NV = 0x92A1; - public static final int GL_DARKEN_NV = 0x9297; - public static final int GL_DIFFERENCE_NV = 0x929E; - public static final int GL_DISJOINT_NV = 0x9283; - public static final int GL_DST_ATOP_NV = 0x928F; - public static final int GL_DST_IN_NV = 0x928B; - public static final int GL_DST_NV = 0x9287; - public static final int GL_DST_OUT_NV = 0x928D; - public static final int GL_DST_OVER_NV = 0x9289; - public static final int GL_EXCLUSION_NV = 0x92A0; - public static final int GL_GREEN_NV = 0x1904; - public static final int GL_HARDLIGHT_NV = 0x929B; - public static final int GL_HARDMIX_NV = 0x92A9; - public static final int GL_HSL_COLOR_NV = 0x92AF; - public static final int GL_HSL_HUE_NV = 0x92AD; - public static final int GL_HSL_LUMINOSITY_NV = 0x92B0; - public static final int GL_HSL_SATURATION_NV = 0x92AE; - public static final int GL_INVERT_OVG_NV = 0x92B4; - public static final int GL_INVERT_RGB_NV = 0x92A3; - public static final int GL_LIGHTEN_NV = 0x9298; - public static final int GL_LINEARBURN_NV = 0x92A5; - public static final int GL_LINEARDODGE_NV = 0x92A4; - public static final int GL_LINEARLIGHT_NV = 0x92A7; - public static final int GL_MINUS_CLAMPED_NV = 0x92B3; - public static final int GL_MINUS_NV = 0x929F; - public static final int GL_MULTIPLY_NV = 0x9294; - public static final int GL_OVERLAY_NV = 0x9296; - public static final int GL_PINLIGHT_NV = 0x92A8; - public static final int GL_PLUS_CLAMPED_ALPHA_NV = 0x92B2; - public static final int GL_PLUS_CLAMPED_NV = 0x92B1; - public static final int GL_PLUS_DARKER_NV = 0x9292; - public static final int GL_PLUS_NV = 0x9291; - public static final int GL_RED_NV = 0x1903; - public static final int GL_SCREEN_NV = 0x9295; - public static final int GL_SOFTLIGHT_NV = 0x929C; - public static final int GL_SRC_ATOP_NV = 0x928E; - public static final int GL_SRC_IN_NV = 0x928A; - public static final int GL_SRC_NV = 0x9286; - public static final int GL_SRC_OUT_NV = 0x928C; - public static final int GL_SRC_OVER_NV = 0x9288; - public static final int GL_UNCORRELATED_NV = 0x9282; - public static final int GL_VIVIDLIGHT_NV = 0x92A6; - public static final int GL_XOR_NV = 0x1506; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_blend_equation_advanced) return; - ext.glBlendParameteriNV = load.invoke("glBlendParameteriNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glBlendBarrierNV = load.invoke("glBlendBarrierNV", ofVoid()); - } +public interface GLNVBlendEquationAdvanced { + int GL_BLEND_OVERLAP_NV = 0x9281; + int GL_BLEND_PREMULTIPLIED_SRC_NV = 0x9280; + int GL_BLUE_NV = 0x1905; + int GL_COLORBURN_NV = 0x929A; + int GL_COLORDODGE_NV = 0x9299; + int GL_CONJOINT_NV = 0x9284; + int GL_CONTRAST_NV = 0x92A1; + int GL_DARKEN_NV = 0x9297; + int GL_DIFFERENCE_NV = 0x929E; + int GL_DISJOINT_NV = 0x9283; + int GL_DST_ATOP_NV = 0x928F; + int GL_DST_IN_NV = 0x928B; + int GL_DST_NV = 0x9287; + int GL_DST_OUT_NV = 0x928D; + int GL_DST_OVER_NV = 0x9289; + int GL_EXCLUSION_NV = 0x92A0; + int GL_GREEN_NV = 0x1904; + int GL_HARDLIGHT_NV = 0x929B; + int GL_HARDMIX_NV = 0x92A9; + int GL_HSL_COLOR_NV = 0x92AF; + int GL_HSL_HUE_NV = 0x92AD; + int GL_HSL_LUMINOSITY_NV = 0x92B0; + int GL_HSL_SATURATION_NV = 0x92AE; + int GL_INVERT_OVG_NV = 0x92B4; + int GL_INVERT_RGB_NV = 0x92A3; + int GL_LIGHTEN_NV = 0x9298; + int GL_LINEARBURN_NV = 0x92A5; + int GL_LINEARDODGE_NV = 0x92A4; + int GL_LINEARLIGHT_NV = 0x92A7; + int GL_MINUS_CLAMPED_NV = 0x92B3; + int GL_MINUS_NV = 0x929F; + int GL_MULTIPLY_NV = 0x9294; + int GL_OVERLAY_NV = 0x9296; + int GL_PINLIGHT_NV = 0x92A8; + int GL_PLUS_CLAMPED_ALPHA_NV = 0x92B2; + int GL_PLUS_CLAMPED_NV = 0x92B1; + int GL_PLUS_DARKER_NV = 0x9292; + int GL_PLUS_NV = 0x9291; + int GL_RED_NV = 0x1903; + int GL_SCREEN_NV = 0x9295; + int GL_SOFTLIGHT_NV = 0x929C; + int GL_SRC_ATOP_NV = 0x928E; + int GL_SRC_IN_NV = 0x928A; + int GL_SRC_NV = 0x9286; + int GL_SRC_OUT_NV = 0x928C; + int GL_SRC_OVER_NV = 0x9288; + int GL_UNCORRELATED_NV = 0x9282; + int GL_VIVIDLIGHT_NV = 0x92A6; + int GL_XOR_NV = 0x1506; - public static void glBlendParameteriNV(int pname, int value) { - final var ext = getExtCapabilities(); - try { - check(ext.glBlendParameteriNV).invokeExact(pname, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBlendParameteriNV(int pname, int value) { + throw new ContextException(); } - public static void glBlendBarrierNV() { - final var ext = getExtCapabilities(); - try { - check(ext.glBlendBarrierNV).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBlendBarrierNV() { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVBlendEquationAdvancedCoherent.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVBlendEquationAdvancedCoherent.java index 64ac7dc0..cd9d53b3 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVBlendEquationAdvancedCoherent.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVBlendEquationAdvancedCoherent.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_blend_equation_advanced_coherent} */ -public final class GLNVBlendEquationAdvancedCoherent { - public static final int GL_BLEND_ADVANCED_COHERENT_NV = 0x9285; +public interface GLNVBlendEquationAdvancedCoherent { + int GL_BLEND_ADVANCED_COHERENT_NV = 0x9285; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVClipSpaceWScaling.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVClipSpaceWScaling.java index 83bb883a..5bf5406a 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVClipSpaceWScaling.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVClipSpaceWScaling.java @@ -16,31 +16,20 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_clip_space_w_scaling} */ -public final class GLNVClipSpaceWScaling { - public static final int GL_VIEWPORT_POSITION_W_SCALE_NV = 0x937C; - public static final int GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV = 0x937D; - public static final int GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV = 0x937E; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_clip_space_w_scaling) return; - ext.glViewportPositionWScaleNV = load.invoke("glViewportPositionWScaleNV", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT)); - } +public interface GLNVClipSpaceWScaling { + int GL_VIEWPORT_POSITION_W_SCALE_NV = 0x937C; + int GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV = 0x937D; + int GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV = 0x937E; - public static void glViewportPositionWScaleNV(int index, float xcoeff, float ycoeff) { - final var ext = getExtCapabilities(); - try { - check(ext.glViewportPositionWScaleNV).invokeExact(index, xcoeff, ycoeff); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glViewportPositionWScaleNV(int index, float xcoeff, float ycoeff) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVCommandList.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVCommandList.java index dc5d4a76..3da6a8d4 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVCommandList.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVCommandList.java @@ -16,179 +16,100 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_command_list} */ -public final class GLNVCommandList { - public static final int GL_TERMINATE_SEQUENCE_COMMAND_NV = 0x0000; - public static final int GL_NOP_COMMAND_NV = 0x0001; - public static final int GL_DRAW_ELEMENTS_COMMAND_NV = 0x0002; - public static final int GL_DRAW_ARRAYS_COMMAND_NV = 0x0003; - public static final int GL_DRAW_ELEMENTS_STRIP_COMMAND_NV = 0x0004; - public static final int GL_DRAW_ARRAYS_STRIP_COMMAND_NV = 0x0005; - public static final int GL_DRAW_ELEMENTS_INSTANCED_COMMAND_NV = 0x0006; - public static final int GL_DRAW_ARRAYS_INSTANCED_COMMAND_NV = 0x0007; - public static final int GL_ELEMENT_ADDRESS_COMMAND_NV = 0x0008; - public static final int GL_ATTRIBUTE_ADDRESS_COMMAND_NV = 0x0009; - public static final int GL_UNIFORM_ADDRESS_COMMAND_NV = 0x000A; - public static final int GL_BLEND_COLOR_COMMAND_NV = 0x000B; - public static final int GL_STENCIL_REF_COMMAND_NV = 0x000C; - public static final int GL_LINE_WIDTH_COMMAND_NV = 0x000D; - public static final int GL_POLYGON_OFFSET_COMMAND_NV = 0x000E; - public static final int GL_ALPHA_REF_COMMAND_NV = 0x000F; - public static final int GL_VIEWPORT_COMMAND_NV = 0x0010; - public static final int GL_SCISSOR_COMMAND_NV = 0x0011; - public static final int GL_FRONT_FACE_COMMAND_NV = 0x0012; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_command_list) return; - ext.glCreateStatesNV = load.invoke("glCreateStatesNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glDeleteStatesNV = load.invoke("glDeleteStatesNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glIsStateNV = load.invoke("glIsStateNV", of(JAVA_BYTE, JAVA_INT)); - ext.glStateCaptureNV = load.invoke("glStateCaptureNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glGetCommandHeaderNV = load.invoke("glGetCommandHeaderNV", of(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetStageIndexNV = load.invoke("glGetStageIndexNV", of(JAVA_SHORT, JAVA_INT)); - ext.glDrawCommandsNV = load.invoke("glDrawCommandsNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, ADDRESS, JAVA_INT)); - ext.glDrawCommandsAddressNV = load.invoke("glDrawCommandsAddressNV", ofVoid(JAVA_INT, ADDRESS, ADDRESS, JAVA_INT)); - ext.glDrawCommandsStatesNV = load.invoke("glDrawCommandsStatesNV", ofVoid(JAVA_INT, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_INT)); - ext.glDrawCommandsStatesAddressNV = load.invoke("glDrawCommandsStatesAddressNV", ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_INT)); - ext.glCreateCommandListsNV = load.invoke("glCreateCommandListsNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glDeleteCommandListsNV = load.invoke("glDeleteCommandListsNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glIsCommandListNV = load.invoke("glIsCommandListNV", of(JAVA_BYTE, JAVA_INT)); - ext.glListDrawCommandsStatesClientNV = load.invoke("glListDrawCommandsStatesClientNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_INT)); - ext.glCommandListSegmentsNV = load.invoke("glCommandListSegmentsNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glCompileCommandListNV = load.invoke("glCompileCommandListNV", ofVoid(JAVA_INT)); - ext.glCallCommandListNV = load.invoke("glCallCommandListNV", ofVoid(JAVA_INT)); - } - - public static void glCreateStatesNV(int n, @NativeType("GLuint *") MemorySegment states) { - final var ext = getExtCapabilities(); - try { - check(ext.glCreateStatesNV).invokeExact(n, states); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glDeleteStatesNV(int n, @NativeType("const GLuint *") MemorySegment states) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteStatesNV).invokeExact(n, states); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static boolean glIsStateNV(int state) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsStateNV).invokeExact(state); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glStateCaptureNV(int state, int mode) { - final var ext = getExtCapabilities(); - try { - check(ext.glStateCaptureNV).invokeExact(state, mode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static int glGetCommandHeaderNV(int tokenID, int size) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glGetCommandHeaderNV).invokeExact(tokenID, size); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static short glGetStageIndexNV(int shadertype) { - final var ext = getExtCapabilities(); - try { - return (short) - check(ext.glGetStageIndexNV).invokeExact(shadertype); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glDrawCommandsNV(int primitiveMode, int buffer, @NativeType("const GLintptr *") MemorySegment indirects, @NativeType("const GLsizei *") MemorySegment sizes, int count) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawCommandsNV).invokeExact(primitiveMode, buffer, indirects, sizes, count); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glDrawCommandsAddressNV(int primitiveMode, @NativeType("const GLuint64 *") MemorySegment indirects, @NativeType("const GLsizei *") MemorySegment sizes, int count) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawCommandsAddressNV).invokeExact(primitiveMode, indirects, sizes, count); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glDrawCommandsStatesNV(int buffer, @NativeType("const GLintptr *") MemorySegment indirects, @NativeType("const GLsizei *") MemorySegment sizes, @NativeType("const GLuint *") MemorySegment states, @NativeType("const GLuint *") MemorySegment fbos, int count) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawCommandsStatesNV).invokeExact(buffer, indirects, sizes, states, fbos, count); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glDrawCommandsStatesAddressNV(@NativeType("const GLuint64 *") MemorySegment indirects, @NativeType("const GLsizei *") MemorySegment sizes, @NativeType("const GLuint *") MemorySegment states, @NativeType("const GLuint *") MemorySegment fbos, int count) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawCommandsStatesAddressNV).invokeExact(indirects, sizes, states, fbos, count); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glCreateCommandListsNV(int n, @NativeType("GLuint *") MemorySegment lists) { - final var ext = getExtCapabilities(); - try { - check(ext.glCreateCommandListsNV).invokeExact(n, lists); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glDeleteCommandListsNV(int n, @NativeType("const GLuint *") MemorySegment lists) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteCommandListsNV).invokeExact(n, lists); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLNVCommandList { + int GL_TERMINATE_SEQUENCE_COMMAND_NV = 0x0000; + int GL_NOP_COMMAND_NV = 0x0001; + int GL_DRAW_ELEMENTS_COMMAND_NV = 0x0002; + int GL_DRAW_ARRAYS_COMMAND_NV = 0x0003; + int GL_DRAW_ELEMENTS_STRIP_COMMAND_NV = 0x0004; + int GL_DRAW_ARRAYS_STRIP_COMMAND_NV = 0x0005; + int GL_DRAW_ELEMENTS_INSTANCED_COMMAND_NV = 0x0006; + int GL_DRAW_ARRAYS_INSTANCED_COMMAND_NV = 0x0007; + int GL_ELEMENT_ADDRESS_COMMAND_NV = 0x0008; + int GL_ATTRIBUTE_ADDRESS_COMMAND_NV = 0x0009; + int GL_UNIFORM_ADDRESS_COMMAND_NV = 0x000A; + int GL_BLEND_COLOR_COMMAND_NV = 0x000B; + int GL_STENCIL_REF_COMMAND_NV = 0x000C; + int GL_LINE_WIDTH_COMMAND_NV = 0x000D; + int GL_POLYGON_OFFSET_COMMAND_NV = 0x000E; + int GL_ALPHA_REF_COMMAND_NV = 0x000F; + int GL_VIEWPORT_COMMAND_NV = 0x0010; + int GL_SCISSOR_COMMAND_NV = 0x0011; + int GL_FRONT_FACE_COMMAND_NV = 0x0012; + + default void glCreateStatesNV(int n, @NativeType("GLuint *") MemorySegment states) { + throw new ContextException(); + } + + default void glDeleteStatesNV(int n, @NativeType("const GLuint *") MemorySegment states) { + throw new ContextException(); + } + + default boolean glIsStateNV(int state) { + throw new ContextException(); + } + + default void glStateCaptureNV(int state, int mode) { + throw new ContextException(); + } + + default int glGetCommandHeaderNV(int tokenID, int size) { + throw new ContextException(); + } + + default short glGetStageIndexNV(int shadertype) { + throw new ContextException(); + } + + default void glDrawCommandsNV(int primitiveMode, int buffer, @NativeType("const GLintptr *") MemorySegment indirects, @NativeType("const GLsizei *") MemorySegment sizes, int count) { + throw new ContextException(); + } + + default void glDrawCommandsAddressNV(int primitiveMode, @NativeType("const GLuint64 *") MemorySegment indirects, @NativeType("const GLsizei *") MemorySegment sizes, int count) { + throw new ContextException(); + } + + default void glDrawCommandsStatesNV(int buffer, @NativeType("const GLintptr *") MemorySegment indirects, @NativeType("const GLsizei *") MemorySegment sizes, @NativeType("const GLuint *") MemorySegment states, @NativeType("const GLuint *") MemorySegment fbos, int count) { + throw new ContextException(); + } + + default void glDrawCommandsStatesAddressNV(@NativeType("const GLuint64 *") MemorySegment indirects, @NativeType("const GLsizei *") MemorySegment sizes, @NativeType("const GLuint *") MemorySegment states, @NativeType("const GLuint *") MemorySegment fbos, int count) { + throw new ContextException(); + } + + default void glCreateCommandListsNV(int n, @NativeType("GLuint *") MemorySegment lists) { + throw new ContextException(); + } + + default void glDeleteCommandListsNV(int n, @NativeType("const GLuint *") MemorySegment lists) { + throw new ContextException(); } - public static boolean glIsCommandListNV(int list) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsCommandListNV).invokeExact(list); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsCommandListNV(int list) { + throw new ContextException(); } - public static void glListDrawCommandsStatesClientNV(int list, int segment, @NativeType("const void **") MemorySegment indirects, @NativeType("const GLsizei *") MemorySegment sizes, @NativeType("const GLuint *") MemorySegment states, @NativeType("const GLuint *") MemorySegment fbos, int count) { - final var ext = getExtCapabilities(); - try { - check(ext.glListDrawCommandsStatesClientNV).invokeExact(list, segment, indirects, sizes, states, fbos, count); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glListDrawCommandsStatesClientNV(int list, int segment, @NativeType("const void **") MemorySegment indirects, @NativeType("const GLsizei *") MemorySegment sizes, @NativeType("const GLuint *") MemorySegment states, @NativeType("const GLuint *") MemorySegment fbos, int count) { + throw new ContextException(); } - public static void glCommandListSegmentsNV(int list, int segments) { - final var ext = getExtCapabilities(); - try { - check(ext.glCommandListSegmentsNV).invokeExact(list, segments); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCommandListSegmentsNV(int list, int segments) { + throw new ContextException(); } - public static void glCompileCommandListNV(int list) { - final var ext = getExtCapabilities(); - try { - check(ext.glCompileCommandListNV).invokeExact(list); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCompileCommandListNV(int list) { + throw new ContextException(); } - public static void glCallCommandListNV(int list) { - final var ext = getExtCapabilities(); - try { - check(ext.glCallCommandListNV).invokeExact(list); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCallCommandListNV(int list) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVComputeProgram5.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVComputeProgram5.java index f7f3cee8..ab22aed3 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVComputeProgram5.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVComputeProgram5.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_compute_program5} */ -public final class GLNVComputeProgram5 { - public static final int GL_COMPUTE_PROGRAM_NV = 0x90FB; - public static final int GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV = 0x90FC; +public interface GLNVComputeProgram5 { + int GL_COMPUTE_PROGRAM_NV = 0x90FB; + int GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV = 0x90FC; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVConditionalRender.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVConditionalRender.java index dde4d1bb..cf741443 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVConditionalRender.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVConditionalRender.java @@ -16,40 +16,25 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_conditional_render} */ -public final class GLNVConditionalRender { - public static final int GL_QUERY_WAIT_NV = 0x8E13; - public static final int GL_QUERY_NO_WAIT_NV = 0x8E14; - public static final int GL_QUERY_BY_REGION_WAIT_NV = 0x8E15; - public static final int GL_QUERY_BY_REGION_NO_WAIT_NV = 0x8E16; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_conditional_render) return; - ext.glBeginConditionalRenderNV = load.invoke("glBeginConditionalRenderNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glEndConditionalRenderNV = load.invoke("glEndConditionalRenderNV", ofVoid()); - } +public interface GLNVConditionalRender { + int GL_QUERY_WAIT_NV = 0x8E13; + int GL_QUERY_NO_WAIT_NV = 0x8E14; + int GL_QUERY_BY_REGION_WAIT_NV = 0x8E15; + int GL_QUERY_BY_REGION_NO_WAIT_NV = 0x8E16; - public static void glBeginConditionalRenderNV(int id, int mode) { - final var ext = getExtCapabilities(); - try { - check(ext.glBeginConditionalRenderNV).invokeExact(id, mode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBeginConditionalRenderNV(int id, int mode) { + throw new ContextException(); } - public static void glEndConditionalRenderNV() { - final var ext = getExtCapabilities(); - try { - check(ext.glEndConditionalRenderNV).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEndConditionalRenderNV() { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVConservativeRaster.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVConservativeRaster.java index f25dc09b..1c3e8642 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVConservativeRaster.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVConservativeRaster.java @@ -16,32 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_conservative_raster} */ -public final class GLNVConservativeRaster { - public static final int GL_CONSERVATIVE_RASTERIZATION_NV = 0x9346; - public static final int GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV = 0x9347; - public static final int GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV = 0x9348; - public static final int GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV = 0x9349; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_conservative_raster) return; - ext.glSubpixelPrecisionBiasNV = load.invoke("glSubpixelPrecisionBiasNV", ofVoid(JAVA_INT, JAVA_INT)); - } +public interface GLNVConservativeRaster { + int GL_CONSERVATIVE_RASTERIZATION_NV = 0x9346; + int GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV = 0x9347; + int GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV = 0x9348; + int GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV = 0x9349; - public static void glSubpixelPrecisionBiasNV(int xbits, int ybits) { - final var ext = getExtCapabilities(); - try { - check(ext.glSubpixelPrecisionBiasNV).invokeExact(xbits, ybits); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSubpixelPrecisionBiasNV(int xbits, int ybits) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVConservativeRasterDilate.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVConservativeRasterDilate.java index 93f71105..6e971b43 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVConservativeRasterDilate.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVConservativeRasterDilate.java @@ -16,31 +16,20 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_conservative_raster_dilate} */ -public final class GLNVConservativeRasterDilate { - public static final int GL_CONSERVATIVE_RASTER_DILATE_NV = 0x9379; - public static final int GL_CONSERVATIVE_RASTER_DILATE_RANGE_NV = 0x937A; - public static final int GL_CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV = 0x937B; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_conservative_raster_dilate) return; - ext.glConservativeRasterParameterfNV = load.invoke("glConservativeRasterParameterfNV", ofVoid(JAVA_INT, JAVA_FLOAT)); - } +public interface GLNVConservativeRasterDilate { + int GL_CONSERVATIVE_RASTER_DILATE_NV = 0x9379; + int GL_CONSERVATIVE_RASTER_DILATE_RANGE_NV = 0x937A; + int GL_CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV = 0x937B; - public static void glConservativeRasterParameterfNV(int pname, float value) { - final var ext = getExtCapabilities(); - try { - check(ext.glConservativeRasterParameterfNV).invokeExact(pname, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glConservativeRasterParameterfNV(int pname, float value) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVConservativeRasterPreSnap.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVConservativeRasterPreSnap.java index 980c8a26..fbcf8447 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVConservativeRasterPreSnap.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVConservativeRasterPreSnap.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_conservative_raster_pre_snap} */ -public final class GLNVConservativeRasterPreSnap { - public static final int GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_NV = 0x9550; +public interface GLNVConservativeRasterPreSnap { + int GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_NV = 0x9550; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVConservativeRasterPreSnapTriangles.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVConservativeRasterPreSnapTriangles.java index 8a24e828..c88c57c0 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVConservativeRasterPreSnapTriangles.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVConservativeRasterPreSnapTriangles.java @@ -16,31 +16,20 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_conservative_raster_pre_snap_triangles} */ -public final class GLNVConservativeRasterPreSnapTriangles { - public static final int GL_CONSERVATIVE_RASTER_MODE_NV = 0x954D; - public static final int GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV = 0x954E; - public static final int GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV = 0x954F; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_conservative_raster_pre_snap_triangles) return; - ext.glConservativeRasterParameteriNV = load.invoke("glConservativeRasterParameteriNV", ofVoid(JAVA_INT, JAVA_INT)); - } +public interface GLNVConservativeRasterPreSnapTriangles { + int GL_CONSERVATIVE_RASTER_MODE_NV = 0x954D; + int GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV = 0x954E; + int GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV = 0x954F; - public static void glConservativeRasterParameteriNV(int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glConservativeRasterParameteriNV).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glConservativeRasterParameteriNV(int pname, int param) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVCopyDepthToColor.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVCopyDepthToColor.java index 8587e932..ca47e73b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVCopyDepthToColor.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVCopyDepthToColor.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_copy_depth_to_color} */ -public final class GLNVCopyDepthToColor { - public static final int GL_DEPTH_STENCIL_TO_RGBA_NV = 0x886E; - public static final int GL_DEPTH_STENCIL_TO_BGRA_NV = 0x886F; +public interface GLNVCopyDepthToColor { + int GL_DEPTH_STENCIL_TO_RGBA_NV = 0x886E; + int GL_DEPTH_STENCIL_TO_BGRA_NV = 0x886F; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVCopyImage.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVCopyImage.java index 94ae52a3..389d0d22 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVCopyImage.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVCopyImage.java @@ -16,28 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_copy_image} */ -public final class GLNVCopyImage { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_copy_image) return; - ext.glCopyImageSubDataNV = load.invoke("glCopyImageSubDataNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLNVCopyImage { - public static void glCopyImageSubDataNV(int srcName, int srcTarget, int srcLevel, int srcX, int srcY, int srcZ, int dstName, int dstTarget, int dstLevel, int dstX, int dstY, int dstZ, int width, int height, int depth) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyImageSubDataNV).invokeExact(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, width, height, depth); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyImageSubDataNV(int srcName, int srcTarget, int srcLevel, int srcX, int srcY, int srcZ, int dstName, int dstTarget, int dstLevel, int dstX, int dstY, int dstZ, int width, int height, int depth) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVDeepTexture3D.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVDeepTexture3D.java index db50def8..6d8f4f45 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVDeepTexture3D.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVDeepTexture3D.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_deep_texture3D} */ -public final class GLNVDeepTexture3D { - public static final int GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV = 0x90D0; - public static final int GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV = 0x90D1; +public interface GLNVDeepTexture3D { + int GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV = 0x90D0; + int GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV = 0x90D1; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVDepthBufferFloat.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVDepthBufferFloat.java index cd081830..2cf2761e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVDepthBufferFloat.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVDepthBufferFloat.java @@ -16,48 +16,29 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_depth_buffer_float} */ -public final class GLNVDepthBufferFloat { - public static final int GL_DEPTH_COMPONENT32F_NV = 0x8DAB; - public static final int GL_DEPTH32F_STENCIL8_NV = 0x8DAC; - public static final int GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV = 0x8DAD; - public static final int GL_DEPTH_BUFFER_FLOAT_MODE_NV = 0x8DAF; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_depth_buffer_float) return; - ext.glDepthRangedNV = load.invoke("glDepthRangedNV", ofVoid(JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glClearDepthdNV = load.invoke("glClearDepthdNV", ofVoid(JAVA_DOUBLE)); - ext.glDepthBoundsdNV = load.invoke("glDepthBoundsdNV", ofVoid(JAVA_DOUBLE, JAVA_DOUBLE)); - } +public interface GLNVDepthBufferFloat { + int GL_DEPTH_COMPONENT32F_NV = 0x8DAB; + int GL_DEPTH32F_STENCIL8_NV = 0x8DAC; + int GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV = 0x8DAD; + int GL_DEPTH_BUFFER_FLOAT_MODE_NV = 0x8DAF; - public static void glDepthRangedNV(double zNear, double zFar) { - final var ext = getExtCapabilities(); - try { - check(ext.glDepthRangedNV).invokeExact(zNear, zFar); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDepthRangedNV(double zNear, double zFar) { + throw new ContextException(); } - public static void glClearDepthdNV(double depth) { - final var ext = getExtCapabilities(); - try { - check(ext.glClearDepthdNV).invokeExact(depth); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glClearDepthdNV(double depth) { + throw new ContextException(); } - public static void glDepthBoundsdNV(double zmin, double zmax) { - final var ext = getExtCapabilities(); - try { - check(ext.glDepthBoundsdNV).invokeExact(zmin, zmax); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDepthBoundsdNV(double zmin, double zmax) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVDepthClamp.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVDepthClamp.java index b782616f..8d160b3c 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVDepthClamp.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVDepthClamp.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_depth_clamp} */ -public final class GLNVDepthClamp { - public static final int GL_DEPTH_CLAMP_NV = 0x864F; +public interface GLNVDepthClamp { + int GL_DEPTH_CLAMP_NV = 0x864F; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVDrawTexture.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVDrawTexture.java index 085de6d2..fc32f39a 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVDrawTexture.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVDrawTexture.java @@ -16,28 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_draw_texture} */ -public final class GLNVDrawTexture { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_draw_texture) return; - ext.glDrawTextureNV = load.invoke("glDrawTextureNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - } +public interface GLNVDrawTexture { - public static void glDrawTextureNV(int texture, int sampler, float x0, float y0, float x1, float y1, float z, float s0, float t0, float s1, float t1) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawTextureNV).invokeExact(texture, sampler, x0, y0, x1, y1, z, s0, t0, s1, t1); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDrawTextureNV(int texture, int sampler, float x0, float y0, float x1, float y1, float z, float s0, float t0, float s1, float t1) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVDrawVulkanImage.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVDrawVulkanImage.java index 5238c653..5151738c 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVDrawVulkanImage.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVDrawVulkanImage.java @@ -16,61 +16,33 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_draw_vulkan_image} */ -public final class GLNVDrawVulkanImage { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_draw_vulkan_image) return; - ext.glDrawVkImageNV = load.invoke("glDrawVkImageNV", ofVoid(JAVA_LONG, JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glGetVkProcAddrNV = load.invoke("glGetVkProcAddrNV", of(ADDRESS, ADDRESS)); - ext.glWaitVkSemaphoreNV = load.invoke("glWaitVkSemaphoreNV", ofVoid(JAVA_LONG)); - ext.glSignalVkSemaphoreNV = load.invoke("glSignalVkSemaphoreNV", ofVoid(JAVA_LONG)); - ext.glSignalVkFenceNV = load.invoke("glSignalVkFenceNV", ofVoid(JAVA_LONG)); - } +public interface GLNVDrawVulkanImage { - public static void glDrawVkImageNV(long vkImage, int sampler, float x0, float y0, float x1, float y1, float z, float s0, float t0, float s1, float t1) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawVkImageNV).invokeExact(vkImage, sampler, x0, y0, x1, y1, z, s0, t0, s1, t1); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDrawVkImageNV(long vkImage, int sampler, float x0, float y0, float x1, float y1, float z, float s0, float t0, float s1, float t1) { + throw new ContextException(); } - public static @NativeType("GLVULKANPROCNV") MemorySegment glGetVkProcAddrNV(@NativeType("const GLchar *") MemorySegment name) { - final var ext = getExtCapabilities(); - try { - return (MemorySegment) - check(ext.glGetVkProcAddrNV).invokeExact(name); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + @NativeType("GLVULKANPROCNV") default MemorySegment glGetVkProcAddrNV(@NativeType("const GLchar *") MemorySegment name) { + throw new ContextException(); } - public static void glWaitVkSemaphoreNV(long vkSemaphore) { - final var ext = getExtCapabilities(); - try { - check(ext.glWaitVkSemaphoreNV).invokeExact(vkSemaphore); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWaitVkSemaphoreNV(long vkSemaphore) { + throw new ContextException(); } - public static void glSignalVkSemaphoreNV(long vkSemaphore) { - final var ext = getExtCapabilities(); - try { - check(ext.glSignalVkSemaphoreNV).invokeExact(vkSemaphore); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSignalVkSemaphoreNV(long vkSemaphore) { + throw new ContextException(); } - public static void glSignalVkFenceNV(long vkFence) { - final var ext = getExtCapabilities(); - try { - check(ext.glSignalVkFenceNV).invokeExact(vkFence); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSignalVkFenceNV(long vkFence) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVEvaluators.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVEvaluators.java index 5d3e2cf7..d531f029 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVEvaluators.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVEvaluators.java @@ -16,116 +16,73 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_evaluators} */ -public final class GLNVEvaluators { - public static final int GL_EVAL_2D_NV = 0x86C0; - public static final int GL_EVAL_TRIANGULAR_2D_NV = 0x86C1; - public static final int GL_MAP_TESSELLATION_NV = 0x86C2; - public static final int GL_MAP_ATTRIB_U_ORDER_NV = 0x86C3; - public static final int GL_MAP_ATTRIB_V_ORDER_NV = 0x86C4; - public static final int GL_EVAL_FRACTIONAL_TESSELLATION_NV = 0x86C5; - public static final int GL_EVAL_VERTEX_ATTRIB0_NV = 0x86C6; - public static final int GL_EVAL_VERTEX_ATTRIB1_NV = 0x86C7; - public static final int GL_EVAL_VERTEX_ATTRIB2_NV = 0x86C8; - public static final int GL_EVAL_VERTEX_ATTRIB3_NV = 0x86C9; - public static final int GL_EVAL_VERTEX_ATTRIB4_NV = 0x86CA; - public static final int GL_EVAL_VERTEX_ATTRIB5_NV = 0x86CB; - public static final int GL_EVAL_VERTEX_ATTRIB6_NV = 0x86CC; - public static final int GL_EVAL_VERTEX_ATTRIB7_NV = 0x86CD; - public static final int GL_EVAL_VERTEX_ATTRIB8_NV = 0x86CE; - public static final int GL_EVAL_VERTEX_ATTRIB9_NV = 0x86CF; - public static final int GL_EVAL_VERTEX_ATTRIB10_NV = 0x86D0; - public static final int GL_EVAL_VERTEX_ATTRIB11_NV = 0x86D1; - public static final int GL_EVAL_VERTEX_ATTRIB12_NV = 0x86D2; - public static final int GL_EVAL_VERTEX_ATTRIB13_NV = 0x86D3; - public static final int GL_EVAL_VERTEX_ATTRIB14_NV = 0x86D4; - public static final int GL_EVAL_VERTEX_ATTRIB15_NV = 0x86D5; - public static final int GL_MAX_MAP_TESSELLATION_NV = 0x86D6; - public static final int GL_MAX_RATIONAL_EVAL_ORDER_NV = 0x86D7; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_evaluators) return; - ext.glMapControlPointsNV = load.invoke("glMapControlPointsNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glMapParameterivNV = load.invoke("glMapParameterivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMapParameterfvNV = load.invoke("glMapParameterfvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMapControlPointsNV = load.invoke("glGetMapControlPointsNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, ADDRESS)); - ext.glGetMapParameterivNV = load.invoke("glGetMapParameterivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMapParameterfvNV = load.invoke("glGetMapParameterfvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMapAttribParameterivNV = load.invoke("glGetMapAttribParameterivNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMapAttribParameterfvNV = load.invoke("glGetMapAttribParameterfvNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glEvalMapsNV = load.invoke("glEvalMapsNV", ofVoid(JAVA_INT, JAVA_INT)); - } +public interface GLNVEvaluators { + int GL_EVAL_2D_NV = 0x86C0; + int GL_EVAL_TRIANGULAR_2D_NV = 0x86C1; + int GL_MAP_TESSELLATION_NV = 0x86C2; + int GL_MAP_ATTRIB_U_ORDER_NV = 0x86C3; + int GL_MAP_ATTRIB_V_ORDER_NV = 0x86C4; + int GL_EVAL_FRACTIONAL_TESSELLATION_NV = 0x86C5; + int GL_EVAL_VERTEX_ATTRIB0_NV = 0x86C6; + int GL_EVAL_VERTEX_ATTRIB1_NV = 0x86C7; + int GL_EVAL_VERTEX_ATTRIB2_NV = 0x86C8; + int GL_EVAL_VERTEX_ATTRIB3_NV = 0x86C9; + int GL_EVAL_VERTEX_ATTRIB4_NV = 0x86CA; + int GL_EVAL_VERTEX_ATTRIB5_NV = 0x86CB; + int GL_EVAL_VERTEX_ATTRIB6_NV = 0x86CC; + int GL_EVAL_VERTEX_ATTRIB7_NV = 0x86CD; + int GL_EVAL_VERTEX_ATTRIB8_NV = 0x86CE; + int GL_EVAL_VERTEX_ATTRIB9_NV = 0x86CF; + int GL_EVAL_VERTEX_ATTRIB10_NV = 0x86D0; + int GL_EVAL_VERTEX_ATTRIB11_NV = 0x86D1; + int GL_EVAL_VERTEX_ATTRIB12_NV = 0x86D2; + int GL_EVAL_VERTEX_ATTRIB13_NV = 0x86D3; + int GL_EVAL_VERTEX_ATTRIB14_NV = 0x86D4; + int GL_EVAL_VERTEX_ATTRIB15_NV = 0x86D5; + int GL_MAX_MAP_TESSELLATION_NV = 0x86D6; + int GL_MAX_RATIONAL_EVAL_ORDER_NV = 0x86D7; - public static void glMapControlPointsNV(int target, int index, int type, int ustride, int vstride, int uorder, int vorder, boolean packed, @NativeType("const void *") MemorySegment points) { - final var ext = getExtCapabilities(); - try { - check(ext.glMapControlPointsNV).invokeExact(target, index, type, ustride, vstride, uorder, vorder, packed, points); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMapControlPointsNV(int target, int index, int type, int ustride, int vstride, int uorder, int vorder, boolean packed, @NativeType("const void *") MemorySegment points) { + throw new ContextException(); } - public static void glMapParameterivNV(int target, int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glMapParameterivNV).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMapParameterivNV(int target, int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glMapParameterfvNV(int target, int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glMapParameterfvNV).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMapParameterfvNV(int target, int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetMapControlPointsNV(int target, int index, int type, int ustride, int vstride, boolean packed, @NativeType("void *") MemorySegment points) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMapControlPointsNV).invokeExact(target, index, type, ustride, vstride, packed, points); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMapControlPointsNV(int target, int index, int type, int ustride, int vstride, boolean packed, @NativeType("void *") MemorySegment points) { + throw new ContextException(); } - public static void glGetMapParameterivNV(int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMapParameterivNV).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMapParameterivNV(int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetMapParameterfvNV(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMapParameterfvNV).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMapParameterfvNV(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetMapAttribParameterivNV(int target, int index, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMapAttribParameterivNV).invokeExact(target, index, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMapAttribParameterivNV(int target, int index, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetMapAttribParameterfvNV(int target, int index, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMapAttribParameterfvNV).invokeExact(target, index, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMapAttribParameterfvNV(int target, int index, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glEvalMapsNV(int target, int mode) { - final var ext = getExtCapabilities(); - try { - check(ext.glEvalMapsNV).invokeExact(target, mode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEvalMapsNV(int target, int mode) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVExplicitMultisample.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVExplicitMultisample.java index 856db0f9..cb6e91bb 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVExplicitMultisample.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVExplicitMultisample.java @@ -16,54 +16,35 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_explicit_multisample} */ -public final class GLNVExplicitMultisample { - public static final int GL_SAMPLE_POSITION_NV = 0x8E50; - public static final int GL_SAMPLE_MASK_NV = 0x8E51; - public static final int GL_SAMPLE_MASK_VALUE_NV = 0x8E52; - public static final int GL_TEXTURE_BINDING_RENDERBUFFER_NV = 0x8E53; - public static final int GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV = 0x8E54; - public static final int GL_TEXTURE_RENDERBUFFER_NV = 0x8E55; - public static final int GL_SAMPLER_RENDERBUFFER_NV = 0x8E56; - public static final int GL_INT_SAMPLER_RENDERBUFFER_NV = 0x8E57; - public static final int GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV = 0x8E58; - public static final int GL_MAX_SAMPLE_MASK_WORDS_NV = 0x8E59; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_explicit_multisample) return; - ext.glGetMultisamplefvNV = load.invoke("glGetMultisamplefvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glSampleMaskIndexedNV = load.invoke("glSampleMaskIndexedNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glTexRenderbufferNV = load.invoke("glTexRenderbufferNV", ofVoid(JAVA_INT, JAVA_INT)); - } +public interface GLNVExplicitMultisample { + int GL_SAMPLE_POSITION_NV = 0x8E50; + int GL_SAMPLE_MASK_NV = 0x8E51; + int GL_SAMPLE_MASK_VALUE_NV = 0x8E52; + int GL_TEXTURE_BINDING_RENDERBUFFER_NV = 0x8E53; + int GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV = 0x8E54; + int GL_TEXTURE_RENDERBUFFER_NV = 0x8E55; + int GL_SAMPLER_RENDERBUFFER_NV = 0x8E56; + int GL_INT_SAMPLER_RENDERBUFFER_NV = 0x8E57; + int GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV = 0x8E58; + int GL_MAX_SAMPLE_MASK_WORDS_NV = 0x8E59; - public static void glGetMultisamplefvNV(int pname, int index, @NativeType("GLfloat *") MemorySegment val) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMultisamplefvNV).invokeExact(pname, index, val); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMultisamplefvNV(int pname, int index, @NativeType("GLfloat *") MemorySegment val) { + throw new ContextException(); } - public static void glSampleMaskIndexedNV(int index, int mask) { - final var ext = getExtCapabilities(); - try { - check(ext.glSampleMaskIndexedNV).invokeExact(index, mask); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSampleMaskIndexedNV(int index, int mask) { + throw new ContextException(); } - public static void glTexRenderbufferNV(int target, int renderbuffer) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexRenderbufferNV).invokeExact(target, renderbuffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexRenderbufferNV(int target, int renderbuffer) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFence.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFence.java index 6455554a..0f0ab5eb 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFence.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFence.java @@ -16,81 +16,44 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_fence} */ -public final class GLNVFence { - public static final int GL_ALL_COMPLETED_NV = 0x84F2; - public static final int GL_FENCE_STATUS_NV = 0x84F3; - public static final int GL_FENCE_CONDITION_NV = 0x84F4; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_fence) return; - ext.glDeleteFencesNV = load.invoke("glDeleteFencesNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glGenFencesNV = load.invoke("glGenFencesNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glIsFenceNV = load.invoke("glIsFenceNV", of(JAVA_BYTE, JAVA_INT)); - ext.glTestFenceNV = load.invoke("glTestFenceNV", of(JAVA_BYTE, JAVA_INT)); - ext.glGetFenceivNV = load.invoke("glGetFenceivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glFinishFenceNV = load.invoke("glFinishFenceNV", ofVoid(JAVA_INT)); - ext.glSetFenceNV = load.invoke("glSetFenceNV", ofVoid(JAVA_INT, JAVA_INT)); - } +public interface GLNVFence { + int GL_ALL_COMPLETED_NV = 0x84F2; + int GL_FENCE_STATUS_NV = 0x84F3; + int GL_FENCE_CONDITION_NV = 0x84F4; - public static void glDeleteFencesNV(int n, @NativeType("const GLuint *") MemorySegment fences) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteFencesNV).invokeExact(n, fences); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDeleteFencesNV(int n, @NativeType("const GLuint *") MemorySegment fences) { + throw new ContextException(); } - public static void glGenFencesNV(int n, @NativeType("GLuint *") MemorySegment fences) { - final var ext = getExtCapabilities(); - try { - check(ext.glGenFencesNV).invokeExact(n, fences); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGenFencesNV(int n, @NativeType("GLuint *") MemorySegment fences) { + throw new ContextException(); } - public static boolean glIsFenceNV(int fence) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsFenceNV).invokeExact(fence); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsFenceNV(int fence) { + throw new ContextException(); } - public static boolean glTestFenceNV(int fence) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glTestFenceNV).invokeExact(fence); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glTestFenceNV(int fence) { + throw new ContextException(); } - public static void glGetFenceivNV(int fence, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetFenceivNV).invokeExact(fence, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetFenceivNV(int fence, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glFinishFenceNV(int fence) { - final var ext = getExtCapabilities(); - try { - check(ext.glFinishFenceNV).invokeExact(fence); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFinishFenceNV(int fence) { + throw new ContextException(); } - public static void glSetFenceNV(int fence, int condition) { - final var ext = getExtCapabilities(); - try { - check(ext.glSetFenceNV).invokeExact(fence, condition); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSetFenceNV(int fence, int condition) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFillRectangle.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFillRectangle.java index 7da64672..107409ad 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFillRectangle.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFillRectangle.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_fill_rectangle} */ -public final class GLNVFillRectangle { - public static final int GL_FILL_RECTANGLE_NV = 0x933C; +public interface GLNVFillRectangle { + int GL_FILL_RECTANGLE_NV = 0x933C; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFloatBuffer.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFloatBuffer.java index 7a034a30..39aa05a6 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFloatBuffer.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFloatBuffer.java @@ -16,31 +16,27 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_float_buffer} */ -public final class GLNVFloatBuffer { - public static final int GL_FLOAT_R_NV = 0x8880; - public static final int GL_FLOAT_RG_NV = 0x8881; - public static final int GL_FLOAT_RGB_NV = 0x8882; - public static final int GL_FLOAT_RGBA_NV = 0x8883; - public static final int GL_FLOAT_R16_NV = 0x8884; - public static final int GL_FLOAT_R32_NV = 0x8885; - public static final int GL_FLOAT_RG16_NV = 0x8886; - public static final int GL_FLOAT_RG32_NV = 0x8887; - public static final int GL_FLOAT_RGB16_NV = 0x8888; - public static final int GL_FLOAT_RGB32_NV = 0x8889; - public static final int GL_FLOAT_RGBA16_NV = 0x888A; - public static final int GL_FLOAT_RGBA32_NV = 0x888B; - public static final int GL_TEXTURE_FLOAT_COMPONENTS_NV = 0x888C; - public static final int GL_FLOAT_CLEAR_COLOR_VALUE_NV = 0x888D; - public static final int GL_FLOAT_RGBA_MODE_NV = 0x888E; +public interface GLNVFloatBuffer { + int GL_FLOAT_R_NV = 0x8880; + int GL_FLOAT_RG_NV = 0x8881; + int GL_FLOAT_RGB_NV = 0x8882; + int GL_FLOAT_RGBA_NV = 0x8883; + int GL_FLOAT_R16_NV = 0x8884; + int GL_FLOAT_R32_NV = 0x8885; + int GL_FLOAT_RG16_NV = 0x8886; + int GL_FLOAT_RG32_NV = 0x8887; + int GL_FLOAT_RGB16_NV = 0x8888; + int GL_FLOAT_RGB32_NV = 0x8889; + int GL_FLOAT_RGBA16_NV = 0x888A; + int GL_FLOAT_RGBA32_NV = 0x888B; + int GL_TEXTURE_FLOAT_COMPONENTS_NV = 0x888C; + int GL_FLOAT_CLEAR_COLOR_VALUE_NV = 0x888D; + int GL_FLOAT_RGBA_MODE_NV = 0x888E; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFogDistance.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFogDistance.java index 1fbfeafc..ce19fdee 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFogDistance.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFogDistance.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_fog_distance} */ -public final class GLNVFogDistance { - public static final int GL_FOG_DISTANCE_MODE_NV = 0x855A; - public static final int GL_EYE_RADIAL_NV = 0x855B; - public static final int GL_EYE_PLANE_ABSOLUTE_NV = 0x855C; +public interface GLNVFogDistance { + int GL_FOG_DISTANCE_MODE_NV = 0x855A; + int GL_EYE_RADIAL_NV = 0x855B; + int GL_EYE_PLANE_ABSOLUTE_NV = 0x855C; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFragmentCoverageToColor.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFragmentCoverageToColor.java index cf7698e2..35f91e41 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFragmentCoverageToColor.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFragmentCoverageToColor.java @@ -16,30 +16,19 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_fragment_coverage_to_color} */ -public final class GLNVFragmentCoverageToColor { - public static final int GL_FRAGMENT_COVERAGE_TO_COLOR_NV = 0x92DD; - public static final int GL_FRAGMENT_COVERAGE_COLOR_NV = 0x92DE; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_fragment_coverage_to_color) return; - ext.glFragmentCoverageColorNV = load.invoke("glFragmentCoverageColorNV", ofVoid(JAVA_INT)); - } +public interface GLNVFragmentCoverageToColor { + int GL_FRAGMENT_COVERAGE_TO_COLOR_NV = 0x92DD; + int GL_FRAGMENT_COVERAGE_COLOR_NV = 0x92DE; - public static void glFragmentCoverageColorNV(int color) { - final var ext = getExtCapabilities(); - try { - check(ext.glFragmentCoverageColorNV).invokeExact(color); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFragmentCoverageColorNV(int color) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFragmentProgram.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFragmentProgram.java index 3ff21b33..09a7160c 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFragmentProgram.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFragmentProgram.java @@ -16,74 +16,43 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_fragment_program} */ -public final class GLNVFragmentProgram { - public static final int GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV = 0x8868; - public static final int GL_FRAGMENT_PROGRAM_NV = 0x8870; - public static final int GL_MAX_TEXTURE_COORDS_NV = 0x8871; - public static final int GL_MAX_TEXTURE_IMAGE_UNITS_NV = 0x8872; - public static final int GL_FRAGMENT_PROGRAM_BINDING_NV = 0x8873; - public static final int GL_PROGRAM_ERROR_STRING_NV = 0x8874; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_fragment_program) return; - ext.glProgramNamedParameter4fNV = load.invoke("glProgramNamedParameter4fNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glProgramNamedParameter4fvNV = load.invoke("glProgramNamedParameter4fvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - ext.glProgramNamedParameter4dNV = load.invoke("glProgramNamedParameter4dNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glProgramNamedParameter4dvNV = load.invoke("glProgramNamedParameter4dvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - ext.glGetProgramNamedParameterfvNV = load.invoke("glGetProgramNamedParameterfvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - ext.glGetProgramNamedParameterdvNV = load.invoke("glGetProgramNamedParameterdvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - } - - public static void glProgramNamedParameter4fNV(int id, int len, @NativeType("const GLubyte *") MemorySegment name, float x, float y, float z, float w) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramNamedParameter4fNV).invokeExact(id, len, name, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLNVFragmentProgram { + int GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV = 0x8868; + int GL_FRAGMENT_PROGRAM_NV = 0x8870; + int GL_MAX_TEXTURE_COORDS_NV = 0x8871; + int GL_MAX_TEXTURE_IMAGE_UNITS_NV = 0x8872; + int GL_FRAGMENT_PROGRAM_BINDING_NV = 0x8873; + int GL_PROGRAM_ERROR_STRING_NV = 0x8874; + + default void glProgramNamedParameter4fNV(int id, int len, @NativeType("const GLubyte *") MemorySegment name, float x, float y, float z, float w) { + throw new ContextException(); } - public static void glProgramNamedParameter4fvNV(int id, int len, @NativeType("const GLubyte *") MemorySegment name, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramNamedParameter4fvNV).invokeExact(id, len, name, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramNamedParameter4fvNV(int id, int len, @NativeType("const GLubyte *") MemorySegment name, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glProgramNamedParameter4dNV(int id, int len, @NativeType("const GLubyte *") MemorySegment name, double x, double y, double z, double w) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramNamedParameter4dNV).invokeExact(id, len, name, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramNamedParameter4dNV(int id, int len, @NativeType("const GLubyte *") MemorySegment name, double x, double y, double z, double w) { + throw new ContextException(); } - public static void glProgramNamedParameter4dvNV(int id, int len, @NativeType("const GLubyte *") MemorySegment name, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramNamedParameter4dvNV).invokeExact(id, len, name, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramNamedParameter4dvNV(int id, int len, @NativeType("const GLubyte *") MemorySegment name, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glGetProgramNamedParameterfvNV(int id, int len, @NativeType("const GLubyte *") MemorySegment name, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetProgramNamedParameterfvNV).invokeExact(id, len, name, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetProgramNamedParameterfvNV(int id, int len, @NativeType("const GLubyte *") MemorySegment name, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetProgramNamedParameterdvNV(int id, int len, @NativeType("const GLubyte *") MemorySegment name, @NativeType("GLdouble *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetProgramNamedParameterdvNV).invokeExact(id, len, name, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetProgramNamedParameterdvNV(int id, int len, @NativeType("const GLubyte *") MemorySegment name, @NativeType("GLdouble *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFragmentProgram2.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFragmentProgram2.java index 03698561..153621d4 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFragmentProgram2.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFragmentProgram2.java @@ -16,21 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_fragment_program2} */ -public final class GLNVFragmentProgram2 { - public static final int GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV = 0x88F4; - public static final int GL_MAX_PROGRAM_CALL_DEPTH_NV = 0x88F5; - public static final int GL_MAX_PROGRAM_IF_DEPTH_NV = 0x88F6; - public static final int GL_MAX_PROGRAM_LOOP_DEPTH_NV = 0x88F7; - public static final int GL_MAX_PROGRAM_LOOP_COUNT_NV = 0x88F8; +public interface GLNVFragmentProgram2 { + int GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV = 0x88F4; + int GL_MAX_PROGRAM_CALL_DEPTH_NV = 0x88F5; + int GL_MAX_PROGRAM_IF_DEPTH_NV = 0x88F6; + int GL_MAX_PROGRAM_LOOP_DEPTH_NV = 0x88F7; + int GL_MAX_PROGRAM_LOOP_COUNT_NV = 0x88F8; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFramebufferMixedSamples.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFramebufferMixedSamples.java index 1e46b57e..c691429a 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFramebufferMixedSamples.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFramebufferMixedSamples.java @@ -16,52 +16,33 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_framebuffer_mixed_samples} */ -public final class GLNVFramebufferMixedSamples { - public static final int GL_COVERAGE_MODULATION_TABLE_NV = 0x9331; - public static final int GL_COLOR_SAMPLES_NV = 0x8E20; - public static final int GL_DEPTH_SAMPLES_NV = 0x932D; - public static final int GL_STENCIL_SAMPLES_NV = 0x932E; - public static final int GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV = 0x932F; - public static final int GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV = 0x9330; - public static final int GL_COVERAGE_MODULATION_NV = 0x9332; - public static final int GL_COVERAGE_MODULATION_TABLE_SIZE_NV = 0x9333; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_framebuffer_mixed_samples) return; - ext.glCoverageModulationTableNV = load.invoke("glCoverageModulationTableNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glGetCoverageModulationTableNV = load.invoke("glGetCoverageModulationTableNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glCoverageModulationNV = load.invoke("glCoverageModulationNV", ofVoid(JAVA_INT)); - } +public interface GLNVFramebufferMixedSamples { + int GL_COVERAGE_MODULATION_TABLE_NV = 0x9331; + int GL_COLOR_SAMPLES_NV = 0x8E20; + int GL_DEPTH_SAMPLES_NV = 0x932D; + int GL_STENCIL_SAMPLES_NV = 0x932E; + int GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV = 0x932F; + int GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV = 0x9330; + int GL_COVERAGE_MODULATION_NV = 0x9332; + int GL_COVERAGE_MODULATION_TABLE_SIZE_NV = 0x9333; - public static void glCoverageModulationTableNV(int n, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glCoverageModulationTableNV).invokeExact(n, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCoverageModulationTableNV(int n, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glGetCoverageModulationTableNV(int bufSize, @NativeType("GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetCoverageModulationTableNV).invokeExact(bufSize, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetCoverageModulationTableNV(int bufSize, @NativeType("GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glCoverageModulationNV(int components) { - final var ext = getExtCapabilities(); - try { - check(ext.glCoverageModulationNV).invokeExact(components); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCoverageModulationNV(int components) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFramebufferMultisampleCoverage.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFramebufferMultisampleCoverage.java index 592b4c53..521dbb89 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFramebufferMultisampleCoverage.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVFramebufferMultisampleCoverage.java @@ -16,32 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_framebuffer_multisample_coverage} */ -public final class GLNVFramebufferMultisampleCoverage { - public static final int GL_RENDERBUFFER_COVERAGE_SAMPLES_NV = 0x8CAB; - public static final int GL_RENDERBUFFER_COLOR_SAMPLES_NV = 0x8E10; - public static final int GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV = 0x8E11; - public static final int GL_MULTISAMPLE_COVERAGE_MODES_NV = 0x8E12; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_framebuffer_multisample_coverage) return; - ext.glRenderbufferStorageMultisampleCoverageNV = load.invoke("glRenderbufferStorageMultisampleCoverageNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLNVFramebufferMultisampleCoverage { + int GL_RENDERBUFFER_COVERAGE_SAMPLES_NV = 0x8CAB; + int GL_RENDERBUFFER_COLOR_SAMPLES_NV = 0x8E10; + int GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV = 0x8E11; + int GL_MULTISAMPLE_COVERAGE_MODES_NV = 0x8E12; - public static void glRenderbufferStorageMultisampleCoverageNV(int target, int coverageSamples, int colorSamples, int internalformat, int width, int height) { - final var ext = getExtCapabilities(); - try { - check(ext.glRenderbufferStorageMultisampleCoverageNV).invokeExact(target, coverageSamples, colorSamples, internalformat, width, height); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glRenderbufferStorageMultisampleCoverageNV(int target, int coverageSamples, int colorSamples, int internalformat, int width, int height) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVGeometryProgram4.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVGeometryProgram4.java index 98ebb1ec..87533a5e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVGeometryProgram4.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVGeometryProgram4.java @@ -16,47 +16,28 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_geometry_program4} */ -public final class GLNVGeometryProgram4 { - public static final int GL_GEOMETRY_PROGRAM_NV = 0x8C26; - public static final int GL_MAX_PROGRAM_OUTPUT_VERTICES_NV = 0x8C27; - public static final int GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV = 0x8C28; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_geometry_program4) return; - ext.glProgramVertexLimitNV = load.invoke("glProgramVertexLimitNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glFramebufferTextureEXT = load.invoke("glFramebufferTextureEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glFramebufferTextureFaceEXT = load.invoke("glFramebufferTextureFaceEXT", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLNVGeometryProgram4 { + int GL_GEOMETRY_PROGRAM_NV = 0x8C26; + int GL_MAX_PROGRAM_OUTPUT_VERTICES_NV = 0x8C27; + int GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV = 0x8C28; - public static void glProgramVertexLimitNV(int target, int limit) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramVertexLimitNV).invokeExact(target, limit); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramVertexLimitNV(int target, int limit) { + throw new ContextException(); } - public static void glFramebufferTextureEXT(int target, int attachment, int texture, int level) { - final var ext = getExtCapabilities(); - try { - check(ext.glFramebufferTextureEXT).invokeExact(target, attachment, texture, level); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFramebufferTextureEXT(int target, int attachment, int texture, int level) { + throw new ContextException(); } - public static void glFramebufferTextureFaceEXT(int target, int attachment, int texture, int level, int face) { - final var ext = getExtCapabilities(); - try { - check(ext.glFramebufferTextureFaceEXT).invokeExact(target, attachment, texture, level, face); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFramebufferTextureFaceEXT(int target, int attachment, int texture, int level, int face) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVGpuMulticast.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVGpuMulticast.java index 06b65502..5207e1ef 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVGpuMulticast.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVGpuMulticast.java @@ -16,121 +16,66 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_gpu_multicast} */ -public final class GLNVGpuMulticast { - public static final int GL_PER_GPU_STORAGE_BIT_NV = 0x0800; - public static final int GL_MULTICAST_GPUS_NV = 0x92BA; - public static final int GL_RENDER_GPU_MASK_NV = 0x9558; - public static final int GL_PER_GPU_STORAGE_NV = 0x9548; - public static final int GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV = 0x9549; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_gpu_multicast) return; - ext.glRenderGpuMaskNV = load.invoke("glRenderGpuMaskNV", ofVoid(JAVA_INT)); - ext.glMulticastBufferSubDataNV = load.invoke("glMulticastBufferSubDataNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG, ADDRESS)); - ext.glMulticastCopyBufferSubDataNV = load.invoke("glMulticastCopyBufferSubDataNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glMulticastCopyImageSubDataNV = load.invoke("glMulticastCopyImageSubDataNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMulticastBlitFramebufferNV = load.invoke("glMulticastBlitFramebufferNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMulticastFramebufferSampleLocationsfvNV = load.invoke("glMulticastFramebufferSampleLocationsfvNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMulticastBarrierNV = load.invoke("glMulticastBarrierNV", ofVoid()); - ext.glMulticastWaitSyncNV = load.invoke("glMulticastWaitSyncNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glMulticastGetQueryObjectivNV = load.invoke("glMulticastGetQueryObjectivNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMulticastGetQueryObjectuivNV = load.invoke("glMulticastGetQueryObjectuivNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMulticastGetQueryObjecti64vNV = load.invoke("glMulticastGetQueryObjecti64vNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMulticastGetQueryObjectui64vNV = load.invoke("glMulticastGetQueryObjectui64vNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static void glRenderGpuMaskNV(int mask) { - final var ext = getExtCapabilities(); - try { - check(ext.glRenderGpuMaskNV).invokeExact(mask); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLNVGpuMulticast { + int GL_PER_GPU_STORAGE_BIT_NV = 0x0800; + int GL_MULTICAST_GPUS_NV = 0x92BA; + int GL_RENDER_GPU_MASK_NV = 0x9558; + int GL_PER_GPU_STORAGE_NV = 0x9548; + int GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV = 0x9549; + + default void glRenderGpuMaskNV(int mask) { + throw new ContextException(); } - public static void glMulticastBufferSubDataNV(int gpuMask, int buffer, long offset, long size, @NativeType("const void *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glMulticastBufferSubDataNV).invokeExact(gpuMask, buffer, offset, size, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMulticastBufferSubDataNV(int gpuMask, int buffer, long offset, long size, @NativeType("const void *") MemorySegment data) { + throw new ContextException(); } - public static void glMulticastCopyBufferSubDataNV(int readGpu, int writeGpuMask, int readBuffer, int writeBuffer, long readOffset, long writeOffset, long size) { - final var ext = getExtCapabilities(); - try { - check(ext.glMulticastCopyBufferSubDataNV).invokeExact(readGpu, writeGpuMask, readBuffer, writeBuffer, readOffset, writeOffset, size); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMulticastCopyBufferSubDataNV(int readGpu, int writeGpuMask, int readBuffer, int writeBuffer, long readOffset, long writeOffset, long size) { + throw new ContextException(); } - public static void glMulticastCopyImageSubDataNV(int srcGpu, int dstGpuMask, int srcName, int srcTarget, int srcLevel, int srcX, int srcY, int srcZ, int dstName, int dstTarget, int dstLevel, int dstX, int dstY, int dstZ, int srcWidth, int srcHeight, int srcDepth) { - final var ext = getExtCapabilities(); - try { - check(ext.glMulticastCopyImageSubDataNV).invokeExact(srcGpu, dstGpuMask, srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMulticastCopyImageSubDataNV(int srcGpu, int dstGpuMask, int srcName, int srcTarget, int srcLevel, int srcX, int srcY, int srcZ, int dstName, int dstTarget, int dstLevel, int dstX, int dstY, int dstZ, int srcWidth, int srcHeight, int srcDepth) { + throw new ContextException(); } - public static void glMulticastBlitFramebufferNV(int srcGpu, int dstGpu, int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, int mask, int filter) { - final var ext = getExtCapabilities(); - try { - check(ext.glMulticastBlitFramebufferNV).invokeExact(srcGpu, dstGpu, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMulticastBlitFramebufferNV(int srcGpu, int dstGpu, int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, int mask, int filter) { + throw new ContextException(); } - public static void glMulticastFramebufferSampleLocationsfvNV(int gpu, int framebuffer, int start, int count, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMulticastFramebufferSampleLocationsfvNV).invokeExact(gpu, framebuffer, start, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMulticastFramebufferSampleLocationsfvNV(int gpu, int framebuffer, int start, int count, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glMulticastBarrierNV() { - final var ext = getExtCapabilities(); - try { - check(ext.glMulticastBarrierNV).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMulticastBarrierNV() { + throw new ContextException(); } - public static void glMulticastWaitSyncNV(int signalGpu, int waitGpuMask) { - final var ext = getExtCapabilities(); - try { - check(ext.glMulticastWaitSyncNV).invokeExact(signalGpu, waitGpuMask); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMulticastWaitSyncNV(int signalGpu, int waitGpuMask) { + throw new ContextException(); } - public static void glMulticastGetQueryObjectivNV(int gpu, int id, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glMulticastGetQueryObjectivNV).invokeExact(gpu, id, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMulticastGetQueryObjectivNV(int gpu, int id, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glMulticastGetQueryObjectuivNV(int gpu, int id, int pname, @NativeType("GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glMulticastGetQueryObjectuivNV).invokeExact(gpu, id, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMulticastGetQueryObjectuivNV(int gpu, int id, int pname, @NativeType("GLuint *") MemorySegment params) { + throw new ContextException(); } - public static void glMulticastGetQueryObjecti64vNV(int gpu, int id, int pname, @NativeType("GLint64 *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glMulticastGetQueryObjecti64vNV).invokeExact(gpu, id, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMulticastGetQueryObjecti64vNV(int gpu, int id, int pname, @NativeType("GLint64 *") MemorySegment params) { + throw new ContextException(); } - public static void glMulticastGetQueryObjectui64vNV(int gpu, int id, int pname, @NativeType("GLuint64 *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glMulticastGetQueryObjectui64vNV).invokeExact(gpu, id, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMulticastGetQueryObjectui64vNV(int gpu, int id, int pname, @NativeType("GLuint64 *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVGpuProgram4.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVGpuProgram4.java index e3ab9f11..e41ba92b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVGpuProgram4.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVGpuProgram4.java @@ -16,156 +16,85 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_gpu_program4} */ -public final class GLNVGpuProgram4 { - public static final int GL_MIN_PROGRAM_TEXEL_OFFSET_NV = 0x8904; - public static final int GL_MAX_PROGRAM_TEXEL_OFFSET_NV = 0x8905; - public static final int GL_PROGRAM_ATTRIB_COMPONENTS_NV = 0x8906; - public static final int GL_PROGRAM_RESULT_COMPONENTS_NV = 0x8907; - public static final int GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV = 0x8908; - public static final int GL_MAX_PROGRAM_RESULT_COMPONENTS_NV = 0x8909; - public static final int GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV = 0x8DA5; - public static final int GL_MAX_PROGRAM_GENERIC_RESULTS_NV = 0x8DA6; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_gpu_program4) return; - ext.glProgramLocalParameterI4iNV = load.invoke("glProgramLocalParameterI4iNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glProgramLocalParameterI4ivNV = load.invoke("glProgramLocalParameterI4ivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramLocalParametersI4ivNV = load.invoke("glProgramLocalParametersI4ivNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramLocalParameterI4uiNV = load.invoke("glProgramLocalParameterI4uiNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glProgramLocalParameterI4uivNV = load.invoke("glProgramLocalParameterI4uivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramLocalParametersI4uivNV = load.invoke("glProgramLocalParametersI4uivNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramEnvParameterI4iNV = load.invoke("glProgramEnvParameterI4iNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glProgramEnvParameterI4ivNV = load.invoke("glProgramEnvParameterI4ivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramEnvParametersI4ivNV = load.invoke("glProgramEnvParametersI4ivNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramEnvParameterI4uiNV = load.invoke("glProgramEnvParameterI4uiNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glProgramEnvParameterI4uivNV = load.invoke("glProgramEnvParameterI4uivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramEnvParametersI4uivNV = load.invoke("glProgramEnvParametersI4uivNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetProgramLocalParameterIivNV = load.invoke("glGetProgramLocalParameterIivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetProgramLocalParameterIuivNV = load.invoke("glGetProgramLocalParameterIuivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetProgramEnvParameterIivNV = load.invoke("glGetProgramEnvParameterIivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetProgramEnvParameterIuivNV = load.invoke("glGetProgramEnvParameterIuivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static void glProgramLocalParameterI4iNV(int target, int index, int x, int y, int z, int w) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramLocalParameterI4iNV).invokeExact(target, index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glProgramLocalParameterI4ivNV(int target, int index, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramLocalParameterI4ivNV).invokeExact(target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glProgramLocalParametersI4ivNV(int target, int index, int count, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramLocalParametersI4ivNV).invokeExact(target, index, count, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glProgramLocalParameterI4uiNV(int target, int index, int x, int y, int z, int w) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramLocalParameterI4uiNV).invokeExact(target, index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glProgramLocalParameterI4uivNV(int target, int index, @NativeType("const GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramLocalParameterI4uivNV).invokeExact(target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glProgramLocalParametersI4uivNV(int target, int index, int count, @NativeType("const GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramLocalParametersI4uivNV).invokeExact(target, index, count, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glProgramEnvParameterI4iNV(int target, int index, int x, int y, int z, int w) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramEnvParameterI4iNV).invokeExact(target, index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glProgramEnvParameterI4ivNV(int target, int index, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramEnvParameterI4ivNV).invokeExact(target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glProgramEnvParametersI4ivNV(int target, int index, int count, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramEnvParametersI4ivNV).invokeExact(target, index, count, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glProgramEnvParameterI4uiNV(int target, int index, int x, int y, int z, int w) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramEnvParameterI4uiNV).invokeExact(target, index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glProgramEnvParameterI4uivNV(int target, int index, @NativeType("const GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramEnvParameterI4uivNV).invokeExact(target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glProgramEnvParametersI4uivNV(int target, int index, int count, @NativeType("const GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramEnvParametersI4uivNV).invokeExact(target, index, count, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLNVGpuProgram4 { + int GL_MIN_PROGRAM_TEXEL_OFFSET_NV = 0x8904; + int GL_MAX_PROGRAM_TEXEL_OFFSET_NV = 0x8905; + int GL_PROGRAM_ATTRIB_COMPONENTS_NV = 0x8906; + int GL_PROGRAM_RESULT_COMPONENTS_NV = 0x8907; + int GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV = 0x8908; + int GL_MAX_PROGRAM_RESULT_COMPONENTS_NV = 0x8909; + int GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV = 0x8DA5; + int GL_MAX_PROGRAM_GENERIC_RESULTS_NV = 0x8DA6; + + default void glProgramLocalParameterI4iNV(int target, int index, int x, int y, int z, int w) { + throw new ContextException(); + } + + default void glProgramLocalParameterI4ivNV(int target, int index, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); + } + + default void glProgramLocalParametersI4ivNV(int target, int index, int count, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); + } + + default void glProgramLocalParameterI4uiNV(int target, int index, int x, int y, int z, int w) { + throw new ContextException(); + } + + default void glProgramLocalParameterI4uivNV(int target, int index, @NativeType("const GLuint *") MemorySegment params) { + throw new ContextException(); + } + + default void glProgramLocalParametersI4uivNV(int target, int index, int count, @NativeType("const GLuint *") MemorySegment params) { + throw new ContextException(); + } + + default void glProgramEnvParameterI4iNV(int target, int index, int x, int y, int z, int w) { + throw new ContextException(); + } + + default void glProgramEnvParameterI4ivNV(int target, int index, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); + } + + default void glProgramEnvParametersI4ivNV(int target, int index, int count, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); + } + + default void glProgramEnvParameterI4uiNV(int target, int index, int x, int y, int z, int w) { + throw new ContextException(); + } + + default void glProgramEnvParameterI4uivNV(int target, int index, @NativeType("const GLuint *") MemorySegment params) { + throw new ContextException(); + } + + default void glProgramEnvParametersI4uivNV(int target, int index, int count, @NativeType("const GLuint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetProgramLocalParameterIivNV(int target, int index, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetProgramLocalParameterIivNV).invokeExact(target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetProgramLocalParameterIivNV(int target, int index, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetProgramLocalParameterIuivNV(int target, int index, @NativeType("GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetProgramLocalParameterIuivNV).invokeExact(target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetProgramLocalParameterIuivNV(int target, int index, @NativeType("GLuint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetProgramEnvParameterIivNV(int target, int index, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetProgramEnvParameterIivNV).invokeExact(target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetProgramEnvParameterIivNV(int target, int index, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetProgramEnvParameterIuivNV(int target, int index, @NativeType("GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetProgramEnvParameterIuivNV).invokeExact(target, index, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetProgramEnvParameterIuivNV(int target, int index, @NativeType("GLuint *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVGpuProgram5.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVGpuProgram5.java index f2970f53..07a289c5 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVGpuProgram5.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVGpuProgram5.java @@ -16,44 +16,29 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_gpu_program5} */ -public final class GLNVGpuProgram5 { - public static final int GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV = 0x8E5A; - public static final int GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV = 0x8E5B; - public static final int GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV = 0x8E5C; - public static final int GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV = 0x8E5D; - public static final int GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV = 0x8E5E; - public static final int GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV = 0x8E5F; - public static final int GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV = 0x8F44; - public static final int GL_MAX_PROGRAM_SUBROUTINE_NUM_NV = 0x8F45; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_gpu_program5) return; - ext.glProgramSubroutineParametersuivNV = load.invoke("glProgramSubroutineParametersuivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetProgramSubroutineParameteruivNV = load.invoke("glGetProgramSubroutineParameteruivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLNVGpuProgram5 { + int GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV = 0x8E5A; + int GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV = 0x8E5B; + int GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV = 0x8E5C; + int GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV = 0x8E5D; + int GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV = 0x8E5E; + int GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV = 0x8E5F; + int GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV = 0x8F44; + int GL_MAX_PROGRAM_SUBROUTINE_NUM_NV = 0x8F45; - public static void glProgramSubroutineParametersuivNV(int target, int count, @NativeType("const GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramSubroutineParametersuivNV).invokeExact(target, count, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramSubroutineParametersuivNV(int target, int count, @NativeType("const GLuint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetProgramSubroutineParameteruivNV(int target, int index, @NativeType("GLuint *") MemorySegment param) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetProgramSubroutineParameteruivNV).invokeExact(target, index, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetProgramSubroutineParameteruivNV(int target, int index, @NativeType("GLuint *") MemorySegment param) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVHalfFloat.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVHalfFloat.java index 764f6b63..0fc4214a 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVHalfFloat.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVHalfFloat.java @@ -16,389 +16,198 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_half_float} */ -public final class GLNVHalfFloat { - public static final int GL_HALF_FLOAT_NV = 0x140B; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_half_float) return; - ext.glVertex2hNV = load.invoke("glVertex2hNV", ofVoid(JAVA_SHORT, JAVA_SHORT)); - ext.glVertex2hvNV = load.invoke("glVertex2hvNV", ofVoid(ADDRESS)); - ext.glVertex3hNV = load.invoke("glVertex3hNV", ofVoid(JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glVertex3hvNV = load.invoke("glVertex3hvNV", ofVoid(ADDRESS)); - ext.glVertex4hNV = load.invoke("glVertex4hNV", ofVoid(JAVA_SHORT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glVertex4hvNV = load.invoke("glVertex4hvNV", ofVoid(ADDRESS)); - ext.glNormal3hNV = load.invoke("glNormal3hNV", ofVoid(JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glNormal3hvNV = load.invoke("glNormal3hvNV", ofVoid(ADDRESS)); - ext.glColor3hNV = load.invoke("glColor3hNV", ofVoid(JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glColor3hvNV = load.invoke("glColor3hvNV", ofVoid(ADDRESS)); - ext.glColor4hNV = load.invoke("glColor4hNV", ofVoid(JAVA_SHORT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glColor4hvNV = load.invoke("glColor4hvNV", ofVoid(ADDRESS)); - ext.glTexCoord1hNV = load.invoke("glTexCoord1hNV", ofVoid(JAVA_SHORT)); - ext.glTexCoord1hvNV = load.invoke("glTexCoord1hvNV", ofVoid(ADDRESS)); - ext.glTexCoord2hNV = load.invoke("glTexCoord2hNV", ofVoid(JAVA_SHORT, JAVA_SHORT)); - ext.glTexCoord2hvNV = load.invoke("glTexCoord2hvNV", ofVoid(ADDRESS)); - ext.glTexCoord3hNV = load.invoke("glTexCoord3hNV", ofVoid(JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glTexCoord3hvNV = load.invoke("glTexCoord3hvNV", ofVoid(ADDRESS)); - ext.glTexCoord4hNV = load.invoke("glTexCoord4hNV", ofVoid(JAVA_SHORT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glTexCoord4hvNV = load.invoke("glTexCoord4hvNV", ofVoid(ADDRESS)); - ext.glMultiTexCoord1hNV = load.invoke("glMultiTexCoord1hNV", ofVoid(JAVA_INT, JAVA_SHORT)); - ext.glMultiTexCoord1hvNV = load.invoke("glMultiTexCoord1hvNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord2hNV = load.invoke("glMultiTexCoord2hNV", ofVoid(JAVA_INT, JAVA_SHORT, JAVA_SHORT)); - ext.glMultiTexCoord2hvNV = load.invoke("glMultiTexCoord2hvNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord3hNV = load.invoke("glMultiTexCoord3hNV", ofVoid(JAVA_INT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glMultiTexCoord3hvNV = load.invoke("glMultiTexCoord3hvNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord4hNV = load.invoke("glMultiTexCoord4hNV", ofVoid(JAVA_INT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glMultiTexCoord4hvNV = load.invoke("glMultiTexCoord4hvNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib1hNV = load.invoke("glVertexAttrib1hNV", ofVoid(JAVA_INT, JAVA_SHORT)); - ext.glVertexAttrib1hvNV = load.invoke("glVertexAttrib1hvNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib2hNV = load.invoke("glVertexAttrib2hNV", ofVoid(JAVA_INT, JAVA_SHORT, JAVA_SHORT)); - ext.glVertexAttrib2hvNV = load.invoke("glVertexAttrib2hvNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib3hNV = load.invoke("glVertexAttrib3hNV", ofVoid(JAVA_INT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glVertexAttrib3hvNV = load.invoke("glVertexAttrib3hvNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib4hNV = load.invoke("glVertexAttrib4hNV", ofVoid(JAVA_INT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glVertexAttrib4hvNV = load.invoke("glVertexAttrib4hvNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribs1hvNV = load.invoke("glVertexAttribs1hvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVertexAttribs2hvNV = load.invoke("glVertexAttribs2hvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVertexAttribs3hvNV = load.invoke("glVertexAttribs3hvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVertexAttribs4hvNV = load.invoke("glVertexAttribs4hvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glFogCoordhNV = load.invoke("glFogCoordhNV", ofVoid(JAVA_SHORT)); - ext.glFogCoordhvNV = load.invoke("glFogCoordhvNV", ofVoid(ADDRESS)); - ext.glSecondaryColor3hNV = load.invoke("glSecondaryColor3hNV", ofVoid(JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glSecondaryColor3hvNV = load.invoke("glSecondaryColor3hvNV", ofVoid(ADDRESS)); - ext.glVertexWeighthNV = load.invoke("glVertexWeighthNV", ofVoid(JAVA_SHORT)); - ext.glVertexWeighthvNV = load.invoke("glVertexWeighthvNV", ofVoid(ADDRESS)); - } - - public static void glVertex2hNV(short x, short y) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertex2hNV).invokeExact(x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertex2hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertex2hvNV).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertex3hNV(short x, short y, short z) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertex3hNV).invokeExact(x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertex3hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertex3hvNV).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertex4hNV(short x, short y, short z, short w) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertex4hNV).invokeExact(x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glVertex4hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertex4hvNV).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glNormal3hNV(short nx, short ny, short nz) { - final var ext = getExtCapabilities(); - try { - check(ext.glNormal3hNV).invokeExact(nx, ny, nz); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glNormal3hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glNormal3hvNV).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glColor3hNV(short red, short green, short blue) { - final var ext = getExtCapabilities(); - try { - check(ext.glColor3hNV).invokeExact(red, green, blue); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glColor3hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glColor3hvNV).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLNVHalfFloat { + int GL_HALF_FLOAT_NV = 0x140B; + + default void glVertex2hNV(short x, short y) { + throw new ContextException(); + } + + default void glVertex2hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); + } + + default void glVertex3hNV(short x, short y, short z) { + throw new ContextException(); + } + + default void glVertex3hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); + } + + default void glVertex4hNV(short x, short y, short z, short w) { + throw new ContextException(); + } + + default void glVertex4hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); + } + + default void glNormal3hNV(short nx, short ny, short nz) { + throw new ContextException(); + } + + default void glNormal3hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); + } + + default void glColor3hNV(short red, short green, short blue) { + throw new ContextException(); + } + + default void glColor3hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); } - public static void glColor4hNV(short red, short green, short blue, short alpha) { - final var ext = getExtCapabilities(); - try { - check(ext.glColor4hNV).invokeExact(red, green, blue, alpha); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glColor4hNV(short red, short green, short blue, short alpha) { + throw new ContextException(); } - public static void glColor4hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glColor4hvNV).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glColor4hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); } - public static void glTexCoord1hNV(short s) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord1hNV).invokeExact(s); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord1hNV(short s) { + throw new ContextException(); } - public static void glTexCoord1hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord1hvNV).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord1hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); } - public static void glTexCoord2hNV(short s, short t) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord2hNV).invokeExact(s, t); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord2hNV(short s, short t) { + throw new ContextException(); } - public static void glTexCoord2hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord2hvNV).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord2hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); } - public static void glTexCoord3hNV(short s, short t, short r) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord3hNV).invokeExact(s, t, r); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord3hNV(short s, short t, short r) { + throw new ContextException(); } - public static void glTexCoord3hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord3hvNV).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord3hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); } - public static void glTexCoord4hNV(short s, short t, short r, short q) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord4hNV).invokeExact(s, t, r, q); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord4hNV(short s, short t, short r, short q) { + throw new ContextException(); } - public static void glTexCoord4hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord4hvNV).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord4hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); } - public static void glMultiTexCoord1hNV(int target, short s) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord1hNV).invokeExact(target, s); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord1hNV(int target, short s) { + throw new ContextException(); } - public static void glMultiTexCoord1hvNV(int target, @NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord1hvNV).invokeExact(target, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord1hvNV(int target, @NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); } - public static void glMultiTexCoord2hNV(int target, short s, short t) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord2hNV).invokeExact(target, s, t); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord2hNV(int target, short s, short t) { + throw new ContextException(); } - public static void glMultiTexCoord2hvNV(int target, @NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord2hvNV).invokeExact(target, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord2hvNV(int target, @NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); } - public static void glMultiTexCoord3hNV(int target, short s, short t, short r) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord3hNV).invokeExact(target, s, t, r); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord3hNV(int target, short s, short t, short r) { + throw new ContextException(); } - public static void glMultiTexCoord3hvNV(int target, @NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord3hvNV).invokeExact(target, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord3hvNV(int target, @NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); } - public static void glMultiTexCoord4hNV(int target, short s, short t, short r, short q) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord4hNV).invokeExact(target, s, t, r, q); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord4hNV(int target, short s, short t, short r, short q) { + throw new ContextException(); } - public static void glMultiTexCoord4hvNV(int target, @NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord4hvNV).invokeExact(target, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord4hvNV(int target, @NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib1hNV(int index, short x) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib1hNV).invokeExact(index, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib1hNV(int index, short x) { + throw new ContextException(); } - public static void glVertexAttrib1hvNV(int index, @NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib1hvNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib1hvNV(int index, @NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib2hNV(int index, short x, short y) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib2hNV).invokeExact(index, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib2hNV(int index, short x, short y) { + throw new ContextException(); } - public static void glVertexAttrib2hvNV(int index, @NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib2hvNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib2hvNV(int index, @NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib3hNV(int index, short x, short y, short z) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib3hNV).invokeExact(index, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib3hNV(int index, short x, short y, short z) { + throw new ContextException(); } - public static void glVertexAttrib3hvNV(int index, @NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib3hvNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib3hvNV(int index, @NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib4hNV(int index, short x, short y, short z, short w) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4hNV).invokeExact(index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4hNV(int index, short x, short y, short z, short w) { + throw new ContextException(); } - public static void glVertexAttrib4hvNV(int index, @NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4hvNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4hvNV(int index, @NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribs1hvNV(int index, int n, @NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribs1hvNV).invokeExact(index, n, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribs1hvNV(int index, int n, @NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribs2hvNV(int index, int n, @NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribs2hvNV).invokeExact(index, n, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribs2hvNV(int index, int n, @NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribs3hvNV(int index, int n, @NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribs3hvNV).invokeExact(index, n, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribs3hvNV(int index, int n, @NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribs4hvNV(int index, int n, @NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribs4hvNV).invokeExact(index, n, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribs4hvNV(int index, int n, @NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); } - public static void glFogCoordhNV(short fog) { - final var ext = getExtCapabilities(); - try { - check(ext.glFogCoordhNV).invokeExact(fog); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFogCoordhNV(short fog) { + throw new ContextException(); } - public static void glFogCoordhvNV(@NativeType("const GLhalfNV *") MemorySegment fog) { - final var ext = getExtCapabilities(); - try { - check(ext.glFogCoordhvNV).invokeExact(fog); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFogCoordhvNV(@NativeType("const GLhalfNV *") MemorySegment fog) { + throw new ContextException(); } - public static void glSecondaryColor3hNV(short red, short green, short blue) { - final var ext = getExtCapabilities(); - try { - check(ext.glSecondaryColor3hNV).invokeExact(red, green, blue); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSecondaryColor3hNV(short red, short green, short blue) { + throw new ContextException(); } - public static void glSecondaryColor3hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glSecondaryColor3hvNV).invokeExact(v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSecondaryColor3hvNV(@NativeType("const GLhalfNV *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexWeighthNV(short weight) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexWeighthNV).invokeExact(weight); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexWeighthNV(short weight) { + throw new ContextException(); } - public static void glVertexWeighthvNV(@NativeType("const GLhalfNV *") MemorySegment weight) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexWeighthvNV).invokeExact(weight); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexWeighthvNV(@NativeType("const GLhalfNV *") MemorySegment weight) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVInternalformatSampleQuery.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVInternalformatSampleQuery.java index adf8e174..d3eec91b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVInternalformatSampleQuery.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVInternalformatSampleQuery.java @@ -16,32 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_internalformat_sample_query} */ -public final class GLNVInternalformatSampleQuery { - public static final int GL_MULTISAMPLES_NV = 0x9371; - public static final int GL_SUPERSAMPLE_SCALE_X_NV = 0x9372; - public static final int GL_SUPERSAMPLE_SCALE_Y_NV = 0x9373; - public static final int GL_CONFORMANT_NV = 0x9374; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_internalformat_sample_query) return; - ext.glGetInternalformatSampleivNV = load.invoke("glGetInternalformatSampleivNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLNVInternalformatSampleQuery { + int GL_MULTISAMPLES_NV = 0x9371; + int GL_SUPERSAMPLE_SCALE_X_NV = 0x9372; + int GL_SUPERSAMPLE_SCALE_Y_NV = 0x9373; + int GL_CONFORMANT_NV = 0x9374; - public static void glGetInternalformatSampleivNV(int target, int internalformat, int samples, int pname, int count, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetInternalformatSampleivNV).invokeExact(target, internalformat, samples, pname, count, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetInternalformatSampleivNV(int target, int internalformat, int samples, int pname, int count, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVLightMaxExponent.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVLightMaxExponent.java index 49a204f1..d8ebce07 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVLightMaxExponent.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVLightMaxExponent.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_light_max_exponent} */ -public final class GLNVLightMaxExponent { - public static final int GL_MAX_SHININESS_NV = 0x8504; - public static final int GL_MAX_SPOT_EXPONENT_NV = 0x8505; +public interface GLNVLightMaxExponent { + int GL_MAX_SHININESS_NV = 0x8504; + int GL_MAX_SPOT_EXPONENT_NV = 0x8505; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVMemoryAttachment.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVMemoryAttachment.java index 871f7d4e..9c3c11f1 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVMemoryAttachment.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVMemoryAttachment.java @@ -16,78 +16,47 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_memory_attachment} */ -public final class GLNVMemoryAttachment { - public static final int GL_ATTACHED_MEMORY_OBJECT_NV = 0x95A4; - public static final int GL_ATTACHED_MEMORY_OFFSET_NV = 0x95A5; - public static final int GL_MEMORY_ATTACHABLE_ALIGNMENT_NV = 0x95A6; - public static final int GL_MEMORY_ATTACHABLE_SIZE_NV = 0x95A7; - public static final int GL_MEMORY_ATTACHABLE_NV = 0x95A8; - public static final int GL_DETACHED_MEMORY_INCARNATION_NV = 0x95A9; - public static final int GL_DETACHED_TEXTURES_NV = 0x95AA; - public static final int GL_DETACHED_BUFFERS_NV = 0x95AB; - public static final int GL_MAX_DETACHED_TEXTURES_NV = 0x95AC; - public static final int GL_MAX_DETACHED_BUFFERS_NV = 0x95AD; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_memory_attachment) return; - ext.glGetMemoryObjectDetachedResourcesuivNV = load.invoke("glGetMemoryObjectDetachedResourcesuivNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glResetMemoryObjectParameterNV = load.invoke("glResetMemoryObjectParameterNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glTexAttachMemoryNV = load.invoke("glTexAttachMemoryNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glBufferAttachMemoryNV = load.invoke("glBufferAttachMemoryNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glTextureAttachMemoryNV = load.invoke("glTextureAttachMemoryNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glNamedBufferAttachMemoryNV = load.invoke("glNamedBufferAttachMemoryNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG)); - } - - public static void glGetMemoryObjectDetachedResourcesuivNV(int memory, int pname, int first, int count, @NativeType("GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMemoryObjectDetachedResourcesuivNV).invokeExact(memory, pname, first, count, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLNVMemoryAttachment { + int GL_ATTACHED_MEMORY_OBJECT_NV = 0x95A4; + int GL_ATTACHED_MEMORY_OFFSET_NV = 0x95A5; + int GL_MEMORY_ATTACHABLE_ALIGNMENT_NV = 0x95A6; + int GL_MEMORY_ATTACHABLE_SIZE_NV = 0x95A7; + int GL_MEMORY_ATTACHABLE_NV = 0x95A8; + int GL_DETACHED_MEMORY_INCARNATION_NV = 0x95A9; + int GL_DETACHED_TEXTURES_NV = 0x95AA; + int GL_DETACHED_BUFFERS_NV = 0x95AB; + int GL_MAX_DETACHED_TEXTURES_NV = 0x95AC; + int GL_MAX_DETACHED_BUFFERS_NV = 0x95AD; + + default void glGetMemoryObjectDetachedResourcesuivNV(int memory, int pname, int first, int count, @NativeType("GLuint *") MemorySegment params) { + throw new ContextException(); } - public static void glResetMemoryObjectParameterNV(int memory, int pname) { - final var ext = getExtCapabilities(); - try { - check(ext.glResetMemoryObjectParameterNV).invokeExact(memory, pname); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glResetMemoryObjectParameterNV(int memory, int pname) { + throw new ContextException(); } - public static void glTexAttachMemoryNV(int target, int memory, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexAttachMemoryNV).invokeExact(target, memory, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexAttachMemoryNV(int target, int memory, long offset) { + throw new ContextException(); } - public static void glBufferAttachMemoryNV(int target, int memory, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glBufferAttachMemoryNV).invokeExact(target, memory, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBufferAttachMemoryNV(int target, int memory, long offset) { + throw new ContextException(); } - public static void glTextureAttachMemoryNV(int texture, int memory, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureAttachMemoryNV).invokeExact(texture, memory, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureAttachMemoryNV(int texture, int memory, long offset) { + throw new ContextException(); } - public static void glNamedBufferAttachMemoryNV(int buffer, int memory, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedBufferAttachMemoryNV).invokeExact(buffer, memory, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedBufferAttachMemoryNV(int buffer, int memory, long offset) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVMemoryObjectSparse.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVMemoryObjectSparse.java index 1a8a608f..07f3e9b1 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVMemoryObjectSparse.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVMemoryObjectSparse.java @@ -16,52 +16,29 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_memory_object_sparse} */ -public final class GLNVMemoryObjectSparse { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_memory_object_sparse) return; - ext.glBufferPageCommitmentMemNV = load.invoke("glBufferPageCommitmentMemNV", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_INT, JAVA_LONG, JAVA_BYTE)); - ext.glTexPageCommitmentMemNV = load.invoke("glTexPageCommitmentMemNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_BYTE)); - ext.glNamedBufferPageCommitmentMemNV = load.invoke("glNamedBufferPageCommitmentMemNV", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_INT, JAVA_LONG, JAVA_BYTE)); - ext.glTexturePageCommitmentMemNV = load.invoke("glTexturePageCommitmentMemNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_BYTE)); - } +public interface GLNVMemoryObjectSparse { - public static void glBufferPageCommitmentMemNV(int target, long offset, long size, int memory, long memOffset, boolean commit) { - final var ext = getExtCapabilities(); - try { - check(ext.glBufferPageCommitmentMemNV).invokeExact(target, offset, size, memory, memOffset, commit); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBufferPageCommitmentMemNV(int target, long offset, long size, int memory, long memOffset, boolean commit) { + throw new ContextException(); } - public static void glTexPageCommitmentMemNV(int target, int layer, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int memory, long offset, boolean commit) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexPageCommitmentMemNV).invokeExact(target, layer, level, xoffset, yoffset, zoffset, width, height, depth, memory, offset, commit); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexPageCommitmentMemNV(int target, int layer, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int memory, long offset, boolean commit) { + throw new ContextException(); } - public static void glNamedBufferPageCommitmentMemNV(int buffer, long offset, long size, int memory, long memOffset, boolean commit) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedBufferPageCommitmentMemNV).invokeExact(buffer, offset, size, memory, memOffset, commit); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedBufferPageCommitmentMemNV(int buffer, long offset, long size, int memory, long memOffset, boolean commit) { + throw new ContextException(); } - public static void glTexturePageCommitmentMemNV(int texture, int layer, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int memory, long offset, boolean commit) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexturePageCommitmentMemNV).invokeExact(texture, layer, level, xoffset, yoffset, zoffset, width, height, depth, memory, offset, commit); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexturePageCommitmentMemNV(int texture, int layer, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int memory, long offset, boolean commit) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVMeshShader.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVMeshShader.java index 96e0c9cd..e806ab9c 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVMeshShader.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVMeshShader.java @@ -16,100 +16,77 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_mesh_shader} */ -public final class GLNVMeshShader { - public static final int GL_MESH_SHADER_NV = 0x9559; - public static final int GL_TASK_SHADER_NV = 0x955A; - public static final int GL_MAX_MESH_UNIFORM_BLOCKS_NV = 0x8E60; - public static final int GL_MAX_MESH_TEXTURE_IMAGE_UNITS_NV = 0x8E61; - public static final int GL_MAX_MESH_IMAGE_UNIFORMS_NV = 0x8E62; - public static final int GL_MAX_MESH_UNIFORM_COMPONENTS_NV = 0x8E63; - public static final int GL_MAX_MESH_ATOMIC_COUNTER_BUFFERS_NV = 0x8E64; - public static final int GL_MAX_MESH_ATOMIC_COUNTERS_NV = 0x8E65; - public static final int GL_MAX_MESH_SHADER_STORAGE_BLOCKS_NV = 0x8E66; - public static final int GL_MAX_COMBINED_MESH_UNIFORM_COMPONENTS_NV = 0x8E67; - public static final int GL_MAX_TASK_UNIFORM_BLOCKS_NV = 0x8E68; - public static final int GL_MAX_TASK_TEXTURE_IMAGE_UNITS_NV = 0x8E69; - public static final int GL_MAX_TASK_IMAGE_UNIFORMS_NV = 0x8E6A; - public static final int GL_MAX_TASK_UNIFORM_COMPONENTS_NV = 0x8E6B; - public static final int GL_MAX_TASK_ATOMIC_COUNTER_BUFFERS_NV = 0x8E6C; - public static final int GL_MAX_TASK_ATOMIC_COUNTERS_NV = 0x8E6D; - public static final int GL_MAX_TASK_SHADER_STORAGE_BLOCKS_NV = 0x8E6E; - public static final int GL_MAX_COMBINED_TASK_UNIFORM_COMPONENTS_NV = 0x8E6F; - public static final int GL_MAX_MESH_WORK_GROUP_INVOCATIONS_NV = 0x95A2; - public static final int GL_MAX_TASK_WORK_GROUP_INVOCATIONS_NV = 0x95A3; - public static final int GL_MAX_MESH_TOTAL_MEMORY_SIZE_NV = 0x9536; - public static final int GL_MAX_TASK_TOTAL_MEMORY_SIZE_NV = 0x9537; - public static final int GL_MAX_MESH_OUTPUT_VERTICES_NV = 0x9538; - public static final int GL_MAX_MESH_OUTPUT_PRIMITIVES_NV = 0x9539; - public static final int GL_MAX_TASK_OUTPUT_COUNT_NV = 0x953A; - public static final int GL_MAX_DRAW_MESH_TASKS_COUNT_NV = 0x953D; - public static final int GL_MAX_MESH_VIEWS_NV = 0x9557; - public static final int GL_MESH_OUTPUT_PER_VERTEX_GRANULARITY_NV = 0x92DF; - public static final int GL_MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_NV = 0x9543; - public static final int GL_MAX_MESH_WORK_GROUP_SIZE_NV = 0x953B; - public static final int GL_MAX_TASK_WORK_GROUP_SIZE_NV = 0x953C; - public static final int GL_MESH_WORK_GROUP_SIZE_NV = 0x953E; - public static final int GL_TASK_WORK_GROUP_SIZE_NV = 0x953F; - public static final int GL_MESH_VERTICES_OUT_NV = 0x9579; - public static final int GL_MESH_PRIMITIVES_OUT_NV = 0x957A; - public static final int GL_MESH_OUTPUT_TYPE_NV = 0x957B; - public static final int GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV = 0x959C; - public static final int GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV = 0x959D; - public static final int GL_REFERENCED_BY_MESH_SHADER_NV = 0x95A0; - public static final int GL_REFERENCED_BY_TASK_SHADER_NV = 0x95A1; - public static final int GL_MESH_SHADER_BIT_NV = 0x00000040; - public static final int GL_TASK_SHADER_BIT_NV = 0x00000080; - public static final int GL_MESH_SUBROUTINE_NV = 0x957C; - public static final int GL_TASK_SUBROUTINE_NV = 0x957D; - public static final int GL_MESH_SUBROUTINE_UNIFORM_NV = 0x957E; - public static final int GL_TASK_SUBROUTINE_UNIFORM_NV = 0x957F; - public static final int GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV = 0x959E; - public static final int GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV = 0x959F; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_mesh_shader) return; - ext.glDrawMeshTasksNV = load.invoke("glDrawMeshTasksNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glDrawMeshTasksIndirectNV = load.invoke("glDrawMeshTasksIndirectNV", ofVoid(JAVA_LONG)); - ext.glMultiDrawMeshTasksIndirectNV = load.invoke("glMultiDrawMeshTasksIndirectNV", ofVoid(JAVA_LONG, JAVA_INT, JAVA_INT)); - ext.glMultiDrawMeshTasksIndirectCountNV = load.invoke("glMultiDrawMeshTasksIndirectCountNV", ofVoid(JAVA_LONG, JAVA_LONG, JAVA_INT, JAVA_INT)); - } +public interface GLNVMeshShader { + int GL_MESH_SHADER_NV = 0x9559; + int GL_TASK_SHADER_NV = 0x955A; + int GL_MAX_MESH_UNIFORM_BLOCKS_NV = 0x8E60; + int GL_MAX_MESH_TEXTURE_IMAGE_UNITS_NV = 0x8E61; + int GL_MAX_MESH_IMAGE_UNIFORMS_NV = 0x8E62; + int GL_MAX_MESH_UNIFORM_COMPONENTS_NV = 0x8E63; + int GL_MAX_MESH_ATOMIC_COUNTER_BUFFERS_NV = 0x8E64; + int GL_MAX_MESH_ATOMIC_COUNTERS_NV = 0x8E65; + int GL_MAX_MESH_SHADER_STORAGE_BLOCKS_NV = 0x8E66; + int GL_MAX_COMBINED_MESH_UNIFORM_COMPONENTS_NV = 0x8E67; + int GL_MAX_TASK_UNIFORM_BLOCKS_NV = 0x8E68; + int GL_MAX_TASK_TEXTURE_IMAGE_UNITS_NV = 0x8E69; + int GL_MAX_TASK_IMAGE_UNIFORMS_NV = 0x8E6A; + int GL_MAX_TASK_UNIFORM_COMPONENTS_NV = 0x8E6B; + int GL_MAX_TASK_ATOMIC_COUNTER_BUFFERS_NV = 0x8E6C; + int GL_MAX_TASK_ATOMIC_COUNTERS_NV = 0x8E6D; + int GL_MAX_TASK_SHADER_STORAGE_BLOCKS_NV = 0x8E6E; + int GL_MAX_COMBINED_TASK_UNIFORM_COMPONENTS_NV = 0x8E6F; + int GL_MAX_MESH_WORK_GROUP_INVOCATIONS_NV = 0x95A2; + int GL_MAX_TASK_WORK_GROUP_INVOCATIONS_NV = 0x95A3; + int GL_MAX_MESH_TOTAL_MEMORY_SIZE_NV = 0x9536; + int GL_MAX_TASK_TOTAL_MEMORY_SIZE_NV = 0x9537; + int GL_MAX_MESH_OUTPUT_VERTICES_NV = 0x9538; + int GL_MAX_MESH_OUTPUT_PRIMITIVES_NV = 0x9539; + int GL_MAX_TASK_OUTPUT_COUNT_NV = 0x953A; + int GL_MAX_DRAW_MESH_TASKS_COUNT_NV = 0x953D; + int GL_MAX_MESH_VIEWS_NV = 0x9557; + int GL_MESH_OUTPUT_PER_VERTEX_GRANULARITY_NV = 0x92DF; + int GL_MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_NV = 0x9543; + int GL_MAX_MESH_WORK_GROUP_SIZE_NV = 0x953B; + int GL_MAX_TASK_WORK_GROUP_SIZE_NV = 0x953C; + int GL_MESH_WORK_GROUP_SIZE_NV = 0x953E; + int GL_TASK_WORK_GROUP_SIZE_NV = 0x953F; + int GL_MESH_VERTICES_OUT_NV = 0x9579; + int GL_MESH_PRIMITIVES_OUT_NV = 0x957A; + int GL_MESH_OUTPUT_TYPE_NV = 0x957B; + int GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV = 0x959C; + int GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV = 0x959D; + int GL_REFERENCED_BY_MESH_SHADER_NV = 0x95A0; + int GL_REFERENCED_BY_TASK_SHADER_NV = 0x95A1; + int GL_MESH_SHADER_BIT_NV = 0x00000040; + int GL_TASK_SHADER_BIT_NV = 0x00000080; + int GL_MESH_SUBROUTINE_NV = 0x957C; + int GL_TASK_SUBROUTINE_NV = 0x957D; + int GL_MESH_SUBROUTINE_UNIFORM_NV = 0x957E; + int GL_TASK_SUBROUTINE_UNIFORM_NV = 0x957F; + int GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV = 0x959E; + int GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV = 0x959F; - public static void glDrawMeshTasksNV(int first, int count) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawMeshTasksNV).invokeExact(first, count); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDrawMeshTasksNV(int first, int count) { + throw new ContextException(); } - public static void glDrawMeshTasksIndirectNV(long indirect) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawMeshTasksIndirectNV).invokeExact(indirect); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDrawMeshTasksIndirectNV(long indirect) { + throw new ContextException(); } - public static void glMultiDrawMeshTasksIndirectNV(long indirect, int drawcount, int stride) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiDrawMeshTasksIndirectNV).invokeExact(indirect, drawcount, stride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiDrawMeshTasksIndirectNV(long indirect, int drawcount, int stride) { + throw new ContextException(); } - public static void glMultiDrawMeshTasksIndirectCountNV(long indirect, long drawcount, int maxdrawcount, int stride) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiDrawMeshTasksIndirectCountNV).invokeExact(indirect, drawcount, maxdrawcount, stride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiDrawMeshTasksIndirectCountNV(long indirect, long drawcount, int maxdrawcount, int stride) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVMultisampleFilterHint.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVMultisampleFilterHint.java index 4f495a8d..fc21aca2 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVMultisampleFilterHint.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVMultisampleFilterHint.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_multisample_filter_hint} */ -public final class GLNVMultisampleFilterHint { - public static final int GL_MULTISAMPLE_FILTER_HINT_NV = 0x8534; +public interface GLNVMultisampleFilterHint { + int GL_MULTISAMPLE_FILTER_HINT_NV = 0x8534; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVOcculusionQuery.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVOcculusionQuery.java index f1102e58..e54a4eb1 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVOcculusionQuery.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVOcculusionQuery.java @@ -16,81 +16,45 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_occlusion_query} */ -public final class GLNVOcculusionQuery { - public static final int GL_PIXEL_COUNTER_BITS_NV = 0x8864; - public static final int GL_CURRENT_OCCLUSION_QUERY_ID_NV = 0x8865; - public static final int GL_PIXEL_COUNT_NV = 0x8866; - public static final int GL_PIXEL_COUNT_AVAILABLE_NV = 0x8867; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_occlusion_query) return; - ext.glGenOcclusionQueriesNV = load.invoke("glGenOcclusionQueriesNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glDeleteOcclusionQueriesNV = load.invoke("glDeleteOcclusionQueriesNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glIsOcclusionQueryNV = load.invoke("glIsOcclusionQueryNV", of(JAVA_BYTE, JAVA_INT)); - ext.glBeginOcclusionQueryNV = load.invoke("glBeginOcclusionQueryNV", ofVoid(JAVA_INT)); - ext.glEndOcclusionQueryNV = load.invoke("glEndOcclusionQueryNV", ofVoid()); - ext.glGetOcclusionQueryivNV = load.invoke("glGetOcclusionQueryivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetOcclusionQueryuivNV = load.invoke("glGetOcclusionQueryuivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLNVOcculusionQuery { + int GL_PIXEL_COUNTER_BITS_NV = 0x8864; + int GL_CURRENT_OCCLUSION_QUERY_ID_NV = 0x8865; + int GL_PIXEL_COUNT_NV = 0x8866; + int GL_PIXEL_COUNT_AVAILABLE_NV = 0x8867; - public static void glGenOcclusionQueriesNV(int n, @NativeType("GLuint *") MemorySegment ids) { - final var ext = getExtCapabilities(); - try { - check(ext.glGenOcclusionQueriesNV).invokeExact(n, ids); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGenOcclusionQueriesNV(int n, @NativeType("GLuint *") MemorySegment ids) { + throw new ContextException(); } - public static void glDeleteOcclusionQueriesNV(int n, @NativeType("const GLuint *") MemorySegment ids) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteOcclusionQueriesNV).invokeExact(n, ids); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDeleteOcclusionQueriesNV(int n, @NativeType("const GLuint *") MemorySegment ids) { + throw new ContextException(); } - public static boolean glIsOcclusionQueryNV(int id) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsOcclusionQueryNV).invokeExact(id); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsOcclusionQueryNV(int id) { + throw new ContextException(); } - public static void glBeginOcclusionQueryNV(int id) { - final var ext = getExtCapabilities(); - try { - check(ext.glBeginOcclusionQueryNV).invokeExact(id); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBeginOcclusionQueryNV(int id) { + throw new ContextException(); } - public static void glEndOcclusionQueryNV() { - final var ext = getExtCapabilities(); - try { - check(ext.glEndOcclusionQueryNV).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEndOcclusionQueryNV() { + throw new ContextException(); } - public static void glGetOcclusionQueryivNV(int id, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetOcclusionQueryivNV).invokeExact(id, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetOcclusionQueryivNV(int id, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetOcclusionQueryuivNV(int id, int pname, @NativeType("GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetOcclusionQueryuivNV).invokeExact(id, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetOcclusionQueryuivNV(int id, int pname, @NativeType("GLuint *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPackedDepthStencil.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPackedDepthStencil.java index 2e08f44a..49aafabb 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPackedDepthStencil.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPackedDepthStencil.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_packed_depth_stencil} */ -public final class GLNVPackedDepthStencil { - public static final int GL_DEPTH_STENCIL_NV = 0x84F9; - public static final int GL_UNSIGNED_INT_24_8_NV = 0x84FA; +public interface GLNVPackedDepthStencil { + int GL_DEPTH_STENCIL_NV = 0x84F9; + int GL_UNSIGNED_INT_24_8_NV = 0x84FA; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVParameterBufferObject.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVParameterBufferObject.java index 32dedf19..9bf1ff09 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVParameterBufferObject.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVParameterBufferObject.java @@ -16,49 +16,30 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_parameter_buffer_object} */ -public final class GLNVParameterBufferObject { - public static final int GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV = 0x8DA0; - public static final int GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV = 0x8DA1; - public static final int GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA2; - public static final int GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA3; - public static final int GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA4; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_parameter_buffer_object) return; - ext.glProgramBufferParametersfvNV = load.invoke("glProgramBufferParametersfvNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramBufferParametersIivNV = load.invoke("glProgramBufferParametersIivNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramBufferParametersIuivNV = load.invoke("glProgramBufferParametersIuivNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLNVParameterBufferObject { + int GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV = 0x8DA0; + int GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV = 0x8DA1; + int GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA2; + int GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA3; + int GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA4; - public static void glProgramBufferParametersfvNV(int target, int bindingIndex, int wordIndex, int count, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramBufferParametersfvNV).invokeExact(target, bindingIndex, wordIndex, count, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramBufferParametersfvNV(int target, int bindingIndex, int wordIndex, int count, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glProgramBufferParametersIivNV(int target, int bindingIndex, int wordIndex, int count, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramBufferParametersIivNV).invokeExact(target, bindingIndex, wordIndex, count, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramBufferParametersIivNV(int target, int bindingIndex, int wordIndex, int count, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glProgramBufferParametersIuivNV(int target, int bindingIndex, int wordIndex, int count, @NativeType("const GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramBufferParametersIuivNV).invokeExact(target, bindingIndex, wordIndex, count, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramBufferParametersIuivNV(int target, int bindingIndex, int wordIndex, int count, @NativeType("const GLuint *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPathRendering.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPathRendering.java index 2b6c4437..5044d103 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPathRendering.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPathRendering.java @@ -16,704 +16,432 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_path_rendering} */ -public final class GLNVPathRendering { - public static final int GL_PATH_FORMAT_SVG_NV = 0x9070; - public static final int GL_PATH_FORMAT_PS_NV = 0x9071; - public static final int GL_STANDARD_FONT_NAME_NV = 0x9072; - public static final int GL_SYSTEM_FONT_NAME_NV = 0x9073; - public static final int GL_FILE_NAME_NV = 0x9074; - public static final int GL_PATH_STROKE_WIDTH_NV = 0x9075; - public static final int GL_PATH_END_CAPS_NV = 0x9076; - public static final int GL_PATH_INITIAL_END_CAP_NV = 0x9077; - public static final int GL_PATH_TERMINAL_END_CAP_NV = 0x9078; - public static final int GL_PATH_JOIN_STYLE_NV = 0x9079; - public static final int GL_PATH_MITER_LIMIT_NV = 0x907A; - public static final int GL_PATH_DASH_CAPS_NV = 0x907B; - public static final int GL_PATH_INITIAL_DASH_CAP_NV = 0x907C; - public static final int GL_PATH_TERMINAL_DASH_CAP_NV = 0x907D; - public static final int GL_PATH_DASH_OFFSET_NV = 0x907E; - public static final int GL_PATH_CLIENT_LENGTH_NV = 0x907F; - public static final int GL_PATH_FILL_MODE_NV = 0x9080; - public static final int GL_PATH_FILL_MASK_NV = 0x9081; - public static final int GL_PATH_FILL_COVER_MODE_NV = 0x9082; - public static final int GL_PATH_STROKE_COVER_MODE_NV = 0x9083; - public static final int GL_PATH_STROKE_MASK_NV = 0x9084; - public static final int GL_COUNT_UP_NV = 0x9088; - public static final int GL_COUNT_DOWN_NV = 0x9089; - public static final int GL_PATH_OBJECT_BOUNDING_BOX_NV = 0x908A; - public static final int GL_CONVEX_HULL_NV = 0x908B; - public static final int GL_BOUNDING_BOX_NV = 0x908D; - public static final int GL_TRANSLATE_X_NV = 0x908E; - public static final int GL_TRANSLATE_Y_NV = 0x908F; - public static final int GL_TRANSLATE_2D_NV = 0x9090; - public static final int GL_TRANSLATE_3D_NV = 0x9091; - public static final int GL_AFFINE_2D_NV = 0x9092; - public static final int GL_AFFINE_3D_NV = 0x9094; - public static final int GL_TRANSPOSE_AFFINE_2D_NV = 0x9096; - public static final int GL_TRANSPOSE_AFFINE_3D_NV = 0x9098; - public static final int GL_UTF8_NV = 0x909A; - public static final int GL_UTF16_NV = 0x909B; - public static final int GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV = 0x909C; - public static final int GL_PATH_COMMAND_COUNT_NV = 0x909D; - public static final int GL_PATH_COORD_COUNT_NV = 0x909E; - public static final int GL_PATH_DASH_ARRAY_COUNT_NV = 0x909F; - public static final int GL_PATH_COMPUTED_LENGTH_NV = 0x90A0; - public static final int GL_PATH_FILL_BOUNDING_BOX_NV = 0x90A1; - public static final int GL_PATH_STROKE_BOUNDING_BOX_NV = 0x90A2; - public static final int GL_SQUARE_NV = 0x90A3; - public static final int GL_ROUND_NV = 0x90A4; - public static final int GL_TRIANGULAR_NV = 0x90A5; - public static final int GL_BEVEL_NV = 0x90A6; - public static final int GL_MITER_REVERT_NV = 0x90A7; - public static final int GL_MITER_TRUNCATE_NV = 0x90A8; - public static final int GL_SKIP_MISSING_GLYPH_NV = 0x90A9; - public static final int GL_USE_MISSING_GLYPH_NV = 0x90AA; - public static final int GL_PATH_ERROR_POSITION_NV = 0x90AB; - public static final int GL_ACCUM_ADJACENT_PAIRS_NV = 0x90AD; - public static final int GL_ADJACENT_PAIRS_NV = 0x90AE; - public static final int GL_FIRST_TO_REST_NV = 0x90AF; - public static final int GL_PATH_GEN_MODE_NV = 0x90B0; - public static final int GL_PATH_GEN_COEFF_NV = 0x90B1; - public static final int GL_PATH_GEN_COMPONENTS_NV = 0x90B3; - public static final int GL_PATH_STENCIL_FUNC_NV = 0x90B7; - public static final int GL_PATH_STENCIL_REF_NV = 0x90B8; - public static final int GL_PATH_STENCIL_VALUE_MASK_NV = 0x90B9; - public static final int GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV = 0x90BD; - public static final int GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV = 0x90BE; - public static final int GL_PATH_COVER_DEPTH_FUNC_NV = 0x90BF; - public static final int GL_PATH_DASH_OFFSET_RESET_NV = 0x90B4; - public static final int GL_MOVE_TO_RESETS_NV = 0x90B5; - public static final int GL_MOVE_TO_CONTINUES_NV = 0x90B6; - public static final int GL_CLOSE_PATH_NV = 0x00; - public static final int GL_MOVE_TO_NV = 0x02; - public static final int GL_RELATIVE_MOVE_TO_NV = 0x03; - public static final int GL_LINE_TO_NV = 0x04; - public static final int GL_RELATIVE_LINE_TO_NV = 0x05; - public static final int GL_HORIZONTAL_LINE_TO_NV = 0x06; - public static final int GL_RELATIVE_HORIZONTAL_LINE_TO_NV = 0x07; - public static final int GL_VERTICAL_LINE_TO_NV = 0x08; - public static final int GL_RELATIVE_VERTICAL_LINE_TO_NV = 0x09; - public static final int GL_QUADRATIC_CURVE_TO_NV = 0x0A; - public static final int GL_RELATIVE_QUADRATIC_CURVE_TO_NV = 0x0B; - public static final int GL_CUBIC_CURVE_TO_NV = 0x0C; - public static final int GL_RELATIVE_CUBIC_CURVE_TO_NV = 0x0D; - public static final int GL_SMOOTH_QUADRATIC_CURVE_TO_NV = 0x0E; - public static final int GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV = 0x0F; - public static final int GL_SMOOTH_CUBIC_CURVE_TO_NV = 0x10; - public static final int GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV = 0x11; - public static final int GL_SMALL_CCW_ARC_TO_NV = 0x12; - public static final int GL_RELATIVE_SMALL_CCW_ARC_TO_NV = 0x13; - public static final int GL_SMALL_CW_ARC_TO_NV = 0x14; - public static final int GL_RELATIVE_SMALL_CW_ARC_TO_NV = 0x15; - public static final int GL_LARGE_CCW_ARC_TO_NV = 0x16; - public static final int GL_RELATIVE_LARGE_CCW_ARC_TO_NV = 0x17; - public static final int GL_LARGE_CW_ARC_TO_NV = 0x18; - public static final int GL_RELATIVE_LARGE_CW_ARC_TO_NV = 0x19; - public static final int GL_RESTART_PATH_NV = 0xF0; - public static final int GL_DUP_FIRST_CUBIC_CURVE_TO_NV = 0xF2; - public static final int GL_DUP_LAST_CUBIC_CURVE_TO_NV = 0xF4; - public static final int GL_RECT_NV = 0xF6; - public static final int GL_CIRCULAR_CCW_ARC_TO_NV = 0xF8; - public static final int GL_CIRCULAR_CW_ARC_TO_NV = 0xFA; - public static final int GL_CIRCULAR_TANGENT_ARC_TO_NV = 0xFC; - public static final int GL_ARC_TO_NV = 0xFE; - public static final int GL_RELATIVE_ARC_TO_NV = 0xFF; - public static final int GL_BOLD_BIT_NV = 0x01; - public static final int GL_ITALIC_BIT_NV = 0x02; - public static final int GL_GLYPH_WIDTH_BIT_NV = 0x01; - public static final int GL_GLYPH_HEIGHT_BIT_NV = 0x02; - public static final int GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV = 0x04; - public static final int GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV = 0x08; - public static final int GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV = 0x10; - public static final int GL_GLYPH_VERTICAL_BEARING_X_BIT_NV = 0x20; - public static final int GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV = 0x40; - public static final int GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV = 0x80; - public static final int GL_GLYPH_HAS_KERNING_BIT_NV = 0x100; - public static final int GL_FONT_X_MIN_BOUNDS_BIT_NV = 0x00010000; - public static final int GL_FONT_Y_MIN_BOUNDS_BIT_NV = 0x00020000; - public static final int GL_FONT_X_MAX_BOUNDS_BIT_NV = 0x00040000; - public static final int GL_FONT_Y_MAX_BOUNDS_BIT_NV = 0x00080000; - public static final int GL_FONT_UNITS_PER_EM_BIT_NV = 0x00100000; - public static final int GL_FONT_ASCENDER_BIT_NV = 0x00200000; - public static final int GL_FONT_DESCENDER_BIT_NV = 0x00400000; - public static final int GL_FONT_HEIGHT_BIT_NV = 0x00800000; - public static final int GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV = 0x01000000; - public static final int GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV = 0x02000000; - public static final int GL_FONT_UNDERLINE_POSITION_BIT_NV = 0x04000000; - public static final int GL_FONT_UNDERLINE_THICKNESS_BIT_NV = 0x08000000; - public static final int GL_FONT_HAS_KERNING_BIT_NV = 0x10000000; - public static final int GL_ROUNDED_RECT_NV = 0xE8; - public static final int GL_RELATIVE_ROUNDED_RECT_NV = 0xE9; - public static final int GL_ROUNDED_RECT2_NV = 0xEA; - public static final int GL_RELATIVE_ROUNDED_RECT2_NV = 0xEB; - public static final int GL_ROUNDED_RECT4_NV = 0xEC; - public static final int GL_RELATIVE_ROUNDED_RECT4_NV = 0xED; - public static final int GL_ROUNDED_RECT8_NV = 0xEE; - public static final int GL_RELATIVE_ROUNDED_RECT8_NV = 0xEF; - public static final int GL_RELATIVE_RECT_NV = 0xF7; - public static final int GL_FONT_GLYPHS_AVAILABLE_NV = 0x9368; - public static final int GL_FONT_TARGET_UNAVAILABLE_NV = 0x9369; - public static final int GL_FONT_UNAVAILABLE_NV = 0x936A; - public static final int GL_FONT_UNINTELLIGIBLE_NV = 0x936B; - public static final int GL_CONIC_CURVE_TO_NV = 0x1A; - public static final int GL_RELATIVE_CONIC_CURVE_TO_NV = 0x1B; - public static final int GL_FONT_NUM_GLYPH_INDICES_BIT_NV = 0x20000000; - public static final int GL_STANDARD_FONT_FORMAT_NV = 0x936C; - public static final int GL_2_BYTES_NV = 0x1407; - public static final int GL_3_BYTES_NV = 0x1408; - public static final int GL_4_BYTES_NV = 0x1409; - public static final int GL_EYE_LINEAR_NV = 0x2400; - public static final int GL_OBJECT_LINEAR_NV = 0x2401; - public static final int GL_CONSTANT_NV = 0x8576; - public static final int GL_PATH_FOG_GEN_MODE_NV = 0x90AC; - public static final int GL_PRIMARY_COLOR_NV = 0x852C; - public static final int GL_SECONDARY_COLOR_NV = 0x852D; - public static final int GL_PATH_GEN_COLOR_FORMAT_NV = 0x90B2; - public static final int GL_PATH_PROJECTION_NV = 0x1701; - public static final int GL_PATH_MODELVIEW_NV = 0x1700; - public static final int GL_PATH_MODELVIEW_STACK_DEPTH_NV = 0x0BA3; - public static final int GL_PATH_MODELVIEW_MATRIX_NV = 0x0BA6; - public static final int GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV = 0x0D36; - public static final int GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV = 0x84E3; - public static final int GL_PATH_PROJECTION_STACK_DEPTH_NV = 0x0BA4; - public static final int GL_PATH_PROJECTION_MATRIX_NV = 0x0BA7; - public static final int GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV = 0x0D38; - public static final int GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV = 0x84E4; - public static final int GL_FRAGMENT_INPUT_NV = 0x936D; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_path_rendering) return; - ext.glGenPathsNV = load.invoke("glGenPathsNV", of(JAVA_INT, JAVA_INT)); - ext.glDeletePathsNV = load.invoke("glDeletePathsNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glIsPathNV = load.invoke("glIsPathNV", of(JAVA_BYTE, JAVA_INT)); - ext.glPathCommandsNV = load.invoke("glPathCommandsNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glPathCoordsNV = load.invoke("glPathCoordsNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glPathSubCommandsNV = load.invoke("glPathSubCommandsNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glPathSubCoordsNV = load.invoke("glPathSubCoordsNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glPathStringNV = load.invoke("glPathStringNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glPathGlyphsNV = load.invoke("glPathGlyphsNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT, JAVA_FLOAT)); - ext.glPathGlyphRangeNV = load.invoke("glPathGlyphRangeNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_FLOAT)); - ext.glWeightPathsNV = load.invoke("glWeightPathsNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - ext.glCopyPathNV = load.invoke("glCopyPathNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glInterpolatePathsNV = load.invoke("glInterpolatePathsNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_FLOAT)); - ext.glTransformPathNV = load.invoke("glTransformPathNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glPathParameterivNV = load.invoke("glPathParameterivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glPathParameteriNV = load.invoke("glPathParameteriNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glPathParameterfvNV = load.invoke("glPathParameterfvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glPathParameterfNV = load.invoke("glPathParameterfNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_FLOAT)); - ext.glPathDashArrayNV = load.invoke("glPathDashArrayNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glPathStencilFuncNV = load.invoke("glPathStencilFuncNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glPathStencilDepthOffsetNV = load.invoke("glPathStencilDepthOffsetNV", ofVoid(JAVA_FLOAT, JAVA_FLOAT)); - ext.glStencilFillPathNV = load.invoke("glStencilFillPathNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glStencilStrokePathNV = load.invoke("glStencilStrokePathNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glStencilFillPathInstancedNV = load.invoke("glStencilFillPathInstancedNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glStencilStrokePathInstancedNV = load.invoke("glStencilStrokePathInstancedNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glPathCoverDepthFuncNV = load.invoke("glPathCoverDepthFuncNV", ofVoid(JAVA_INT)); - ext.glCoverFillPathNV = load.invoke("glCoverFillPathNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glCoverStrokePathNV = load.invoke("glCoverStrokePathNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glCoverFillPathInstancedNV = load.invoke("glCoverFillPathInstancedNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCoverStrokePathInstancedNV = load.invoke("glCoverStrokePathInstancedNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetPathParameterivNV = load.invoke("glGetPathParameterivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetPathParameterfvNV = load.invoke("glGetPathParameterfvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetPathCommandsNV = load.invoke("glGetPathCommandsNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glGetPathCoordsNV = load.invoke("glGetPathCoordsNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glGetPathDashArrayNV = load.invoke("glGetPathDashArrayNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glGetPathMetricsNV = load.invoke("glGetPathMetricsNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetPathMetricRangeNV = load.invoke("glGetPathMetricRangeNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetPathSpacingNV = load.invoke("glGetPathSpacingNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_INT, ADDRESS)); - ext.glIsPointInFillPathNV = load.invoke("glIsPointInFillPathNV", of(JAVA_BYTE, JAVA_INT, JAVA_INT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glIsPointInStrokePathNV = load.invoke("glIsPointInStrokePathNV", of(JAVA_BYTE, JAVA_INT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glGetPathLengthNV = load.invoke("glGetPathLengthNV", of(JAVA_FLOAT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glPointAlongPathNV = load.invoke("glPointAlongPathNV", of(JAVA_BYTE, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_FLOAT, ADDRESS, ADDRESS, ADDRESS, ADDRESS)); - ext.glMatrixLoad3x2fNV = load.invoke("glMatrixLoad3x2fNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glMatrixLoad3x3fNV = load.invoke("glMatrixLoad3x3fNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glMatrixLoadTranspose3x3fNV = load.invoke("glMatrixLoadTranspose3x3fNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glMatrixMult3x2fNV = load.invoke("glMatrixMult3x2fNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glMatrixMult3x3fNV = load.invoke("glMatrixMult3x3fNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glMatrixMultTranspose3x3fNV = load.invoke("glMatrixMultTranspose3x3fNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glStencilThenCoverFillPathNV = load.invoke("glStencilThenCoverFillPathNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glStencilThenCoverStrokePathNV = load.invoke("glStencilThenCoverStrokePathNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glStencilThenCoverFillPathInstancedNV = load.invoke("glStencilThenCoverFillPathInstancedNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glStencilThenCoverStrokePathInstancedNV = load.invoke("glStencilThenCoverStrokePathInstancedNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glPathGlyphIndexRangeNV = load.invoke("glPathGlyphIndexRangeNV", of(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT, JAVA_FLOAT, ADDRESS)); - ext.glPathGlyphIndexArrayNV = load.invoke("glPathGlyphIndexArrayNV", of(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_FLOAT)); - ext.glPathMemoryGlyphIndexArrayNV = load.invoke("glPathMemoryGlyphIndexArrayNV", of(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG, ADDRESS, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_FLOAT)); - ext.glProgramPathFragmentInputGenNV = load.invoke("glProgramPathFragmentInputGenNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetProgramResourcefvNV = load.invoke("glGetProgramResourcefvNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT, ADDRESS, ADDRESS)); - ext.glPathColorGenNV = load.invoke("glPathColorGenNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glPathTexGenNV = load.invoke("glPathTexGenNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glPathFogGenNV = load.invoke("glPathFogGenNV", ofVoid(JAVA_INT)); - ext.glGetPathColorGenivNV = load.invoke("glGetPathColorGenivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetPathColorGenfvNV = load.invoke("glGetPathColorGenfvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetPathTexGenivNV = load.invoke("glGetPathTexGenivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetPathTexGenfvNV = load.invoke("glGetPathTexGenfvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static int glGenPathsNV(int range) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glGenPathsNV).invokeExact(range); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glDeletePathsNV(int path, int range) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeletePathsNV).invokeExact(path, range); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static boolean glIsPathNV(int path) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsPathNV).invokeExact(path); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glPathCommandsNV(int path, int numCommands, @NativeType("const GLubyte *") MemorySegment commands, int numCoords, int coordType, @NativeType("const void *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glPathCommandsNV).invokeExact(path, numCommands, commands, numCoords, coordType, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glPathCoordsNV(int path, int numCoords, int coordType, @NativeType("const void *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glPathCoordsNV).invokeExact(path, numCoords, coordType, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glPathSubCommandsNV(int path, int commandStart, int commandsToDelete, int numCommands, @NativeType("const GLubyte *") MemorySegment commands, int numCoords, int coordType, @NativeType("const void *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glPathSubCommandsNV).invokeExact(path, commandStart, commandsToDelete, numCommands, commands, numCoords, coordType, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glPathSubCoordsNV(int path, int coordStart, int numCoords, int coordType, @NativeType("const void *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glPathSubCoordsNV).invokeExact(path, coordStart, numCoords, coordType, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glPathStringNV(int path, int format, int length, @NativeType("const void *") MemorySegment pathString) { - final var ext = getExtCapabilities(); - try { - check(ext.glPathStringNV).invokeExact(path, format, length, pathString); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glPathGlyphsNV(int firstPathName, int fontTarget, @NativeType("const void *") MemorySegment fontName, int fontStyle, int numGlyphs, int type, @NativeType("const void *") MemorySegment charcodes, int handleMissingGlyphs, int pathParameterTemplate, float emScale) { - final var ext = getExtCapabilities(); - try { - check(ext.glPathGlyphsNV).invokeExact(firstPathName, fontTarget, fontName, fontStyle, numGlyphs, type, charcodes, handleMissingGlyphs, pathParameterTemplate, emScale); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glPathGlyphRangeNV(int firstPathName, int fontTarget, @NativeType("const void *") MemorySegment fontName, int fontStyle, int firstGlyph, int numGlyphs, int handleMissingGlyphs, int pathParameterTemplate, float emScale) { - final var ext = getExtCapabilities(); - try { - check(ext.glPathGlyphRangeNV).invokeExact(firstPathName, fontTarget, fontName, fontStyle, firstGlyph, numGlyphs, handleMissingGlyphs, pathParameterTemplate, emScale); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLNVPathRendering { + int GL_PATH_FORMAT_SVG_NV = 0x9070; + int GL_PATH_FORMAT_PS_NV = 0x9071; + int GL_STANDARD_FONT_NAME_NV = 0x9072; + int GL_SYSTEM_FONT_NAME_NV = 0x9073; + int GL_FILE_NAME_NV = 0x9074; + int GL_PATH_STROKE_WIDTH_NV = 0x9075; + int GL_PATH_END_CAPS_NV = 0x9076; + int GL_PATH_INITIAL_END_CAP_NV = 0x9077; + int GL_PATH_TERMINAL_END_CAP_NV = 0x9078; + int GL_PATH_JOIN_STYLE_NV = 0x9079; + int GL_PATH_MITER_LIMIT_NV = 0x907A; + int GL_PATH_DASH_CAPS_NV = 0x907B; + int GL_PATH_INITIAL_DASH_CAP_NV = 0x907C; + int GL_PATH_TERMINAL_DASH_CAP_NV = 0x907D; + int GL_PATH_DASH_OFFSET_NV = 0x907E; + int GL_PATH_CLIENT_LENGTH_NV = 0x907F; + int GL_PATH_FILL_MODE_NV = 0x9080; + int GL_PATH_FILL_MASK_NV = 0x9081; + int GL_PATH_FILL_COVER_MODE_NV = 0x9082; + int GL_PATH_STROKE_COVER_MODE_NV = 0x9083; + int GL_PATH_STROKE_MASK_NV = 0x9084; + int GL_COUNT_UP_NV = 0x9088; + int GL_COUNT_DOWN_NV = 0x9089; + int GL_PATH_OBJECT_BOUNDING_BOX_NV = 0x908A; + int GL_CONVEX_HULL_NV = 0x908B; + int GL_BOUNDING_BOX_NV = 0x908D; + int GL_TRANSLATE_X_NV = 0x908E; + int GL_TRANSLATE_Y_NV = 0x908F; + int GL_TRANSLATE_2D_NV = 0x9090; + int GL_TRANSLATE_3D_NV = 0x9091; + int GL_AFFINE_2D_NV = 0x9092; + int GL_AFFINE_3D_NV = 0x9094; + int GL_TRANSPOSE_AFFINE_2D_NV = 0x9096; + int GL_TRANSPOSE_AFFINE_3D_NV = 0x9098; + int GL_UTF8_NV = 0x909A; + int GL_UTF16_NV = 0x909B; + int GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV = 0x909C; + int GL_PATH_COMMAND_COUNT_NV = 0x909D; + int GL_PATH_COORD_COUNT_NV = 0x909E; + int GL_PATH_DASH_ARRAY_COUNT_NV = 0x909F; + int GL_PATH_COMPUTED_LENGTH_NV = 0x90A0; + int GL_PATH_FILL_BOUNDING_BOX_NV = 0x90A1; + int GL_PATH_STROKE_BOUNDING_BOX_NV = 0x90A2; + int GL_SQUARE_NV = 0x90A3; + int GL_ROUND_NV = 0x90A4; + int GL_TRIANGULAR_NV = 0x90A5; + int GL_BEVEL_NV = 0x90A6; + int GL_MITER_REVERT_NV = 0x90A7; + int GL_MITER_TRUNCATE_NV = 0x90A8; + int GL_SKIP_MISSING_GLYPH_NV = 0x90A9; + int GL_USE_MISSING_GLYPH_NV = 0x90AA; + int GL_PATH_ERROR_POSITION_NV = 0x90AB; + int GL_ACCUM_ADJACENT_PAIRS_NV = 0x90AD; + int GL_ADJACENT_PAIRS_NV = 0x90AE; + int GL_FIRST_TO_REST_NV = 0x90AF; + int GL_PATH_GEN_MODE_NV = 0x90B0; + int GL_PATH_GEN_COEFF_NV = 0x90B1; + int GL_PATH_GEN_COMPONENTS_NV = 0x90B3; + int GL_PATH_STENCIL_FUNC_NV = 0x90B7; + int GL_PATH_STENCIL_REF_NV = 0x90B8; + int GL_PATH_STENCIL_VALUE_MASK_NV = 0x90B9; + int GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV = 0x90BD; + int GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV = 0x90BE; + int GL_PATH_COVER_DEPTH_FUNC_NV = 0x90BF; + int GL_PATH_DASH_OFFSET_RESET_NV = 0x90B4; + int GL_MOVE_TO_RESETS_NV = 0x90B5; + int GL_MOVE_TO_CONTINUES_NV = 0x90B6; + int GL_CLOSE_PATH_NV = 0x00; + int GL_MOVE_TO_NV = 0x02; + int GL_RELATIVE_MOVE_TO_NV = 0x03; + int GL_LINE_TO_NV = 0x04; + int GL_RELATIVE_LINE_TO_NV = 0x05; + int GL_HORIZONTAL_LINE_TO_NV = 0x06; + int GL_RELATIVE_HORIZONTAL_LINE_TO_NV = 0x07; + int GL_VERTICAL_LINE_TO_NV = 0x08; + int GL_RELATIVE_VERTICAL_LINE_TO_NV = 0x09; + int GL_QUADRATIC_CURVE_TO_NV = 0x0A; + int GL_RELATIVE_QUADRATIC_CURVE_TO_NV = 0x0B; + int GL_CUBIC_CURVE_TO_NV = 0x0C; + int GL_RELATIVE_CUBIC_CURVE_TO_NV = 0x0D; + int GL_SMOOTH_QUADRATIC_CURVE_TO_NV = 0x0E; + int GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV = 0x0F; + int GL_SMOOTH_CUBIC_CURVE_TO_NV = 0x10; + int GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV = 0x11; + int GL_SMALL_CCW_ARC_TO_NV = 0x12; + int GL_RELATIVE_SMALL_CCW_ARC_TO_NV = 0x13; + int GL_SMALL_CW_ARC_TO_NV = 0x14; + int GL_RELATIVE_SMALL_CW_ARC_TO_NV = 0x15; + int GL_LARGE_CCW_ARC_TO_NV = 0x16; + int GL_RELATIVE_LARGE_CCW_ARC_TO_NV = 0x17; + int GL_LARGE_CW_ARC_TO_NV = 0x18; + int GL_RELATIVE_LARGE_CW_ARC_TO_NV = 0x19; + int GL_RESTART_PATH_NV = 0xF0; + int GL_DUP_FIRST_CUBIC_CURVE_TO_NV = 0xF2; + int GL_DUP_LAST_CUBIC_CURVE_TO_NV = 0xF4; + int GL_RECT_NV = 0xF6; + int GL_CIRCULAR_CCW_ARC_TO_NV = 0xF8; + int GL_CIRCULAR_CW_ARC_TO_NV = 0xFA; + int GL_CIRCULAR_TANGENT_ARC_TO_NV = 0xFC; + int GL_ARC_TO_NV = 0xFE; + int GL_RELATIVE_ARC_TO_NV = 0xFF; + int GL_BOLD_BIT_NV = 0x01; + int GL_ITALIC_BIT_NV = 0x02; + int GL_GLYPH_WIDTH_BIT_NV = 0x01; + int GL_GLYPH_HEIGHT_BIT_NV = 0x02; + int GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV = 0x04; + int GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV = 0x08; + int GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV = 0x10; + int GL_GLYPH_VERTICAL_BEARING_X_BIT_NV = 0x20; + int GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV = 0x40; + int GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV = 0x80; + int GL_GLYPH_HAS_KERNING_BIT_NV = 0x100; + int GL_FONT_X_MIN_BOUNDS_BIT_NV = 0x00010000; + int GL_FONT_Y_MIN_BOUNDS_BIT_NV = 0x00020000; + int GL_FONT_X_MAX_BOUNDS_BIT_NV = 0x00040000; + int GL_FONT_Y_MAX_BOUNDS_BIT_NV = 0x00080000; + int GL_FONT_UNITS_PER_EM_BIT_NV = 0x00100000; + int GL_FONT_ASCENDER_BIT_NV = 0x00200000; + int GL_FONT_DESCENDER_BIT_NV = 0x00400000; + int GL_FONT_HEIGHT_BIT_NV = 0x00800000; + int GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV = 0x01000000; + int GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV = 0x02000000; + int GL_FONT_UNDERLINE_POSITION_BIT_NV = 0x04000000; + int GL_FONT_UNDERLINE_THICKNESS_BIT_NV = 0x08000000; + int GL_FONT_HAS_KERNING_BIT_NV = 0x10000000; + int GL_ROUNDED_RECT_NV = 0xE8; + int GL_RELATIVE_ROUNDED_RECT_NV = 0xE9; + int GL_ROUNDED_RECT2_NV = 0xEA; + int GL_RELATIVE_ROUNDED_RECT2_NV = 0xEB; + int GL_ROUNDED_RECT4_NV = 0xEC; + int GL_RELATIVE_ROUNDED_RECT4_NV = 0xED; + int GL_ROUNDED_RECT8_NV = 0xEE; + int GL_RELATIVE_ROUNDED_RECT8_NV = 0xEF; + int GL_RELATIVE_RECT_NV = 0xF7; + int GL_FONT_GLYPHS_AVAILABLE_NV = 0x9368; + int GL_FONT_TARGET_UNAVAILABLE_NV = 0x9369; + int GL_FONT_UNAVAILABLE_NV = 0x936A; + int GL_FONT_UNINTELLIGIBLE_NV = 0x936B; + int GL_CONIC_CURVE_TO_NV = 0x1A; + int GL_RELATIVE_CONIC_CURVE_TO_NV = 0x1B; + int GL_FONT_NUM_GLYPH_INDICES_BIT_NV = 0x20000000; + int GL_STANDARD_FONT_FORMAT_NV = 0x936C; + int GL_2_BYTES_NV = 0x1407; + int GL_3_BYTES_NV = 0x1408; + int GL_4_BYTES_NV = 0x1409; + int GL_EYE_LINEAR_NV = 0x2400; + int GL_OBJECT_LINEAR_NV = 0x2401; + int GL_CONSTANT_NV = 0x8576; + int GL_PATH_FOG_GEN_MODE_NV = 0x90AC; + int GL_PRIMARY_COLOR_NV = 0x852C; + int GL_SECONDARY_COLOR_NV = 0x852D; + int GL_PATH_GEN_COLOR_FORMAT_NV = 0x90B2; + int GL_PATH_PROJECTION_NV = 0x1701; + int GL_PATH_MODELVIEW_NV = 0x1700; + int GL_PATH_MODELVIEW_STACK_DEPTH_NV = 0x0BA3; + int GL_PATH_MODELVIEW_MATRIX_NV = 0x0BA6; + int GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV = 0x0D36; + int GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV = 0x84E3; + int GL_PATH_PROJECTION_STACK_DEPTH_NV = 0x0BA4; + int GL_PATH_PROJECTION_MATRIX_NV = 0x0BA7; + int GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV = 0x0D38; + int GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV = 0x84E4; + int GL_FRAGMENT_INPUT_NV = 0x936D; + + default int glGenPathsNV(int range) { + throw new ContextException(); + } + + default void glDeletePathsNV(int path, int range) { + throw new ContextException(); + } + + default boolean glIsPathNV(int path) { + throw new ContextException(); + } + + default void glPathCommandsNV(int path, int numCommands, @NativeType("const GLubyte *") MemorySegment commands, int numCoords, int coordType, @NativeType("const void *") MemorySegment coords) { + throw new ContextException(); + } + + default void glPathCoordsNV(int path, int numCoords, int coordType, @NativeType("const void *") MemorySegment coords) { + throw new ContextException(); + } + + default void glPathSubCommandsNV(int path, int commandStart, int commandsToDelete, int numCommands, @NativeType("const GLubyte *") MemorySegment commands, int numCoords, int coordType, @NativeType("const void *") MemorySegment coords) { + throw new ContextException(); + } + + default void glPathSubCoordsNV(int path, int coordStart, int numCoords, int coordType, @NativeType("const void *") MemorySegment coords) { + throw new ContextException(); + } + + default void glPathStringNV(int path, int format, int length, @NativeType("const void *") MemorySegment pathString) { + throw new ContextException(); + } + + default void glPathGlyphsNV(int firstPathName, int fontTarget, @NativeType("const void *") MemorySegment fontName, int fontStyle, int numGlyphs, int type, @NativeType("const void *") MemorySegment charcodes, int handleMissingGlyphs, int pathParameterTemplate, float emScale) { + throw new ContextException(); + } + + default void glPathGlyphRangeNV(int firstPathName, int fontTarget, @NativeType("const void *") MemorySegment fontName, int fontStyle, int firstGlyph, int numGlyphs, int handleMissingGlyphs, int pathParameterTemplate, float emScale) { + throw new ContextException(); } - public static void glWeightPathsNV(int resultPath, int numPaths, @NativeType("const GLuint *") MemorySegment paths, @NativeType("const GLfloat *") MemorySegment weights) { - final var ext = getExtCapabilities(); - try { - check(ext.glWeightPathsNV).invokeExact(resultPath, numPaths, paths, weights); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWeightPathsNV(int resultPath, int numPaths, @NativeType("const GLuint *") MemorySegment paths, @NativeType("const GLfloat *") MemorySegment weights) { + throw new ContextException(); } - public static void glCopyPathNV(int resultPath, int srcPath) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyPathNV).invokeExact(resultPath, srcPath); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyPathNV(int resultPath, int srcPath) { + throw new ContextException(); } - public static void glInterpolatePathsNV(int resultPath, int pathA, int pathB, float weight) { - final var ext = getExtCapabilities(); - try { - check(ext.glInterpolatePathsNV).invokeExact(resultPath, pathA, pathB, weight); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glInterpolatePathsNV(int resultPath, int pathA, int pathB, float weight) { + throw new ContextException(); } - public static void glTransformPathNV(int resultPath, int srcPath, int transformType, @NativeType("const GLfloat *") MemorySegment transformValues) { - final var ext = getExtCapabilities(); - try { - check(ext.glTransformPathNV).invokeExact(resultPath, srcPath, transformType, transformValues); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTransformPathNV(int resultPath, int srcPath, int transformType, @NativeType("const GLfloat *") MemorySegment transformValues) { + throw new ContextException(); } - public static void glPathParameterivNV(int path, int pname, @NativeType("const GLint *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glPathParameterivNV).invokeExact(path, pname, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPathParameterivNV(int path, int pname, @NativeType("const GLint *") MemorySegment value) { + throw new ContextException(); } - public static void glPathParameteriNV(int path, int pname, int value) { - final var ext = getExtCapabilities(); - try { - check(ext.glPathParameteriNV).invokeExact(path, pname, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPathParameteriNV(int path, int pname, int value) { + throw new ContextException(); } - public static void glPathParameterfvNV(int path, int pname, @NativeType("const GLfloat *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glPathParameterfvNV).invokeExact(path, pname, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPathParameterfvNV(int path, int pname, @NativeType("const GLfloat *") MemorySegment value) { + throw new ContextException(); } - public static void glPathParameterfNV(int path, int pname, float value) { - final var ext = getExtCapabilities(); - try { - check(ext.glPathParameterfNV).invokeExact(path, pname, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPathParameterfNV(int path, int pname, float value) { + throw new ContextException(); } - public static void glPathDashArrayNV(int path, int dashCount, @NativeType("const GLfloat *") MemorySegment dashArray) { - final var ext = getExtCapabilities(); - try { - check(ext.glPathDashArrayNV).invokeExact(path, dashCount, dashArray); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPathDashArrayNV(int path, int dashCount, @NativeType("const GLfloat *") MemorySegment dashArray) { + throw new ContextException(); } - public static void glPathStencilFuncNV(int func, int ref, int mask) { - final var ext = getExtCapabilities(); - try { - check(ext.glPathStencilFuncNV).invokeExact(func, ref, mask); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPathStencilFuncNV(int func, int ref, int mask) { + throw new ContextException(); } - public static void glPathStencilDepthOffsetNV(float factor, float units) { - final var ext = getExtCapabilities(); - try { - check(ext.glPathStencilDepthOffsetNV).invokeExact(factor, units); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPathStencilDepthOffsetNV(float factor, float units) { + throw new ContextException(); } - public static void glStencilFillPathNV(int path, int fillMode, int mask) { - final var ext = getExtCapabilities(); - try { - check(ext.glStencilFillPathNV).invokeExact(path, fillMode, mask); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glStencilFillPathNV(int path, int fillMode, int mask) { + throw new ContextException(); } - public static void glStencilStrokePathNV(int path, int reference, int mask) { - final var ext = getExtCapabilities(); - try { - check(ext.glStencilStrokePathNV).invokeExact(path, reference, mask); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glStencilStrokePathNV(int path, int reference, int mask) { + throw new ContextException(); } - public static void glStencilFillPathInstancedNV(int numPaths, int pathNameType, @NativeType("const void *") MemorySegment paths, int pathBase, int fillMode, int mask, int transformType, @NativeType("const GLfloat *") MemorySegment transformValues) { - final var ext = getExtCapabilities(); - try { - check(ext.glStencilFillPathInstancedNV).invokeExact(numPaths, pathNameType, paths, pathBase, fillMode, mask, transformType, transformValues); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glStencilFillPathInstancedNV(int numPaths, int pathNameType, @NativeType("const void *") MemorySegment paths, int pathBase, int fillMode, int mask, int transformType, @NativeType("const GLfloat *") MemorySegment transformValues) { + throw new ContextException(); } - public static void glStencilStrokePathInstancedNV(int numPaths, int pathNameType, @NativeType("const void *") MemorySegment paths, int pathBase, int reference, int mask, int transformType, @NativeType("const GLfloat *") MemorySegment transformValues) { - final var ext = getExtCapabilities(); - try { - check(ext.glStencilStrokePathInstancedNV).invokeExact(numPaths, pathNameType, paths, pathBase, reference, mask, transformType, transformValues); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glStencilStrokePathInstancedNV(int numPaths, int pathNameType, @NativeType("const void *") MemorySegment paths, int pathBase, int reference, int mask, int transformType, @NativeType("const GLfloat *") MemorySegment transformValues) { + throw new ContextException(); } - public static void glPathCoverDepthFuncNV(int func) { - final var ext = getExtCapabilities(); - try { - check(ext.glPathCoverDepthFuncNV).invokeExact(func); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPathCoverDepthFuncNV(int func) { + throw new ContextException(); } - public static void glCoverFillPathNV(int path, int coverMode) { - final var ext = getExtCapabilities(); - try { - check(ext.glCoverFillPathNV).invokeExact(path, coverMode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCoverFillPathNV(int path, int coverMode) { + throw new ContextException(); } - public static void glCoverStrokePathNV(int path, int coverMode) { - final var ext = getExtCapabilities(); - try { - check(ext.glCoverStrokePathNV).invokeExact(path, coverMode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCoverStrokePathNV(int path, int coverMode) { + throw new ContextException(); } - public static void glCoverFillPathInstancedNV(int numPaths, int pathNameType, @NativeType("const void *") MemorySegment paths, int pathBase, int coverMode, int transformType, @NativeType("const GLfloat *") MemorySegment transformValues) { - final var ext = getExtCapabilities(); - try { - check(ext.glCoverFillPathInstancedNV).invokeExact(numPaths, pathNameType, paths, pathBase, coverMode, transformType, transformValues); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCoverFillPathInstancedNV(int numPaths, int pathNameType, @NativeType("const void *") MemorySegment paths, int pathBase, int coverMode, int transformType, @NativeType("const GLfloat *") MemorySegment transformValues) { + throw new ContextException(); } - public static void glCoverStrokePathInstancedNV(int numPaths, int pathNameType, @NativeType("const void *") MemorySegment paths, int pathBase, int coverMode, int transformType, @NativeType("const GLfloat *") MemorySegment transformValues) { - final var ext = getExtCapabilities(); - try { - check(ext.glCoverStrokePathInstancedNV).invokeExact(numPaths, pathNameType, paths, pathBase, coverMode, transformType, transformValues); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCoverStrokePathInstancedNV(int numPaths, int pathNameType, @NativeType("const void *") MemorySegment paths, int pathBase, int coverMode, int transformType, @NativeType("const GLfloat *") MemorySegment transformValues) { + throw new ContextException(); } - public static void glGetPathParameterivNV(int path, int pname, @NativeType("GLint *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPathParameterivNV).invokeExact(path, pname, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPathParameterivNV(int path, int pname, @NativeType("GLint *") MemorySegment value) { + throw new ContextException(); } - public static void glGetPathParameterfvNV(int path, int pname, @NativeType("GLfloat *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPathParameterfvNV).invokeExact(path, pname, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPathParameterfvNV(int path, int pname, @NativeType("GLfloat *") MemorySegment value) { + throw new ContextException(); } - public static void glGetPathCommandsNV(int path, @NativeType("GLubyte *") MemorySegment commands) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPathCommandsNV).invokeExact(path, commands); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPathCommandsNV(int path, @NativeType("GLubyte *") MemorySegment commands) { + throw new ContextException(); } - public static void glGetPathCoordsNV(int path, @NativeType("GLfloat *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPathCoordsNV).invokeExact(path, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPathCoordsNV(int path, @NativeType("GLfloat *") MemorySegment coords) { + throw new ContextException(); } - public static void glGetPathDashArrayNV(int path, @NativeType("GLfloat *") MemorySegment dashArray) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPathDashArrayNV).invokeExact(path, dashArray); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPathDashArrayNV(int path, @NativeType("GLfloat *") MemorySegment dashArray) { + throw new ContextException(); } - public static void glGetPathMetricsNV(int metricQueryMask, int numPaths, int pathNameType, @NativeType("const void *") MemorySegment paths, int pathBase, int stride, @NativeType("GLfloat *") MemorySegment metrics) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPathMetricsNV).invokeExact(metricQueryMask, numPaths, pathNameType, paths, pathBase, stride, metrics); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPathMetricsNV(int metricQueryMask, int numPaths, int pathNameType, @NativeType("const void *") MemorySegment paths, int pathBase, int stride, @NativeType("GLfloat *") MemorySegment metrics) { + throw new ContextException(); } - public static void glGetPathMetricRangeNV(int metricQueryMask, int firstPathName, int numPaths, int stride, @NativeType("GLfloat *") MemorySegment metrics) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPathMetricRangeNV).invokeExact(metricQueryMask, firstPathName, numPaths, stride, metrics); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPathMetricRangeNV(int metricQueryMask, int firstPathName, int numPaths, int stride, @NativeType("GLfloat *") MemorySegment metrics) { + throw new ContextException(); } - public static void glGetPathSpacingNV(int pathListMode, int numPaths, int pathNameType, @NativeType("const void *") MemorySegment paths, int pathBase, float advanceScale, float kerningScale, int transformType, @NativeType("GLfloat *") MemorySegment returnedSpacing) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPathSpacingNV).invokeExact(pathListMode, numPaths, pathNameType, paths, pathBase, advanceScale, kerningScale, transformType, returnedSpacing); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPathSpacingNV(int pathListMode, int numPaths, int pathNameType, @NativeType("const void *") MemorySegment paths, int pathBase, float advanceScale, float kerningScale, int transformType, @NativeType("GLfloat *") MemorySegment returnedSpacing) { + throw new ContextException(); } - public static boolean glIsPointInFillPathNV(int path, int mask, float x, float y) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsPointInFillPathNV).invokeExact(path, mask, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsPointInFillPathNV(int path, int mask, float x, float y) { + throw new ContextException(); } - public static boolean glIsPointInStrokePathNV(int path, float x, float y) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsPointInStrokePathNV).invokeExact(path, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsPointInStrokePathNV(int path, float x, float y) { + throw new ContextException(); } - public static float glGetPathLengthNV(int path, int startSegment, int numSegments) { - final var ext = getExtCapabilities(); - try { - return (float) - check(ext.glGetPathLengthNV).invokeExact(path, startSegment, numSegments); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default float glGetPathLengthNV(int path, int startSegment, int numSegments) { + throw new ContextException(); } - public static boolean glPointAlongPathNV(int path, int startSegment, int numSegments, float distance, @NativeType("GLfloat *") MemorySegment x, @NativeType("GLfloat *") MemorySegment y, @NativeType("GLfloat *") MemorySegment tangentX, @NativeType("GLfloat *") MemorySegment tangentY) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glPointAlongPathNV).invokeExact(path, startSegment, numSegments, distance, x, y, tangentX, tangentY); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glPointAlongPathNV(int path, int startSegment, int numSegments, float distance, @NativeType("GLfloat *") MemorySegment x, @NativeType("GLfloat *") MemorySegment y, @NativeType("GLfloat *") MemorySegment tangentX, @NativeType("GLfloat *") MemorySegment tangentY) { + throw new ContextException(); } - public static void glMatrixLoad3x2fNV(int matrixMode, @NativeType("const GLfloat *") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixLoad3x2fNV).invokeExact(matrixMode, m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMatrixLoad3x2fNV(int matrixMode, @NativeType("const GLfloat *") MemorySegment m) { + throw new ContextException(); } - public static void glMatrixLoad3x3fNV(int matrixMode, @NativeType("const GLfloat *") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixLoad3x3fNV).invokeExact(matrixMode, m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMatrixLoad3x3fNV(int matrixMode, @NativeType("const GLfloat *") MemorySegment m) { + throw new ContextException(); } - public static void glMatrixLoadTranspose3x3fNV(int matrixMode, @NativeType("const GLfloat *") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixLoadTranspose3x3fNV).invokeExact(matrixMode, m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMatrixLoadTranspose3x3fNV(int matrixMode, @NativeType("const GLfloat *") MemorySegment m) { + throw new ContextException(); } - public static void glMatrixMult3x2fNV(int matrixMode, @NativeType("const GLfloat *") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixMult3x2fNV).invokeExact(matrixMode, m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMatrixMult3x2fNV(int matrixMode, @NativeType("const GLfloat *") MemorySegment m) { + throw new ContextException(); } - public static void glMatrixMult3x3fNV(int matrixMode, @NativeType("const GLfloat *") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixMult3x3fNV).invokeExact(matrixMode, m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMatrixMult3x3fNV(int matrixMode, @NativeType("const GLfloat *") MemorySegment m) { + throw new ContextException(); } - public static void glMatrixMultTranspose3x3fNV(int matrixMode, @NativeType("const GLfloat *") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glMatrixMultTranspose3x3fNV).invokeExact(matrixMode, m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMatrixMultTranspose3x3fNV(int matrixMode, @NativeType("const GLfloat *") MemorySegment m) { + throw new ContextException(); } - public static void glStencilThenCoverFillPathNV(int path, int fillMode, int mask, int coverMode) { - final var ext = getExtCapabilities(); - try { - check(ext.glStencilThenCoverFillPathNV).invokeExact(path, fillMode, mask, coverMode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glStencilThenCoverFillPathNV(int path, int fillMode, int mask, int coverMode) { + throw new ContextException(); } - public static void glStencilThenCoverStrokePathNV(int path, int reference, int mask, int coverMode) { - final var ext = getExtCapabilities(); - try { - check(ext.glStencilThenCoverStrokePathNV).invokeExact(path, reference, mask, coverMode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glStencilThenCoverStrokePathNV(int path, int reference, int mask, int coverMode) { + throw new ContextException(); } - public static void glStencilThenCoverFillPathInstancedNV(int numPaths, int pathNameType, @NativeType("const void *") MemorySegment paths, int pathBase, int fillMode, int mask, int coverMode, int transformType, @NativeType("const GLfloat *") MemorySegment transformValues) { - final var ext = getExtCapabilities(); - try { - check(ext.glStencilThenCoverFillPathInstancedNV).invokeExact(numPaths, pathNameType, paths, pathBase, fillMode, mask, coverMode, transformType, transformValues); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glStencilThenCoverFillPathInstancedNV(int numPaths, int pathNameType, @NativeType("const void *") MemorySegment paths, int pathBase, int fillMode, int mask, int coverMode, int transformType, @NativeType("const GLfloat *") MemorySegment transformValues) { + throw new ContextException(); } - public static void glStencilThenCoverStrokePathInstancedNV(int numPaths, int pathNameType, @NativeType("const void *") MemorySegment paths, int pathBase, int reference, int mask, int coverMode, int transformType, @NativeType("const GLfloat *") MemorySegment transformValues) { - final var ext = getExtCapabilities(); - try { - check(ext.glStencilThenCoverStrokePathInstancedNV).invokeExact(numPaths, pathNameType, paths, pathBase, reference, mask, coverMode, transformType, transformValues); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glStencilThenCoverStrokePathInstancedNV(int numPaths, int pathNameType, @NativeType("const void *") MemorySegment paths, int pathBase, int reference, int mask, int coverMode, int transformType, @NativeType("const GLfloat *") MemorySegment transformValues) { + throw new ContextException(); } - public static int glPathGlyphIndexRangeNV(int fontTarget, @NativeType("const void *") MemorySegment fontName, int fontStyle, int pathParameterTemplate, float emScale, @NativeType("GLuint *") MemorySegment baseAndCount) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glPathGlyphIndexRangeNV).invokeExact(fontTarget, fontName, fontStyle, pathParameterTemplate, emScale, baseAndCount); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glPathGlyphIndexRangeNV(int fontTarget, @NativeType("const void *") MemorySegment fontName, int fontStyle, int pathParameterTemplate, float emScale, @NativeType("GLuint *") MemorySegment baseAndCount) { + throw new ContextException(); } - public static int glPathGlyphIndexArrayNV(int firstPathName, int fontTarget, @NativeType("const void *") MemorySegment fontName, int fontStyle, int firstGlyphIndex, int numGlyphs, int pathParameterTemplate, float emScale) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glPathGlyphIndexArrayNV).invokeExact(firstPathName, fontTarget, fontName, fontStyle, firstGlyphIndex, numGlyphs, pathParameterTemplate, emScale); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glPathGlyphIndexArrayNV(int firstPathName, int fontTarget, @NativeType("const void *") MemorySegment fontName, int fontStyle, int firstGlyphIndex, int numGlyphs, int pathParameterTemplate, float emScale) { + throw new ContextException(); } - public static int glPathMemoryGlyphIndexArrayNV(int firstPathName, int fontTarget, long fontSize, @NativeType("const void *") MemorySegment fontData, int faceIndex, int firstGlyphIndex, int numGlyphs, int pathParameterTemplate, float emScale) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glPathMemoryGlyphIndexArrayNV).invokeExact(firstPathName, fontTarget, fontSize, fontData, faceIndex, firstGlyphIndex, numGlyphs, pathParameterTemplate, emScale); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glPathMemoryGlyphIndexArrayNV(int firstPathName, int fontTarget, long fontSize, @NativeType("const void *") MemorySegment fontData, int faceIndex, int firstGlyphIndex, int numGlyphs, int pathParameterTemplate, float emScale) { + throw new ContextException(); } - public static void glProgramPathFragmentInputGenNV(int program, int location, int genMode, int components, @NativeType("const GLfloat *") MemorySegment coeffs) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramPathFragmentInputGenNV).invokeExact(program, location, genMode, components, coeffs); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramPathFragmentInputGenNV(int program, int location, int genMode, int components, @NativeType("const GLfloat *") MemorySegment coeffs) { + throw new ContextException(); } - public static void glGetProgramResourcefvNV(int program, int programInterface, int index, int propCount, @NativeType("const GLenum *") MemorySegment props, int count, @NativeType("GLsizei *") MemorySegment length, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetProgramResourcefvNV).invokeExact(program, programInterface, index, propCount, props, count, length, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetProgramResourcefvNV(int program, int programInterface, int index, int propCount, @NativeType("const GLenum *") MemorySegment props, int count, @NativeType("GLsizei *") MemorySegment length, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glPathColorGenNV(int color, int genMode, int colorFormat, @NativeType("const GLfloat *") MemorySegment coeffs) { - final var ext = getExtCapabilities(); - try { - check(ext.glPathColorGenNV).invokeExact(color, genMode, colorFormat, coeffs); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPathColorGenNV(int color, int genMode, int colorFormat, @NativeType("const GLfloat *") MemorySegment coeffs) { + throw new ContextException(); } - public static void glPathTexGenNV(int texCoordSet, int genMode, int components, @NativeType("const GLfloat *") MemorySegment coeffs) { - final var ext = getExtCapabilities(); - try { - check(ext.glPathTexGenNV).invokeExact(texCoordSet, genMode, components, coeffs); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPathTexGenNV(int texCoordSet, int genMode, int components, @NativeType("const GLfloat *") MemorySegment coeffs) { + throw new ContextException(); } - public static void glPathFogGenNV(int genMode) { - final var ext = getExtCapabilities(); - try { - check(ext.glPathFogGenNV).invokeExact(genMode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPathFogGenNV(int genMode) { + throw new ContextException(); } - public static void glGetPathColorGenivNV(int color, int pname, @NativeType("GLint *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPathColorGenivNV).invokeExact(color, pname, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPathColorGenivNV(int color, int pname, @NativeType("GLint *") MemorySegment value) { + throw new ContextException(); } - public static void glGetPathColorGenfvNV(int color, int pname, @NativeType("GLfloat *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPathColorGenfvNV).invokeExact(color, pname, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPathColorGenfvNV(int color, int pname, @NativeType("GLfloat *") MemorySegment value) { + throw new ContextException(); } - public static void glGetPathTexGenivNV(int texCoordSet, int pname, @NativeType("GLint *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPathTexGenivNV).invokeExact(texCoordSet, pname, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPathTexGenivNV(int texCoordSet, int pname, @NativeType("GLint *") MemorySegment value) { + throw new ContextException(); } - public static void glGetPathTexGenfvNV(int texCoordSet, int pname, @NativeType("GLfloat *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPathTexGenfvNV).invokeExact(texCoordSet, pname, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPathTexGenfvNV(int texCoordSet, int pname, @NativeType("GLfloat *") MemorySegment value) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPathRenderingSharedEdge.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPathRenderingSharedEdge.java index 379ca3e9..4231a616 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPathRenderingSharedEdge.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPathRenderingSharedEdge.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_path_rendering_shared_edge} */ -public final class GLNVPathRenderingSharedEdge { - public static final int GL_SHARED_EDGE_NV = 0xC0; +public interface GLNVPathRenderingSharedEdge { + int GL_SHARED_EDGE_NV = 0xC0; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPixelDataRange.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPixelDataRange.java index a706583a..d39a60fd 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPixelDataRange.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPixelDataRange.java @@ -16,42 +16,27 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_pixel_data_range} */ -public final class GLNVPixelDataRange { - public static final int GL_WRITE_PIXEL_DATA_RANGE_NV = 0x8878; - public static final int GL_READ_PIXEL_DATA_RANGE_NV = 0x8879; - public static final int GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV = 0x887A; - public static final int GL_READ_PIXEL_DATA_RANGE_LENGTH_NV = 0x887B; - public static final int GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV = 0x887C; - public static final int GL_READ_PIXEL_DATA_RANGE_POINTER_NV = 0x887D; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_pixel_data_range) return; - ext.glPixelDataRangeNV = load.invoke("glPixelDataRangeNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glFlushPixelDataRangeNV = load.invoke("glFlushPixelDataRangeNV", ofVoid(JAVA_INT)); - } +public interface GLNVPixelDataRange { + int GL_WRITE_PIXEL_DATA_RANGE_NV = 0x8878; + int GL_READ_PIXEL_DATA_RANGE_NV = 0x8879; + int GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV = 0x887A; + int GL_READ_PIXEL_DATA_RANGE_LENGTH_NV = 0x887B; + int GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV = 0x887C; + int GL_READ_PIXEL_DATA_RANGE_POINTER_NV = 0x887D; - public static void glPixelDataRangeNV(int target, int length, @NativeType("const void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glPixelDataRangeNV).invokeExact(target, length, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPixelDataRangeNV(int target, int length, @NativeType("const void *") MemorySegment pointer) { + throw new ContextException(); } - public static void glFlushPixelDataRangeNV(int target) { - final var ext = getExtCapabilities(); - try { - check(ext.glFlushPixelDataRangeNV).invokeExact(target); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFlushPixelDataRangeNV(int target) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPointSprite.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPointSprite.java index df57ac2e..47788a2b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPointSprite.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPointSprite.java @@ -16,39 +16,24 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_point_sprite} */ -public final class GLNVPointSprite { - public static final int GL_POINT_SPRITE_NV = 0x8861; - public static final int GL_COORD_REPLACE_NV = 0x8862; - public static final int GL_POINT_SPRITE_R_MODE_NV = 0x8863; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_point_sprite) return; - ext.glPointParameteriNV = load.invoke("glPointParameteriNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glPointParameterivNV = load.invoke("glPointParameterivNV", ofVoid(JAVA_INT, ADDRESS)); - } +public interface GLNVPointSprite { + int GL_POINT_SPRITE_NV = 0x8861; + int GL_COORD_REPLACE_NV = 0x8862; + int GL_POINT_SPRITE_R_MODE_NV = 0x8863; - public static void glPointParameteriNV(int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glPointParameteriNV).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPointParameteriNV(int pname, int param) { + throw new ContextException(); } - public static void glPointParameterivNV(int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glPointParameterivNV).invokeExact(pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPointParameterivNV(int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPresentVideo.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPresentVideo.java index 82f63cdd..743c26b4 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPresentVideo.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPresentVideo.java @@ -16,74 +16,43 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_present_video} */ -public final class GLNVPresentVideo { - public static final int GL_FRAME_NV = 0x8E26; - public static final int GL_FIELDS_NV = 0x8E27; - public static final int GL_CURRENT_TIME_NV = 0x8E28; - public static final int GL_NUM_FILL_STREAMS_NV = 0x8E29; - public static final int GL_PRESENT_TIME_NV = 0x8E2A; - public static final int GL_PRESENT_DURATION_NV = 0x8E2B; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_present_video) return; - ext.glPresentFrameKeyedNV = load.invoke("glPresentFrameKeyedNV", ofVoid(JAVA_INT, JAVA_LONG, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glPresentFrameDualFillNV = load.invoke("glPresentFrameDualFillNV", ofVoid(JAVA_INT, JAVA_LONG, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetVideoivNV = load.invoke("glGetVideoivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVideouivNV = load.invoke("glGetVideouivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVideoi64vNV = load.invoke("glGetVideoi64vNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVideoui64vNV = load.invoke("glGetVideoui64vNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static void glPresentFrameKeyedNV(int video_slot, long minPresentTime, int beginPresentTimeId, int presentDurationId, int type, int target0, int fill0, int key0, int target1, int fill1, int key1) { - final var ext = getExtCapabilities(); - try { - check(ext.glPresentFrameKeyedNV).invokeExact(video_slot, minPresentTime, beginPresentTimeId, presentDurationId, type, target0, fill0, key0, target1, fill1, key1); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLNVPresentVideo { + int GL_FRAME_NV = 0x8E26; + int GL_FIELDS_NV = 0x8E27; + int GL_CURRENT_TIME_NV = 0x8E28; + int GL_NUM_FILL_STREAMS_NV = 0x8E29; + int GL_PRESENT_TIME_NV = 0x8E2A; + int GL_PRESENT_DURATION_NV = 0x8E2B; + + default void glPresentFrameKeyedNV(int video_slot, long minPresentTime, int beginPresentTimeId, int presentDurationId, int type, int target0, int fill0, int key0, int target1, int fill1, int key1) { + throw new ContextException(); } - public static void glPresentFrameDualFillNV(int video_slot, long minPresentTime, int beginPresentTimeId, int presentDurationId, int type, int target0, int fill0, int target1, int fill1, int target2, int fill2, int target3, int fill3) { - final var ext = getExtCapabilities(); - try { - check(ext.glPresentFrameDualFillNV).invokeExact(video_slot, minPresentTime, beginPresentTimeId, presentDurationId, type, target0, fill0, target1, fill1, target2, fill2, target3, fill3); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPresentFrameDualFillNV(int video_slot, long minPresentTime, int beginPresentTimeId, int presentDurationId, int type, int target0, int fill0, int target1, int fill1, int target2, int fill2, int target3, int fill3) { + throw new ContextException(); } - public static void glGetVideoivNV(int video_slot, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVideoivNV).invokeExact(video_slot, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVideoivNV(int video_slot, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetVideouivNV(int video_slot, int pname, @NativeType("GLuint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVideouivNV).invokeExact(video_slot, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVideouivNV(int video_slot, int pname, @NativeType("GLuint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetVideoi64vNV(int video_slot, int pname, @NativeType("GLint64EXT *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVideoi64vNV).invokeExact(video_slot, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVideoi64vNV(int video_slot, int pname, @NativeType("GLint64EXT *") MemorySegment params) { + throw new ContextException(); } - public static void glGetVideoui64vNV(int video_slot, int pname, @NativeType("GLuint64EXT *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVideoui64vNV).invokeExact(video_slot, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVideoui64vNV(int video_slot, int pname, @NativeType("GLuint64EXT *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPrimitiveRestart.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPrimitiveRestart.java index 170f31db..e0e781a0 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPrimitiveRestart.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPrimitiveRestart.java @@ -16,38 +16,23 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_primitive_restart} */ -public final class GLNVPrimitiveRestart { - public static final int GL_PRIMITIVE_RESTART_NV = 0x8558; - public static final int GL_PRIMITIVE_RESTART_INDEX_NV = 0x8559; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_primitive_restart) return; - ext.glPrimitiveRestartNV = load.invoke("glPrimitiveRestartNV", ofVoid()); - ext.glPrimitiveRestartIndexNV = load.invoke("glPrimitiveRestartIndexNV", ofVoid(JAVA_INT)); - } +public interface GLNVPrimitiveRestart { + int GL_PRIMITIVE_RESTART_NV = 0x8558; + int GL_PRIMITIVE_RESTART_INDEX_NV = 0x8559; - public static void glPrimitiveRestartNV() { - final var ext = getExtCapabilities(); - try { - check(ext.glPrimitiveRestartNV).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPrimitiveRestartNV() { + throw new ContextException(); } - public static void glPrimitiveRestartIndexNV(int index) { - final var ext = getExtCapabilities(); - try { - check(ext.glPrimitiveRestartIndexNV).invokeExact(index); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPrimitiveRestartIndexNV(int index) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPrimitiveShadingRate.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPrimitiveShadingRate.java index 9bc7af3c..4a55640c 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPrimitiveShadingRate.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVPrimitiveShadingRate.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_primitive_shading_rate} */ -public final class GLNVPrimitiveShadingRate { - public static final int GL_SHADING_RATE_IMAGE_PER_PRIMITIVE_NV = 0x95B1; - public static final int GL_SHADING_RATE_IMAGE_PALETTE_COUNT_NV = 0x95B2; +public interface GLNVPrimitiveShadingRate { + int GL_SHADING_RATE_IMAGE_PER_PRIMITIVE_NV = 0x95B1; + int GL_SHADING_RATE_IMAGE_PALETTE_COUNT_NV = 0x95B2; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVQueryResource.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVQueryResource.java index ced4cffb..3672358b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVQueryResource.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVQueryResource.java @@ -16,35 +16,23 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_query_resource} */ -public final class GLNVQueryResource { - public static final int GL_QUERY_RESOURCE_TYPE_VIDMEM_ALLOC_NV = 0x9540; - public static final int GL_QUERY_RESOURCE_MEMTYPE_VIDMEM_NV = 0x9542; - public static final int GL_QUERY_RESOURCE_SYS_RESERVED_NV = 0x9544; - public static final int GL_QUERY_RESOURCE_TEXTURE_NV = 0x9545; - public static final int GL_QUERY_RESOURCE_RENDERBUFFER_NV = 0x9546; - public static final int GL_QUERY_RESOURCE_BUFFEROBJECT_NV = 0x9547; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_query_resource) return; - ext.glQueryResourceNV = load.invoke("glQueryResourceNV", of(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLNVQueryResource { + int GL_QUERY_RESOURCE_TYPE_VIDMEM_ALLOC_NV = 0x9540; + int GL_QUERY_RESOURCE_MEMTYPE_VIDMEM_NV = 0x9542; + int GL_QUERY_RESOURCE_SYS_RESERVED_NV = 0x9544; + int GL_QUERY_RESOURCE_TEXTURE_NV = 0x9545; + int GL_QUERY_RESOURCE_RENDERBUFFER_NV = 0x9546; + int GL_QUERY_RESOURCE_BUFFEROBJECT_NV = 0x9547; - public static int glQueryResourceNV(int queryType, int tagId, int count, @NativeType("GLint *") MemorySegment buffer) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glQueryResourceNV).invokeExact(queryType, tagId, count, buffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glQueryResourceNV(int queryType, int tagId, int count, @NativeType("GLint *") MemorySegment buffer) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVQueryResourceTag.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVQueryResourceTag.java index 3d5b7348..c64a77d5 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVQueryResourceTag.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVQueryResourceTag.java @@ -16,44 +16,25 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_query_resource_tag} */ -public final class GLNVQueryResourceTag { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_query_resource_tag) return; - ext.glGenQueryResourceTagNV = load.invoke("glGenQueryResourceTagNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glDeleteQueryResourceTagNV = load.invoke("glDeleteQueryResourceTagNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glQueryResourceTagNV = load.invoke("glQueryResourceTagNV", ofVoid(JAVA_INT, ADDRESS)); - } +public interface GLNVQueryResourceTag { - public static void glGenQueryResourceTagNV(int n, @NativeType("GLint *") MemorySegment tagIds) { - final var ext = getExtCapabilities(); - try { - check(ext.glGenQueryResourceTagNV).invokeExact(n, tagIds); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGenQueryResourceTagNV(int n, @NativeType("GLint *") MemorySegment tagIds) { + throw new ContextException(); } - public static void glDeleteQueryResourceTagNV(int n, @NativeType("const GLint *") MemorySegment tagIds) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteQueryResourceTagNV).invokeExact(n, tagIds); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDeleteQueryResourceTagNV(int n, @NativeType("const GLint *") MemorySegment tagIds) { + throw new ContextException(); } - public static void glQueryResourceTagNV(int tagId, @NativeType("const GLchar *") MemorySegment tagString) { - final var ext = getExtCapabilities(); - try { - check(ext.glQueryResourceTagNV).invokeExact(tagId, tagString); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glQueryResourceTagNV(int tagId, @NativeType("const GLchar *") MemorySegment tagString) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVRegisterCombiners.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVRegisterCombiners.java index 6a407815..dda059e8 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVRegisterCombiners.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVRegisterCombiners.java @@ -16,173 +16,114 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_register_combiners} */ -public final class GLNVRegisterCombiners { - public static final int GL_REGISTER_COMBINERS_NV = 0x8522; - public static final int GL_VARIABLE_A_NV = 0x8523; - public static final int GL_VARIABLE_B_NV = 0x8524; - public static final int GL_VARIABLE_C_NV = 0x8525; - public static final int GL_VARIABLE_D_NV = 0x8526; - public static final int GL_VARIABLE_E_NV = 0x8527; - public static final int GL_VARIABLE_F_NV = 0x8528; - public static final int GL_VARIABLE_G_NV = 0x8529; - public static final int GL_CONSTANT_COLOR0_NV = 0x852A; - public static final int GL_CONSTANT_COLOR1_NV = 0x852B; - public static final int GL_SPARE0_NV = 0x852E; - public static final int GL_SPARE1_NV = 0x852F; - public static final int GL_DISCARD_NV = 0x8530; - public static final int GL_E_TIMES_F_NV = 0x8531; - public static final int GL_SPARE0_PLUS_SECONDARY_COLOR_NV = 0x8532; - public static final int GL_UNSIGNED_IDENTITY_NV = 0x8536; - public static final int GL_UNSIGNED_INVERT_NV = 0x8537; - public static final int GL_EXPAND_NORMAL_NV = 0x8538; - public static final int GL_EXPAND_NEGATE_NV = 0x8539; - public static final int GL_HALF_BIAS_NORMAL_NV = 0x853A; - public static final int GL_HALF_BIAS_NEGATE_NV = 0x853B; - public static final int GL_SIGNED_IDENTITY_NV = 0x853C; - public static final int GL_SIGNED_NEGATE_NV = 0x853D; - public static final int GL_SCALE_BY_TWO_NV = 0x853E; - public static final int GL_SCALE_BY_FOUR_NV = 0x853F; - public static final int GL_SCALE_BY_ONE_HALF_NV = 0x8540; - public static final int GL_BIAS_BY_NEGATIVE_ONE_HALF_NV = 0x8541; - public static final int GL_COMBINER_INPUT_NV = 0x8542; - public static final int GL_COMBINER_MAPPING_NV = 0x8543; - public static final int GL_COMBINER_COMPONENT_USAGE_NV = 0x8544; - public static final int GL_COMBINER_AB_DOT_PRODUCT_NV = 0x8545; - public static final int GL_COMBINER_CD_DOT_PRODUCT_NV = 0x8546; - public static final int GL_COMBINER_MUX_SUM_NV = 0x8547; - public static final int GL_COMBINER_SCALE_NV = 0x8548; - public static final int GL_COMBINER_BIAS_NV = 0x8549; - public static final int GL_COMBINER_AB_OUTPUT_NV = 0x854A; - public static final int GL_COMBINER_CD_OUTPUT_NV = 0x854B; - public static final int GL_COMBINER_SUM_OUTPUT_NV = 0x854C; - public static final int GL_MAX_GENERAL_COMBINERS_NV = 0x854D; - public static final int GL_NUM_GENERAL_COMBINERS_NV = 0x854E; - public static final int GL_COLOR_SUM_CLAMP_NV = 0x854F; - public static final int GL_COMBINER0_NV = 0x8550; - public static final int GL_COMBINER1_NV = 0x8551; - public static final int GL_COMBINER2_NV = 0x8552; - public static final int GL_COMBINER3_NV = 0x8553; - public static final int GL_COMBINER4_NV = 0x8554; - public static final int GL_COMBINER5_NV = 0x8555; - public static final int GL_COMBINER6_NV = 0x8556; - public static final int GL_COMBINER7_NV = 0x8557; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_register_combiners) return; - ext.glCombinerParameterfvNV = load.invoke("glCombinerParameterfvNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glCombinerParameterfNV = load.invoke("glCombinerParameterfNV", ofVoid(JAVA_INT, JAVA_FLOAT)); - ext.glCombinerParameterivNV = load.invoke("glCombinerParameterivNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glCombinerParameteriNV = load.invoke("glCombinerParameteriNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glCombinerInputNV = load.invoke("glCombinerInputNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glCombinerOutputNV = load.invoke("glCombinerOutputNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, JAVA_BYTE, JAVA_BYTE)); - ext.glFinalCombinerInputNV = load.invoke("glFinalCombinerInputNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetCombinerInputParameterfvNV = load.invoke("glGetCombinerInputParameterfvNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetCombinerInputParameterivNV = load.invoke("glGetCombinerInputParameterivNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetCombinerOutputParameterfvNV = load.invoke("glGetCombinerOutputParameterfvNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetCombinerOutputParameterivNV = load.invoke("glGetCombinerOutputParameterivNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetFinalCombinerInputParameterfvNV = load.invoke("glGetFinalCombinerInputParameterfvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetFinalCombinerInputParameterivNV = load.invoke("glGetFinalCombinerInputParameterivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static void glCombinerParameterfvNV(int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glCombinerParameterfvNV).invokeExact(pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLNVRegisterCombiners { + int GL_REGISTER_COMBINERS_NV = 0x8522; + int GL_VARIABLE_A_NV = 0x8523; + int GL_VARIABLE_B_NV = 0x8524; + int GL_VARIABLE_C_NV = 0x8525; + int GL_VARIABLE_D_NV = 0x8526; + int GL_VARIABLE_E_NV = 0x8527; + int GL_VARIABLE_F_NV = 0x8528; + int GL_VARIABLE_G_NV = 0x8529; + int GL_CONSTANT_COLOR0_NV = 0x852A; + int GL_CONSTANT_COLOR1_NV = 0x852B; + int GL_SPARE0_NV = 0x852E; + int GL_SPARE1_NV = 0x852F; + int GL_DISCARD_NV = 0x8530; + int GL_E_TIMES_F_NV = 0x8531; + int GL_SPARE0_PLUS_SECONDARY_COLOR_NV = 0x8532; + int GL_UNSIGNED_IDENTITY_NV = 0x8536; + int GL_UNSIGNED_INVERT_NV = 0x8537; + int GL_EXPAND_NORMAL_NV = 0x8538; + int GL_EXPAND_NEGATE_NV = 0x8539; + int GL_HALF_BIAS_NORMAL_NV = 0x853A; + int GL_HALF_BIAS_NEGATE_NV = 0x853B; + int GL_SIGNED_IDENTITY_NV = 0x853C; + int GL_SIGNED_NEGATE_NV = 0x853D; + int GL_SCALE_BY_TWO_NV = 0x853E; + int GL_SCALE_BY_FOUR_NV = 0x853F; + int GL_SCALE_BY_ONE_HALF_NV = 0x8540; + int GL_BIAS_BY_NEGATIVE_ONE_HALF_NV = 0x8541; + int GL_COMBINER_INPUT_NV = 0x8542; + int GL_COMBINER_MAPPING_NV = 0x8543; + int GL_COMBINER_COMPONENT_USAGE_NV = 0x8544; + int GL_COMBINER_AB_DOT_PRODUCT_NV = 0x8545; + int GL_COMBINER_CD_DOT_PRODUCT_NV = 0x8546; + int GL_COMBINER_MUX_SUM_NV = 0x8547; + int GL_COMBINER_SCALE_NV = 0x8548; + int GL_COMBINER_BIAS_NV = 0x8549; + int GL_COMBINER_AB_OUTPUT_NV = 0x854A; + int GL_COMBINER_CD_OUTPUT_NV = 0x854B; + int GL_COMBINER_SUM_OUTPUT_NV = 0x854C; + int GL_MAX_GENERAL_COMBINERS_NV = 0x854D; + int GL_NUM_GENERAL_COMBINERS_NV = 0x854E; + int GL_COLOR_SUM_CLAMP_NV = 0x854F; + int GL_COMBINER0_NV = 0x8550; + int GL_COMBINER1_NV = 0x8551; + int GL_COMBINER2_NV = 0x8552; + int GL_COMBINER3_NV = 0x8553; + int GL_COMBINER4_NV = 0x8554; + int GL_COMBINER5_NV = 0x8555; + int GL_COMBINER6_NV = 0x8556; + int GL_COMBINER7_NV = 0x8557; + + default void glCombinerParameterfvNV(int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glCombinerParameterfNV(int pname, float param) { - final var ext = getExtCapabilities(); - try { - check(ext.glCombinerParameterfNV).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCombinerParameterfNV(int pname, float param) { + throw new ContextException(); } - public static void glCombinerParameterivNV(int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glCombinerParameterivNV).invokeExact(pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCombinerParameterivNV(int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glCombinerParameteriNV(int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glCombinerParameteriNV).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCombinerParameteriNV(int pname, int param) { + throw new ContextException(); } - public static void glCombinerInputNV(int stage, int portion, int variable, int input, int mapping, int componentUsage) { - final var ext = getExtCapabilities(); - try { - check(ext.glCombinerInputNV).invokeExact(stage, portion, variable, input, mapping, componentUsage); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCombinerInputNV(int stage, int portion, int variable, int input, int mapping, int componentUsage) { + throw new ContextException(); } - public static void glCombinerOutputNV(int stage, int portion, int abOutput, int cdOutput, int sumOutput, int scale, int bias, boolean abDotProduct, boolean cdDotProduct, boolean muxSum) { - final var ext = getExtCapabilities(); - try { - check(ext.glCombinerOutputNV).invokeExact(stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCombinerOutputNV(int stage, int portion, int abOutput, int cdOutput, int sumOutput, int scale, int bias, boolean abDotProduct, boolean cdDotProduct, boolean muxSum) { + throw new ContextException(); } - public static void glFinalCombinerInputNV(int variable, int input, int mapping, int componentUsage) { - final var ext = getExtCapabilities(); - try { - check(ext.glFinalCombinerInputNV).invokeExact(variable, input, mapping, componentUsage); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFinalCombinerInputNV(int variable, int input, int mapping, int componentUsage) { + throw new ContextException(); } - public static void glGetCombinerInputParameterfvNV(int stage, int portion, int variable, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetCombinerInputParameterfvNV).invokeExact(stage, portion, variable, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetCombinerInputParameterfvNV(int stage, int portion, int variable, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetCombinerInputParameterivNV(int stage, int portion, int variable, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetCombinerInputParameterivNV).invokeExact(stage, portion, variable, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetCombinerInputParameterivNV(int stage, int portion, int variable, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetCombinerOutputParameterfvNV(int stage, int portion, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetCombinerOutputParameterfvNV).invokeExact(stage, portion, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetCombinerOutputParameterfvNV(int stage, int portion, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetCombinerOutputParameterivNV(int stage, int portion, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetCombinerOutputParameterivNV).invokeExact(stage, portion, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetCombinerOutputParameterivNV(int stage, int portion, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetFinalCombinerInputParameterfvNV(int variable, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetFinalCombinerInputParameterfvNV).invokeExact(variable, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetFinalCombinerInputParameterfvNV(int variable, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetFinalCombinerInputParameterivNV(int variable, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetFinalCombinerInputParameterivNV).invokeExact(variable, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetFinalCombinerInputParameterivNV(int variable, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVRegisterCombiners2.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVRegisterCombiners2.java index 3b2add9c..710ead58 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVRegisterCombiners2.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVRegisterCombiners2.java @@ -16,37 +16,22 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_register_combiners2} */ -public final class GLNVRegisterCombiners2 { - public static final int GL_PER_STAGE_CONSTANTS_NV = 0x8535; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_register_combiners2) return; - ext.glCombinerStageParameterfvNV = load.invoke("glCombinerStageParameterfvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetCombinerStageParameterfvNV = load.invoke("glGetCombinerStageParameterfvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLNVRegisterCombiners2 { + int GL_PER_STAGE_CONSTANTS_NV = 0x8535; - public static void glCombinerStageParameterfvNV(int stage, int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glCombinerStageParameterfvNV).invokeExact(stage, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCombinerStageParameterfvNV(int stage, int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetCombinerStageParameterfvNV(int stage, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetCombinerStageParameterfvNV).invokeExact(stage, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetCombinerStageParameterfvNV(int stage, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVRepresentativeFragmentTest.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVRepresentativeFragmentTest.java index b951deb0..d3d22cf1 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVRepresentativeFragmentTest.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVRepresentativeFragmentTest.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_representative_fragment_test} */ -public final class GLNVRepresentativeFragmentTest { - public static final int GL_REPRESENTATIVE_FRAGMENT_TEST_NV = 0x937F; +public interface GLNVRepresentativeFragmentTest { + int GL_REPRESENTATIVE_FRAGMENT_TEST_NV = 0x937F; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVRobustnessVideoMemoryPurge.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVRobustnessVideoMemoryPurge.java index d8cfd7b5..bca65ef9 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVRobustnessVideoMemoryPurge.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVRobustnessVideoMemoryPurge.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_robustness_video_memory_purge} */ -public final class GLNVRobustnessVideoMemoryPurge { - public static final int GL_PURGED_CONTEXT_RESET_NV = 0x92BB; +public interface GLNVRobustnessVideoMemoryPurge { + int GL_PURGED_CONTEXT_RESET_NV = 0x92BB; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVSampleLocations.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVSampleLocations.java index 9edb09fe..d476b01a 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVSampleLocations.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVSampleLocations.java @@ -16,52 +16,33 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_sample_locations} */ -public final class GLNVSampleLocations { - public static final int GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV = 0x933D; - public static final int GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV = 0x933E; - public static final int GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV = 0x933F; - public static final int GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV = 0x9340; - public static final int GL_SAMPLE_LOCATION_NV = 0x8E50; - public static final int GL_PROGRAMMABLE_SAMPLE_LOCATION_NV = 0x9341; - public static final int GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV = 0x9342; - public static final int GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV = 0x9343; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_sample_locations) return; - ext.glFramebufferSampleLocationsfvNV = load.invoke("glFramebufferSampleLocationsfvNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glNamedFramebufferSampleLocationsfvNV = load.invoke("glNamedFramebufferSampleLocationsfvNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glResolveDepthValuesNV = load.invoke("glResolveDepthValuesNV", ofVoid()); - } +public interface GLNVSampleLocations { + int GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV = 0x933D; + int GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV = 0x933E; + int GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV = 0x933F; + int GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV = 0x9340; + int GL_SAMPLE_LOCATION_NV = 0x8E50; + int GL_PROGRAMMABLE_SAMPLE_LOCATION_NV = 0x9341; + int GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV = 0x9342; + int GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV = 0x9343; - public static void glFramebufferSampleLocationsfvNV(int target, int start, int count, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glFramebufferSampleLocationsfvNV).invokeExact(target, start, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFramebufferSampleLocationsfvNV(int target, int start, int count, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glNamedFramebufferSampleLocationsfvNV(int framebuffer, int start, int count, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glNamedFramebufferSampleLocationsfvNV).invokeExact(framebuffer, start, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNamedFramebufferSampleLocationsfvNV(int framebuffer, int start, int count, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glResolveDepthValuesNV() { - final var ext = getExtCapabilities(); - try { - check(ext.glResolveDepthValuesNV).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glResolveDepthValuesNV() { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVScissorExclusive.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVScissorExclusive.java index f3688775..66124796 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVScissorExclusive.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVScissorExclusive.java @@ -16,38 +16,23 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_scissor_exclusive} */ -public final class GLNVScissorExclusive { - public static final int GL_SCISSOR_TEST_EXCLUSIVE_NV = 0x9555; - public static final int GL_SCISSOR_BOX_EXCLUSIVE_NV = 0x9556; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_scissor_exclusive) return; - ext.glScissorExclusiveNV = load.invoke("glScissorExclusiveNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glScissorExclusiveArrayvNV = load.invoke("glScissorExclusiveArrayvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLNVScissorExclusive { + int GL_SCISSOR_TEST_EXCLUSIVE_NV = 0x9555; + int GL_SCISSOR_BOX_EXCLUSIVE_NV = 0x9556; - public static void glScissorExclusiveNV(int x, int y, int width, int height) { - final var ext = getExtCapabilities(); - try { - check(ext.glScissorExclusiveNV).invokeExact(x, y, width, height); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glScissorExclusiveNV(int x, int y, int width, int height) { + throw new ContextException(); } - public static void glScissorExclusiveArrayvNV(int first, int count, @NativeType("const GLint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glScissorExclusiveArrayvNV).invokeExact(first, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glScissorExclusiveArrayvNV(int first, int count, @NativeType("const GLint *") MemorySegment v) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVShaderBufferLoad.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVShaderBufferLoad.java index 3983228f..102b1421 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVShaderBufferLoad.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVShaderBufferLoad.java @@ -16,129 +16,68 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_shader_buffer_load} */ -public final class GLNVShaderBufferLoad { - public static final int GL_BUFFER_GPU_ADDRESS_NV = 0x8F1D; - public static final int GL_GPU_ADDRESS_NV = 0x8F34; - public static final int GL_MAX_SHADER_BUFFER_ADDRESS_NV = 0x8F35; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_shader_buffer_load) return; - ext.glMakeBufferResidentNV = load.invoke("glMakeBufferResidentNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glMakeBufferNonResidentNV = load.invoke("glMakeBufferNonResidentNV", ofVoid(JAVA_INT)); - ext.glIsBufferResidentNV = load.invoke("glIsBufferResidentNV", of(JAVA_BYTE, JAVA_INT)); - ext.glMakeNamedBufferResidentNV = load.invoke("glMakeNamedBufferResidentNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glMakeNamedBufferNonResidentNV = load.invoke("glMakeNamedBufferNonResidentNV", ofVoid(JAVA_INT)); - ext.glIsNamedBufferResidentNV = load.invoke("glIsNamedBufferResidentNV", of(JAVA_BYTE, JAVA_INT)); - ext.glGetBufferParameterui64vNV = load.invoke("glGetBufferParameterui64vNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetNamedBufferParameterui64vNV = load.invoke("glGetNamedBufferParameterui64vNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetIntegerui64vNV = load.invoke("glGetIntegerui64vNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glUniformui64NV = load.invoke("glUniformui64NV", ofVoid(JAVA_INT, JAVA_LONG)); - ext.glUniformui64vNV = load.invoke("glUniformui64vNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramUniformui64NV = load.invoke("glProgramUniformui64NV", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glProgramUniformui64vNV = load.invoke("glProgramUniformui64vNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLNVShaderBufferLoad { + int GL_BUFFER_GPU_ADDRESS_NV = 0x8F1D; + int GL_GPU_ADDRESS_NV = 0x8F34; + int GL_MAX_SHADER_BUFFER_ADDRESS_NV = 0x8F35; - public static void glMakeBufferResidentNV(int target, int access) { - final var ext = getExtCapabilities(); - try { - check(ext.glMakeBufferResidentNV).invokeExact(target, access); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMakeBufferResidentNV(int target, int access) { + throw new ContextException(); } - public static void glMakeBufferNonResidentNV(int target) { - final var ext = getExtCapabilities(); - try { - check(ext.glMakeBufferNonResidentNV).invokeExact(target); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMakeBufferNonResidentNV(int target) { + throw new ContextException(); } - public static boolean glIsBufferResidentNV(int target) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsBufferResidentNV).invokeExact(target); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsBufferResidentNV(int target) { + throw new ContextException(); } - public static void glMakeNamedBufferResidentNV(int buffer, int access) { - final var ext = getExtCapabilities(); - try { - check(ext.glMakeNamedBufferResidentNV).invokeExact(buffer, access); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMakeNamedBufferResidentNV(int buffer, int access) { + throw new ContextException(); } - public static void glMakeNamedBufferNonResidentNV(int buffer) { - final var ext = getExtCapabilities(); - try { - check(ext.glMakeNamedBufferNonResidentNV).invokeExact(buffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMakeNamedBufferNonResidentNV(int buffer) { + throw new ContextException(); } - public static boolean glIsNamedBufferResidentNV(int buffer) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsNamedBufferResidentNV).invokeExact(buffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsNamedBufferResidentNV(int buffer) { + throw new ContextException(); } - public static void glGetBufferParameterui64vNV(int target, int pname, @NativeType("GLuint64EXT *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetBufferParameterui64vNV).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetBufferParameterui64vNV(int target, int pname, @NativeType("GLuint64EXT *") MemorySegment params) { + throw new ContextException(); } - public static void glGetNamedBufferParameterui64vNV(int buffer, int pname, @NativeType("GLuint64EXT *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetNamedBufferParameterui64vNV).invokeExact(buffer, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetNamedBufferParameterui64vNV(int buffer, int pname, @NativeType("GLuint64EXT *") MemorySegment params) { + throw new ContextException(); } - public static void glGetIntegerui64vNV(int value, @NativeType("GLuint64EXT *") MemorySegment result) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetIntegerui64vNV).invokeExact(value, result); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetIntegerui64vNV(int value, @NativeType("GLuint64EXT *") MemorySegment result) { + throw new ContextException(); } - public static void glUniformui64NV(int location, long value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniformui64NV).invokeExact(location, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniformui64NV(int location, long value) { + throw new ContextException(); } - public static void glUniformui64vNV(int location, int count, @NativeType("const GLuint64EXT *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glUniformui64vNV).invokeExact(location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUniformui64vNV(int location, int count, @NativeType("const GLuint64EXT *") MemorySegment value) { + throw new ContextException(); } - public static void glProgramUniformui64NV(int program, int location, long value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformui64NV).invokeExact(program, location, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformui64NV(int program, int location, long value) { + throw new ContextException(); } - public static void glProgramUniformui64vNV(int program, int location, int count, @NativeType("const GLuint64EXT *") MemorySegment value) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramUniformui64vNV).invokeExact(program, location, count, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramUniformui64vNV(int program, int location, int count, @NativeType("const GLuint64EXT *") MemorySegment value) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVShaderBufferStore.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVShaderBufferStore.java index 749f3776..9f21e619 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVShaderBufferStore.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVShaderBufferStore.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_shader_buffer_store} */ -public final class GLNVShaderBufferStore { - public static final int GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV = 0x00000010; +public interface GLNVShaderBufferStore { + int GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV = 0x00000010; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVShaderSubgroupPartitioned.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVShaderSubgroupPartitioned.java index 89e25d92..b7e5526b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVShaderSubgroupPartitioned.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVShaderSubgroupPartitioned.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_shader_subgroup_partitioned} */ -public final class GLNVShaderSubgroupPartitioned { - public static final int GL_SUBGROUP_FEATURE_PARTITIONED_BIT_NV = 0x00000100; +public interface GLNVShaderSubgroupPartitioned { + int GL_SUBGROUP_FEATURE_PARTITIONED_BIT_NV = 0x00000100; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVShaderThreadGroup.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVShaderThreadGroup.java index 98bfbf57..f690622f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVShaderThreadGroup.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVShaderThreadGroup.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_shader_thread_group} */ -public final class GLNVShaderThreadGroup { - public static final int GL_WARP_SIZE_NV = 0x9339; - public static final int GL_WARPS_PER_SM_NV = 0x933A; - public static final int GL_SM_COUNT_NV = 0x933B; +public interface GLNVShaderThreadGroup { + int GL_WARP_SIZE_NV = 0x9339; + int GL_WARPS_PER_SM_NV = 0x933A; + int GL_SM_COUNT_NV = 0x933B; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVShadingRateImage.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVShadingRateImage.java index 5dd4a6ce..59db8f95 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVShadingRateImage.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVShadingRateImage.java @@ -16,97 +16,62 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_shading_rate_image} */ -public final class GLNVShadingRateImage { - public static final int GL_SHADING_RATE_IMAGE_NV = 0x9563; - public static final int GL_SHADING_RATE_NO_INVOCATIONS_NV = 0x9564; - public static final int GL_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV = 0x9565; - public static final int GL_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV = 0x9566; - public static final int GL_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV = 0x9567; - public static final int GL_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV = 0x9568; - public static final int GL_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV = 0x9569; - public static final int GL_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV = 0x956A; - public static final int GL_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV = 0x956B; - public static final int GL_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV = 0x956C; - public static final int GL_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV = 0x956D; - public static final int GL_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV = 0x956E; - public static final int GL_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV = 0x956F; - public static final int GL_SHADING_RATE_IMAGE_BINDING_NV = 0x955B; - public static final int GL_SHADING_RATE_IMAGE_TEXEL_WIDTH_NV = 0x955C; - public static final int GL_SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV = 0x955D; - public static final int GL_SHADING_RATE_IMAGE_PALETTE_SIZE_NV = 0x955E; - public static final int GL_MAX_COARSE_FRAGMENT_SAMPLES_NV = 0x955F; - public static final int GL_SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV = 0x95AE; - public static final int GL_SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV = 0x95AF; - public static final int GL_SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV = 0x95B0; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_shading_rate_image) return; - ext.glBindShadingRateImageNV = load.invoke("glBindShadingRateImageNV", ofVoid(JAVA_INT)); - ext.glGetShadingRateImagePaletteNV = load.invoke("glGetShadingRateImagePaletteNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetShadingRateSampleLocationivNV = load.invoke("glGetShadingRateSampleLocationivNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glShadingRateImageBarrierNV = load.invoke("glShadingRateImageBarrierNV", ofVoid(JAVA_BYTE)); - ext.glShadingRateImagePaletteNV = load.invoke("glShadingRateImagePaletteNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glShadingRateSampleOrderNV = load.invoke("glShadingRateSampleOrderNV", ofVoid(JAVA_INT)); - ext.glShadingRateSampleOrderCustomNV = load.invoke("glShadingRateSampleOrderCustomNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLNVShadingRateImage { + int GL_SHADING_RATE_IMAGE_NV = 0x9563; + int GL_SHADING_RATE_NO_INVOCATIONS_NV = 0x9564; + int GL_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV = 0x9565; + int GL_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV = 0x9566; + int GL_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV = 0x9567; + int GL_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV = 0x9568; + int GL_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV = 0x9569; + int GL_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV = 0x956A; + int GL_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV = 0x956B; + int GL_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV = 0x956C; + int GL_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV = 0x956D; + int GL_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV = 0x956E; + int GL_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV = 0x956F; + int GL_SHADING_RATE_IMAGE_BINDING_NV = 0x955B; + int GL_SHADING_RATE_IMAGE_TEXEL_WIDTH_NV = 0x955C; + int GL_SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV = 0x955D; + int GL_SHADING_RATE_IMAGE_PALETTE_SIZE_NV = 0x955E; + int GL_MAX_COARSE_FRAGMENT_SAMPLES_NV = 0x955F; + int GL_SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV = 0x95AE; + int GL_SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV = 0x95AF; + int GL_SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV = 0x95B0; - public static void glBindShadingRateImageNV(int texture) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindShadingRateImageNV).invokeExact(texture); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBindShadingRateImageNV(int texture) { + throw new ContextException(); } - public static void glGetShadingRateImagePaletteNV(int viewport, int entry, @NativeType("GLenum *") MemorySegment rate) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetShadingRateImagePaletteNV).invokeExact(viewport, entry, rate); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetShadingRateImagePaletteNV(int viewport, int entry, @NativeType("GLenum *") MemorySegment rate) { + throw new ContextException(); } - public static void glGetShadingRateSampleLocationivNV(int rate, int samples, int index, @NativeType("GLint *") MemorySegment location) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetShadingRateSampleLocationivNV).invokeExact(rate, samples, index, location); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetShadingRateSampleLocationivNV(int rate, int samples, int index, @NativeType("GLint *") MemorySegment location) { + throw new ContextException(); } - public static void glShadingRateImageBarrierNV(boolean synchronize) { - final var ext = getExtCapabilities(); - try { - check(ext.glShadingRateImageBarrierNV).invokeExact(synchronize); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glShadingRateImageBarrierNV(boolean synchronize) { + throw new ContextException(); } - public static void glShadingRateImagePaletteNV(int viewport, int first, int count, @NativeType("const GLenum *") MemorySegment rates) { - final var ext = getExtCapabilities(); - try { - check(ext.glShadingRateImagePaletteNV).invokeExact(viewport, first, count, rates); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glShadingRateImagePaletteNV(int viewport, int first, int count, @NativeType("const GLenum *") MemorySegment rates) { + throw new ContextException(); } - public static void glShadingRateSampleOrderNV(int order) { - final var ext = getExtCapabilities(); - try { - check(ext.glShadingRateSampleOrderNV).invokeExact(order); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glShadingRateSampleOrderNV(int order) { + throw new ContextException(); } - public static void glShadingRateSampleOrderCustomNV(int rate, int samples, @NativeType("const GLint *") MemorySegment locations) { - final var ext = getExtCapabilities(); - try { - check(ext.glShadingRateSampleOrderCustomNV).invokeExact(rate, samples, locations); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glShadingRateSampleOrderCustomNV(int rate, int samples, @NativeType("const GLint *") MemorySegment locations) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTessellationProgram5.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTessellationProgram5.java index 47bb0870..8cadd98f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTessellationProgram5.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTessellationProgram5.java @@ -16,21 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_tessellation_program5} */ -public final class GLNVTessellationProgram5 { - public static final int GL_MAX_PROGRAM_PATCH_ATTRIBS_NV = 0x86D8; - public static final int GL_TESS_CONTROL_PROGRAM_NV = 0x891E; - public static final int GL_TESS_EVALUATION_PROGRAM_NV = 0x891F; - public static final int GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV = 0x8C74; - public static final int GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV = 0x8C75; +public interface GLNVTessellationProgram5 { + int GL_MAX_PROGRAM_PATCH_ATTRIBS_NV = 0x86D8; + int GL_TESS_CONTROL_PROGRAM_NV = 0x891E; + int GL_TESS_EVALUATION_PROGRAM_NV = 0x891F; + int GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV = 0x8C74; + int GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV = 0x8C75; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTexgenEmboss.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTexgenEmboss.java index c43382bb..9d700d14 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTexgenEmboss.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTexgenEmboss.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_texgen_emboss} */ -public final class GLNVTexgenEmboss { - public static final int GL_EMBOSS_LIGHT_NV = 0x855D; - public static final int GL_EMBOSS_CONSTANT_NV = 0x855E; - public static final int GL_EMBOSS_MAP_NV = 0x855F; +public interface GLNVTexgenEmboss { + int GL_EMBOSS_LIGHT_NV = 0x855D; + int GL_EMBOSS_CONSTANT_NV = 0x855E; + int GL_EMBOSS_MAP_NV = 0x855F; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTexgenReflection.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTexgenReflection.java index 7b091106..3be22e77 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTexgenReflection.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTexgenReflection.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_texgen_reflection} */ -public final class GLNVTexgenReflection { - public static final int GL_NORMAL_MAP_NV = 0x8511; - public static final int GL_REFLECTION_MAP_NV = 0x8512; +public interface GLNVTexgenReflection { + int GL_NORMAL_MAP_NV = 0x8511; + int GL_REFLECTION_MAP_NV = 0x8512; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureBarrier.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureBarrier.java index 8670511c..28200c80 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureBarrier.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureBarrier.java @@ -16,28 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_texture_barrier} */ -public final class GLNVTextureBarrier { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_texture_barrier) return; - ext.glTextureBarrierNV = load.invoke("glTextureBarrierNV", ofVoid()); - } +public interface GLNVTextureBarrier { - public static void glTextureBarrierNV() { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureBarrierNV).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureBarrierNV() { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureEnvCombine4.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureEnvCombine4.java index c6eb7080..b5d30b70 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureEnvCombine4.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureEnvCombine4.java @@ -16,21 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_texture_env_combine4} */ -public final class GLNVTextureEnvCombine4 { - public static final int GL_COMBINE4_NV = 0x8503; - public static final int GL_SOURCE3_RGB_NV = 0x8583; - public static final int GL_SOURCE3_ALPHA_NV = 0x858B; - public static final int GL_OPERAND3_RGB_NV = 0x8593; - public static final int GL_OPERAND3_ALPHA_NV = 0x859B; +public interface GLNVTextureEnvCombine4 { + int GL_COMBINE4_NV = 0x8503; + int GL_SOURCE3_RGB_NV = 0x8583; + int GL_SOURCE3_ALPHA_NV = 0x858B; + int GL_OPERAND3_RGB_NV = 0x8593; + int GL_OPERAND3_ALPHA_NV = 0x859B; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureExpandNormal.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureExpandNormal.java index 2df5e36e..c3dcbcc8 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureExpandNormal.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureExpandNormal.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_texture_expand_normal} */ -public final class GLNVTextureExpandNormal { - public static final int GL_TEXTURE_UNSIGNED_REMAP_MODE_NV = 0x888F; +public interface GLNVTextureExpandNormal { + int GL_TEXTURE_UNSIGNED_REMAP_MODE_NV = 0x888F; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureMultisample.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureMultisample.java index b200a9bd..264445c2 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureMultisample.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureMultisample.java @@ -16,70 +16,39 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_texture_multisample} */ -public final class GLNVTextureMultisample { - public static final int GL_TEXTURE_COVERAGE_SAMPLES_NV = 0x9045; - public static final int GL_TEXTURE_COLOR_SAMPLES_NV = 0x9046; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_texture_multisample) return; - ext.glTexImage2DMultisampleCoverageNV = load.invoke("glTexImage2DMultisampleCoverageNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE)); - ext.glTexImage3DMultisampleCoverageNV = load.invoke("glTexImage3DMultisampleCoverageNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE)); - ext.glTextureImage2DMultisampleNV = load.invoke("glTextureImage2DMultisampleNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE)); - ext.glTextureImage3DMultisampleNV = load.invoke("glTextureImage3DMultisampleNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE)); - ext.glTextureImage2DMultisampleCoverageNV = load.invoke("glTextureImage2DMultisampleCoverageNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE)); - ext.glTextureImage3DMultisampleCoverageNV = load.invoke("glTextureImage3DMultisampleCoverageNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE)); - } +public interface GLNVTextureMultisample { + int GL_TEXTURE_COVERAGE_SAMPLES_NV = 0x9045; + int GL_TEXTURE_COLOR_SAMPLES_NV = 0x9046; - public static void glTexImage2DMultisampleCoverageNV(int target, int coverageSamples, int colorSamples, int internalFormat, int width, int height, boolean fixedSampleLocations) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexImage2DMultisampleCoverageNV).invokeExact(target, coverageSamples, colorSamples, internalFormat, width, height, fixedSampleLocations); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexImage2DMultisampleCoverageNV(int target, int coverageSamples, int colorSamples, int internalFormat, int width, int height, boolean fixedSampleLocations) { + throw new ContextException(); } - public static void glTexImage3DMultisampleCoverageNV(int target, int coverageSamples, int colorSamples, int internalFormat, int width, int height, int depth, boolean fixedSampleLocations) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexImage3DMultisampleCoverageNV).invokeExact(target, coverageSamples, colorSamples, internalFormat, width, height, depth, fixedSampleLocations); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexImage3DMultisampleCoverageNV(int target, int coverageSamples, int colorSamples, int internalFormat, int width, int height, int depth, boolean fixedSampleLocations) { + throw new ContextException(); } - public static void glTextureImage2DMultisampleNV(int texture, int target, int samples, int internalFormat, int width, int height, boolean fixedSampleLocations) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureImage2DMultisampleNV).invokeExact(texture, target, samples, internalFormat, width, height, fixedSampleLocations); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureImage2DMultisampleNV(int texture, int target, int samples, int internalFormat, int width, int height, boolean fixedSampleLocations) { + throw new ContextException(); } - public static void glTextureImage3DMultisampleNV(int texture, int target, int samples, int internalFormat, int width, int height, int depth, boolean fixedSampleLocations) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureImage3DMultisampleNV).invokeExact(texture, target, samples, internalFormat, width, height, depth, fixedSampleLocations); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureImage3DMultisampleNV(int texture, int target, int samples, int internalFormat, int width, int height, int depth, boolean fixedSampleLocations) { + throw new ContextException(); } - public static void glTextureImage2DMultisampleCoverageNV(int texture, int target, int coverageSamples, int colorSamples, int internalFormat, int width, int height, boolean fixedSampleLocations) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureImage2DMultisampleCoverageNV).invokeExact(texture, target, coverageSamples, colorSamples, internalFormat, width, height, fixedSampleLocations); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureImage2DMultisampleCoverageNV(int texture, int target, int coverageSamples, int colorSamples, int internalFormat, int width, int height, boolean fixedSampleLocations) { + throw new ContextException(); } - public static void glTextureImage3DMultisampleCoverageNV(int texture, int target, int coverageSamples, int colorSamples, int internalFormat, int width, int height, int depth, boolean fixedSampleLocations) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureImage3DMultisampleCoverageNV).invokeExact(texture, target, coverageSamples, colorSamples, internalFormat, width, height, depth, fixedSampleLocations); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureImage3DMultisampleCoverageNV(int texture, int target, int coverageSamples, int colorSamples, int internalFormat, int width, int height, int depth, boolean fixedSampleLocations) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureRectangle.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureRectangle.java index b46ba94f..18c6e0fe 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureRectangle.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureRectangle.java @@ -16,20 +16,16 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_texture_rectangle} */ -public final class GLNVTextureRectangle { - public static final int GL_TEXTURE_RECTANGLE_NV = 0x84F5; - public static final int GL_TEXTURE_BINDING_RECTANGLE_NV = 0x84F6; - public static final int GL_PROXY_TEXTURE_RECTANGLE_NV = 0x84F7; - public static final int GL_MAX_RECTANGLE_TEXTURE_SIZE_NV = 0x84F8; +public interface GLNVTextureRectangle { + int GL_TEXTURE_RECTANGLE_NV = 0x84F5; + int GL_TEXTURE_BINDING_RECTANGLE_NV = 0x84F6; + int GL_PROXY_TEXTURE_RECTANGLE_NV = 0x84F7; + int GL_MAX_RECTANGLE_TEXTURE_SIZE_NV = 0x84F8; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureShader.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureShader.java index 02e60038..f5730e6a 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureShader.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureShader.java @@ -16,89 +16,85 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_texture_shader} */ -public final class GLNVTextureShader { - public static final int GL_OFFSET_TEXTURE_RECTANGLE_NV = 0x864C; - public static final int GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV = 0x864D; - public static final int GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV = 0x864E; - public static final int GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV = 0x86D9; - public static final int GL_UNSIGNED_INT_S8_S8_8_8_NV = 0x86DA; - public static final int GL_UNSIGNED_INT_8_8_S8_S8_REV_NV = 0x86DB; - public static final int GL_DSDT_MAG_INTENSITY_NV = 0x86DC; - public static final int GL_SHADER_CONSISTENT_NV = 0x86DD; - public static final int GL_TEXTURE_SHADER_NV = 0x86DE; - public static final int GL_SHADER_OPERATION_NV = 0x86DF; - public static final int GL_CULL_MODES_NV = 0x86E0; - public static final int GL_OFFSET_TEXTURE_MATRIX_NV = 0x86E1; - public static final int GL_OFFSET_TEXTURE_SCALE_NV = 0x86E2; - public static final int GL_OFFSET_TEXTURE_BIAS_NV = 0x86E3; - public static final int GL_OFFSET_TEXTURE_2D_MATRIX_NV = 0x86E1; - public static final int GL_OFFSET_TEXTURE_2D_SCALE_NV = 0x86E2; - public static final int GL_OFFSET_TEXTURE_2D_BIAS_NV = 0x86E3; - public static final int GL_PREVIOUS_TEXTURE_INPUT_NV = 0x86E4; - public static final int GL_CONST_EYE_NV = 0x86E5; - public static final int GL_PASS_THROUGH_NV = 0x86E6; - public static final int GL_CULL_FRAGMENT_NV = 0x86E7; - public static final int GL_OFFSET_TEXTURE_2D_NV = 0x86E8; - public static final int GL_DEPENDENT_AR_TEXTURE_2D_NV = 0x86E9; - public static final int GL_DEPENDENT_GB_TEXTURE_2D_NV = 0x86EA; - public static final int GL_DOT_PRODUCT_NV = 0x86EC; - public static final int GL_DOT_PRODUCT_DEPTH_REPLACE_NV = 0x86ED; - public static final int GL_DOT_PRODUCT_TEXTURE_2D_NV = 0x86EE; - public static final int GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV = 0x86F0; - public static final int GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV = 0x86F1; - public static final int GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV = 0x86F2; - public static final int GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV = 0x86F3; - public static final int GL_HILO_NV = 0x86F4; - public static final int GL_DSDT_NV = 0x86F5; - public static final int GL_DSDT_MAG_NV = 0x86F6; - public static final int GL_DSDT_MAG_VIB_NV = 0x86F7; - public static final int GL_HILO16_NV = 0x86F8; - public static final int GL_SIGNED_HILO_NV = 0x86F9; - public static final int GL_SIGNED_HILO16_NV = 0x86FA; - public static final int GL_SIGNED_RGBA_NV = 0x86FB; - public static final int GL_SIGNED_RGBA8_NV = 0x86FC; - public static final int GL_SIGNED_RGB_NV = 0x86FE; - public static final int GL_SIGNED_RGB8_NV = 0x86FF; - public static final int GL_SIGNED_LUMINANCE_NV = 0x8701; - public static final int GL_SIGNED_LUMINANCE8_NV = 0x8702; - public static final int GL_SIGNED_LUMINANCE_ALPHA_NV = 0x8703; - public static final int GL_SIGNED_LUMINANCE8_ALPHA8_NV = 0x8704; - public static final int GL_SIGNED_ALPHA_NV = 0x8705; - public static final int GL_SIGNED_ALPHA8_NV = 0x8706; - public static final int GL_SIGNED_INTENSITY_NV = 0x8707; - public static final int GL_SIGNED_INTENSITY8_NV = 0x8708; - public static final int GL_DSDT8_NV = 0x8709; - public static final int GL_DSDT8_MAG8_NV = 0x870A; - public static final int GL_DSDT8_MAG8_INTENSITY8_NV = 0x870B; - public static final int GL_SIGNED_RGB_UNSIGNED_ALPHA_NV = 0x870C; - public static final int GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV = 0x870D; - public static final int GL_HI_SCALE_NV = 0x870E; - public static final int GL_LO_SCALE_NV = 0x870F; - public static final int GL_DS_SCALE_NV = 0x8710; - public static final int GL_DT_SCALE_NV = 0x8711; - public static final int GL_MAGNITUDE_SCALE_NV = 0x8712; - public static final int GL_VIBRANCE_SCALE_NV = 0x8713; - public static final int GL_HI_BIAS_NV = 0x8714; - public static final int GL_LO_BIAS_NV = 0x8715; - public static final int GL_DS_BIAS_NV = 0x8716; - public static final int GL_DT_BIAS_NV = 0x8717; - public static final int GL_MAGNITUDE_BIAS_NV = 0x8718; - public static final int GL_VIBRANCE_BIAS_NV = 0x8719; - public static final int GL_TEXTURE_BORDER_VALUES_NV = 0x871A; - public static final int GL_TEXTURE_HI_SIZE_NV = 0x871B; - public static final int GL_TEXTURE_LO_SIZE_NV = 0x871C; - public static final int GL_TEXTURE_DS_SIZE_NV = 0x871D; - public static final int GL_TEXTURE_DT_SIZE_NV = 0x871E; - public static final int GL_TEXTURE_MAG_SIZE_NV = 0x871F; +public interface GLNVTextureShader { + int GL_OFFSET_TEXTURE_RECTANGLE_NV = 0x864C; + int GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV = 0x864D; + int GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV = 0x864E; + int GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV = 0x86D9; + int GL_UNSIGNED_INT_S8_S8_8_8_NV = 0x86DA; + int GL_UNSIGNED_INT_8_8_S8_S8_REV_NV = 0x86DB; + int GL_DSDT_MAG_INTENSITY_NV = 0x86DC; + int GL_SHADER_CONSISTENT_NV = 0x86DD; + int GL_TEXTURE_SHADER_NV = 0x86DE; + int GL_SHADER_OPERATION_NV = 0x86DF; + int GL_CULL_MODES_NV = 0x86E0; + int GL_OFFSET_TEXTURE_MATRIX_NV = 0x86E1; + int GL_OFFSET_TEXTURE_SCALE_NV = 0x86E2; + int GL_OFFSET_TEXTURE_BIAS_NV = 0x86E3; + int GL_OFFSET_TEXTURE_2D_MATRIX_NV = 0x86E1; + int GL_OFFSET_TEXTURE_2D_SCALE_NV = 0x86E2; + int GL_OFFSET_TEXTURE_2D_BIAS_NV = 0x86E3; + int GL_PREVIOUS_TEXTURE_INPUT_NV = 0x86E4; + int GL_CONST_EYE_NV = 0x86E5; + int GL_PASS_THROUGH_NV = 0x86E6; + int GL_CULL_FRAGMENT_NV = 0x86E7; + int GL_OFFSET_TEXTURE_2D_NV = 0x86E8; + int GL_DEPENDENT_AR_TEXTURE_2D_NV = 0x86E9; + int GL_DEPENDENT_GB_TEXTURE_2D_NV = 0x86EA; + int GL_DOT_PRODUCT_NV = 0x86EC; + int GL_DOT_PRODUCT_DEPTH_REPLACE_NV = 0x86ED; + int GL_DOT_PRODUCT_TEXTURE_2D_NV = 0x86EE; + int GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV = 0x86F0; + int GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV = 0x86F1; + int GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV = 0x86F2; + int GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV = 0x86F3; + int GL_HILO_NV = 0x86F4; + int GL_DSDT_NV = 0x86F5; + int GL_DSDT_MAG_NV = 0x86F6; + int GL_DSDT_MAG_VIB_NV = 0x86F7; + int GL_HILO16_NV = 0x86F8; + int GL_SIGNED_HILO_NV = 0x86F9; + int GL_SIGNED_HILO16_NV = 0x86FA; + int GL_SIGNED_RGBA_NV = 0x86FB; + int GL_SIGNED_RGBA8_NV = 0x86FC; + int GL_SIGNED_RGB_NV = 0x86FE; + int GL_SIGNED_RGB8_NV = 0x86FF; + int GL_SIGNED_LUMINANCE_NV = 0x8701; + int GL_SIGNED_LUMINANCE8_NV = 0x8702; + int GL_SIGNED_LUMINANCE_ALPHA_NV = 0x8703; + int GL_SIGNED_LUMINANCE8_ALPHA8_NV = 0x8704; + int GL_SIGNED_ALPHA_NV = 0x8705; + int GL_SIGNED_ALPHA8_NV = 0x8706; + int GL_SIGNED_INTENSITY_NV = 0x8707; + int GL_SIGNED_INTENSITY8_NV = 0x8708; + int GL_DSDT8_NV = 0x8709; + int GL_DSDT8_MAG8_NV = 0x870A; + int GL_DSDT8_MAG8_INTENSITY8_NV = 0x870B; + int GL_SIGNED_RGB_UNSIGNED_ALPHA_NV = 0x870C; + int GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV = 0x870D; + int GL_HI_SCALE_NV = 0x870E; + int GL_LO_SCALE_NV = 0x870F; + int GL_DS_SCALE_NV = 0x8710; + int GL_DT_SCALE_NV = 0x8711; + int GL_MAGNITUDE_SCALE_NV = 0x8712; + int GL_VIBRANCE_SCALE_NV = 0x8713; + int GL_HI_BIAS_NV = 0x8714; + int GL_LO_BIAS_NV = 0x8715; + int GL_DS_BIAS_NV = 0x8716; + int GL_DT_BIAS_NV = 0x8717; + int GL_MAGNITUDE_BIAS_NV = 0x8718; + int GL_VIBRANCE_BIAS_NV = 0x8719; + int GL_TEXTURE_BORDER_VALUES_NV = 0x871A; + int GL_TEXTURE_HI_SIZE_NV = 0x871B; + int GL_TEXTURE_LO_SIZE_NV = 0x871C; + int GL_TEXTURE_DS_SIZE_NV = 0x871D; + int GL_TEXTURE_DT_SIZE_NV = 0x871E; + int GL_TEXTURE_MAG_SIZE_NV = 0x871F; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureShader2.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureShader2.java index ea726fd6..8d8c2874 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureShader2.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureShader2.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_texture_shader2} */ -public final class GLNVTextureShader2 { - public static final int GL_DOT_PRODUCT_TEXTURE_3D_NV = 0x86EF; +public interface GLNVTextureShader2 { + int GL_DOT_PRODUCT_TEXTURE_3D_NV = 0x86EF; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureShader3.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureShader3.java index 6f6a10dc..d29e62a3 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureShader3.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTextureShader3.java @@ -16,33 +16,29 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_texture_shader3} */ -public final class GLNVTextureShader3 { - public static final int GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV = 0x8850; - public static final int GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV = 0x8851; - public static final int GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8852; - public static final int GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV = 0x8853; - public static final int GL_OFFSET_HILO_TEXTURE_2D_NV = 0x8854; - public static final int GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV = 0x8855; - public static final int GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV = 0x8856; - public static final int GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8857; - public static final int GL_DEPENDENT_HILO_TEXTURE_2D_NV = 0x8858; - public static final int GL_DEPENDENT_RGB_TEXTURE_3D_NV = 0x8859; - public static final int GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV = 0x885A; - public static final int GL_DOT_PRODUCT_PASS_THROUGH_NV = 0x885B; - public static final int GL_DOT_PRODUCT_TEXTURE_1D_NV = 0x885C; - public static final int GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV = 0x885D; - public static final int GL_HILO8_NV = 0x885E; - public static final int GL_SIGNED_HILO8_NV = 0x885F; - public static final int GL_FORCE_BLUE_TO_ONE_NV = 0x8860; +public interface GLNVTextureShader3 { + int GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV = 0x8850; + int GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV = 0x8851; + int GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8852; + int GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV = 0x8853; + int GL_OFFSET_HILO_TEXTURE_2D_NV = 0x8854; + int GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV = 0x8855; + int GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV = 0x8856; + int GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8857; + int GL_DEPENDENT_HILO_TEXTURE_2D_NV = 0x8858; + int GL_DEPENDENT_RGB_TEXTURE_3D_NV = 0x8859; + int GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV = 0x885A; + int GL_DOT_PRODUCT_PASS_THROUGH_NV = 0x885B; + int GL_DOT_PRODUCT_TEXTURE_1D_NV = 0x885C; + int GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV = 0x885D; + int GL_HILO8_NV = 0x885E; + int GL_SIGNED_HILO8_NV = 0x885F; + int GL_FORCE_BLUE_TO_ONE_NV = 0x8860; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTimelineSemaphore.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTimelineSemaphore.java index 488a483b..37372549 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTimelineSemaphore.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTimelineSemaphore.java @@ -16,49 +16,30 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_timeline_semaphore} */ -public final class GLNVTimelineSemaphore { - public static final int GL_TIMELINE_SEMAPHORE_VALUE_NV = 0x9595; - public static final int GL_SEMAPHORE_TYPE_NV = 0x95B3; - public static final int GL_SEMAPHORE_TYPE_BINARY_NV = 0x95B4; - public static final int GL_SEMAPHORE_TYPE_TIMELINE_NV = 0x95B5; - public static final int GL_MAX_TIMELINE_SEMAPHORE_VALUE_DIFFERENCE_NV = 0x95B6; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_timeline_semaphore) return; - ext.glCreateSemaphoresNV = load.invoke("glCreateSemaphoresNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glSemaphoreParameterivNV = load.invoke("glSemaphoreParameterivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetSemaphoreParameterivNV = load.invoke("glGetSemaphoreParameterivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLNVTimelineSemaphore { + int GL_TIMELINE_SEMAPHORE_VALUE_NV = 0x9595; + int GL_SEMAPHORE_TYPE_NV = 0x95B3; + int GL_SEMAPHORE_TYPE_BINARY_NV = 0x95B4; + int GL_SEMAPHORE_TYPE_TIMELINE_NV = 0x95B5; + int GL_MAX_TIMELINE_SEMAPHORE_VALUE_DIFFERENCE_NV = 0x95B6; - public static void glCreateSemaphoresNV(int n, @NativeType("GLuint *") MemorySegment semaphores) { - final var ext = getExtCapabilities(); - try { - check(ext.glCreateSemaphoresNV).invokeExact(n, semaphores); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCreateSemaphoresNV(int n, @NativeType("GLuint *") MemorySegment semaphores) { + throw new ContextException(); } - public static void glSemaphoreParameterivNV(int semaphore, int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glSemaphoreParameterivNV).invokeExact(semaphore, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSemaphoreParameterivNV(int semaphore, int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetSemaphoreParameterivNV(int semaphore, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetSemaphoreParameterivNV).invokeExact(semaphore, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetSemaphoreParameterivNV(int semaphore, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTransformFeedback.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTransformFeedback.java index 72367cb4..e095292f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTransformFeedback.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTransformFeedback.java @@ -16,148 +16,92 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_transform_feedback} */ -public final class GLNVTransformFeedback { - public static final int GL_BACK_PRIMARY_COLOR_NV = 0x8C77; - public static final int GL_BACK_SECONDARY_COLOR_NV = 0x8C78; - public static final int GL_TEXTURE_COORD_NV = 0x8C79; - public static final int GL_CLIP_DISTANCE_NV = 0x8C7A; - public static final int GL_VERTEX_ID_NV = 0x8C7B; - public static final int GL_PRIMITIVE_ID_NV = 0x8C7C; - public static final int GL_GENERIC_ATTRIB_NV = 0x8C7D; - public static final int GL_TRANSFORM_FEEDBACK_ATTRIBS_NV = 0x8C7E; - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV = 0x8C7F; - public static final int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV = 0x8C80; - public static final int GL_ACTIVE_VARYINGS_NV = 0x8C81; - public static final int GL_ACTIVE_VARYING_MAX_LENGTH_NV = 0x8C82; - public static final int GL_TRANSFORM_FEEDBACK_VARYINGS_NV = 0x8C83; - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_START_NV = 0x8C84; - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV = 0x8C85; - public static final int GL_TRANSFORM_FEEDBACK_RECORD_NV = 0x8C86; - public static final int GL_PRIMITIVES_GENERATED_NV = 0x8C87; - public static final int GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV = 0x8C88; - public static final int GL_RASTERIZER_DISCARD_NV = 0x8C89; - public static final int GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV = 0x8C8A; - public static final int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV = 0x8C8B; - public static final int GL_INTERLEAVED_ATTRIBS_NV = 0x8C8C; - public static final int GL_SEPARATE_ATTRIBS_NV = 0x8C8D; - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_NV = 0x8C8E; - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV = 0x8C8F; - public static final int GL_LAYER_NV = 0x8DAA; - public static final int GL_NEXT_BUFFER_NV = -2; - public static final int GL_SKIP_COMPONENTS4_NV = -3; - public static final int GL_SKIP_COMPONENTS3_NV = -4; - public static final int GL_SKIP_COMPONENTS2_NV = -5; - public static final int GL_SKIP_COMPONENTS1_NV = -6; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_transform_feedback) return; - ext.glBeginTransformFeedbackNV = load.invoke("glBeginTransformFeedbackNV", ofVoid(JAVA_INT)); - ext.glEndTransformFeedbackNV = load.invoke("glEndTransformFeedbackNV", ofVoid()); - ext.glTransformFeedbackAttribsNV = load.invoke("glTransformFeedbackAttribsNV", ofVoid(JAVA_INT, ADDRESS, JAVA_INT)); - ext.glBindBufferRangeNV = load.invoke("glBindBufferRangeNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG)); - ext.glBindBufferOffsetNV = load.invoke("glBindBufferOffsetNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glBindBufferBaseNV = load.invoke("glBindBufferBaseNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glTransformFeedbackVaryingsNV = load.invoke("glTransformFeedbackVaryingsNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, JAVA_INT)); - ext.glActiveVaryingNV = load.invoke("glActiveVaryingNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glGetVaryingLocationNV = load.invoke("glGetVaryingLocationNV", of(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetActiveVaryingNV = load.invoke("glGetActiveVaryingNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, ADDRESS, ADDRESS, ADDRESS)); - ext.glGetTransformFeedbackVaryingNV = load.invoke("glGetTransformFeedbackVaryingNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glTransformFeedbackStreamAttribsNV = load.invoke("glTransformFeedbackStreamAttribsNV", ofVoid(JAVA_INT, ADDRESS, JAVA_INT, ADDRESS, JAVA_INT)); - } - - public static void glBeginTransformFeedbackNV(int primitiveMode) { - final var ext = getExtCapabilities(); - try { - check(ext.glBeginTransformFeedbackNV).invokeExact(primitiveMode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLNVTransformFeedback { + int GL_BACK_PRIMARY_COLOR_NV = 0x8C77; + int GL_BACK_SECONDARY_COLOR_NV = 0x8C78; + int GL_TEXTURE_COORD_NV = 0x8C79; + int GL_CLIP_DISTANCE_NV = 0x8C7A; + int GL_VERTEX_ID_NV = 0x8C7B; + int GL_PRIMITIVE_ID_NV = 0x8C7C; + int GL_GENERIC_ATTRIB_NV = 0x8C7D; + int GL_TRANSFORM_FEEDBACK_ATTRIBS_NV = 0x8C7E; + int GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV = 0x8C7F; + int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV = 0x8C80; + int GL_ACTIVE_VARYINGS_NV = 0x8C81; + int GL_ACTIVE_VARYING_MAX_LENGTH_NV = 0x8C82; + int GL_TRANSFORM_FEEDBACK_VARYINGS_NV = 0x8C83; + int GL_TRANSFORM_FEEDBACK_BUFFER_START_NV = 0x8C84; + int GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV = 0x8C85; + int GL_TRANSFORM_FEEDBACK_RECORD_NV = 0x8C86; + int GL_PRIMITIVES_GENERATED_NV = 0x8C87; + int GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV = 0x8C88; + int GL_RASTERIZER_DISCARD_NV = 0x8C89; + int GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV = 0x8C8A; + int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV = 0x8C8B; + int GL_INTERLEAVED_ATTRIBS_NV = 0x8C8C; + int GL_SEPARATE_ATTRIBS_NV = 0x8C8D; + int GL_TRANSFORM_FEEDBACK_BUFFER_NV = 0x8C8E; + int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV = 0x8C8F; + int GL_LAYER_NV = 0x8DAA; + int GL_NEXT_BUFFER_NV = -2; + int GL_SKIP_COMPONENTS4_NV = -3; + int GL_SKIP_COMPONENTS3_NV = -4; + int GL_SKIP_COMPONENTS2_NV = -5; + int GL_SKIP_COMPONENTS1_NV = -6; + + default void glBeginTransformFeedbackNV(int primitiveMode) { + throw new ContextException(); } - public static void glEndTransformFeedbackNV() { - final var ext = getExtCapabilities(); - try { - check(ext.glEndTransformFeedbackNV).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEndTransformFeedbackNV() { + throw new ContextException(); } - public static void glTransformFeedbackAttribsNV(int count, @NativeType("const GLint *") MemorySegment attribs, int bufferMode) { - final var ext = getExtCapabilities(); - try { - check(ext.glTransformFeedbackAttribsNV).invokeExact(count, attribs, bufferMode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTransformFeedbackAttribsNV(int count, @NativeType("const GLint *") MemorySegment attribs, int bufferMode) { + throw new ContextException(); } - public static void glBindBufferRangeNV(int target, int index, int buffer, long offset, long size) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindBufferRangeNV).invokeExact(target, index, buffer, offset, size); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBindBufferRangeNV(int target, int index, int buffer, long offset, long size) { + throw new ContextException(); } - public static void glBindBufferOffsetNV(int target, int index, int buffer, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindBufferOffsetNV).invokeExact(target, index, buffer, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBindBufferOffsetNV(int target, int index, int buffer, long offset) { + throw new ContextException(); } - public static void glBindBufferBaseNV(int target, int index, int buffer) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindBufferBaseNV).invokeExact(target, index, buffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBindBufferBaseNV(int target, int index, int buffer) { + throw new ContextException(); } - public static void glTransformFeedbackVaryingsNV(int program, int count, @NativeType("const GLint *") MemorySegment locations, int bufferMode) { - final var ext = getExtCapabilities(); - try { - check(ext.glTransformFeedbackVaryingsNV).invokeExact(program, count, locations, bufferMode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTransformFeedbackVaryingsNV(int program, int count, @NativeType("const GLint *") MemorySegment locations, int bufferMode) { + throw new ContextException(); } - public static void glActiveVaryingNV(int program, @NativeType("const GLchar *") MemorySegment name) { - final var ext = getExtCapabilities(); - try { - check(ext.glActiveVaryingNV).invokeExact(program, name); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glActiveVaryingNV(int program, @NativeType("const GLchar *") MemorySegment name) { + throw new ContextException(); } - public static int glGetVaryingLocationNV(int program, @NativeType("const GLchar *") MemorySegment name) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glGetVaryingLocationNV).invokeExact(program, name); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glGetVaryingLocationNV(int program, @NativeType("const GLchar *") MemorySegment name) { + throw new ContextException(); } - public static void glGetActiveVaryingNV(int program, int index, int bufSize, @NativeType("GLsizei *") MemorySegment length, @NativeType("GLsizei *") MemorySegment size, @NativeType("GLenum *") MemorySegment type, @NativeType("GLchar *") MemorySegment name) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetActiveVaryingNV).invokeExact(program, index, bufSize, length, size, type, name); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetActiveVaryingNV(int program, int index, int bufSize, @NativeType("GLsizei *") MemorySegment length, @NativeType("GLsizei *") MemorySegment size, @NativeType("GLenum *") MemorySegment type, @NativeType("GLchar *") MemorySegment name) { + throw new ContextException(); } - public static void glGetTransformFeedbackVaryingNV(int program, int index, @NativeType("GLint *") MemorySegment location) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetTransformFeedbackVaryingNV).invokeExact(program, index, location); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetTransformFeedbackVaryingNV(int program, int index, @NativeType("GLint *") MemorySegment location) { + throw new ContextException(); } - public static void glTransformFeedbackStreamAttribsNV(int count, @NativeType("const GLint *") MemorySegment attribs, int nbuffers, @NativeType("const GLint *") MemorySegment bufstreams, int bufferMode) { - final var ext = getExtCapabilities(); - try { - check(ext.glTransformFeedbackStreamAttribsNV).invokeExact(count, attribs, nbuffers, bufstreams, bufferMode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTransformFeedbackStreamAttribsNV(int count, @NativeType("const GLint *") MemorySegment attribs, int nbuffers, @NativeType("const GLint *") MemorySegment bufstreams, int bufferMode) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTransformFeedback2.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTransformFeedback2.java index 2fd3afd2..53752c92 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTransformFeedback2.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVTransformFeedback2.java @@ -16,81 +16,45 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_transform_feedback2} */ -public final class GLNVTransformFeedback2 { - public static final int GL_TRANSFORM_FEEDBACK_NV = 0x8E22; - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV = 0x8E23; - public static final int GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV = 0x8E24; - public static final int GL_TRANSFORM_FEEDBACK_BINDING_NV = 0x8E25; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_transform_feedback2) return; - ext.glBindTransformFeedbackNV = load.invoke("glBindTransformFeedbackNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glDeleteTransformFeedbacksNV = load.invoke("glDeleteTransformFeedbacksNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glGenTransformFeedbacksNV = load.invoke("glGenTransformFeedbacksNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glIsTransformFeedbackNV = load.invoke("glIsTransformFeedbackNV", of(JAVA_BYTE, JAVA_INT)); - ext.glPauseTransformFeedbackNV = load.invoke("glPauseTransformFeedbackNV", ofVoid()); - ext.glResumeTransformFeedbackNV = load.invoke("glResumeTransformFeedbackNV", ofVoid()); - ext.glDrawTransformFeedbackNV = load.invoke("glDrawTransformFeedbackNV", ofVoid(JAVA_INT, JAVA_INT)); - } +public interface GLNVTransformFeedback2 { + int GL_TRANSFORM_FEEDBACK_NV = 0x8E22; + int GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV = 0x8E23; + int GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV = 0x8E24; + int GL_TRANSFORM_FEEDBACK_BINDING_NV = 0x8E25; - public static void glBindTransformFeedbackNV(int target, int id) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindTransformFeedbackNV).invokeExact(target, id); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBindTransformFeedbackNV(int target, int id) { + throw new ContextException(); } - public static void glDeleteTransformFeedbacksNV(int n, @NativeType("const GLuint *") MemorySegment ids) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteTransformFeedbacksNV).invokeExact(n, ids); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDeleteTransformFeedbacksNV(int n, @NativeType("const GLuint *") MemorySegment ids) { + throw new ContextException(); } - public static void glGenTransformFeedbacksNV(int n, @NativeType("GLuint *") MemorySegment ids) { - final var ext = getExtCapabilities(); - try { - check(ext.glGenTransformFeedbacksNV).invokeExact(n, ids); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGenTransformFeedbacksNV(int n, @NativeType("GLuint *") MemorySegment ids) { + throw new ContextException(); } - public static boolean glIsTransformFeedbackNV(int id) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsTransformFeedbackNV).invokeExact(id); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsTransformFeedbackNV(int id) { + throw new ContextException(); } - public static void glPauseTransformFeedbackNV() { - final var ext = getExtCapabilities(); - try { - check(ext.glPauseTransformFeedbackNV).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPauseTransformFeedbackNV() { + throw new ContextException(); } - public static void glResumeTransformFeedbackNV() { - final var ext = getExtCapabilities(); - try { - check(ext.glResumeTransformFeedbackNV).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glResumeTransformFeedbackNV() { + throw new ContextException(); } - public static void glDrawTransformFeedbackNV(int mode, int id) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawTransformFeedbackNV).invokeExact(mode, id); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDrawTransformFeedbackNV(int mode, int id) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVUniformBufferUnifiedMemory.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVUniformBufferUnifiedMemory.java index fe248618..6a3b1228 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVUniformBufferUnifiedMemory.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVUniformBufferUnifiedMemory.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_uniform_buffer_unified_memory} */ -public final class GLNVUniformBufferUnifiedMemory { - public static final int GL_UNIFORM_BUFFER_UNIFIED_NV = 0x936E; - public static final int GL_UNIFORM_BUFFER_ADDRESS_NV = 0x936F; - public static final int GL_UNIFORM_BUFFER_LENGTH_NV = 0x9370; +public interface GLNVUniformBufferUnifiedMemory { + int GL_UNIFORM_BUFFER_UNIFIED_NV = 0x936E; + int GL_UNIFORM_BUFFER_ADDRESS_NV = 0x936F; + int GL_UNIFORM_BUFFER_LENGTH_NV = 0x9370; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVDPAUInterop.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVDPAUInterop.java index 6737f5f8..dc2f1743 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVDPAUInterop.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVDPAUInterop.java @@ -16,107 +16,57 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_vdpau_interop} */ -public final class GLNVVDPAUInterop { - public static final int GL_SURFACE_STATE_NV = 0x86EB; - public static final int GL_SURFACE_REGISTERED_NV = 0x86FD; - public static final int GL_SURFACE_MAPPED_NV = 0x8700; - public static final int GL_WRITE_DISCARD_NV = 0x88BE; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_vdpau_interop) return; - ext.glVDPAUInitNV = load.invoke("glVDPAUInitNV", ofVoid(ADDRESS, ADDRESS)); - ext.glVDPAUFiniNV = load.invoke("glVDPAUFiniNV", ofVoid()); - ext.glVDPAURegisterVideoSurfaceNV = load.invoke("glVDPAURegisterVideoSurfaceNV", of(JAVA_LONG, ADDRESS, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVDPAURegisterOutputSurfaceNV = load.invoke("glVDPAURegisterOutputSurfaceNV", of(JAVA_LONG, ADDRESS, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVDPAUIsSurfaceNV = load.invoke("glVDPAUIsSurfaceNV", of(JAVA_BYTE, JAVA_LONG)); - ext.glVDPAUUnregisterSurfaceNV = load.invoke("glVDPAUUnregisterSurfaceNV", ofVoid(JAVA_LONG)); - ext.glVDPAUGetSurfaceivNV = load.invoke("glVDPAUGetSurfaceivNV", ofVoid(JAVA_LONG, JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - ext.glVDPAUSurfaceAccessNV = load.invoke("glVDPAUSurfaceAccessNV", ofVoid(JAVA_LONG, JAVA_INT)); - ext.glVDPAUMapSurfacesNV = load.invoke("glVDPAUMapSurfacesNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVDPAUUnmapSurfacesNV = load.invoke("glVDPAUUnmapSurfacesNV", ofVoid(JAVA_INT, ADDRESS)); - } +public interface GLNVVDPAUInterop { + int GL_SURFACE_STATE_NV = 0x86EB; + int GL_SURFACE_REGISTERED_NV = 0x86FD; + int GL_SURFACE_MAPPED_NV = 0x8700; + int GL_WRITE_DISCARD_NV = 0x88BE; - public static void glVDPAUInitNV(@NativeType("const void *") MemorySegment vdpDevice, @NativeType("const void *") MemorySegment getProcAddress) { - final var ext = getExtCapabilities(); - try { - check(ext.glVDPAUInitNV).invokeExact(vdpDevice, getProcAddress); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVDPAUInitNV(@NativeType("const void *") MemorySegment vdpDevice, @NativeType("const void *") MemorySegment getProcAddress) { + throw new ContextException(); } - public static void glVDPAUFiniNV() { - final var ext = getExtCapabilities(); - try { - check(ext.glVDPAUFiniNV).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVDPAUFiniNV() { + throw new ContextException(); } - public static long glVDPAURegisterVideoSurfaceNV(@NativeType("const void *") MemorySegment vdpSurface, int target, int numTextureNames, @NativeType("const GLuint *") MemorySegment textureNames) { - final var ext = getExtCapabilities(); - try { - return (long) - check(ext.glVDPAURegisterVideoSurfaceNV).invokeExact(vdpSurface, target, numTextureNames, textureNames); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default long glVDPAURegisterVideoSurfaceNV(@NativeType("const void *") MemorySegment vdpSurface, int target, int numTextureNames, @NativeType("const GLuint *") MemorySegment textureNames) { + throw new ContextException(); } - public static long glVDPAURegisterOutputSurfaceNV(@NativeType("const void *") MemorySegment vdpSurface, int target, int numTextureNames, @NativeType("const GLuint *") MemorySegment textureNames) { - final var ext = getExtCapabilities(); - try { - return (long) - check(ext.glVDPAURegisterOutputSurfaceNV).invokeExact(vdpSurface, target, numTextureNames, textureNames); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default long glVDPAURegisterOutputSurfaceNV(@NativeType("const void *") MemorySegment vdpSurface, int target, int numTextureNames, @NativeType("const GLuint *") MemorySegment textureNames) { + throw new ContextException(); } - public static boolean glVDPAUIsSurfaceNV(long surface) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glVDPAUIsSurfaceNV).invokeExact(surface); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glVDPAUIsSurfaceNV(long surface) { + throw new ContextException(); } - public static void glVDPAUUnregisterSurfaceNV(long surface) { - final var ext = getExtCapabilities(); - try { - check(ext.glVDPAUUnregisterSurfaceNV).invokeExact(surface); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVDPAUUnregisterSurfaceNV(long surface) { + throw new ContextException(); } - public static void glVDPAUGetSurfaceivNV(long surface, int pname, int count, @NativeType("GLsizei *") MemorySegment length, @NativeType("GLint *") MemorySegment values) { - final var ext = getExtCapabilities(); - try { - check(ext.glVDPAUGetSurfaceivNV).invokeExact(surface, pname, count, length, values); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVDPAUGetSurfaceivNV(long surface, int pname, int count, @NativeType("GLsizei *") MemorySegment length, @NativeType("GLint *") MemorySegment values) { + throw new ContextException(); } - public static void glVDPAUSurfaceAccessNV(long surface, int access) { - final var ext = getExtCapabilities(); - try { - check(ext.glVDPAUSurfaceAccessNV).invokeExact(surface, access); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVDPAUSurfaceAccessNV(long surface, int access) { + throw new ContextException(); } - public static void glVDPAUMapSurfacesNV(int numSurfaces, @NativeType("const GLvdpauSurfaceNV *") MemorySegment surfaces) { - final var ext = getExtCapabilities(); - try { - check(ext.glVDPAUMapSurfacesNV).invokeExact(numSurfaces, surfaces); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVDPAUMapSurfacesNV(int numSurfaces, @NativeType("const GLvdpauSurfaceNV *") MemorySegment surfaces) { + throw new ContextException(); } - public static void glVDPAUUnmapSurfacesNV(int numSurface, @NativeType("const GLvdpauSurfaceNV *") MemorySegment surfaces) { - final var ext = getExtCapabilities(); - try { - check(ext.glVDPAUUnmapSurfacesNV).invokeExact(numSurface, surfaces); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVDPAUUnmapSurfacesNV(int numSurface, @NativeType("const GLvdpauSurfaceNV *") MemorySegment surfaces) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVDPAUInterop2.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVDPAUInterop2.java index 20bd85f5..c6737391 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVDPAUInterop2.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVDPAUInterop2.java @@ -16,29 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_vdpau_interop2} */ -public final class GLNVVDPAUInterop2 { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_vdpau_interop2) return; - ext.glVDPAURegisterVideoSurfaceWithPictureStructureNV = load.invoke("glVDPAURegisterVideoSurfaceWithPictureStructureNV", of(JAVA_LONG, ADDRESS, JAVA_INT, JAVA_INT, ADDRESS, JAVA_BYTE)); - } +public interface GLNVVDPAUInterop2 { - public static long glVDPAURegisterVideoSurfaceWithPictureStructureNV(@NativeType("const void *") MemorySegment vdpSurface, int target, int numTextureNames, @NativeType("const GLuint *") MemorySegment textureNames, boolean isFrameStructure) { - final var ext = getExtCapabilities(); - try { - return (long) - check(ext.glVDPAURegisterVideoSurfaceWithPictureStructureNV).invokeExact(vdpSurface, target, numTextureNames, textureNames, isFrameStructure); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default long glVDPAURegisterVideoSurfaceWithPictureStructureNV(@NativeType("const void *") MemorySegment vdpSurface, int target, int numTextureNames, @NativeType("const GLuint *") MemorySegment textureNames, boolean isFrameStructure) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexArrayRange.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexArrayRange.java index ece609da..e59ad8ee 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexArrayRange.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexArrayRange.java @@ -16,41 +16,26 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_vertex_array_range} */ -public final class GLNVVertexArrayRange { - public static final int GL_VERTEX_ARRAY_RANGE_NV = 0x851D; - public static final int GL_VERTEX_ARRAY_RANGE_LENGTH_NV = 0x851E; - public static final int GL_VERTEX_ARRAY_RANGE_VALID_NV = 0x851F; - public static final int GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV = 0x8520; - public static final int GL_VERTEX_ARRAY_RANGE_POINTER_NV = 0x8521; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_vertex_array_range) return; - ext.glFlushVertexArrayRangeNV = load.invoke("glFlushVertexArrayRangeNV", ofVoid()); - ext.glVertexArrayRangeNV = load.invoke("glVertexArrayRangeNV", ofVoid(JAVA_INT, ADDRESS)); - } +public interface GLNVVertexArrayRange { + int GL_VERTEX_ARRAY_RANGE_NV = 0x851D; + int GL_VERTEX_ARRAY_RANGE_LENGTH_NV = 0x851E; + int GL_VERTEX_ARRAY_RANGE_VALID_NV = 0x851F; + int GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV = 0x8520; + int GL_VERTEX_ARRAY_RANGE_POINTER_NV = 0x8521; - public static void glFlushVertexArrayRangeNV() { - final var ext = getExtCapabilities(); - try { - check(ext.glFlushVertexArrayRangeNV).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFlushVertexArrayRangeNV() { + throw new ContextException(); } - public static void glVertexArrayRangeNV(int length, @NativeType("const void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexArrayRangeNV).invokeExact(length, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexArrayRangeNV(int length, @NativeType("const void *") MemorySegment pointer) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexArrayRange2.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexArrayRange2.java index 2b2dcb41..c1df30db 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexArrayRange2.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexArrayRange2.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_vertex_array_range2} */ -public final class GLNVVertexArrayRange2 { - public static final int GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV = 0x8533; +public interface GLNVVertexArrayRange2 { + int GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV = 0x8533; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexAttribInteger64bit.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexAttribInteger64bit.java index 59b9ad8f..5198a29e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexAttribInteger64bit.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexAttribInteger64bit.java @@ -16,172 +16,89 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_vertex_attrib_integer_64bit} */ -public final class GLNVVertexAttribInteger64bit { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_vertex_attrib_integer_64bit) return; - ext.glVertexAttribL1i64NV = load.invoke("glVertexAttribL1i64NV", ofVoid(JAVA_INT, JAVA_LONG)); - ext.glVertexAttribL2i64NV = load.invoke("glVertexAttribL2i64NV", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG)); - ext.glVertexAttribL3i64NV = load.invoke("glVertexAttribL3i64NV", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glVertexAttribL4i64NV = load.invoke("glVertexAttribL4i64NV", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glVertexAttribL1i64vNV = load.invoke("glVertexAttribL1i64vNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribL2i64vNV = load.invoke("glVertexAttribL2i64vNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribL3i64vNV = load.invoke("glVertexAttribL3i64vNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribL4i64vNV = load.invoke("glVertexAttribL4i64vNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribL1ui64NV = load.invoke("glVertexAttribL1ui64NV", ofVoid(JAVA_INT, JAVA_LONG)); - ext.glVertexAttribL2ui64NV = load.invoke("glVertexAttribL2ui64NV", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG)); - ext.glVertexAttribL3ui64NV = load.invoke("glVertexAttribL3ui64NV", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glVertexAttribL4ui64NV = load.invoke("glVertexAttribL4ui64NV", ofVoid(JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG)); - ext.glVertexAttribL1ui64vNV = load.invoke("glVertexAttribL1ui64vNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribL2ui64vNV = load.invoke("glVertexAttribL2ui64vNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribL3ui64vNV = load.invoke("glVertexAttribL3ui64vNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribL4ui64vNV = load.invoke("glVertexAttribL4ui64vNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glGetVertexAttribLi64vNV = load.invoke("glGetVertexAttribLi64vNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVertexAttribLui64vNV = load.invoke("glGetVertexAttribLui64vNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVertexAttribLFormatNV = load.invoke("glVertexAttribLFormatNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } - - public static void glVertexAttribL1i64NV(int index, long x) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL1i64NV).invokeExact(index, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLNVVertexAttribInteger64bit { + + default void glVertexAttribL1i64NV(int index, long x) { + throw new ContextException(); } - public static void glVertexAttribL2i64NV(int index, long x, long y) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL2i64NV).invokeExact(index, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL2i64NV(int index, long x, long y) { + throw new ContextException(); } - public static void glVertexAttribL3i64NV(int index, long x, long y, long z) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL3i64NV).invokeExact(index, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL3i64NV(int index, long x, long y, long z) { + throw new ContextException(); } - public static void glVertexAttribL4i64NV(int index, long x, long y, long z, long w) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL4i64NV).invokeExact(index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL4i64NV(int index, long x, long y, long z, long w) { + throw new ContextException(); } - public static void glVertexAttribL1i64vNV(int index, @NativeType("const GLint64EXT *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL1i64vNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL1i64vNV(int index, @NativeType("const GLint64EXT *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribL2i64vNV(int index, @NativeType("const GLint64EXT *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL2i64vNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL2i64vNV(int index, @NativeType("const GLint64EXT *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribL3i64vNV(int index, @NativeType("const GLint64EXT *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL3i64vNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL3i64vNV(int index, @NativeType("const GLint64EXT *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribL4i64vNV(int index, @NativeType("const GLint64EXT *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL4i64vNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL4i64vNV(int index, @NativeType("const GLint64EXT *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribL1ui64NV(int index, long x) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL1ui64NV).invokeExact(index, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL1ui64NV(int index, long x) { + throw new ContextException(); } - public static void glVertexAttribL2ui64NV(int index, long x, long y) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL2ui64NV).invokeExact(index, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL2ui64NV(int index, long x, long y) { + throw new ContextException(); } - public static void glVertexAttribL3ui64NV(int index, long x, long y, long z) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL3ui64NV).invokeExact(index, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL3ui64NV(int index, long x, long y, long z) { + throw new ContextException(); } - public static void glVertexAttribL4ui64NV(int index, long x, long y, long z, long w) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL4ui64NV).invokeExact(index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL4ui64NV(int index, long x, long y, long z, long w) { + throw new ContextException(); } - public static void glVertexAttribL1ui64vNV(int index, @NativeType("const GLuint64EXT *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL1ui64vNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL1ui64vNV(int index, @NativeType("const GLuint64EXT *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribL2ui64vNV(int index, @NativeType("const GLuint64EXT *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL2ui64vNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL2ui64vNV(int index, @NativeType("const GLuint64EXT *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribL3ui64vNV(int index, @NativeType("const GLuint64EXT *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL3ui64vNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL3ui64vNV(int index, @NativeType("const GLuint64EXT *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribL4ui64vNV(int index, @NativeType("const GLuint64EXT *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribL4ui64vNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribL4ui64vNV(int index, @NativeType("const GLuint64EXT *") MemorySegment v) { + throw new ContextException(); } - public static void glGetVertexAttribLi64vNV(int index, int pname, @NativeType("GLint64EXT *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVertexAttribLi64vNV).invokeExact(index, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVertexAttribLi64vNV(int index, int pname, @NativeType("GLint64EXT *") MemorySegment params) { + throw new ContextException(); } - public static void glGetVertexAttribLui64vNV(int index, int pname, @NativeType("GLuint64EXT *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVertexAttribLui64vNV).invokeExact(index, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVertexAttribLui64vNV(int index, int pname, @NativeType("GLuint64EXT *") MemorySegment params) { + throw new ContextException(); } - public static void glVertexAttribLFormatNV(int index, int size, int type, int stride) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribLFormatNV).invokeExact(index, size, type, stride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribLFormatNV(int index, int size, int type, int stride) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexBufferUnifiedMemory.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexBufferUnifiedMemory.java index 2989fad7..e4259699 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexBufferUnifiedMemory.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexBufferUnifiedMemory.java @@ -16,141 +16,86 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_vertex_buffer_unified_memory} */ -public final class GLNVVertexBufferUnifiedMemory { - public static final int GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV = 0x8F1E; - public static final int GL_ELEMENT_ARRAY_UNIFIED_NV = 0x8F1F; - public static final int GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV = 0x8F20; - public static final int GL_VERTEX_ARRAY_ADDRESS_NV = 0x8F21; - public static final int GL_NORMAL_ARRAY_ADDRESS_NV = 0x8F22; - public static final int GL_COLOR_ARRAY_ADDRESS_NV = 0x8F23; - public static final int GL_INDEX_ARRAY_ADDRESS_NV = 0x8F24; - public static final int GL_TEXTURE_COORD_ARRAY_ADDRESS_NV = 0x8F25; - public static final int GL_EDGE_FLAG_ARRAY_ADDRESS_NV = 0x8F26; - public static final int GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV = 0x8F27; - public static final int GL_FOG_COORD_ARRAY_ADDRESS_NV = 0x8F28; - public static final int GL_ELEMENT_ARRAY_ADDRESS_NV = 0x8F29; - public static final int GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV = 0x8F2A; - public static final int GL_VERTEX_ARRAY_LENGTH_NV = 0x8F2B; - public static final int GL_NORMAL_ARRAY_LENGTH_NV = 0x8F2C; - public static final int GL_COLOR_ARRAY_LENGTH_NV = 0x8F2D; - public static final int GL_INDEX_ARRAY_LENGTH_NV = 0x8F2E; - public static final int GL_TEXTURE_COORD_ARRAY_LENGTH_NV = 0x8F2F; - public static final int GL_EDGE_FLAG_ARRAY_LENGTH_NV = 0x8F30; - public static final int GL_SECONDARY_COLOR_ARRAY_LENGTH_NV = 0x8F31; - public static final int GL_FOG_COORD_ARRAY_LENGTH_NV = 0x8F32; - public static final int GL_ELEMENT_ARRAY_LENGTH_NV = 0x8F33; - public static final int GL_DRAW_INDIRECT_UNIFIED_NV = 0x8F40; - public static final int GL_DRAW_INDIRECT_ADDRESS_NV = 0x8F41; - public static final int GL_DRAW_INDIRECT_LENGTH_NV = 0x8F42; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_vertex_buffer_unified_memory) return; - ext.glBufferAddressRangeNV = load.invoke("glBufferAddressRangeNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG)); - ext.glVertexFormatNV = load.invoke("glVertexFormatNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glNormalFormatNV = load.invoke("glNormalFormatNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glColorFormatNV = load.invoke("glColorFormatNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glIndexFormatNV = load.invoke("glIndexFormatNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glTexCoordFormatNV = load.invoke("glTexCoordFormatNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glEdgeFlagFormatNV = load.invoke("glEdgeFlagFormatNV", ofVoid(JAVA_INT)); - ext.glSecondaryColorFormatNV = load.invoke("glSecondaryColorFormatNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glFogCoordFormatNV = load.invoke("glFogCoordFormatNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glVertexAttribFormatNV = load.invoke("glVertexAttribFormatNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_BYTE, JAVA_INT)); - ext.glVertexAttribIFormatNV = load.invoke("glVertexAttribIFormatNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetIntegerui64i_vNV = load.invoke("glGetIntegerui64i_vNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static void glBufferAddressRangeNV(int pname, int index, long address, long length) { - final var ext = getExtCapabilities(); - try { - check(ext.glBufferAddressRangeNV).invokeExact(pname, index, address, length); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLNVVertexBufferUnifiedMemory { + int GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV = 0x8F1E; + int GL_ELEMENT_ARRAY_UNIFIED_NV = 0x8F1F; + int GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV = 0x8F20; + int GL_VERTEX_ARRAY_ADDRESS_NV = 0x8F21; + int GL_NORMAL_ARRAY_ADDRESS_NV = 0x8F22; + int GL_COLOR_ARRAY_ADDRESS_NV = 0x8F23; + int GL_INDEX_ARRAY_ADDRESS_NV = 0x8F24; + int GL_TEXTURE_COORD_ARRAY_ADDRESS_NV = 0x8F25; + int GL_EDGE_FLAG_ARRAY_ADDRESS_NV = 0x8F26; + int GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV = 0x8F27; + int GL_FOG_COORD_ARRAY_ADDRESS_NV = 0x8F28; + int GL_ELEMENT_ARRAY_ADDRESS_NV = 0x8F29; + int GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV = 0x8F2A; + int GL_VERTEX_ARRAY_LENGTH_NV = 0x8F2B; + int GL_NORMAL_ARRAY_LENGTH_NV = 0x8F2C; + int GL_COLOR_ARRAY_LENGTH_NV = 0x8F2D; + int GL_INDEX_ARRAY_LENGTH_NV = 0x8F2E; + int GL_TEXTURE_COORD_ARRAY_LENGTH_NV = 0x8F2F; + int GL_EDGE_FLAG_ARRAY_LENGTH_NV = 0x8F30; + int GL_SECONDARY_COLOR_ARRAY_LENGTH_NV = 0x8F31; + int GL_FOG_COORD_ARRAY_LENGTH_NV = 0x8F32; + int GL_ELEMENT_ARRAY_LENGTH_NV = 0x8F33; + int GL_DRAW_INDIRECT_UNIFIED_NV = 0x8F40; + int GL_DRAW_INDIRECT_ADDRESS_NV = 0x8F41; + int GL_DRAW_INDIRECT_LENGTH_NV = 0x8F42; + + default void glBufferAddressRangeNV(int pname, int index, long address, long length) { + throw new ContextException(); } - public static void glVertexFormatNV(int size, int type, int stride) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexFormatNV).invokeExact(size, type, stride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexFormatNV(int size, int type, int stride) { + throw new ContextException(); } - public static void glNormalFormatNV(int type, int stride) { - final var ext = getExtCapabilities(); - try { - check(ext.glNormalFormatNV).invokeExact(type, stride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNormalFormatNV(int type, int stride) { + throw new ContextException(); } - public static void glColorFormatNV(int size, int type, int stride) { - final var ext = getExtCapabilities(); - try { - check(ext.glColorFormatNV).invokeExact(size, type, stride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glColorFormatNV(int size, int type, int stride) { + throw new ContextException(); } - public static void glIndexFormatNV(int type, int stride) { - final var ext = getExtCapabilities(); - try { - check(ext.glIndexFormatNV).invokeExact(type, stride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glIndexFormatNV(int type, int stride) { + throw new ContextException(); } - public static void glTexCoordFormatNV(int size, int type, int stride) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoordFormatNV).invokeExact(size, type, stride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoordFormatNV(int size, int type, int stride) { + throw new ContextException(); } - public static void glEdgeFlagFormatNV(int stride) { - final var ext = getExtCapabilities(); - try { - check(ext.glEdgeFlagFormatNV).invokeExact(stride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEdgeFlagFormatNV(int stride) { + throw new ContextException(); } - public static void glSecondaryColorFormatNV(int size, int type, int stride) { - final var ext = getExtCapabilities(); - try { - check(ext.glSecondaryColorFormatNV).invokeExact(size, type, stride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSecondaryColorFormatNV(int size, int type, int stride) { + throw new ContextException(); } - public static void glFogCoordFormatNV(int type, int stride) { - final var ext = getExtCapabilities(); - try { - check(ext.glFogCoordFormatNV).invokeExact(type, stride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFogCoordFormatNV(int type, int stride) { + throw new ContextException(); } - public static void glVertexAttribFormatNV(int index, int size, int type, boolean normalized, int stride) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribFormatNV).invokeExact(index, size, type, normalized, stride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribFormatNV(int index, int size, int type, boolean normalized, int stride) { + throw new ContextException(); } - public static void glVertexAttribIFormatNV(int index, int size, int type, int stride) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribIFormatNV).invokeExact(index, size, type, stride); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribIFormatNV(int index, int size, int type, int stride) { + throw new ContextException(); } - public static void glGetIntegerui64i_vNV(int value, int index, @NativeType("GLuint64EXT *") MemorySegment result) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetIntegerui64i_vNV).invokeExact(value, index, result); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetIntegerui64i_vNV(int value, int index, @NativeType("GLuint64EXT *") MemorySegment result) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexProgram.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexProgram.java index 529aad74..08192cdd 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexProgram.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexProgram.java @@ -16,617 +16,352 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_vertex_program} */ -public final class GLNVVertexProgram { - public static final int GL_VERTEX_PROGRAM_NV = 0x8620; - public static final int GL_VERTEX_STATE_PROGRAM_NV = 0x8621; - public static final int GL_ATTRIB_ARRAY_SIZE_NV = 0x8623; - public static final int GL_ATTRIB_ARRAY_STRIDE_NV = 0x8624; - public static final int GL_ATTRIB_ARRAY_TYPE_NV = 0x8625; - public static final int GL_CURRENT_ATTRIB_NV = 0x8626; - public static final int GL_PROGRAM_LENGTH_NV = 0x8627; - public static final int GL_PROGRAM_STRING_NV = 0x8628; - public static final int GL_MODELVIEW_PROJECTION_NV = 0x8629; - public static final int GL_IDENTITY_NV = 0x862A; - public static final int GL_INVERSE_NV = 0x862B; - public static final int GL_TRANSPOSE_NV = 0x862C; - public static final int GL_INVERSE_TRANSPOSE_NV = 0x862D; - public static final int GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV = 0x862E; - public static final int GL_MAX_TRACK_MATRICES_NV = 0x862F; - public static final int GL_MATRIX0_NV = 0x8630; - public static final int GL_MATRIX1_NV = 0x8631; - public static final int GL_MATRIX2_NV = 0x8632; - public static final int GL_MATRIX3_NV = 0x8633; - public static final int GL_MATRIX4_NV = 0x8634; - public static final int GL_MATRIX5_NV = 0x8635; - public static final int GL_MATRIX6_NV = 0x8636; - public static final int GL_MATRIX7_NV = 0x8637; - public static final int GL_CURRENT_MATRIX_STACK_DEPTH_NV = 0x8640; - public static final int GL_CURRENT_MATRIX_NV = 0x8641; - public static final int GL_VERTEX_PROGRAM_POINT_SIZE_NV = 0x8642; - public static final int GL_VERTEX_PROGRAM_TWO_SIDE_NV = 0x8643; - public static final int GL_PROGRAM_PARAMETER_NV = 0x8644; - public static final int GL_ATTRIB_ARRAY_POINTER_NV = 0x8645; - public static final int GL_PROGRAM_TARGET_NV = 0x8646; - public static final int GL_PROGRAM_RESIDENT_NV = 0x8647; - public static final int GL_TRACK_MATRIX_NV = 0x8648; - public static final int GL_TRACK_MATRIX_TRANSFORM_NV = 0x8649; - public static final int GL_VERTEX_PROGRAM_BINDING_NV = 0x864A; - public static final int GL_PROGRAM_ERROR_POSITION_NV = 0x864B; - public static final int GL_VERTEX_ATTRIB_ARRAY0_NV = 0x8650; - public static final int GL_VERTEX_ATTRIB_ARRAY1_NV = 0x8651; - public static final int GL_VERTEX_ATTRIB_ARRAY2_NV = 0x8652; - public static final int GL_VERTEX_ATTRIB_ARRAY3_NV = 0x8653; - public static final int GL_VERTEX_ATTRIB_ARRAY4_NV = 0x8654; - public static final int GL_VERTEX_ATTRIB_ARRAY5_NV = 0x8655; - public static final int GL_VERTEX_ATTRIB_ARRAY6_NV = 0x8656; - public static final int GL_VERTEX_ATTRIB_ARRAY7_NV = 0x8657; - public static final int GL_VERTEX_ATTRIB_ARRAY8_NV = 0x8658; - public static final int GL_VERTEX_ATTRIB_ARRAY9_NV = 0x8659; - public static final int GL_VERTEX_ATTRIB_ARRAY10_NV = 0x865A; - public static final int GL_VERTEX_ATTRIB_ARRAY11_NV = 0x865B; - public static final int GL_VERTEX_ATTRIB_ARRAY12_NV = 0x865C; - public static final int GL_VERTEX_ATTRIB_ARRAY13_NV = 0x865D; - public static final int GL_VERTEX_ATTRIB_ARRAY14_NV = 0x865E; - public static final int GL_VERTEX_ATTRIB_ARRAY15_NV = 0x865F; - public static final int GL_MAP1_VERTEX_ATTRIB0_4_NV = 0x8660; - public static final int GL_MAP1_VERTEX_ATTRIB1_4_NV = 0x8661; - public static final int GL_MAP1_VERTEX_ATTRIB2_4_NV = 0x8662; - public static final int GL_MAP1_VERTEX_ATTRIB3_4_NV = 0x8663; - public static final int GL_MAP1_VERTEX_ATTRIB4_4_NV = 0x8664; - public static final int GL_MAP1_VERTEX_ATTRIB5_4_NV = 0x8665; - public static final int GL_MAP1_VERTEX_ATTRIB6_4_NV = 0x8666; - public static final int GL_MAP1_VERTEX_ATTRIB7_4_NV = 0x8667; - public static final int GL_MAP1_VERTEX_ATTRIB8_4_NV = 0x8668; - public static final int GL_MAP1_VERTEX_ATTRIB9_4_NV = 0x8669; - public static final int GL_MAP1_VERTEX_ATTRIB10_4_NV = 0x866A; - public static final int GL_MAP1_VERTEX_ATTRIB11_4_NV = 0x866B; - public static final int GL_MAP1_VERTEX_ATTRIB12_4_NV = 0x866C; - public static final int GL_MAP1_VERTEX_ATTRIB13_4_NV = 0x866D; - public static final int GL_MAP1_VERTEX_ATTRIB14_4_NV = 0x866E; - public static final int GL_MAP1_VERTEX_ATTRIB15_4_NV = 0x866F; - public static final int GL_MAP2_VERTEX_ATTRIB0_4_NV = 0x8670; - public static final int GL_MAP2_VERTEX_ATTRIB1_4_NV = 0x8671; - public static final int GL_MAP2_VERTEX_ATTRIB2_4_NV = 0x8672; - public static final int GL_MAP2_VERTEX_ATTRIB3_4_NV = 0x8673; - public static final int GL_MAP2_VERTEX_ATTRIB4_4_NV = 0x8674; - public static final int GL_MAP2_VERTEX_ATTRIB5_4_NV = 0x8675; - public static final int GL_MAP2_VERTEX_ATTRIB6_4_NV = 0x8676; - public static final int GL_MAP2_VERTEX_ATTRIB7_4_NV = 0x8677; - public static final int GL_MAP2_VERTEX_ATTRIB8_4_NV = 0x8678; - public static final int GL_MAP2_VERTEX_ATTRIB9_4_NV = 0x8679; - public static final int GL_MAP2_VERTEX_ATTRIB10_4_NV = 0x867A; - public static final int GL_MAP2_VERTEX_ATTRIB11_4_NV = 0x867B; - public static final int GL_MAP2_VERTEX_ATTRIB12_4_NV = 0x867C; - public static final int GL_MAP2_VERTEX_ATTRIB13_4_NV = 0x867D; - public static final int GL_MAP2_VERTEX_ATTRIB14_4_NV = 0x867E; - public static final int GL_MAP2_VERTEX_ATTRIB15_4_NV = 0x867F; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_vertex_program) return; - ext.glAreProgramsResidentNV = load.invoke("glAreProgramsResidentNV", of(JAVA_BYTE, JAVA_INT, ADDRESS, ADDRESS)); - ext.glBindProgramNV = load.invoke("glBindProgramNV", ofVoid(JAVA_INT, JAVA_INT)); - ext.glDeleteProgramsNV = load.invoke("glDeleteProgramsNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glExecuteProgramNV = load.invoke("glExecuteProgramNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGenProgramsNV = load.invoke("glGenProgramsNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glGetProgramParameterdvNV = load.invoke("glGetProgramParameterdvNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetProgramParameterfvNV = load.invoke("glGetProgramParameterfvNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetProgramivNV = load.invoke("glGetProgramivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetProgramStringNV = load.invoke("glGetProgramStringNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetTrackMatrixivNV = load.invoke("glGetTrackMatrixivNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVertexAttribdvNV = load.invoke("glGetVertexAttribdvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVertexAttribfvNV = load.invoke("glGetVertexAttribfvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVertexAttribivNV = load.invoke("glGetVertexAttribivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVertexAttribPointervNV = load.invoke("glGetVertexAttribPointervNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glIsProgramNV = load.invoke("glIsProgramNV", of(JAVA_BYTE, JAVA_INT)); - ext.glLoadProgramNV = load.invoke("glLoadProgramNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramParameter4dNV = load.invoke("glProgramParameter4dNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glProgramParameter4dvNV = load.invoke("glProgramParameter4dvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramParameter4fNV = load.invoke("glProgramParameter4fNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glProgramParameter4fvNV = load.invoke("glProgramParameter4fvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramParameters4dvNV = load.invoke("glProgramParameters4dvNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glProgramParameters4fvNV = load.invoke("glProgramParameters4fvNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glRequestResidentProgramsNV = load.invoke("glRequestResidentProgramsNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glTrackMatrixNV = load.invoke("glTrackMatrixNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glVertexAttribPointerNV = load.invoke("glVertexAttribPointerNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVertexAttrib1dNV = load.invoke("glVertexAttrib1dNV", ofVoid(JAVA_INT, JAVA_DOUBLE)); - ext.glVertexAttrib1dvNV = load.invoke("glVertexAttrib1dvNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib1fNV = load.invoke("glVertexAttrib1fNV", ofVoid(JAVA_INT, JAVA_FLOAT)); - ext.glVertexAttrib1fvNV = load.invoke("glVertexAttrib1fvNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib1sNV = load.invoke("glVertexAttrib1sNV", ofVoid(JAVA_INT, JAVA_SHORT)); - ext.glVertexAttrib1svNV = load.invoke("glVertexAttrib1svNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib2dNV = load.invoke("glVertexAttrib2dNV", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glVertexAttrib2dvNV = load.invoke("glVertexAttrib2dvNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib2fNV = load.invoke("glVertexAttrib2fNV", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glVertexAttrib2fvNV = load.invoke("glVertexAttrib2fvNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib2sNV = load.invoke("glVertexAttrib2sNV", ofVoid(JAVA_INT, JAVA_SHORT, JAVA_SHORT)); - ext.glVertexAttrib2svNV = load.invoke("glVertexAttrib2svNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib3dNV = load.invoke("glVertexAttrib3dNV", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glVertexAttrib3dvNV = load.invoke("glVertexAttrib3dvNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib3fNV = load.invoke("glVertexAttrib3fNV", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glVertexAttrib3fvNV = load.invoke("glVertexAttrib3fvNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib3sNV = load.invoke("glVertexAttrib3sNV", ofVoid(JAVA_INT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glVertexAttrib3svNV = load.invoke("glVertexAttrib3svNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib4dNV = load.invoke("glVertexAttrib4dNV", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); - ext.glVertexAttrib4dvNV = load.invoke("glVertexAttrib4dvNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib4fNV = load.invoke("glVertexAttrib4fNV", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glVertexAttrib4fvNV = load.invoke("glVertexAttrib4fvNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib4sNV = load.invoke("glVertexAttrib4sNV", ofVoid(JAVA_INT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT, JAVA_SHORT)); - ext.glVertexAttrib4svNV = load.invoke("glVertexAttrib4svNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttrib4ubNV = load.invoke("glVertexAttrib4ubNV", ofVoid(JAVA_INT, JAVA_BYTE, JAVA_BYTE, JAVA_BYTE, JAVA_BYTE)); - ext.glVertexAttrib4ubvNV = load.invoke("glVertexAttrib4ubvNV", ofVoid(JAVA_INT, ADDRESS)); - ext.glVertexAttribs1dvNV = load.invoke("glVertexAttribs1dvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVertexAttribs1fvNV = load.invoke("glVertexAttribs1fvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVertexAttribs1svNV = load.invoke("glVertexAttribs1svNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVertexAttribs2dvNV = load.invoke("glVertexAttribs2dvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVertexAttribs2fvNV = load.invoke("glVertexAttribs2fvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVertexAttribs2svNV = load.invoke("glVertexAttribs2svNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVertexAttribs3dvNV = load.invoke("glVertexAttribs3dvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVertexAttribs3fvNV = load.invoke("glVertexAttribs3fvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVertexAttribs3svNV = load.invoke("glVertexAttribs3svNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVertexAttribs4dvNV = load.invoke("glVertexAttribs4dvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVertexAttribs4fvNV = load.invoke("glVertexAttribs4fvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVertexAttribs4svNV = load.invoke("glVertexAttribs4svNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVertexAttribs4ubvNV = load.invoke("glVertexAttribs4ubvNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static boolean glAreProgramsResidentNV(int n, @NativeType("const GLuint *") MemorySegment programs, @NativeType("GLboolean *") MemorySegment residences) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glAreProgramsResidentNV).invokeExact(n, programs, residences); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glBindProgramNV(int target, int id) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindProgramNV).invokeExact(target, id); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glDeleteProgramsNV(int n, @NativeType("const GLuint *") MemorySegment programs) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteProgramsNV).invokeExact(n, programs); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glExecuteProgramNV(int target, int id, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glExecuteProgramNV).invokeExact(target, id, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glGenProgramsNV(int n, @NativeType("GLuint *") MemorySegment programs) { - final var ext = getExtCapabilities(); - try { - check(ext.glGenProgramsNV).invokeExact(n, programs); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glGetProgramParameterdvNV(int target, int index, int pname, @NativeType("GLdouble *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetProgramParameterdvNV).invokeExact(target, index, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glGetProgramParameterfvNV(int target, int index, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetProgramParameterfvNV).invokeExact(target, index, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glGetProgramivNV(int id, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetProgramivNV).invokeExact(id, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glGetProgramStringNV(int id, int pname, @NativeType("GLubyte *") MemorySegment program) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetProgramStringNV).invokeExact(id, pname, program); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glGetTrackMatrixivNV(int target, int address, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetTrackMatrixivNV).invokeExact(target, address, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLNVVertexProgram { + int GL_VERTEX_PROGRAM_NV = 0x8620; + int GL_VERTEX_STATE_PROGRAM_NV = 0x8621; + int GL_ATTRIB_ARRAY_SIZE_NV = 0x8623; + int GL_ATTRIB_ARRAY_STRIDE_NV = 0x8624; + int GL_ATTRIB_ARRAY_TYPE_NV = 0x8625; + int GL_CURRENT_ATTRIB_NV = 0x8626; + int GL_PROGRAM_LENGTH_NV = 0x8627; + int GL_PROGRAM_STRING_NV = 0x8628; + int GL_MODELVIEW_PROJECTION_NV = 0x8629; + int GL_IDENTITY_NV = 0x862A; + int GL_INVERSE_NV = 0x862B; + int GL_TRANSPOSE_NV = 0x862C; + int GL_INVERSE_TRANSPOSE_NV = 0x862D; + int GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV = 0x862E; + int GL_MAX_TRACK_MATRICES_NV = 0x862F; + int GL_MATRIX0_NV = 0x8630; + int GL_MATRIX1_NV = 0x8631; + int GL_MATRIX2_NV = 0x8632; + int GL_MATRIX3_NV = 0x8633; + int GL_MATRIX4_NV = 0x8634; + int GL_MATRIX5_NV = 0x8635; + int GL_MATRIX6_NV = 0x8636; + int GL_MATRIX7_NV = 0x8637; + int GL_CURRENT_MATRIX_STACK_DEPTH_NV = 0x8640; + int GL_CURRENT_MATRIX_NV = 0x8641; + int GL_VERTEX_PROGRAM_POINT_SIZE_NV = 0x8642; + int GL_VERTEX_PROGRAM_TWO_SIDE_NV = 0x8643; + int GL_PROGRAM_PARAMETER_NV = 0x8644; + int GL_ATTRIB_ARRAY_POINTER_NV = 0x8645; + int GL_PROGRAM_TARGET_NV = 0x8646; + int GL_PROGRAM_RESIDENT_NV = 0x8647; + int GL_TRACK_MATRIX_NV = 0x8648; + int GL_TRACK_MATRIX_TRANSFORM_NV = 0x8649; + int GL_VERTEX_PROGRAM_BINDING_NV = 0x864A; + int GL_PROGRAM_ERROR_POSITION_NV = 0x864B; + int GL_VERTEX_ATTRIB_ARRAY0_NV = 0x8650; + int GL_VERTEX_ATTRIB_ARRAY1_NV = 0x8651; + int GL_VERTEX_ATTRIB_ARRAY2_NV = 0x8652; + int GL_VERTEX_ATTRIB_ARRAY3_NV = 0x8653; + int GL_VERTEX_ATTRIB_ARRAY4_NV = 0x8654; + int GL_VERTEX_ATTRIB_ARRAY5_NV = 0x8655; + int GL_VERTEX_ATTRIB_ARRAY6_NV = 0x8656; + int GL_VERTEX_ATTRIB_ARRAY7_NV = 0x8657; + int GL_VERTEX_ATTRIB_ARRAY8_NV = 0x8658; + int GL_VERTEX_ATTRIB_ARRAY9_NV = 0x8659; + int GL_VERTEX_ATTRIB_ARRAY10_NV = 0x865A; + int GL_VERTEX_ATTRIB_ARRAY11_NV = 0x865B; + int GL_VERTEX_ATTRIB_ARRAY12_NV = 0x865C; + int GL_VERTEX_ATTRIB_ARRAY13_NV = 0x865D; + int GL_VERTEX_ATTRIB_ARRAY14_NV = 0x865E; + int GL_VERTEX_ATTRIB_ARRAY15_NV = 0x865F; + int GL_MAP1_VERTEX_ATTRIB0_4_NV = 0x8660; + int GL_MAP1_VERTEX_ATTRIB1_4_NV = 0x8661; + int GL_MAP1_VERTEX_ATTRIB2_4_NV = 0x8662; + int GL_MAP1_VERTEX_ATTRIB3_4_NV = 0x8663; + int GL_MAP1_VERTEX_ATTRIB4_4_NV = 0x8664; + int GL_MAP1_VERTEX_ATTRIB5_4_NV = 0x8665; + int GL_MAP1_VERTEX_ATTRIB6_4_NV = 0x8666; + int GL_MAP1_VERTEX_ATTRIB7_4_NV = 0x8667; + int GL_MAP1_VERTEX_ATTRIB8_4_NV = 0x8668; + int GL_MAP1_VERTEX_ATTRIB9_4_NV = 0x8669; + int GL_MAP1_VERTEX_ATTRIB10_4_NV = 0x866A; + int GL_MAP1_VERTEX_ATTRIB11_4_NV = 0x866B; + int GL_MAP1_VERTEX_ATTRIB12_4_NV = 0x866C; + int GL_MAP1_VERTEX_ATTRIB13_4_NV = 0x866D; + int GL_MAP1_VERTEX_ATTRIB14_4_NV = 0x866E; + int GL_MAP1_VERTEX_ATTRIB15_4_NV = 0x866F; + int GL_MAP2_VERTEX_ATTRIB0_4_NV = 0x8670; + int GL_MAP2_VERTEX_ATTRIB1_4_NV = 0x8671; + int GL_MAP2_VERTEX_ATTRIB2_4_NV = 0x8672; + int GL_MAP2_VERTEX_ATTRIB3_4_NV = 0x8673; + int GL_MAP2_VERTEX_ATTRIB4_4_NV = 0x8674; + int GL_MAP2_VERTEX_ATTRIB5_4_NV = 0x8675; + int GL_MAP2_VERTEX_ATTRIB6_4_NV = 0x8676; + int GL_MAP2_VERTEX_ATTRIB7_4_NV = 0x8677; + int GL_MAP2_VERTEX_ATTRIB8_4_NV = 0x8678; + int GL_MAP2_VERTEX_ATTRIB9_4_NV = 0x8679; + int GL_MAP2_VERTEX_ATTRIB10_4_NV = 0x867A; + int GL_MAP2_VERTEX_ATTRIB11_4_NV = 0x867B; + int GL_MAP2_VERTEX_ATTRIB12_4_NV = 0x867C; + int GL_MAP2_VERTEX_ATTRIB13_4_NV = 0x867D; + int GL_MAP2_VERTEX_ATTRIB14_4_NV = 0x867E; + int GL_MAP2_VERTEX_ATTRIB15_4_NV = 0x867F; + + default boolean glAreProgramsResidentNV(int n, @NativeType("const GLuint *") MemorySegment programs, @NativeType("GLboolean *") MemorySegment residences) { + throw new ContextException(); + } + + default void glBindProgramNV(int target, int id) { + throw new ContextException(); + } + + default void glDeleteProgramsNV(int n, @NativeType("const GLuint *") MemorySegment programs) { + throw new ContextException(); + } + + default void glExecuteProgramNV(int target, int id, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); + } + + default void glGenProgramsNV(int n, @NativeType("GLuint *") MemorySegment programs) { + throw new ContextException(); + } + + default void glGetProgramParameterdvNV(int target, int index, int pname, @NativeType("GLdouble *") MemorySegment params) { + throw new ContextException(); + } + + default void glGetProgramParameterfvNV(int target, int index, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); + } + + default void glGetProgramivNV(int id, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); + } + + default void glGetProgramStringNV(int id, int pname, @NativeType("GLubyte *") MemorySegment program) { + throw new ContextException(); + } + + default void glGetTrackMatrixivNV(int target, int address, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetVertexAttribdvNV(int index, int pname, @NativeType("GLdouble *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVertexAttribdvNV).invokeExact(index, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVertexAttribdvNV(int index, int pname, @NativeType("GLdouble *") MemorySegment params) { + throw new ContextException(); } - public static void glGetVertexAttribfvNV(int index, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVertexAttribfvNV).invokeExact(index, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVertexAttribfvNV(int index, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetVertexAttribivNV(int index, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVertexAttribivNV).invokeExact(index, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVertexAttribivNV(int index, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetVertexAttribPointervNV(int index, int pname, @NativeType("void **") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVertexAttribPointervNV).invokeExact(index, pname, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVertexAttribPointervNV(int index, int pname, @NativeType("void **") MemorySegment pointer) { + throw new ContextException(); } - public static boolean glIsProgramNV(int id) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsProgramNV).invokeExact(id); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsProgramNV(int id) { + throw new ContextException(); } - public static void glLoadProgramNV(int target, int id, int len, @NativeType("const GLubyte *") MemorySegment program) { - final var ext = getExtCapabilities(); - try { - check(ext.glLoadProgramNV).invokeExact(target, id, len, program); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glLoadProgramNV(int target, int id, int len, @NativeType("const GLubyte *") MemorySegment program) { + throw new ContextException(); } - public static void glProgramParameter4dNV(int target, int index, double x, double y, double z, double w) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramParameter4dNV).invokeExact(target, index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramParameter4dNV(int target, int index, double x, double y, double z, double w) { + throw new ContextException(); } - public static void glProgramParameter4dvNV(int target, int index, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramParameter4dvNV).invokeExact(target, index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramParameter4dvNV(int target, int index, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glProgramParameter4fNV(int target, int index, float x, float y, float z, float w) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramParameter4fNV).invokeExact(target, index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramParameter4fNV(int target, int index, float x, float y, float z, float w) { + throw new ContextException(); } - public static void glProgramParameter4fvNV(int target, int index, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramParameter4fvNV).invokeExact(target, index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramParameter4fvNV(int target, int index, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glProgramParameters4dvNV(int target, int index, int count, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramParameters4dvNV).invokeExact(target, index, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramParameters4dvNV(int target, int index, int count, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glProgramParameters4fvNV(int target, int index, int count, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glProgramParameters4fvNV).invokeExact(target, index, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glProgramParameters4fvNV(int target, int index, int count, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glRequestResidentProgramsNV(int n, @NativeType("const GLuint *") MemorySegment programs) { - final var ext = getExtCapabilities(); - try { - check(ext.glRequestResidentProgramsNV).invokeExact(n, programs); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glRequestResidentProgramsNV(int n, @NativeType("const GLuint *") MemorySegment programs) { + throw new ContextException(); } - public static void glTrackMatrixNV(int target, int address, int matrix, int transform) { - final var ext = getExtCapabilities(); - try { - check(ext.glTrackMatrixNV).invokeExact(target, address, matrix, transform); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTrackMatrixNV(int target, int address, int matrix, int transform) { + throw new ContextException(); } - public static void glVertexAttribPointerNV(int index, int fsize, int type, int stride, @NativeType("const void *") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribPointerNV).invokeExact(index, fsize, type, stride, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribPointerNV(int index, int fsize, int type, int stride, @NativeType("const void *") MemorySegment pointer) { + throw new ContextException(); } - public static void glVertexAttrib1dNV(int index, double x) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib1dNV).invokeExact(index, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib1dNV(int index, double x) { + throw new ContextException(); } - public static void glVertexAttrib1dvNV(int index, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib1dvNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib1dvNV(int index, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib1fNV(int index, float x) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib1fNV).invokeExact(index, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib1fNV(int index, float x) { + throw new ContextException(); } - public static void glVertexAttrib1fvNV(int index, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib1fvNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib1fvNV(int index, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib1sNV(int index, short x) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib1sNV).invokeExact(index, x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib1sNV(int index, short x) { + throw new ContextException(); } - public static void glVertexAttrib1svNV(int index, @NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib1svNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib1svNV(int index, @NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib2dNV(int index, double x, double y) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib2dNV).invokeExact(index, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib2dNV(int index, double x, double y) { + throw new ContextException(); } - public static void glVertexAttrib2dvNV(int index, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib2dvNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib2dvNV(int index, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib2fNV(int index, float x, float y) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib2fNV).invokeExact(index, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib2fNV(int index, float x, float y) { + throw new ContextException(); } - public static void glVertexAttrib2fvNV(int index, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib2fvNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib2fvNV(int index, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib2sNV(int index, short x, short y) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib2sNV).invokeExact(index, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib2sNV(int index, short x, short y) { + throw new ContextException(); } - public static void glVertexAttrib2svNV(int index, @NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib2svNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib2svNV(int index, @NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib3dNV(int index, double x, double y, double z) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib3dNV).invokeExact(index, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib3dNV(int index, double x, double y, double z) { + throw new ContextException(); } - public static void glVertexAttrib3dvNV(int index, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib3dvNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib3dvNV(int index, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib3fNV(int index, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib3fNV).invokeExact(index, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib3fNV(int index, float x, float y, float z) { + throw new ContextException(); } - public static void glVertexAttrib3fvNV(int index, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib3fvNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib3fvNV(int index, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib3sNV(int index, short x, short y, short z) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib3sNV).invokeExact(index, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib3sNV(int index, short x, short y, short z) { + throw new ContextException(); } - public static void glVertexAttrib3svNV(int index, @NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib3svNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib3svNV(int index, @NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib4dNV(int index, double x, double y, double z, double w) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4dNV).invokeExact(index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4dNV(int index, double x, double y, double z, double w) { + throw new ContextException(); } - public static void glVertexAttrib4dvNV(int index, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4dvNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4dvNV(int index, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib4fNV(int index, float x, float y, float z, float w) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4fNV).invokeExact(index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4fNV(int index, float x, float y, float z, float w) { + throw new ContextException(); } - public static void glVertexAttrib4fvNV(int index, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4fvNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4fvNV(int index, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib4sNV(int index, short x, short y, short z, short w) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4sNV).invokeExact(index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4sNV(int index, short x, short y, short z, short w) { + throw new ContextException(); } - public static void glVertexAttrib4svNV(int index, @NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4svNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4svNV(int index, @NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttrib4ubNV(int index, byte x, byte y, byte z, byte w) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4ubNV).invokeExact(index, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4ubNV(int index, byte x, byte y, byte z, byte w) { + throw new ContextException(); } - public static void glVertexAttrib4ubvNV(int index, @NativeType("const GLubyte *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttrib4ubvNV).invokeExact(index, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttrib4ubvNV(int index, @NativeType("const GLubyte *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribs1dvNV(int index, int count, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribs1dvNV).invokeExact(index, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribs1dvNV(int index, int count, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribs1fvNV(int index, int count, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribs1fvNV).invokeExact(index, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribs1fvNV(int index, int count, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribs1svNV(int index, int count, @NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribs1svNV).invokeExact(index, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribs1svNV(int index, int count, @NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribs2dvNV(int index, int count, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribs2dvNV).invokeExact(index, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribs2dvNV(int index, int count, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribs2fvNV(int index, int count, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribs2fvNV).invokeExact(index, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribs2fvNV(int index, int count, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribs2svNV(int index, int count, @NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribs2svNV).invokeExact(index, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribs2svNV(int index, int count, @NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribs3dvNV(int index, int count, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribs3dvNV).invokeExact(index, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribs3dvNV(int index, int count, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribs3fvNV(int index, int count, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribs3fvNV).invokeExact(index, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribs3fvNV(int index, int count, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribs3svNV(int index, int count, @NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribs3svNV).invokeExact(index, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribs3svNV(int index, int count, @NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribs4dvNV(int index, int count, @NativeType("const GLdouble *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribs4dvNV).invokeExact(index, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribs4dvNV(int index, int count, @NativeType("const GLdouble *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribs4fvNV(int index, int count, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribs4fvNV).invokeExact(index, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribs4fvNV(int index, int count, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribs4svNV(int index, int count, @NativeType("const GLshort *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribs4svNV).invokeExact(index, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribs4svNV(int index, int count, @NativeType("const GLshort *") MemorySegment v) { + throw new ContextException(); } - public static void glVertexAttribs4ubvNV(int index, int count, @NativeType("const GLubyte *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertexAttribs4ubvNV).invokeExact(index, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertexAttribs4ubvNV(int index, int count, @NativeType("const GLubyte *") MemorySegment v) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexProgram4.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexProgram4.java index 775ada27..fff94309 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexProgram4.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVertexProgram4.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_vertex_program4} */ -public final class GLNVVertexProgram4 { - public static final int GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV = 0x88FD; +public interface GLNVVertexProgram4 { + int GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV = 0x88FD; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVideoCapture.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVideoCapture.java index 5a46913e..be21573e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVideoCapture.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVVideoCapture.java @@ -16,146 +16,90 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_video_capture} */ -public final class GLNVVideoCapture { - public static final int GL_VIDEO_BUFFER_NV = 0x9020; - public static final int GL_VIDEO_BUFFER_BINDING_NV = 0x9021; - public static final int GL_FIELD_UPPER_NV = 0x9022; - public static final int GL_FIELD_LOWER_NV = 0x9023; - public static final int GL_NUM_VIDEO_CAPTURE_STREAMS_NV = 0x9024; - public static final int GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV = 0x9025; - public static final int GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV = 0x9026; - public static final int GL_LAST_VIDEO_CAPTURE_STATUS_NV = 0x9027; - public static final int GL_VIDEO_BUFFER_PITCH_NV = 0x9028; - public static final int GL_VIDEO_COLOR_CONVERSION_MATRIX_NV = 0x9029; - public static final int GL_VIDEO_COLOR_CONVERSION_MAX_NV = 0x902A; - public static final int GL_VIDEO_COLOR_CONVERSION_MIN_NV = 0x902B; - public static final int GL_VIDEO_COLOR_CONVERSION_OFFSET_NV = 0x902C; - public static final int GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV = 0x902D; - public static final int GL_PARTIAL_SUCCESS_NV = 0x902E; - public static final int GL_SUCCESS_NV = 0x902F; - public static final int GL_FAILURE_NV = 0x9030; - public static final int GL_YCBYCR8_422_NV = 0x9031; - public static final int GL_YCBAYCR8A_4224_NV = 0x9032; - public static final int GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV = 0x9033; - public static final int GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV = 0x9034; - public static final int GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV = 0x9035; - public static final int GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV = 0x9036; - public static final int GL_Z4Y12Z4CB12Z4CR12_444_NV = 0x9037; - public static final int GL_VIDEO_CAPTURE_FRAME_WIDTH_NV = 0x9038; - public static final int GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV = 0x9039; - public static final int GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV = 0x903A; - public static final int GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV = 0x903B; - public static final int GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV = 0x903C; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_video_capture) return; - ext.glBeginVideoCaptureNV = load.invoke("glBeginVideoCaptureNV", ofVoid(JAVA_INT)); - ext.glBindVideoCaptureStreamBufferNV = load.invoke("glBindVideoCaptureStreamBufferNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG)); - ext.glBindVideoCaptureStreamTextureNV = load.invoke("glBindVideoCaptureStreamTextureNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glEndVideoCaptureNV = load.invoke("glEndVideoCaptureNV", ofVoid(JAVA_INT)); - ext.glGetVideoCaptureivNV = load.invoke("glGetVideoCaptureivNV", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVideoCaptureStreamivNV = load.invoke("glGetVideoCaptureStreamivNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVideoCaptureStreamfvNV = load.invoke("glGetVideoCaptureStreamfvNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetVideoCaptureStreamdvNV = load.invoke("glGetVideoCaptureStreamdvNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVideoCaptureNV = load.invoke("glVideoCaptureNV", of(JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - ext.glVideoCaptureStreamParameterivNV = load.invoke("glVideoCaptureStreamParameterivNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVideoCaptureStreamParameterfvNV = load.invoke("glVideoCaptureStreamParameterfvNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVideoCaptureStreamParameterdvNV = load.invoke("glVideoCaptureStreamParameterdvNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } - - public static void glBeginVideoCaptureNV(int video_capture_slot) { - final var ext = getExtCapabilities(); - try { - check(ext.glBeginVideoCaptureNV).invokeExact(video_capture_slot); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLNVVideoCapture { + int GL_VIDEO_BUFFER_NV = 0x9020; + int GL_VIDEO_BUFFER_BINDING_NV = 0x9021; + int GL_FIELD_UPPER_NV = 0x9022; + int GL_FIELD_LOWER_NV = 0x9023; + int GL_NUM_VIDEO_CAPTURE_STREAMS_NV = 0x9024; + int GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV = 0x9025; + int GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV = 0x9026; + int GL_LAST_VIDEO_CAPTURE_STATUS_NV = 0x9027; + int GL_VIDEO_BUFFER_PITCH_NV = 0x9028; + int GL_VIDEO_COLOR_CONVERSION_MATRIX_NV = 0x9029; + int GL_VIDEO_COLOR_CONVERSION_MAX_NV = 0x902A; + int GL_VIDEO_COLOR_CONVERSION_MIN_NV = 0x902B; + int GL_VIDEO_COLOR_CONVERSION_OFFSET_NV = 0x902C; + int GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV = 0x902D; + int GL_PARTIAL_SUCCESS_NV = 0x902E; + int GL_SUCCESS_NV = 0x902F; + int GL_FAILURE_NV = 0x9030; + int GL_YCBYCR8_422_NV = 0x9031; + int GL_YCBAYCR8A_4224_NV = 0x9032; + int GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV = 0x9033; + int GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV = 0x9034; + int GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV = 0x9035; + int GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV = 0x9036; + int GL_Z4Y12Z4CB12Z4CR12_444_NV = 0x9037; + int GL_VIDEO_CAPTURE_FRAME_WIDTH_NV = 0x9038; + int GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV = 0x9039; + int GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV = 0x903A; + int GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV = 0x903B; + int GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV = 0x903C; + + default void glBeginVideoCaptureNV(int video_capture_slot) { + throw new ContextException(); } - public static void glBindVideoCaptureStreamBufferNV(int video_capture_slot, int stream, int frame_region, long offset) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindVideoCaptureStreamBufferNV).invokeExact(video_capture_slot, stream, frame_region, offset); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBindVideoCaptureStreamBufferNV(int video_capture_slot, int stream, int frame_region, long offset) { + throw new ContextException(); } - public static void glBindVideoCaptureStreamTextureNV(int video_capture_slot, int stream, int frame_region, int target, int texture) { - final var ext = getExtCapabilities(); - try { - check(ext.glBindVideoCaptureStreamTextureNV).invokeExact(video_capture_slot, stream, frame_region, target, texture); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBindVideoCaptureStreamTextureNV(int video_capture_slot, int stream, int frame_region, int target, int texture) { + throw new ContextException(); } - public static void glEndVideoCaptureNV(int video_capture_slot) { - final var ext = getExtCapabilities(); - try { - check(ext.glEndVideoCaptureNV).invokeExact(video_capture_slot); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEndVideoCaptureNV(int video_capture_slot) { + throw new ContextException(); } - public static void glGetVideoCaptureivNV(int video_capture_slot, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVideoCaptureivNV).invokeExact(video_capture_slot, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVideoCaptureivNV(int video_capture_slot, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetVideoCaptureStreamivNV(int video_capture_slot, int stream, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVideoCaptureStreamivNV).invokeExact(video_capture_slot, stream, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVideoCaptureStreamivNV(int video_capture_slot, int stream, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetVideoCaptureStreamfvNV(int video_capture_slot, int stream, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVideoCaptureStreamfvNV).invokeExact(video_capture_slot, stream, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVideoCaptureStreamfvNV(int video_capture_slot, int stream, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetVideoCaptureStreamdvNV(int video_capture_slot, int stream, int pname, @NativeType("GLdouble *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetVideoCaptureStreamdvNV).invokeExact(video_capture_slot, stream, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetVideoCaptureStreamdvNV(int video_capture_slot, int stream, int pname, @NativeType("GLdouble *") MemorySegment params) { + throw new ContextException(); } - public static int glVideoCaptureNV(int video_capture_slot, @NativeType("GLuint *") MemorySegment sequence_num, @NativeType("GLuint64EXT *") MemorySegment capture_time) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glVideoCaptureNV).invokeExact(video_capture_slot, sequence_num, capture_time); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glVideoCaptureNV(int video_capture_slot, @NativeType("GLuint *") MemorySegment sequence_num, @NativeType("GLuint64EXT *") MemorySegment capture_time) { + throw new ContextException(); } - public static void glVideoCaptureStreamParameterivNV(int video_capture_slot, int stream, int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glVideoCaptureStreamParameterivNV).invokeExact(video_capture_slot, stream, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVideoCaptureStreamParameterivNV(int video_capture_slot, int stream, int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glVideoCaptureStreamParameterfvNV(int video_capture_slot, int stream, int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glVideoCaptureStreamParameterfvNV).invokeExact(video_capture_slot, stream, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVideoCaptureStreamParameterfvNV(int video_capture_slot, int stream, int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glVideoCaptureStreamParameterdvNV(int video_capture_slot, int stream, int pname, @NativeType("const GLdouble *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glVideoCaptureStreamParameterdvNV).invokeExact(video_capture_slot, stream, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVideoCaptureStreamParameterdvNV(int video_capture_slot, int stream, int pname, @NativeType("const GLdouble *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVViewportSwizzle.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVViewportSwizzle.java index c3b1a994..5fa51d37 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVViewportSwizzle.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVViewportSwizzle.java @@ -16,40 +16,29 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NV_viewport_swizzle} */ -public final class GLNVViewportSwizzle { - public static final int GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV = 0x9350; - public static final int GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV = 0x9351; - public static final int GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV = 0x9352; - public static final int GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV = 0x9353; - public static final int GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV = 0x9354; - public static final int GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV = 0x9355; - public static final int GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV = 0x9356; - public static final int GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV = 0x9357; - public static final int GL_VIEWPORT_SWIZZLE_X_NV = 0x9358; - public static final int GL_VIEWPORT_SWIZZLE_Y_NV = 0x9359; - public static final int GL_VIEWPORT_SWIZZLE_Z_NV = 0x935A; - public static final int GL_VIEWPORT_SWIZZLE_W_NV = 0x935B; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NV_viewport_swizzle) return; - ext.glViewportSwizzleNV = load.invoke("glViewportSwizzleNV", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLNVViewportSwizzle { + int GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV = 0x9350; + int GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV = 0x9351; + int GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV = 0x9352; + int GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV = 0x9353; + int GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV = 0x9354; + int GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV = 0x9355; + int GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV = 0x9356; + int GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV = 0x9357; + int GL_VIEWPORT_SWIZZLE_X_NV = 0x9358; + int GL_VIEWPORT_SWIZZLE_Y_NV = 0x9359; + int GL_VIEWPORT_SWIZZLE_Z_NV = 0x935A; + int GL_VIEWPORT_SWIZZLE_W_NV = 0x935B; - public static void glViewportSwizzleNV(int index, int swizzlex, int swizzley, int swizzlez, int swizzlew) { - final var ext = getExtCapabilities(); - try { - check(ext.glViewportSwizzleNV).invokeExact(index, swizzlex, swizzley, swizzlez, swizzlew); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glViewportSwizzleNV(int index, int swizzlex, int swizzley, int swizzlez, int swizzlew) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVXConditionalRender.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVXConditionalRender.java index 147dbdd9..5b1d41ff 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVXConditionalRender.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVXConditionalRender.java @@ -16,36 +16,21 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NVX_conditional_render} */ -public final class GLNVXConditionalRender { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NVX_conditional_render) return; - ext.glBeginConditionalRenderNVX = load.invoke("glBeginConditionalRenderNVX", ofVoid(JAVA_INT)); - ext.glEndConditionalRenderNVX = load.invoke("glEndConditionalRenderNVX", ofVoid()); - } +public interface GLNVXConditionalRender { - public static void glBeginConditionalRenderNVX(int id) { - final var ext = getExtCapabilities(); - try { - check(ext.glBeginConditionalRenderNVX).invokeExact(id); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBeginConditionalRenderNVX(int id) { + throw new ContextException(); } - public static void glEndConditionalRenderNVX() { - final var ext = getExtCapabilities(); - try { - check(ext.glEndConditionalRenderNVX).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEndConditionalRenderNVX() { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVXGpuMemoryInfo.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVXGpuMemoryInfo.java index 4e22beb6..c98c6f3e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVXGpuMemoryInfo.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVXGpuMemoryInfo.java @@ -16,21 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NVX_gpu_memory_info} */ -public final class GLNVXGpuMemoryInfo { - public static final int GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX = 0x9047; - public static final int GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX = 0x9048; - public static final int GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX = 0x9049; - public static final int GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX = 0x904A; - public static final int GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX = 0x904B; +public interface GLNVXGpuMemoryInfo { + int GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX = 0x9047; + int GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX = 0x9048; + int GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX = 0x9049; + int GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX = 0x904A; + int GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX = 0x904B; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVXGpuMulticast2.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVXGpuMulticast2.java index 23477d0a..9c75f3c3 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVXGpuMulticast2.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVXGpuMulticast2.java @@ -16,71 +16,38 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NVX_gpu_multicast2} */ -public final class GLNVXGpuMulticast2 { - public static final int GL_UPLOAD_GPU_MASK_NVX = 0x954A; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NVX_gpu_multicast2) return; - ext.glUploadGpuMaskNVX = load.invoke("glUploadGpuMaskNVX", ofVoid(JAVA_INT)); - ext.glMulticastViewportArrayvNVX = load.invoke("glMulticastViewportArrayvNVX", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMulticastViewportPositionWScaleNVX = load.invoke("glMulticastViewportPositionWScaleNVX", ofVoid(JAVA_INT, JAVA_INT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glMulticastScissorArrayvNVX = load.invoke("glMulticastScissorArrayvNVX", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glAsyncCopyBufferSubDataNVX = load.invoke("glAsyncCopyBufferSubDataNVX", of(JAVA_INT, JAVA_INT, ADDRESS, ADDRESS, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_INT, ADDRESS, ADDRESS)); - ext.glAsyncCopyImageSubDataNVX = load.invoke("glAsyncCopyImageSubDataNVX", of(JAVA_INT, JAVA_INT, ADDRESS, ADDRESS, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - } +public interface GLNVXGpuMulticast2 { + int GL_UPLOAD_GPU_MASK_NVX = 0x954A; - public static void glUploadGpuMaskNVX(int mask) { - final var ext = getExtCapabilities(); - try { - check(ext.glUploadGpuMaskNVX).invokeExact(mask); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glUploadGpuMaskNVX(int mask) { + throw new ContextException(); } - public static void glMulticastViewportArrayvNVX(int gpu, int first, int count, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMulticastViewportArrayvNVX).invokeExact(gpu, first, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMulticastViewportArrayvNVX(int gpu, int first, int count, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glMulticastViewportPositionWScaleNVX(int gpu, int index, float xcoeff, float ycoeff) { - final var ext = getExtCapabilities(); - try { - check(ext.glMulticastViewportPositionWScaleNVX).invokeExact(gpu, index, xcoeff, ycoeff); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMulticastViewportPositionWScaleNVX(int gpu, int index, float xcoeff, float ycoeff) { + throw new ContextException(); } - public static void glMulticastScissorArrayvNVX(int gpu, int first, int count, @NativeType("const GLint *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glMulticastScissorArrayvNVX).invokeExact(gpu, first, count, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMulticastScissorArrayvNVX(int gpu, int first, int count, @NativeType("const GLint *") MemorySegment v) { + throw new ContextException(); } - public static int glAsyncCopyBufferSubDataNVX(int waitSemaphoreCount, @NativeType("const GLuint *") MemorySegment waitSemaphoreArray, @NativeType("const GLuint64 *") MemorySegment fenceValueArray, int readGpu, int writeGpuMask, int readBuffer, int writeBuffer, long readOffset, long writeOffset, long size, int signalSemaphoreCount, @NativeType("const GLuint *") MemorySegment signalSemaphoreArray, @NativeType("const GLuint64 *") MemorySegment signalValueArray) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glAsyncCopyBufferSubDataNVX).invokeExact(waitSemaphoreCount, waitSemaphoreArray, fenceValueArray, readGpu, writeGpuMask, readBuffer, writeBuffer, readOffset, writeOffset, size, signalSemaphoreCount, signalSemaphoreArray, signalValueArray); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glAsyncCopyBufferSubDataNVX(int waitSemaphoreCount, @NativeType("const GLuint *") MemorySegment waitSemaphoreArray, @NativeType("const GLuint64 *") MemorySegment fenceValueArray, int readGpu, int writeGpuMask, int readBuffer, int writeBuffer, long readOffset, long writeOffset, long size, int signalSemaphoreCount, @NativeType("const GLuint *") MemorySegment signalSemaphoreArray, @NativeType("const GLuint64 *") MemorySegment signalValueArray) { + throw new ContextException(); } - public static int glAsyncCopyImageSubDataNVX(int waitSemaphoreCount, @NativeType("const GLuint *") MemorySegment waitSemaphoreArray, @NativeType("const GLuint64 *") MemorySegment waitValueArray, int srcGpu, int dstGpuMask, int srcName, int srcTarget, int srcLevel, int srcX, int srcY, int srcZ, int dstName, int dstTarget, int dstLevel, int dstX, int dstY, int dstZ, int srcWidth, int srcHeight, int srcDepth, int signalSemaphoreCount, @NativeType("const GLuint *") MemorySegment signalSemaphoreArray, @NativeType("const GLuint64 *") MemorySegment signalValueArray) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glAsyncCopyImageSubDataNVX).invokeExact(waitSemaphoreCount, waitSemaphoreArray, waitValueArray, srcGpu, dstGpuMask, srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth, signalSemaphoreCount, signalSemaphoreArray, signalValueArray); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glAsyncCopyImageSubDataNVX(int waitSemaphoreCount, @NativeType("const GLuint *") MemorySegment waitSemaphoreArray, @NativeType("const GLuint64 *") MemorySegment waitValueArray, int srcGpu, int dstGpuMask, int srcName, int srcTarget, int srcLevel, int srcX, int srcY, int srcZ, int dstName, int dstTarget, int dstLevel, int dstX, int dstY, int dstZ, int srcWidth, int srcHeight, int srcDepth, int signalSemaphoreCount, @NativeType("const GLuint *") MemorySegment signalSemaphoreArray, @NativeType("const GLuint64 *") MemorySegment signalValueArray) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVXLinkedGpuMulticast.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVXLinkedGpuMulticast.java index 744ae92a..bd8fc8ca 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVXLinkedGpuMulticast.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVXLinkedGpuMulticast.java @@ -16,46 +16,27 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NVX_linked_gpu_multicast} */ -public final class GLNVXLinkedGpuMulticast { - public static final int GL_LGPU_SEPARATE_STORAGE_BIT_NVX = 0x0800; - public static final int GL_MAX_LGPU_GPUS_NVX = 0x92BA; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NVX_linked_gpu_multicast) return; - ext.glLGPUNamedBufferSubDataNVX = load.invoke("glLGPUNamedBufferSubDataNVX", ofVoid(JAVA_INT, JAVA_INT, JAVA_LONG, JAVA_LONG, ADDRESS)); - ext.glLGPUCopyImageSubDataNVX = load.invoke("glLGPUCopyImageSubDataNVX", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glLGPUInterlockNVX = load.invoke("glLGPUInterlockNVX", ofVoid()); - } +public interface GLNVXLinkedGpuMulticast { + int GL_LGPU_SEPARATE_STORAGE_BIT_NVX = 0x0800; + int GL_MAX_LGPU_GPUS_NVX = 0x92BA; - public static void glLGPUNamedBufferSubDataNVX(int gpuMask, int buffer, long offset, long size, @NativeType("const void *") MemorySegment data) { - final var ext = getExtCapabilities(); - try { - check(ext.glLGPUNamedBufferSubDataNVX).invokeExact(gpuMask, buffer, offset, size, data); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glLGPUNamedBufferSubDataNVX(int gpuMask, int buffer, long offset, long size, @NativeType("const void *") MemorySegment data) { + throw new ContextException(); } - public static void glLGPUCopyImageSubDataNVX(int sourceGpu, int destinationGpuMask, int srcName, int srcTarget, int srcLevel, int srcX, int srxY, int srcZ, int dstName, int dstTarget, int dstLevel, int dstX, int dstY, int dstZ, int width, int height, int depth) { - final var ext = getExtCapabilities(); - try { - check(ext.glLGPUCopyImageSubDataNVX).invokeExact(sourceGpu, destinationGpuMask, srcName, srcTarget, srcLevel, srcX, srxY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, width, height, depth); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glLGPUCopyImageSubDataNVX(int sourceGpu, int destinationGpuMask, int srcName, int srcTarget, int srcLevel, int srcX, int srxY, int srcZ, int dstName, int dstTarget, int dstLevel, int dstX, int dstY, int dstZ, int width, int height, int depth) { + throw new ContextException(); } - public static void glLGPUInterlockNVX() { - final var ext = getExtCapabilities(); - try { - check(ext.glLGPUInterlockNVX).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glLGPUInterlockNVX() { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVXProgressFence.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVXProgressFence.java index b858fdcd..a3e01a32 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVXProgressFence.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLNVXProgressFence.java @@ -16,52 +16,29 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.nv; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_NVX_progress_fence} */ -public final class GLNVXProgressFence { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_NVX_progress_fence) return; - ext.glCreateProgressFenceNVX = load.invoke("glCreateProgressFenceNVX", ofVoid()); - ext.glSignalSemaphoreui64NVX = load.invoke("glSignalSemaphoreui64NVX", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - ext.glWaitSemaphoreui64NVX = load.invoke("glWaitSemaphoreui64NVX", ofVoid(JAVA_INT, JAVA_INT, ADDRESS, ADDRESS)); - ext.glClientWaitSemaphoreui64NVX = load.invoke("glClientWaitSemaphoreui64NVX", ofVoid(JAVA_INT, ADDRESS, ADDRESS)); - } +public interface GLNVXProgressFence { - public static void glCreateProgressFenceNVX() { - final var ext = getExtCapabilities(); - try { - check(ext.glCreateProgressFenceNVX).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCreateProgressFenceNVX() { + throw new ContextException(); } - public static void glSignalSemaphoreui64NVX(int signalGpu, int fenceObjectCount, @NativeType("const GLuint *") MemorySegment semaphoreArray, @NativeType("const GLuint64 *") MemorySegment fenceValueArray) { - final var ext = getExtCapabilities(); - try { - check(ext.glSignalSemaphoreui64NVX).invokeExact(signalGpu, fenceObjectCount, semaphoreArray, fenceValueArray); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSignalSemaphoreui64NVX(int signalGpu, int fenceObjectCount, @NativeType("const GLuint *") MemorySegment semaphoreArray, @NativeType("const GLuint64 *") MemorySegment fenceValueArray) { + throw new ContextException(); } - public static void glWaitSemaphoreui64NVX(int waitGpu, int fenceObjectCount, @NativeType("const GLuint *") MemorySegment semaphoreArray, @NativeType("const GLuint64 *") MemorySegment fenceValueArray) { - final var ext = getExtCapabilities(); - try { - check(ext.glWaitSemaphoreui64NVX).invokeExact(waitGpu, fenceObjectCount, semaphoreArray, fenceValueArray); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glWaitSemaphoreui64NVX(int waitGpu, int fenceObjectCount, @NativeType("const GLuint *") MemorySegment semaphoreArray, @NativeType("const GLuint64 *") MemorySegment fenceValueArray) { + throw new ContextException(); } - public static void glClientWaitSemaphoreui64NVX(int fenceObjectCount, @NativeType("const GLuint *") MemorySegment semaphoreArray, @NativeType("const GLuint64 *") MemorySegment fenceValueArray) { - final var ext = getExtCapabilities(); - try { - check(ext.glClientWaitSemaphoreui64NVX).invokeExact(fenceObjectCount, semaphoreArray, fenceValueArray); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glClientWaitSemaphoreui64NVX(int fenceObjectCount, @NativeType("const GLuint *") MemorySegment semaphoreArray, @NativeType("const GLuint64 *") MemorySegment fenceValueArray) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLVulkanProcNV.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLVulkanProcNV.java index ff939276..07030ec9 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLVulkanProcNV.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/nv/GLVulkanProcNV.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2023 Overrun Organization + * Copyright (c) 2023-2024 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 @@ -16,12 +16,10 @@ package overrungl.opengl.ext.nv; -import overrungl.Callback; +import overrun.marshal.Upcall; -import java.lang.foreign.FunctionDescriptor; -import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodHandles; -import java.lang.invoke.MethodType; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; /** * {@link GLNVDrawVulkanImage} @@ -30,29 +28,28 @@ * @since 0.1.0 */ @FunctionalInterface -public interface GLVulkanProcNV extends Callback { - FunctionDescriptor DESC = FunctionDescriptor.ofVoid(); - MethodType MTYPE = DESC.toMethodType(); - Native NATIVE = segment -> new GLVulkanProcNV() { - @Override - public void invoke() { - try { - nativeHandle(segment).invokeExact(); - } catch (Throwable e) { - throw new AssertionError("should not reach here", e); - } - } - }; +public interface GLVulkanProcNV extends Upcall { + /** + * The type. + */ + Type TYPE = Upcall.type(); + @Stub void invoke(); @Override - default FunctionDescriptor descriptor() { - return DESC; + default MemorySegment stub(Arena arena) { + return TYPE.of(arena, this); } - @Override - default MethodHandle handle(MethodHandles.Lookup lookup) throws NoSuchMethodException, IllegalAccessException { - return lookup.findVirtual(GLVulkanProcNV.class, "invoke", MTYPE); + @Wrapper + static GLVulkanProcNV wrap(Arena arena, MemorySegment stub) { + return TYPE.wrap(stub, handle -> () -> { + try { + handle.invokeExact(); + } catch (Throwable e) { + throw new RuntimeException(e); + } + }); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESByteCoordinates.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESByteCoordinates.java index c7ec56b6..0b22bd09 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESByteCoordinates.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESByteCoordinates.java @@ -16,196 +16,101 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.oes; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_OES_byte_coordinates} */ -public final class GLOESByteCoordinates { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_OES_byte_coordinates) return; - ext.glMultiTexCoord1bOES = load.invoke("glMultiTexCoord1bOES", ofVoid(JAVA_INT, JAVA_BYTE)); - ext.glMultiTexCoord1bvOES = load.invoke("glMultiTexCoord1bvOES", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord2bOES = load.invoke("glMultiTexCoord2bOES", ofVoid(JAVA_INT, JAVA_BYTE, JAVA_BYTE)); - ext.glMultiTexCoord2bvOES = load.invoke("glMultiTexCoord2bvOES", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord3bOES = load.invoke("glMultiTexCoord3bOES", ofVoid(JAVA_INT, JAVA_BYTE, JAVA_BYTE, JAVA_BYTE)); - ext.glMultiTexCoord3bvOES = load.invoke("glMultiTexCoord3bvOES", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord4bOES = load.invoke("glMultiTexCoord4bOES", ofVoid(JAVA_INT, JAVA_BYTE, JAVA_BYTE, JAVA_BYTE, JAVA_BYTE)); - ext.glMultiTexCoord4bvOES = load.invoke("glMultiTexCoord4bvOES", ofVoid(JAVA_INT, ADDRESS)); - ext.glTexCoord1bOES = load.invoke("glTexCoord1bOES", ofVoid(JAVA_BYTE)); - ext.glTexCoord1bvOES = load.invoke("glTexCoord1bvOES", ofVoid(ADDRESS)); - ext.glTexCoord2bOES = load.invoke("glTexCoord2bOES", ofVoid(JAVA_BYTE, JAVA_BYTE)); - ext.glTexCoord2bvOES = load.invoke("glTexCoord2bvOES", ofVoid(ADDRESS)); - ext.glTexCoord3bOES = load.invoke("glTexCoord3bOES", ofVoid(JAVA_BYTE, JAVA_BYTE, JAVA_BYTE)); - ext.glTexCoord3bvOES = load.invoke("glTexCoord3bvOES", ofVoid(ADDRESS)); - ext.glTexCoord4bOES = load.invoke("glTexCoord4bOES", ofVoid(JAVA_BYTE, JAVA_BYTE, JAVA_BYTE, JAVA_BYTE)); - ext.glTexCoord4bvOES = load.invoke("glTexCoord4bvOES", ofVoid(ADDRESS)); - ext.glVertex2bOES = load.invoke("glVertex2bOES", ofVoid(JAVA_BYTE, JAVA_BYTE)); - ext.glVertex2bvOES = load.invoke("glVertex2bvOES", ofVoid(ADDRESS)); - ext.glVertex3bOES = load.invoke("glVertex3bOES", ofVoid(JAVA_BYTE, JAVA_BYTE, JAVA_BYTE)); - ext.glVertex3bvOES = load.invoke("glVertex3bvOES", ofVoid(ADDRESS)); - ext.glVertex4bOES = load.invoke("glVertex4bOES", ofVoid(JAVA_BYTE, JAVA_BYTE, JAVA_BYTE, JAVA_BYTE)); - ext.glVertex4bvOES = load.invoke("glVertex4bvOES", ofVoid(ADDRESS)); - } - - public static void glMultiTexCoord1bOES(int texture, byte s) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord1bOES).invokeExact(texture, s); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMultiTexCoord1bvOES(int texture, @NativeType("const GLbyte *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord1bvOES).invokeExact(texture, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glMultiTexCoord2bOES(int texture, byte s, byte t) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord2bOES).invokeExact(texture, s, t); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLOESByteCoordinates { + + default void glMultiTexCoord1bOES(int texture, byte s) { + throw new ContextException(); + } + + default void glMultiTexCoord1bvOES(int texture, @NativeType("const GLbyte *") MemorySegment coords) { + throw new ContextException(); } - - public static void glMultiTexCoord2bvOES(int texture, @NativeType("const GLbyte *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord2bvOES).invokeExact(texture, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + + default void glMultiTexCoord2bOES(int texture, byte s, byte t) { + throw new ContextException(); + } + + default void glMultiTexCoord2bvOES(int texture, @NativeType("const GLbyte *") MemorySegment coords) { + throw new ContextException(); } - public static void glMultiTexCoord3bOES(int texture, byte s, byte t, byte r) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord3bOES).invokeExact(texture, s, t, r); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord3bOES(int texture, byte s, byte t, byte r) { + throw new ContextException(); } - public static void glMultiTexCoord3bvOES(int texture, @NativeType("const GLbyte *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord3bvOES).invokeExact(texture, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord3bvOES(int texture, @NativeType("const GLbyte *") MemorySegment coords) { + throw new ContextException(); } - public static void glMultiTexCoord4bOES(int texture, byte s, byte t, byte r, byte q) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord4bOES).invokeExact(texture, s, t, r, q); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord4bOES(int texture, byte s, byte t, byte r, byte q) { + throw new ContextException(); } - public static void glMultiTexCoord4bvOES(int texture, @NativeType("const GLbyte *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord4bvOES).invokeExact(texture, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord4bvOES(int texture, @NativeType("const GLbyte *") MemorySegment coords) { + throw new ContextException(); } - public static void glTexCoord1bOES(byte s) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord1bOES).invokeExact(s); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord1bOES(byte s) { + throw new ContextException(); } - public static void glTexCoord1bvOES(@NativeType("const GLbyte *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord1bvOES).invokeExact(coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord1bvOES(@NativeType("const GLbyte *") MemorySegment coords) { + throw new ContextException(); } - public static void glTexCoord2bOES(byte s, byte t) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord2bOES).invokeExact(s, t); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord2bOES(byte s, byte t) { + throw new ContextException(); } - public static void glTexCoord2bvOES(@NativeType("const GLbyte *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord2bvOES).invokeExact(coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord2bvOES(@NativeType("const GLbyte *") MemorySegment coords) { + throw new ContextException(); } - public static void glTexCoord3bOES(byte s, byte t, byte r) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord3bOES).invokeExact(s, t, r); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord3bOES(byte s, byte t, byte r) { + throw new ContextException(); } - public static void glTexCoord3bvOES(@NativeType("const GLbyte *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord3bvOES).invokeExact(coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord3bvOES(@NativeType("const GLbyte *") MemorySegment coords) { + throw new ContextException(); } - public static void glTexCoord4bOES(byte s, byte t, byte r, byte q) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord4bOES).invokeExact(s, t, r, q); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord4bOES(byte s, byte t, byte r, byte q) { + throw new ContextException(); } - public static void glTexCoord4bvOES(@NativeType("const GLbyte *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord4bvOES).invokeExact(coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord4bvOES(@NativeType("const GLbyte *") MemorySegment coords) { + throw new ContextException(); } - public static void glVertex2bOES(byte x, byte y) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertex2bOES).invokeExact(x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertex2bOES(byte x, byte y) { + throw new ContextException(); } - public static void glVertex2bvOES(@NativeType("const GLbyte *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertex2bvOES).invokeExact(coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertex2bvOES(@NativeType("const GLbyte *") MemorySegment coords) { + throw new ContextException(); } - public static void glVertex3bOES(byte x, byte y, byte z) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertex3bOES).invokeExact(x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertex3bOES(byte x, byte y, byte z) { + throw new ContextException(); } - public static void glVertex3bvOES(@NativeType("const GLbyte *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertex3bvOES).invokeExact(coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertex3bvOES(@NativeType("const GLbyte *") MemorySegment coords) { + throw new ContextException(); } - public static void glVertex4bOES(byte x, byte y, byte z, byte w) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertex4bOES).invokeExact(x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertex4bOES(byte x, byte y, byte z, byte w) { + throw new ContextException(); } - public static void glVertex4bvOES(@NativeType("const GLbyte *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertex4bvOES).invokeExact(coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertex4bvOES(@NativeType("const GLbyte *") MemorySegment coords) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESCompressedPalettedTexture.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESCompressedPalettedTexture.java index 90e7859c..bec21478 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESCompressedPalettedTexture.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESCompressedPalettedTexture.java @@ -16,26 +16,22 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.oes; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_OES_compressed_paletted_texture} */ -public final class GLOESCompressedPalettedTexture { - public static final int GL_PALETTE4_RGB8_OES = 0x8B90; - public static final int GL_PALETTE4_RGBA8_OES = 0x8B91; - public static final int GL_PALETTE4_R5_G6_B5_OES = 0x8B92; - public static final int GL_PALETTE4_RGBA4_OES = 0x8B93; - public static final int GL_PALETTE4_RGB5_A1_OES = 0x8B94; - public static final int GL_PALETTE8_RGB8_OES = 0x8B95; - public static final int GL_PALETTE8_RGBA8_OES = 0x8B96; - public static final int GL_PALETTE8_R5_G6_B5_OES = 0x8B97; - public static final int GL_PALETTE8_RGBA4_OES = 0x8B98; - public static final int GL_PALETTE8_RGB5_A1_OES = 0x8B99; +public interface GLOESCompressedPalettedTexture { + int GL_PALETTE4_RGB8_OES = 0x8B90; + int GL_PALETTE4_RGBA8_OES = 0x8B91; + int GL_PALETTE4_R5_G6_B5_OES = 0x8B92; + int GL_PALETTE4_RGBA4_OES = 0x8B93; + int GL_PALETTE4_RGB5_A1_OES = 0x8B94; + int GL_PALETTE8_RGB8_OES = 0x8B95; + int GL_PALETTE8_RGBA8_OES = 0x8B96; + int GL_PALETTE8_R5_G6_B5_OES = 0x8B97; + int GL_PALETTE8_RGBA4_OES = 0x8B98; + int GL_PALETTE8_RGB5_A1_OES = 0x8B99; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESFixedPoint.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESFixedPoint.java index 722b74ab..749414f8 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESFixedPoint.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESFixedPoint.java @@ -16,845 +16,426 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.oes; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_OES_fixed_point} */ -public final class GLOESFixedPoint { - public static final int GL_FIXED_OES = 0x140C; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_OES_fixed_point) return; - ext.glAlphaFuncxOES = load.invoke("glAlphaFuncxOES", ofVoid(JAVA_INT, JAVA_INT)); - ext.glClearColorxOES = load.invoke("glClearColorxOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glClearDepthxOES = load.invoke("glClearDepthxOES", ofVoid(JAVA_INT)); - ext.glClipPlanexOES = load.invoke("glClipPlanexOES", ofVoid(JAVA_INT, ADDRESS)); - ext.glColor4xOES = load.invoke("glColor4xOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glDepthRangexOES = load.invoke("glDepthRangexOES", ofVoid(JAVA_INT, JAVA_INT)); - ext.glFogxOES = load.invoke("glFogxOES", ofVoid(JAVA_INT, JAVA_INT)); - ext.glFogxvOES = load.invoke("glFogxvOES", ofVoid(JAVA_INT, ADDRESS)); - ext.glFrustumxOES = load.invoke("glFrustumxOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetClipPlanexOES = load.invoke("glGetClipPlanexOES", ofVoid(JAVA_INT, ADDRESS)); - ext.glGetFixedvOES = load.invoke("glGetFixedvOES", ofVoid(JAVA_INT, ADDRESS)); - ext.glGetTexEnvxvOES = load.invoke("glGetTexEnvxvOES", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetTexParameterxvOES = load.invoke("glGetTexParameterxvOES", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glLightModelxOES = load.invoke("glLightModelxOES", ofVoid(JAVA_INT, JAVA_INT)); - ext.glLightModelxvOES = load.invoke("glLightModelxvOES", ofVoid(JAVA_INT, ADDRESS)); - ext.glLightxOES = load.invoke("glLightxOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glLightxvOES = load.invoke("glLightxvOES", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glLineWidthxOES = load.invoke("glLineWidthxOES", ofVoid(JAVA_INT)); - ext.glLoadMatrixxOES = load.invoke("glLoadMatrixxOES", ofVoid(ADDRESS)); - ext.glMaterialxOES = load.invoke("glMaterialxOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMaterialxvOES = load.invoke("glMaterialxvOES", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glMultMatrixxOES = load.invoke("glMultMatrixxOES", ofVoid(ADDRESS)); - ext.glMultiTexCoord4xOES = load.invoke("glMultiTexCoord4xOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glNormal3xOES = load.invoke("glNormal3xOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glOrthoxOES = load.invoke("glOrthoxOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glPointParameterxvOES = load.invoke("glPointParameterxvOES", ofVoid(JAVA_INT, ADDRESS)); - ext.glPointSizexOES = load.invoke("glPointSizexOES", ofVoid(JAVA_INT)); - ext.glPolygonOffsetxOES = load.invoke("glPolygonOffsetxOES", ofVoid(JAVA_INT, JAVA_INT)); - ext.glRotatexOES = load.invoke("glRotatexOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glScalexOES = load.invoke("glScalexOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glTexEnvxOES = load.invoke("glTexEnvxOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glTexEnvxvOES = load.invoke("glTexEnvxvOES", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glTexParameterxOES = load.invoke("glTexParameterxOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glTexParameterxvOES = load.invoke("glTexParameterxvOES", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glTranslatexOES = load.invoke("glTranslatexOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glAccumxOES = load.invoke("glAccumxOES", ofVoid(JAVA_INT, JAVA_INT)); - ext.glBitmapxOES = load.invoke("glBitmapxOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glBlendColorxOES = load.invoke("glBlendColorxOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glClearAccumxOES = load.invoke("glClearAccumxOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glColor3xOES = load.invoke("glColor3xOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glColor3xvOES = load.invoke("glColor3xvOES", ofVoid(ADDRESS)); - ext.glColor4xvOES = load.invoke("glColor4xvOES", ofVoid(ADDRESS)); - ext.glConvolutionParameterxOES = load.invoke("glConvolutionParameterxOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glConvolutionParameterxvOES = load.invoke("glConvolutionParameterxvOES", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glEvalCoord1xOES = load.invoke("glEvalCoord1xOES", ofVoid(JAVA_INT)); - ext.glEvalCoord1xvOES = load.invoke("glEvalCoord1xvOES", ofVoid(ADDRESS)); - ext.glEvalCoord2xOES = load.invoke("glEvalCoord2xOES", ofVoid(JAVA_INT, JAVA_INT)); - ext.glEvalCoord2xvOES = load.invoke("glEvalCoord2xvOES", ofVoid(ADDRESS)); - ext.glFeedbackBufferxOES = load.invoke("glFeedbackBufferxOES", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetConvolutionParameterxvOES = load.invoke("glGetConvolutionParameterxvOES", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetHistogramParameterxvOES = load.invoke("glGetHistogramParameterxvOES", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetLightxOES = load.invoke("glGetLightxOES", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMapxvOES = load.invoke("glGetMapxvOES", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetMaterialxOES = load.invoke("glGetMaterialxOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetPixelMapxv = load.invoke("glGetPixelMapxv", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetTexGenxvOES = load.invoke("glGetTexGenxvOES", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetTexLevelParameterxvOES = load.invoke("glGetTexLevelParameterxvOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glIndexxOES = load.invoke("glIndexxOES", ofVoid(JAVA_INT)); - ext.glIndexxvOES = load.invoke("glIndexxvOES", ofVoid(ADDRESS)); - ext.glLoadTransposeMatrixxOES = load.invoke("glLoadTransposeMatrixxOES", ofVoid(ADDRESS)); - ext.glMap1xOES = load.invoke("glMap1xOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMap2xOES = load.invoke("glMap2xOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMapGrid1xOES = load.invoke("glMapGrid1xOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMapGrid2xOES = load.invoke("glMapGrid2xOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMultTransposeMatrixxOES = load.invoke("glMultTransposeMatrixxOES", ofVoid(ADDRESS)); - ext.glMultiTexCoord1xOES = load.invoke("glMultiTexCoord1xOES", ofVoid(JAVA_INT, JAVA_INT)); - ext.glMultiTexCoord1xvOES = load.invoke("glMultiTexCoord1xvOES", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord2xOES = load.invoke("glMultiTexCoord2xOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMultiTexCoord2xvOES = load.invoke("glMultiTexCoord2xvOES", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord3xOES = load.invoke("glMultiTexCoord3xOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glMultiTexCoord3xvOES = load.invoke("glMultiTexCoord3xvOES", ofVoid(JAVA_INT, ADDRESS)); - ext.glMultiTexCoord4xvOES = load.invoke("glMultiTexCoord4xvOES", ofVoid(JAVA_INT, ADDRESS)); - ext.glNormal3xvOES = load.invoke("glNormal3xvOES", ofVoid(ADDRESS)); - ext.glPassThroughxOES = load.invoke("glPassThroughxOES", ofVoid(JAVA_INT)); - ext.glPixelMapx = load.invoke("glPixelMapx", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glPixelStorex = load.invoke("glPixelStorex", ofVoid(JAVA_INT, JAVA_INT)); - ext.glPixelTransferxOES = load.invoke("glPixelTransferxOES", ofVoid(JAVA_INT, JAVA_INT)); - ext.glPixelZoomxOES = load.invoke("glPixelZoomxOES", ofVoid(JAVA_INT, JAVA_INT)); - ext.glPrioritizeTexturesxOES = load.invoke("glPrioritizeTexturesxOES", ofVoid(JAVA_INT, ADDRESS, ADDRESS)); - ext.glRasterPos2xOES = load.invoke("glRasterPos2xOES", ofVoid(JAVA_INT, JAVA_INT)); - ext.glRasterPos2xvOES = load.invoke("glRasterPos2xvOES", ofVoid(ADDRESS)); - ext.glRasterPos3xOES = load.invoke("glRasterPos3xOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glRasterPos3xvOES = load.invoke("glRasterPos3xvOES", ofVoid(ADDRESS)); - ext.glRasterPos4xOES = load.invoke("glRasterPos4xOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glRasterPos4xvOES = load.invoke("glRasterPos4xvOES", ofVoid(ADDRESS)); - ext.glRectxOES = load.invoke("glRectxOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glRectxvOES = load.invoke("glRectxvOES", ofVoid(ADDRESS, ADDRESS)); - ext.glTexCoord1xOES = load.invoke("glTexCoord1xOES", ofVoid(JAVA_INT)); - ext.glTexCoord1xvOES = load.invoke("glTexCoord1xvOES", ofVoid(ADDRESS)); - ext.glTexCoord2xOES = load.invoke("glTexCoord2xOES", ofVoid(JAVA_INT, JAVA_INT)); - ext.glTexCoord2xvOES = load.invoke("glTexCoord2xvOES", ofVoid(ADDRESS)); - ext.glTexCoord3xOES = load.invoke("glTexCoord3xOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glTexCoord3xvOES = load.invoke("glTexCoord3xvOES", ofVoid(ADDRESS)); - ext.glTexCoord4xOES = load.invoke("glTexCoord4xOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glTexCoord4xvOES = load.invoke("glTexCoord4xvOES", ofVoid(ADDRESS)); - ext.glTexGenxOES = load.invoke("glTexGenxOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glTexGenxvOES = load.invoke("glTexGenxvOES", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glVertex2xOES = load.invoke("glVertex2xOES", ofVoid(JAVA_INT)); - ext.glVertex2xvOES = load.invoke("glVertex2xvOES", ofVoid(ADDRESS)); - ext.glVertex3xOES = load.invoke("glVertex3xOES", ofVoid(JAVA_INT, JAVA_INT)); - ext.glVertex3xvOES = load.invoke("glVertex3xvOES", ofVoid(ADDRESS)); - ext.glVertex4xOES = load.invoke("glVertex4xOES", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glVertex4xvOES = load.invoke("glVertex4xvOES", ofVoid(ADDRESS)); - } - - public static void glAlphaFuncxOES(int func, int ref) { - final var ext = getExtCapabilities(); - try { - check(ext.glAlphaFuncxOES).invokeExact(func, ref); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glClearColorxOES(int red, int green, int blue, int alpha) { - final var ext = getExtCapabilities(); - try { - check(ext.glClearColorxOES).invokeExact(red, green, blue, alpha); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glClearDepthxOES(int depth) { - final var ext = getExtCapabilities(); - try { - check(ext.glClearDepthxOES).invokeExact(depth); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glClipPlanexOES(int plane, @NativeType("const GLfixed *") MemorySegment equation) { - final var ext = getExtCapabilities(); - try { - check(ext.glClipPlanexOES).invokeExact(plane, equation); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glColor4xOES(int red, int green, int blue, int alpha) { - final var ext = getExtCapabilities(); - try { - check(ext.glColor4xOES).invokeExact(red, green, blue, alpha); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glDepthRangexOES(int n, int f) { - final var ext = getExtCapabilities(); - try { - check(ext.glDepthRangexOES).invokeExact(n, f); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glFogxOES(int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glFogxOES).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glFogxvOES(int pname, @NativeType("const GLfixed *") MemorySegment param) { - final var ext = getExtCapabilities(); - try { - check(ext.glFogxvOES).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glFrustumxOES(int l, int r, int b, int t, int n, int f) { - final var ext = getExtCapabilities(); - try { - check(ext.glFrustumxOES).invokeExact(l, r, b, t, n, f); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glGetClipPlanexOES(int plane, @NativeType("GLfixed *") MemorySegment equation) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetClipPlanexOES).invokeExact(plane, equation); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLOESFixedPoint { + int GL_FIXED_OES = 0x140C; + + default void glAlphaFuncxOES(int func, int ref) { + throw new ContextException(); + } + + default void glClearColorxOES(int red, int green, int blue, int alpha) { + throw new ContextException(); + } + + default void glClearDepthxOES(int depth) { + throw new ContextException(); + } + + default void glClipPlanexOES(int plane, @NativeType("const GLfixed *") MemorySegment equation) { + throw new ContextException(); + } + + default void glColor4xOES(int red, int green, int blue, int alpha) { + throw new ContextException(); + } + + default void glDepthRangexOES(int n, int f) { + throw new ContextException(); + } + + default void glFogxOES(int pname, int param) { + throw new ContextException(); + } + + default void glFogxvOES(int pname, @NativeType("const GLfixed *") MemorySegment param) { + throw new ContextException(); + } + + default void glFrustumxOES(int l, int r, int b, int t, int n, int f) { + throw new ContextException(); + } + + default void glGetClipPlanexOES(int plane, @NativeType("GLfixed *") MemorySegment equation) { + throw new ContextException(); } - public static void glGetFixedvOES(int pname, @NativeType("GLfixed *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetFixedvOES).invokeExact(pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetFixedvOES(int pname, @NativeType("GLfixed *") MemorySegment params) { + throw new ContextException(); } - public static void glGetTexEnvxvOES(int target, int pname, @NativeType("GLfixed *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetTexEnvxvOES).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetTexEnvxvOES(int target, int pname, @NativeType("GLfixed *") MemorySegment params) { + throw new ContextException(); } - public static void glGetTexParameterxvOES(int target, int pname, @NativeType("GLfixed *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetTexParameterxvOES).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetTexParameterxvOES(int target, int pname, @NativeType("GLfixed *") MemorySegment params) { + throw new ContextException(); } - public static void glLightModelxOES(int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glLightModelxOES).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glLightModelxOES(int pname, int param) { + throw new ContextException(); } - public static void glLightModelxvOES(int pname, @NativeType("const GLfixed *") MemorySegment param) { - final var ext = getExtCapabilities(); - try { - check(ext.glLightModelxvOES).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glLightModelxvOES(int pname, @NativeType("const GLfixed *") MemorySegment param) { + throw new ContextException(); } - public static void glLightxOES(int light, int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glLightxOES).invokeExact(light, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glLightxOES(int light, int pname, int param) { + throw new ContextException(); } - public static void glLightxvOES(int light, int pname, @NativeType("const GLfixed *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glLightxvOES).invokeExact(light, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glLightxvOES(int light, int pname, @NativeType("const GLfixed *") MemorySegment params) { + throw new ContextException(); } - public static void glLineWidthxOES(int width) { - final var ext = getExtCapabilities(); - try { - check(ext.glLineWidthxOES).invokeExact(width); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glLineWidthxOES(int width) { + throw new ContextException(); } - public static void glLoadMatrixxOES(@NativeType("const GLfixed *") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glLoadMatrixxOES).invokeExact(m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glLoadMatrixxOES(@NativeType("const GLfixed *") MemorySegment m) { + throw new ContextException(); } - public static void glMaterialxOES(int face, int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glMaterialxOES).invokeExact(face, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMaterialxOES(int face, int pname, int param) { + throw new ContextException(); } - public static void glMaterialxvOES(int face, int pname, @NativeType("const GLfixed *") MemorySegment param) { - final var ext = getExtCapabilities(); - try { - check(ext.glMaterialxvOES).invokeExact(face, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMaterialxvOES(int face, int pname, @NativeType("const GLfixed *") MemorySegment param) { + throw new ContextException(); } - public static void glMultMatrixxOES(@NativeType("const GLfixed *") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultMatrixxOES).invokeExact(m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultMatrixxOES(@NativeType("const GLfixed *") MemorySegment m) { + throw new ContextException(); } - public static void glMultiTexCoord4xOES(int texture, int s, int t, int r, int q) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord4xOES).invokeExact(texture, s, t, r, q); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord4xOES(int texture, int s, int t, int r, int q) { + throw new ContextException(); } - public static void glNormal3xOES(int nx, int ny, int nz) { - final var ext = getExtCapabilities(); - try { - check(ext.glNormal3xOES).invokeExact(nx, ny, nz); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNormal3xOES(int nx, int ny, int nz) { + throw new ContextException(); } - public static void glOrthoxOES(int l, int r, int b, int t, int n, int f) { - final var ext = getExtCapabilities(); - try { - check(ext.glOrthoxOES).invokeExact(l, r, b, t, n, f); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glOrthoxOES(int l, int r, int b, int t, int n, int f) { + throw new ContextException(); } - public static void glPointParameterxvOES(int pname, @NativeType("const GLfixed *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glPointParameterxvOES).invokeExact(pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPointParameterxvOES(int pname, @NativeType("const GLfixed *") MemorySegment params) { + throw new ContextException(); } - public static void glPointSizexOES(int size) { - final var ext = getExtCapabilities(); - try { - check(ext.glPointSizexOES).invokeExact(size); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPointSizexOES(int size) { + throw new ContextException(); } - public static void glPolygonOffsetxOES(int factor, int units) { - final var ext = getExtCapabilities(); - try { - check(ext.glPolygonOffsetxOES).invokeExact(factor, units); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPolygonOffsetxOES(int factor, int units) { + throw new ContextException(); } - public static void glRotatexOES(int angle, int x, int y, int z) { - final var ext = getExtCapabilities(); - try { - check(ext.glRotatexOES).invokeExact(angle, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glRotatexOES(int angle, int x, int y, int z) { + throw new ContextException(); } - public static void glScalexOES(int x, int y, int z) { - final var ext = getExtCapabilities(); - try { - check(ext.glScalexOES).invokeExact(x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glScalexOES(int x, int y, int z) { + throw new ContextException(); } - public static void glTexEnvxOES(int target, int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexEnvxOES).invokeExact(target, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexEnvxOES(int target, int pname, int param) { + throw new ContextException(); } - public static void glTexEnvxvOES(int target, int pname, @NativeType("const GLfixed *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexEnvxvOES).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexEnvxvOES(int target, int pname, @NativeType("const GLfixed *") MemorySegment params) { + throw new ContextException(); } - public static void glTexParameterxOES(int target, int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexParameterxOES).invokeExact(target, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexParameterxOES(int target, int pname, int param) { + throw new ContextException(); } - public static void glTexParameterxvOES(int target, int pname, @NativeType("const GLfixed *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexParameterxvOES).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexParameterxvOES(int target, int pname, @NativeType("const GLfixed *") MemorySegment params) { + throw new ContextException(); } - public static void glTranslatexOES(int x, int y, int z) { - final var ext = getExtCapabilities(); - try { - check(ext.glTranslatexOES).invokeExact(x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTranslatexOES(int x, int y, int z) { + throw new ContextException(); } - public static void glAccumxOES(int op, int value) { - final var ext = getExtCapabilities(); - try { - check(ext.glAccumxOES).invokeExact(op, value); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glAccumxOES(int op, int value) { + throw new ContextException(); } - public static void glBitmapxOES(int width, int height, int xorig, int yorig, int xmove, int ymove, @NativeType("const GLubyte *") MemorySegment bitmap) { - final var ext = getExtCapabilities(); - try { - check(ext.glBitmapxOES).invokeExact(width, height, xorig, yorig, xmove, ymove, bitmap); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBitmapxOES(int width, int height, int xorig, int yorig, int xmove, int ymove, @NativeType("const GLubyte *") MemorySegment bitmap) { + throw new ContextException(); } - public static void glBlendColorxOES(int red, int green, int blue, int alpha) { - final var ext = getExtCapabilities(); - try { - check(ext.glBlendColorxOES).invokeExact(red, green, blue, alpha); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glBlendColorxOES(int red, int green, int blue, int alpha) { + throw new ContextException(); } - public static void glClearAccumxOES(int red, int green, int blue, int alpha) { - final var ext = getExtCapabilities(); - try { - check(ext.glClearAccumxOES).invokeExact(red, green, blue, alpha); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glClearAccumxOES(int red, int green, int blue, int alpha) { + throw new ContextException(); } - public static void glColor3xOES(int red, int green, int blue) { - final var ext = getExtCapabilities(); - try { - check(ext.glColor3xOES).invokeExact(red, green, blue); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glColor3xOES(int red, int green, int blue) { + throw new ContextException(); } - public static void glColor3xvOES(@NativeType("const GLfixed *") MemorySegment components) { - final var ext = getExtCapabilities(); - try { - check(ext.glColor3xvOES).invokeExact(components); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glColor3xvOES(@NativeType("const GLfixed *") MemorySegment components) { + throw new ContextException(); } - public static void glColor4xvOES(@NativeType("const GLfixed *") MemorySegment components) { - final var ext = getExtCapabilities(); - try { - check(ext.glColor4xvOES).invokeExact(components); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glColor4xvOES(@NativeType("const GLfixed *") MemorySegment components) { + throw new ContextException(); } - public static void glConvolutionParameterxOES(int target, int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glConvolutionParameterxOES).invokeExact(target, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glConvolutionParameterxOES(int target, int pname, int param) { + throw new ContextException(); } - public static void glConvolutionParameterxvOES(int target, int pname, @NativeType("const GLfixed *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glConvolutionParameterxvOES).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glConvolutionParameterxvOES(int target, int pname, @NativeType("const GLfixed *") MemorySegment params) { + throw new ContextException(); } - public static void glEvalCoord1xOES(int u) { - final var ext = getExtCapabilities(); - try { - check(ext.glEvalCoord1xOES).invokeExact(u); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEvalCoord1xOES(int u) { + throw new ContextException(); } - public static void glEvalCoord1xvOES(@NativeType("const GLfixed *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glEvalCoord1xvOES).invokeExact(coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEvalCoord1xvOES(@NativeType("const GLfixed *") MemorySegment coords) { + throw new ContextException(); } - public static void glEvalCoord2xOES(int u, int v) { - final var ext = getExtCapabilities(); - try { - check(ext.glEvalCoord2xOES).invokeExact(u, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEvalCoord2xOES(int u, int v) { + throw new ContextException(); } - public static void glEvalCoord2xvOES(@NativeType("const GLfixed *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glEvalCoord2xvOES).invokeExact(coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glEvalCoord2xvOES(@NativeType("const GLfixed *") MemorySegment coords) { + throw new ContextException(); } - public static void glFeedbackBufferxOES(int n, int type, @NativeType("const GLfixed *") MemorySegment buffer) { - final var ext = getExtCapabilities(); - try { - check(ext.glFeedbackBufferxOES).invokeExact(n, type, buffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFeedbackBufferxOES(int n, int type, @NativeType("const GLfixed *") MemorySegment buffer) { + throw new ContextException(); } - public static void glGetConvolutionParameterxvOES(int target, int pname, @NativeType("GLfixed *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetConvolutionParameterxvOES).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetConvolutionParameterxvOES(int target, int pname, @NativeType("GLfixed *") MemorySegment params) { + throw new ContextException(); } - public static void glGetHistogramParameterxvOES(int target, int pname, @NativeType("GLfixed *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetHistogramParameterxvOES).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetHistogramParameterxvOES(int target, int pname, @NativeType("GLfixed *") MemorySegment params) { + throw new ContextException(); } - public static void glGetLightxOES(int light, int pname, @NativeType("GLfixed *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetLightxOES).invokeExact(light, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetLightxOES(int light, int pname, @NativeType("GLfixed *") MemorySegment params) { + throw new ContextException(); } - public static void glGetMapxvOES(int target, int query, @NativeType("GLfixed *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMapxvOES).invokeExact(target, query, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMapxvOES(int target, int query, @NativeType("GLfixed *") MemorySegment v) { + throw new ContextException(); } - public static void glGetMaterialxOES(int face, int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetMaterialxOES).invokeExact(face, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetMaterialxOES(int face, int pname, int param) { + throw new ContextException(); } - public static void glGetPixelMapxv(int map, int size, @NativeType("GLfixed *") MemorySegment values) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPixelMapxv).invokeExact(map, size, values); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPixelMapxv(int map, int size, @NativeType("GLfixed *") MemorySegment values) { + throw new ContextException(); } - public static void glGetTexGenxvOES(int coord, int pname, @NativeType("GLfixed *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetTexGenxvOES).invokeExact(coord, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetTexGenxvOES(int coord, int pname, @NativeType("GLfixed *") MemorySegment params) { + throw new ContextException(); } - public static void glGetTexLevelParameterxvOES(int target, int level, int pname, @NativeType("GLfixed *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetTexLevelParameterxvOES).invokeExact(target, level, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetTexLevelParameterxvOES(int target, int level, int pname, @NativeType("GLfixed *") MemorySegment params) { + throw new ContextException(); } - public static void glIndexxOES(int component) { - final var ext = getExtCapabilities(); - try { - check(ext.glIndexxOES).invokeExact(component); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glIndexxOES(int component) { + throw new ContextException(); } - public static void glIndexxvOES(@NativeType("const GLfixed *") MemorySegment component) { - final var ext = getExtCapabilities(); - try { - check(ext.glIndexxvOES).invokeExact(component); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glIndexxvOES(@NativeType("const GLfixed *") MemorySegment component) { + throw new ContextException(); } - public static void glLoadTransposeMatrixxOES(@NativeType("const GLfixed *") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glLoadTransposeMatrixxOES).invokeExact(m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glLoadTransposeMatrixxOES(@NativeType("const GLfixed *") MemorySegment m) { + throw new ContextException(); } - public static void glMap1xOES(int target, int u1, int u2, int stride, int order, int points) { - final var ext = getExtCapabilities(); - try { - check(ext.glMap1xOES).invokeExact(target, u1, u2, stride, order, points); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMap1xOES(int target, int u1, int u2, int stride, int order, int points) { + throw new ContextException(); } - public static void glMap2xOES(int target, int u1, int u2, int ustride, int uorder, int v1, int v2, int vstride, int vorder, int points) { - final var ext = getExtCapabilities(); - try { - check(ext.glMap2xOES).invokeExact(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMap2xOES(int target, int u1, int u2, int ustride, int uorder, int v1, int v2, int vstride, int vorder, int points) { + throw new ContextException(); } - public static void glMapGrid1xOES(int n, int u1, int u2) { - final var ext = getExtCapabilities(); - try { - check(ext.glMapGrid1xOES).invokeExact(n, u1, u2); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMapGrid1xOES(int n, int u1, int u2) { + throw new ContextException(); } - public static void glMapGrid2xOES(int n, int u1, int u2, int v1, int v2) { - final var ext = getExtCapabilities(); - try { - check(ext.glMapGrid2xOES).invokeExact(n, u1, u2, v1, v2); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMapGrid2xOES(int n, int u1, int u2, int v1, int v2) { + throw new ContextException(); } - public static void glMultTransposeMatrixxOES(@NativeType("const GLfixed *") MemorySegment m) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultTransposeMatrixxOES).invokeExact(m); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultTransposeMatrixxOES(@NativeType("const GLfixed *") MemorySegment m) { + throw new ContextException(); } - public static void glMultiTexCoord1xOES(int texture, int s) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord1xOES).invokeExact(texture, s); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord1xOES(int texture, int s) { + throw new ContextException(); } - public static void glMultiTexCoord1xvOES(int texture, @NativeType("const GLfixed *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord1xvOES).invokeExact(texture, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord1xvOES(int texture, @NativeType("const GLfixed *") MemorySegment coords) { + throw new ContextException(); } - public static void glMultiTexCoord2xOES(int texture, int s, int t) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord2xOES).invokeExact(texture, s, t); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord2xOES(int texture, int s, int t) { + throw new ContextException(); } - public static void glMultiTexCoord2xvOES(int texture, @NativeType("const GLfixed *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord2xvOES).invokeExact(texture, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord2xvOES(int texture, @NativeType("const GLfixed *") MemorySegment coords) { + throw new ContextException(); } - public static void glMultiTexCoord3xOES(int texture, int s, int t, int r) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord3xOES).invokeExact(texture, s, t, r); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord3xOES(int texture, int s, int t, int r) { + throw new ContextException(); } - public static void glMultiTexCoord3xvOES(int texture, @NativeType("const GLfixed *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord3xvOES).invokeExact(texture, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord3xvOES(int texture, @NativeType("const GLfixed *") MemorySegment coords) { + throw new ContextException(); } - public static void glMultiTexCoord4xvOES(int texture, @NativeType("const GLfixed *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glMultiTexCoord4xvOES).invokeExact(texture, coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glMultiTexCoord4xvOES(int texture, @NativeType("const GLfixed *") MemorySegment coords) { + throw new ContextException(); } - public static void glNormal3xvOES(@NativeType("const GLfixed *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glNormal3xvOES).invokeExact(coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glNormal3xvOES(@NativeType("const GLfixed *") MemorySegment coords) { + throw new ContextException(); } - public static void glPassThroughxOES(int token) { - final var ext = getExtCapabilities(); - try { - check(ext.glPassThroughxOES).invokeExact(token); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPassThroughxOES(int token) { + throw new ContextException(); } - public static void glPixelMapx(int map, int size, @NativeType("const GLfixed *") MemorySegment values) { - final var ext = getExtCapabilities(); - try { - check(ext.glPixelMapx).invokeExact(map, size, values); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPixelMapx(int map, int size, @NativeType("const GLfixed *") MemorySegment values) { + throw new ContextException(); } - public static void glPixelStorex(int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glPixelStorex).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPixelStorex(int pname, int param) { + throw new ContextException(); } - public static void glPixelTransferxOES(int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glPixelTransferxOES).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPixelTransferxOES(int pname, int param) { + throw new ContextException(); } - public static void glPixelZoomxOES(int xfactor, int yfactor) { - final var ext = getExtCapabilities(); - try { - check(ext.glPixelZoomxOES).invokeExact(xfactor, yfactor); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPixelZoomxOES(int xfactor, int yfactor) { + throw new ContextException(); } - public static void glPrioritizeTexturesxOES(int n, @NativeType("const GLuint *") MemorySegment textures, @NativeType("const GLfixed *") MemorySegment priorities) { - final var ext = getExtCapabilities(); - try { - check(ext.glPrioritizeTexturesxOES).invokeExact(n, textures, priorities); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPrioritizeTexturesxOES(int n, @NativeType("const GLuint *") MemorySegment textures, @NativeType("const GLfixed *") MemorySegment priorities) { + throw new ContextException(); } - public static void glRasterPos2xOES(int x, int y) { - final var ext = getExtCapabilities(); - try { - check(ext.glRasterPos2xOES).invokeExact(x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glRasterPos2xOES(int x, int y) { + throw new ContextException(); } - public static void glRasterPos2xvOES(@NativeType("const GLfixed *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glRasterPos2xvOES).invokeExact(coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glRasterPos2xvOES(@NativeType("const GLfixed *") MemorySegment coords) { + throw new ContextException(); } - public static void glRasterPos3xOES(int x, int y, int z) { - final var ext = getExtCapabilities(); - try { - check(ext.glRasterPos3xOES).invokeExact(x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glRasterPos3xOES(int x, int y, int z) { + throw new ContextException(); } - public static void glRasterPos3xvOES(@NativeType("const GLfixed *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glRasterPos3xvOES).invokeExact(coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glRasterPos3xvOES(@NativeType("const GLfixed *") MemorySegment coords) { + throw new ContextException(); } - public static void glRasterPos4xOES(int x, int y, int z, int w) { - final var ext = getExtCapabilities(); - try { - check(ext.glRasterPos4xOES).invokeExact(x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glRasterPos4xOES(int x, int y, int z, int w) { + throw new ContextException(); } - public static void glRasterPos4xvOES(@NativeType("const GLfixed *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glRasterPos4xvOES).invokeExact(coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glRasterPos4xvOES(@NativeType("const GLfixed *") MemorySegment coords) { + throw new ContextException(); } - public static void glRectxOES(int x1, int y1, int x2, int y2) { - final var ext = getExtCapabilities(); - try { - check(ext.glRectxOES).invokeExact(x1, y1, x2, y2); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glRectxOES(int x1, int y1, int x2, int y2) { + throw new ContextException(); } - public static void glRectxvOES(@NativeType("const GLfixed *") MemorySegment v1, @NativeType("const GLfixed *") MemorySegment v2) { - final var ext = getExtCapabilities(); - try { - check(ext.glRectxvOES).invokeExact(v1, v2); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glRectxvOES(@NativeType("const GLfixed *") MemorySegment v1, @NativeType("const GLfixed *") MemorySegment v2) { + throw new ContextException(); } - public static void glTexCoord1xOES(int s) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord1xOES).invokeExact(s); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord1xOES(int s) { + throw new ContextException(); } - public static void glTexCoord1xvOES(@NativeType("const GLfixed *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord1xvOES).invokeExact(coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord1xvOES(@NativeType("const GLfixed *") MemorySegment coords) { + throw new ContextException(); } - public static void glTexCoord2xOES(int s, int t) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord2xOES).invokeExact(s, t); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord2xOES(int s, int t) { + throw new ContextException(); } - public static void glTexCoord2xvOES(@NativeType("const GLfixed *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord2xvOES).invokeExact(coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord2xvOES(@NativeType("const GLfixed *") MemorySegment coords) { + throw new ContextException(); } - public static void glTexCoord3xOES(int s, int t, int r) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord3xOES).invokeExact(s, t, r); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord3xOES(int s, int t, int r) { + throw new ContextException(); } - public static void glTexCoord3xvOES(@NativeType("const GLfixed *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord3xvOES).invokeExact(coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord3xvOES(@NativeType("const GLfixed *") MemorySegment coords) { + throw new ContextException(); } - public static void glTexCoord4xOES(int s, int t, int r, int q) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord4xOES).invokeExact(s, t, r, q); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord4xOES(int s, int t, int r, int q) { + throw new ContextException(); } - public static void glTexCoord4xvOES(@NativeType("const GLfixed *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord4xvOES).invokeExact(coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord4xvOES(@NativeType("const GLfixed *") MemorySegment coords) { + throw new ContextException(); } - public static void glTexGenxOES(int coord, int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexGenxOES).invokeExact(coord, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexGenxOES(int coord, int pname, int param) { + throw new ContextException(); } - public static void glTexGenxvOES(int coord, int pname, @NativeType("const GLfixed *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexGenxvOES).invokeExact(coord, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexGenxvOES(int coord, int pname, @NativeType("const GLfixed *") MemorySegment params) { + throw new ContextException(); } - public static void glVertex2xOES(int x) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertex2xOES).invokeExact(x); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertex2xOES(int x) { + throw new ContextException(); } - public static void glVertex2xvOES(@NativeType("const GLfixed *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertex2xvOES).invokeExact(coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertex2xvOES(@NativeType("const GLfixed *") MemorySegment coords) { + throw new ContextException(); } - public static void glVertex3xOES(int x, int y) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertex3xOES).invokeExact(x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertex3xOES(int x, int y) { + throw new ContextException(); } - public static void glVertex3xvOES(@NativeType("const GLfixed *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertex3xvOES).invokeExact(coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertex3xvOES(@NativeType("const GLfixed *") MemorySegment coords) { + throw new ContextException(); } - public static void glVertex4xOES(int x, int y, int z) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertex4xOES).invokeExact(x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertex4xOES(int x, int y, int z) { + throw new ContextException(); } - public static void glVertex4xvOES(@NativeType("const GLfixed *") MemorySegment coords) { - final var ext = getExtCapabilities(); - try { - check(ext.glVertex4xvOES).invokeExact(coords); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glVertex4xvOES(@NativeType("const GLfixed *") MemorySegment coords) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESQueryMatrix.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESQueryMatrix.java index 9c0096f2..d38e6e68 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESQueryMatrix.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESQueryMatrix.java @@ -16,29 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.oes; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_OES_query_matrix} */ -public final class GLOESQueryMatrix { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_OES_query_matrix) return; - ext.glQueryMatrixxOES = load.invoke("glQueryMatrixxOES", of(JAVA_INT, ADDRESS, ADDRESS)); - } +public interface GLOESQueryMatrix { - public static int glQueryMatrixxOES(@NativeType("GLfixed *") MemorySegment mantissa, @NativeType("GLint *") MemorySegment exponent) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glQueryMatrixxOES).invokeExact(mantissa, exponent); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glQueryMatrixxOES(@NativeType("GLfixed *") MemorySegment mantissa, @NativeType("GLint *") MemorySegment exponent) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESReadFormat.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESReadFormat.java index 1a7e33c1..1af5f057 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESReadFormat.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESReadFormat.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.oes; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_OES_read_format} */ -public final class GLOESReadFormat { - public static final int GL_IMPLEMENTATION_COLOR_READ_TYPE_OES = 0x8B9A; - public static final int GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES = 0x8B9B; +public interface GLOESReadFormat { + int GL_IMPLEMENTATION_COLOR_READ_TYPE_OES = 0x8B9A; + int GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES = 0x8B9B; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESSinglePrecision.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESSinglePrecision.java index 11bc85ae..7ed4101e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESSinglePrecision.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/oes/GLOESSinglePrecision.java @@ -16,68 +16,37 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.oes; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_OES_single_precision} */ -public final class GLOESSinglePrecision { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_OES_single_precision) return; - ext.glClearDepthfOES = load.invoke("glClearDepthfOES", ofVoid(JAVA_FLOAT)); - ext.glClipPlanefOES = load.invoke("glClipPlanefOES", ofVoid(JAVA_INT, ADDRESS)); - ext.glDepthRangefOES = load.invoke("glDepthRangefOES", ofVoid(JAVA_FLOAT, JAVA_FLOAT)); - ext.glFrustumfOES = load.invoke("glFrustumfOES", ofVoid(JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glGetClipPlanefOES = load.invoke("glGetClipPlanefOES", ofVoid(JAVA_INT, ADDRESS)); - ext.glOrthofOES = load.invoke("glOrthofOES", ofVoid(JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - } +public interface GLOESSinglePrecision { - public static void glClearDepthfOES(float depth) { - final var ext = getExtCapabilities(); - try { - check(ext.glClearDepthfOES).invokeExact(depth); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glClearDepthfOES(float depth) { + throw new ContextException(); } - public static void glClipPlanefOES(int plane, @NativeType("const GLfloat *") MemorySegment equation) { - final var ext = getExtCapabilities(); - try { - check(ext.glClipPlanefOES).invokeExact(plane, equation); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glClipPlanefOES(int plane, @NativeType("const GLfloat *") MemorySegment equation) { + throw new ContextException(); } - public static void glDepthRangefOES(float n, float f) { - final var ext = getExtCapabilities(); - try { - check(ext.glDepthRangefOES).invokeExact(n, f); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDepthRangefOES(float n, float f) { + throw new ContextException(); } - public static void glFrustumfOES(float l, float r, float b, float t, float n, float f) { - final var ext = getExtCapabilities(); - try { - check(ext.glFrustumfOES).invokeExact(l, r, b, t, n, f); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFrustumfOES(float l, float r, float b, float t, float n, float f) { + throw new ContextException(); } - public static void glGetClipPlanefOES(int plane, @NativeType("GLfloat *") MemorySegment equation) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetClipPlanefOES).invokeExact(plane, equation); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetClipPlanefOES(int plane, @NativeType("GLfloat *") MemorySegment equation) { + throw new ContextException(); } - public static void glOrthofOES(float l, float r, float b, float t, float n, float f) { - final var ext = getExtCapabilities(); - try { - check(ext.glOrthofOES).invokeExact(l, r, b, t, n, f); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glOrthofOES(float l, float r, float b, float t, float n, float f) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIColorMatrix.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIColorMatrix.java index 95cc319a..16c11c58 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIColorMatrix.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIColorMatrix.java @@ -16,27 +16,23 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGI_color_matrix} */ -public final class GLSGIColorMatrix { - public static final int GL_COLOR_MATRIX_SGI = 0x80B1; - public static final int GL_COLOR_MATRIX_STACK_DEPTH_SGI = 0x80B2; - public static final int GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI = 0x80B3; - public static final int GL_POST_COLOR_MATRIX_RED_SCALE_SGI = 0x80B4; - public static final int GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI = 0x80B5; - public static final int GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI = 0x80B6; - public static final int GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI = 0x80B7; - public static final int GL_POST_COLOR_MATRIX_RED_BIAS_SGI = 0x80B8; - public static final int GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI = 0x80B9; - public static final int GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI = 0x80BA; - public static final int GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI = 0x80BB; +public interface GLSGIColorMatrix { + int GL_COLOR_MATRIX_SGI = 0x80B1; + int GL_COLOR_MATRIX_STACK_DEPTH_SGI = 0x80B2; + int GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI = 0x80B3; + int GL_POST_COLOR_MATRIX_RED_SCALE_SGI = 0x80B4; + int GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI = 0x80B5; + int GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI = 0x80B6; + int GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI = 0x80B7; + int GL_POST_COLOR_MATRIX_RED_BIAS_SGI = 0x80B8; + int GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI = 0x80B9; + int GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI = 0x80BA; + int GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI = 0x80BB; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIColorTable.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIColorTable.java index a8e87741..f11dacf8 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIColorTable.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIColorTable.java @@ -16,92 +16,57 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGI_color_table} */ -public final class GLSGIColorTable { - public static final int GL_COLOR_TABLE_SGI = 0x80D0; - public static final int GL_POST_CONVOLUTION_COLOR_TABLE_SGI = 0x80D1; - public static final int GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI = 0x80D2; - public static final int GL_PROXY_COLOR_TABLE_SGI = 0x80D3; - public static final int GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI = 0x80D4; - public static final int GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI = 0x80D5; - public static final int GL_COLOR_TABLE_SCALE_SGI = 0x80D6; - public static final int GL_COLOR_TABLE_BIAS_SGI = 0x80D7; - public static final int GL_COLOR_TABLE_FORMAT_SGI = 0x80D8; - public static final int GL_COLOR_TABLE_WIDTH_SGI = 0x80D9; - public static final int GL_COLOR_TABLE_RED_SIZE_SGI = 0x80DA; - public static final int GL_COLOR_TABLE_GREEN_SIZE_SGI = 0x80DB; - public static final int GL_COLOR_TABLE_BLUE_SIZE_SGI = 0x80DC; - public static final int GL_COLOR_TABLE_ALPHA_SIZE_SGI = 0x80DD; - public static final int GL_COLOR_TABLE_LUMINANCE_SIZE_SGI = 0x80DE; - public static final int GL_COLOR_TABLE_INTENSITY_SIZE_SGI = 0x80DF; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGI_color_table) return; - ext.glColorTableSGI = load.invoke("glColorTableSGI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glColorTableParameterfvSGI = load.invoke("glColorTableParameterfvSGI", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glColorTableParameterivSGI = load.invoke("glColorTableParameterivSGI", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glCopyColorTableSGI = load.invoke("glCopyColorTableSGI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glGetColorTableSGI = load.invoke("glGetColorTableSGI", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetColorTableParameterfvSGI = load.invoke("glGetColorTableParameterfvSGI", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetColorTableParameterivSGI = load.invoke("glGetColorTableParameterivSGI", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLSGIColorTable { + int GL_COLOR_TABLE_SGI = 0x80D0; + int GL_POST_CONVOLUTION_COLOR_TABLE_SGI = 0x80D1; + int GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI = 0x80D2; + int GL_PROXY_COLOR_TABLE_SGI = 0x80D3; + int GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI = 0x80D4; + int GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI = 0x80D5; + int GL_COLOR_TABLE_SCALE_SGI = 0x80D6; + int GL_COLOR_TABLE_BIAS_SGI = 0x80D7; + int GL_COLOR_TABLE_FORMAT_SGI = 0x80D8; + int GL_COLOR_TABLE_WIDTH_SGI = 0x80D9; + int GL_COLOR_TABLE_RED_SIZE_SGI = 0x80DA; + int GL_COLOR_TABLE_GREEN_SIZE_SGI = 0x80DB; + int GL_COLOR_TABLE_BLUE_SIZE_SGI = 0x80DC; + int GL_COLOR_TABLE_ALPHA_SIZE_SGI = 0x80DD; + int GL_COLOR_TABLE_LUMINANCE_SIZE_SGI = 0x80DE; + int GL_COLOR_TABLE_INTENSITY_SIZE_SGI = 0x80DF; - public static void glColorTableSGI(int target, int internalformat, int width, int format, int type, @NativeType("const void *") MemorySegment table) { - final var ext = getExtCapabilities(); - try { - check(ext.glColorTableSGI).invokeExact(target, internalformat, width, format, type, table); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glColorTableSGI(int target, int internalformat, int width, int format, int type, @NativeType("const void *") MemorySegment table) { + throw new ContextException(); } - public static void glColorTableParameterfvSGI(int target, int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glColorTableParameterfvSGI).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glColorTableParameterfvSGI(int target, int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glColorTableParameterivSGI(int target, int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glColorTableParameterivSGI).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glColorTableParameterivSGI(int target, int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glCopyColorTableSGI(int target, int internalformat, int x, int y, int width) { - final var ext = getExtCapabilities(); - try { - check(ext.glCopyColorTableSGI).invokeExact(target, internalformat, x, y, width); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glCopyColorTableSGI(int target, int internalformat, int x, int y, int width) { + throw new ContextException(); } - public static void glGetColorTableSGI(int target, int format, int type, @NativeType("void *") MemorySegment table) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetColorTableSGI).invokeExact(target, format, type, table); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetColorTableSGI(int target, int format, int type, @NativeType("void *") MemorySegment table) { + throw new ContextException(); } - public static void glGetColorTableParameterfvSGI(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetColorTableParameterfvSGI).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetColorTableParameterfvSGI(int target, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetColorTableParameterivSGI(int target, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetColorTableParameterivSGI).invokeExact(target, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetColorTableParameterivSGI(int target, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISDetailTexture.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISDetailTexture.java index 7498c940..00b4fbc9 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISDetailTexture.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISDetailTexture.java @@ -16,44 +16,29 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIS_detail_texture} */ -public final class GLSGISDetailTexture { - public static final int GL_DETAIL_TEXTURE_2D_SGIS = 0x8095; - public static final int GL_DETAIL_TEXTURE_2D_BINDING_SGIS = 0x8096; - public static final int GL_LINEAR_DETAIL_SGIS = 0x8097; - public static final int GL_LINEAR_DETAIL_ALPHA_SGIS = 0x8098; - public static final int GL_LINEAR_DETAIL_COLOR_SGIS = 0x8099; - public static final int GL_DETAIL_TEXTURE_LEVEL_SGIS = 0x809A; - public static final int GL_DETAIL_TEXTURE_MODE_SGIS = 0x809B; - public static final int GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS = 0x809C; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGIS_detail_texture) return; - ext.glDetailTexFuncSGIS = load.invoke("glDetailTexFuncSGIS", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetDetailTexFuncSGIS = load.invoke("glGetDetailTexFuncSGIS", ofVoid(JAVA_INT, ADDRESS)); - } +public interface GLSGISDetailTexture { + int GL_DETAIL_TEXTURE_2D_SGIS = 0x8095; + int GL_DETAIL_TEXTURE_2D_BINDING_SGIS = 0x8096; + int GL_LINEAR_DETAIL_SGIS = 0x8097; + int GL_LINEAR_DETAIL_ALPHA_SGIS = 0x8098; + int GL_LINEAR_DETAIL_COLOR_SGIS = 0x8099; + int GL_DETAIL_TEXTURE_LEVEL_SGIS = 0x809A; + int GL_DETAIL_TEXTURE_MODE_SGIS = 0x809B; + int GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS = 0x809C; - public static void glDetailTexFuncSGIS(int target, int n, @NativeType("const GLfloat *") MemorySegment points) { - final var ext = getExtCapabilities(); - try { - check(ext.glDetailTexFuncSGIS).invokeExact(target, n, points); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDetailTexFuncSGIS(int target, int n, @NativeType("const GLfloat *") MemorySegment points) { + throw new ContextException(); } - public static void glGetDetailTexFuncSGIS(int target, @NativeType("GLfloat *") MemorySegment points) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetDetailTexFuncSGIS).invokeExact(target, points); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetDetailTexFuncSGIS(int target, @NativeType("GLfloat *") MemorySegment points) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISFogFunction.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISFogFunction.java index 5e6e0d83..87430c9d 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISFogFunction.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISFogFunction.java @@ -16,39 +16,24 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIS_fog_function} */ -public final class GLSGISFogFunction { - public static final int GL_FOG_FUNC_SGIS = 0x812A; - public static final int GL_FOG_FUNC_POINTS_SGIS = 0x812B; - public static final int GL_MAX_FOG_FUNC_POINTS_SGIS = 0x812C; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGIS_fog_function) return; - ext.glFogFuncSGIS = load.invoke("glFogFuncSGIS", ofVoid(JAVA_INT, ADDRESS)); - ext.glGetFogFuncSGIS = load.invoke("glGetFogFuncSGIS", ofVoid(ADDRESS)); - } +public interface GLSGISFogFunction { + int GL_FOG_FUNC_SGIS = 0x812A; + int GL_FOG_FUNC_POINTS_SGIS = 0x812B; + int GL_MAX_FOG_FUNC_POINTS_SGIS = 0x812C; - public static void glFogFuncSGIS(int n, @NativeType("const GLfloat *") MemorySegment points) { - final var ext = getExtCapabilities(); - try { - check(ext.glFogFuncSGIS).invokeExact(n, points); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFogFuncSGIS(int n, @NativeType("const GLfloat *") MemorySegment points) { + throw new ContextException(); } - public static void glGetFogFuncSGIS(@NativeType("GLfloat *") MemorySegment points) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetFogFuncSGIS).invokeExact(points); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetFogFuncSGIS(@NativeType("GLfloat *") MemorySegment points) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISGenerateMipmap.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISGenerateMipmap.java index 404e5a91..13aba568 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISGenerateMipmap.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISGenerateMipmap.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIS_generate_mipmap} */ -public final class GLSGISGenerateMipmap { - public static final int GL_GENERATE_MIPMAP_SGIS = 0x8191; - public static final int GL_GENERATE_MIPMAP_HINT_SGIS = 0x8192; +public interface GLSGISGenerateMipmap { + int GL_GENERATE_MIPMAP_SGIS = 0x8191; + int GL_GENERATE_MIPMAP_HINT_SGIS = 0x8192; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISMultisample.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISMultisample.java index 9da9e512..d57f106f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISMultisample.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISMultisample.java @@ -16,52 +16,37 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIS_multisample} */ -public final class GLSGISMultisample { - public static final int GL_MULTISAMPLE_SGIS = 0x809D; - public static final int GL_SAMPLE_ALPHA_TO_MASK_SGIS = 0x809E; - public static final int GL_SAMPLE_ALPHA_TO_ONE_SGIS = 0x809F; - public static final int GL_SAMPLE_MASK_SGIS = 0x80A0; - public static final int GL_1PASS_SGIS = 0x80A1; - public static final int GL_2PASS_0_SGIS = 0x80A2; - public static final int GL_2PASS_1_SGIS = 0x80A3; - public static final int GL_4PASS_0_SGIS = 0x80A4; - public static final int GL_4PASS_1_SGIS = 0x80A5; - public static final int GL_4PASS_2_SGIS = 0x80A6; - public static final int GL_4PASS_3_SGIS = 0x80A7; - public static final int GL_SAMPLE_BUFFERS_SGIS = 0x80A8; - public static final int GL_SAMPLES_SGIS = 0x80A9; - public static final int GL_SAMPLE_MASK_VALUE_SGIS = 0x80AA; - public static final int GL_SAMPLE_MASK_INVERT_SGIS = 0x80AB; - public static final int GL_SAMPLE_PATTERN_SGIS = 0x80AC; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGIS_multisample) return; - ext.glSampleMaskSGIS = load.invoke("glSampleMaskSGIS", ofVoid(JAVA_FLOAT, JAVA_BYTE)); - ext.glSamplePatternSGIS = load.invoke("glSamplePatternSGIS", ofVoid(JAVA_INT)); - } +public interface GLSGISMultisample { + int GL_MULTISAMPLE_SGIS = 0x809D; + int GL_SAMPLE_ALPHA_TO_MASK_SGIS = 0x809E; + int GL_SAMPLE_ALPHA_TO_ONE_SGIS = 0x809F; + int GL_SAMPLE_MASK_SGIS = 0x80A0; + int GL_1PASS_SGIS = 0x80A1; + int GL_2PASS_0_SGIS = 0x80A2; + int GL_2PASS_1_SGIS = 0x80A3; + int GL_4PASS_0_SGIS = 0x80A4; + int GL_4PASS_1_SGIS = 0x80A5; + int GL_4PASS_2_SGIS = 0x80A6; + int GL_4PASS_3_SGIS = 0x80A7; + int GL_SAMPLE_BUFFERS_SGIS = 0x80A8; + int GL_SAMPLES_SGIS = 0x80A9; + int GL_SAMPLE_MASK_VALUE_SGIS = 0x80AA; + int GL_SAMPLE_MASK_INVERT_SGIS = 0x80AB; + int GL_SAMPLE_PATTERN_SGIS = 0x80AC; - public static void glSampleMaskSGIS(float value, boolean invert) { - final var ext = getExtCapabilities(); - try { - check(ext.glSampleMaskSGIS).invokeExact(value, invert); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSampleMaskSGIS(float value, boolean invert) { + throw new ContextException(); } - public static void glSamplePatternSGIS(int pattern) { - final var ext = getExtCapabilities(); - try { - check(ext.glSamplePatternSGIS).invokeExact(pattern); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSamplePatternSGIS(int pattern) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISPixelTexture.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISPixelTexture.java index 563763b8..c2e1aa6f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISPixelTexture.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISPixelTexture.java @@ -16,72 +16,41 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIS_pixel_texture} */ -public final class GLSGISPixelTexture { - public static final int GL_PIXEL_TEXTURE_SGIS = 0x8353; - public static final int GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS = 0x8354; - public static final int GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS = 0x8355; - public static final int GL_PIXEL_GROUP_COLOR_SGIS = 0x8356; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGIS_pixel_texture) return; - ext.glPixelTexGenParameteriSGIS = load.invoke("glPixelTexGenParameteriSGIS", ofVoid(JAVA_INT, JAVA_INT)); - ext.glPixelTexGenParameterivSGIS = load.invoke("glPixelTexGenParameterivSGIS", ofVoid(JAVA_INT, ADDRESS)); - ext.glPixelTexGenParameterfSGIS = load.invoke("glPixelTexGenParameterfSGIS", ofVoid(JAVA_INT, JAVA_FLOAT)); - ext.glPixelTexGenParameterfvSGIS = load.invoke("glPixelTexGenParameterfvSGIS", ofVoid(JAVA_INT, ADDRESS)); - ext.glGetPixelTexGenParameterivSGIS = load.invoke("glGetPixelTexGenParameterivSGIS", ofVoid(JAVA_INT, ADDRESS)); - ext.glGetPixelTexGenParameterfvSGIS = load.invoke("glGetPixelTexGenParameterfvSGIS", ofVoid(JAVA_INT, ADDRESS)); - } - - public static void glPixelTexGenParameteriSGIS(int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glPixelTexGenParameteriSGIS).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLSGISPixelTexture { + int GL_PIXEL_TEXTURE_SGIS = 0x8353; + int GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS = 0x8354; + int GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS = 0x8355; + int GL_PIXEL_GROUP_COLOR_SGIS = 0x8356; + + default void glPixelTexGenParameteriSGIS(int pname, int param) { + throw new ContextException(); } - public static void glPixelTexGenParameterivSGIS(int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glPixelTexGenParameterivSGIS).invokeExact(pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPixelTexGenParameterivSGIS(int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glPixelTexGenParameterfSGIS(int pname, float param) { - final var ext = getExtCapabilities(); - try { - check(ext.glPixelTexGenParameterfSGIS).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPixelTexGenParameterfSGIS(int pname, float param) { + throw new ContextException(); } - public static void glPixelTexGenParameterfvSGIS(int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glPixelTexGenParameterfvSGIS).invokeExact(pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPixelTexGenParameterfvSGIS(int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetPixelTexGenParameterivSGIS(int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPixelTexGenParameterivSGIS).invokeExact(pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPixelTexGenParameterivSGIS(int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetPixelTexGenParameterfvSGIS(int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetPixelTexGenParameterfvSGIS).invokeExact(pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetPixelTexGenParameterfvSGIS(int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISPointLineTexgen.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISPointLineTexgen.java index 72095425..23c6f610 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISPointLineTexgen.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISPointLineTexgen.java @@ -16,24 +16,20 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIS_point_line_texgen} */ -public final class GLSGISPointLineTexgen { - public static final int GL_EYE_DISTANCE_TO_POINT_SGIS = 0x81F0; - public static final int GL_OBJECT_DISTANCE_TO_POINT_SGIS = 0x81F1; - public static final int GL_EYE_DISTANCE_TO_LINE_SGIS = 0x81F2; - public static final int GL_OBJECT_DISTANCE_TO_LINE_SGIS = 0x81F3; - public static final int GL_EYE_POINT_SGIS = 0x81F4; - public static final int GL_OBJECT_POINT_SGIS = 0x81F5; - public static final int GL_EYE_LINE_SGIS = 0x81F6; - public static final int GL_OBJECT_LINE_SGIS = 0x81F7; +public interface GLSGISPointLineTexgen { + int GL_EYE_DISTANCE_TO_POINT_SGIS = 0x81F0; + int GL_OBJECT_DISTANCE_TO_POINT_SGIS = 0x81F1; + int GL_EYE_DISTANCE_TO_LINE_SGIS = 0x81F2; + int GL_OBJECT_DISTANCE_TO_LINE_SGIS = 0x81F3; + int GL_EYE_POINT_SGIS = 0x81F4; + int GL_OBJECT_POINT_SGIS = 0x81F5; + int GL_EYE_LINE_SGIS = 0x81F6; + int GL_OBJECT_LINE_SGIS = 0x81F7; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISPointParameters.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISPointParameters.java index e1d31315..1abb5e79 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISPointParameters.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISPointParameters.java @@ -16,40 +16,25 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIS_point_parameters} */ -public final class GLSGISPointParameters { - public static final int GL_POINT_SIZE_MIN_SGIS = 0x8126; - public static final int GL_POINT_SIZE_MAX_SGIS = 0x8127; - public static final int GL_POINT_FADE_THRESHOLD_SIZE_SGIS = 0x8128; - public static final int GL_DISTANCE_ATTENUATION_SGIS = 0x8129; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGIS_point_parameters) return; - ext.glPointParameterfSGIS = load.invoke("glPointParameterfSGIS", ofVoid(JAVA_INT, JAVA_FLOAT)); - ext.glPointParameterfvSGIS = load.invoke("glPointParameterfvSGIS", ofVoid(JAVA_INT, ADDRESS)); - } +public interface GLSGISPointParameters { + int GL_POINT_SIZE_MIN_SGIS = 0x8126; + int GL_POINT_SIZE_MAX_SGIS = 0x8127; + int GL_POINT_FADE_THRESHOLD_SIZE_SGIS = 0x8128; + int GL_DISTANCE_ATTENUATION_SGIS = 0x8129; - public static void glPointParameterfSGIS(int pname, float param) { - final var ext = getExtCapabilities(); - try { - check(ext.glPointParameterfSGIS).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPointParameterfSGIS(int pname, float param) { + throw new ContextException(); } - public static void glPointParameterfvSGIS(int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glPointParameterfvSGIS).invokeExact(pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPointParameterfvSGIS(int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISSharpenTexture.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISSharpenTexture.java index bb747805..7db85a23 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISSharpenTexture.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISSharpenTexture.java @@ -16,40 +16,25 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIS_sharpen_texture} */ -public final class GLSGISSharpenTexture { - public static final int GL_LINEAR_SHARPEN_SGIS = 0x80AD; - public static final int GL_LINEAR_SHARPEN_ALPHA_SGIS = 0x80AE; - public static final int GL_LINEAR_SHARPEN_COLOR_SGIS = 0x80AF; - public static final int GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS = 0x80B0; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGIS_sharpen_texture) return; - ext.glSharpenTexFuncSGIS = load.invoke("glSharpenTexFuncSGIS", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetSharpenTexFuncSGIS = load.invoke("glGetSharpenTexFuncSGIS", ofVoid(JAVA_INT, ADDRESS)); - } +public interface GLSGISSharpenTexture { + int GL_LINEAR_SHARPEN_SGIS = 0x80AD; + int GL_LINEAR_SHARPEN_ALPHA_SGIS = 0x80AE; + int GL_LINEAR_SHARPEN_COLOR_SGIS = 0x80AF; + int GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS = 0x80B0; - public static void glSharpenTexFuncSGIS(int target, int n, @NativeType("const GLfloat *") MemorySegment points) { - final var ext = getExtCapabilities(); - try { - check(ext.glSharpenTexFuncSGIS).invokeExact(target, n, points); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSharpenTexFuncSGIS(int target, int n, @NativeType("const GLfloat *") MemorySegment points) { + throw new ContextException(); } - public static void glGetSharpenTexFuncSGIS(int target, @NativeType("GLfloat *") MemorySegment points) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetSharpenTexFuncSGIS).invokeExact(target, points); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetSharpenTexFuncSGIS(int target, @NativeType("GLfloat *") MemorySegment points) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTexture4D.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTexture4D.java index f235cf5d..8ccea1f2 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTexture4D.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTexture4D.java @@ -16,46 +16,31 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIS_texture4D} */ -public final class GLSGISTexture4D { - public static final int GL_PACK_SKIP_VOLUMES_SGIS = 0x8130; - public static final int GL_PACK_IMAGE_DEPTH_SGIS = 0x8131; - public static final int GL_UNPACK_SKIP_VOLUMES_SGIS = 0x8132; - public static final int GL_UNPACK_IMAGE_DEPTH_SGIS = 0x8133; - public static final int GL_TEXTURE_4D_SGIS = 0x8134; - public static final int GL_PROXY_TEXTURE_4D_SGIS = 0x8135; - public static final int GL_TEXTURE_4DSIZE_SGIS = 0x8136; - public static final int GL_TEXTURE_WRAP_Q_SGIS = 0x8137; - public static final int GL_MAX_4D_TEXTURE_SIZE_SGIS = 0x8138; - public static final int GL_TEXTURE_4D_BINDING_SGIS = 0x814F; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGIS_texture4D) return; - ext.glTexImage4DSGIS = load.invoke("glTexImage4DSGIS", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glTexSubImage4DSGIS = load.invoke("glTexSubImage4DSGIS", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLSGISTexture4D { + int GL_PACK_SKIP_VOLUMES_SGIS = 0x8130; + int GL_PACK_IMAGE_DEPTH_SGIS = 0x8131; + int GL_UNPACK_SKIP_VOLUMES_SGIS = 0x8132; + int GL_UNPACK_IMAGE_DEPTH_SGIS = 0x8133; + int GL_TEXTURE_4D_SGIS = 0x8134; + int GL_PROXY_TEXTURE_4D_SGIS = 0x8135; + int GL_TEXTURE_4DSIZE_SGIS = 0x8136; + int GL_TEXTURE_WRAP_Q_SGIS = 0x8137; + int GL_MAX_4D_TEXTURE_SIZE_SGIS = 0x8138; + int GL_TEXTURE_4D_BINDING_SGIS = 0x814F; - public static void glTexImage4DSGIS(int target, int level, int internalformat, int width, int height, int depth, int size4d, int border, int format, int type, @NativeType("const void *") MemorySegment pixels) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexImage4DSGIS).invokeExact(target, level, internalformat, width, height, depth, size4d, border, format, type, pixels); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexImage4DSGIS(int target, int level, int internalformat, int width, int height, int depth, int size4d, int border, int format, int type, @NativeType("const void *") MemorySegment pixels) { + throw new ContextException(); } - public static void glTexSubImage4DSGIS(int target, int level, int xoffset, int yoffset, int zoffset, int woffset, int width, int height, int depth, int size4d, int format, int type, @NativeType("const void *") MemorySegment pixels) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexSubImage4DSGIS).invokeExact(target, level, xoffset, yoffset, zoffset, woffset, width, height, depth, size4d, format, type, pixels); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexSubImage4DSGIS(int target, int level, int xoffset, int yoffset, int zoffset, int woffset, int width, int height, int depth, int size4d, int format, int type, @NativeType("const void *") MemorySegment pixels) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureBorderClamp.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureBorderClamp.java index cff30b7f..a13bdc75 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureBorderClamp.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureBorderClamp.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIS_texture_border_clamp} */ -public final class GLSGISTextureBorderClamp { - public static final int GL_CLAMP_TO_BORDER_SGIS = 0x812D; +public interface GLSGISTextureBorderClamp { + int GL_CLAMP_TO_BORDER_SGIS = 0x812D; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureColorMask.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureColorMask.java index 6e2b103d..41320602 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureColorMask.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureColorMask.java @@ -16,29 +16,18 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIS_texture_color_mask} */ -public final class GLSGISTextureColorMask { - public static final int GL_TEXTURE_COLOR_WRITEMASK_SGIS = 0x81EF; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGIS_texture_color_mask) return; - ext.glTextureColorMaskSGIS = load.invoke("glTextureColorMaskSGIS", ofVoid(JAVA_BYTE, JAVA_BYTE, JAVA_BYTE, JAVA_BYTE)); - } +public interface GLSGISTextureColorMask { + int GL_TEXTURE_COLOR_WRITEMASK_SGIS = 0x81EF; - public static void glTextureColorMaskSGIS(boolean red, boolean green, boolean blue, boolean alpha) { - final var ext = getExtCapabilities(); - try { - check(ext.glTextureColorMaskSGIS).invokeExact(red, green, blue, alpha); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTextureColorMaskSGIS(boolean red, boolean green, boolean blue, boolean alpha) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureEdgeClamp.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureEdgeClamp.java index 824d582a..2bf890d7 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureEdgeClamp.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureEdgeClamp.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIS_texture_edge_clamp} */ -public final class GLSGISTextureEdgeClamp { - public static final int GL_CLAMP_TO_EDGE_SGIS = 0x812F; +public interface GLSGISTextureEdgeClamp { + int GL_CLAMP_TO_EDGE_SGIS = 0x812F; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureFilter4.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureFilter4.java index c92f06e2..fa730658 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureFilter4.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureFilter4.java @@ -16,38 +16,23 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIS_texture_filter4} */ -public final class GLSGISTextureFilter4 { - public static final int GL_FILTER4_SGIS = 0x8146; - public static final int GL_TEXTURE_FILTER4_SIZE_SGIS = 0x8147; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGIS_texture_filter4) return; - ext.glGetTexFilterFuncSGIS = load.invoke("glGetTexFilterFuncSGIS", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glTexFilterFuncSGIS = load.invoke("glTexFilterFuncSGIS", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLSGISTextureFilter4 { + int GL_FILTER4_SGIS = 0x8146; + int GL_TEXTURE_FILTER4_SIZE_SGIS = 0x8147; - public static void glGetTexFilterFuncSGIS(int target, int filter, @NativeType("GLfloat *") MemorySegment weights) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetTexFilterFuncSGIS).invokeExact(target, filter, weights); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetTexFilterFuncSGIS(int target, int filter, @NativeType("GLfloat *") MemorySegment weights) { + throw new ContextException(); } - public static void glTexFilterFuncSGIS(int target, int filter, int n, @NativeType("const GLfloat *") MemorySegment weights) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexFilterFuncSGIS).invokeExact(target, filter, n, weights); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexFilterFuncSGIS(int target, int filter, int n, @NativeType("const GLfloat *") MemorySegment weights) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureLod.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureLod.java index 310987e1..255f7158 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureLod.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureLod.java @@ -16,20 +16,16 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIS_texture_lod} */ -public final class GLSGISTextureLod { - public static final int GL_TEXTURE_MIN_LOD_SGIS = 0x813A; - public static final int GL_TEXTURE_MAX_LOD_SGIS = 0x813B; - public static final int GL_TEXTURE_BASE_LEVEL_SGIS = 0x813C; - public static final int GL_TEXTURE_MAX_LEVEL_SGIS = 0x813D; +public interface GLSGISTextureLod { + int GL_TEXTURE_MIN_LOD_SGIS = 0x813A; + int GL_TEXTURE_MAX_LOD_SGIS = 0x813B; + int GL_TEXTURE_BASE_LEVEL_SGIS = 0x813C; + int GL_TEXTURE_MAX_LEVEL_SGIS = 0x813D; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureSelect.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureSelect.java index e77c06b4..315cc763 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureSelect.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGISTextureSelect.java @@ -16,38 +16,34 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIS_texture_select} */ -public final class GLSGISTextureSelect { - public static final int GL_DUAL_ALPHA4_SGIS = 0x8110; - public static final int GL_DUAL_ALPHA8_SGIS = 0x8111; - public static final int GL_DUAL_ALPHA12_SGIS = 0x8112; - public static final int GL_DUAL_ALPHA16_SGIS = 0x8113; - public static final int GL_DUAL_LUMINANCE4_SGIS = 0x8114; - public static final int GL_DUAL_LUMINANCE8_SGIS = 0x8115; - public static final int GL_DUAL_LUMINANCE12_SGIS = 0x8116; - public static final int GL_DUAL_LUMINANCE16_SGIS = 0x8117; - public static final int GL_DUAL_INTENSITY4_SGIS = 0x8118; - public static final int GL_DUAL_INTENSITY8_SGIS = 0x8119; - public static final int GL_DUAL_INTENSITY12_SGIS = 0x811A; - public static final int GL_DUAL_INTENSITY16_SGIS = 0x811B; - public static final int GL_DUAL_LUMINANCE_ALPHA4_SGIS = 0x811C; - public static final int GL_DUAL_LUMINANCE_ALPHA8_SGIS = 0x811D; - public static final int GL_QUAD_ALPHA4_SGIS = 0x811E; - public static final int GL_QUAD_ALPHA8_SGIS = 0x811F; - public static final int GL_QUAD_LUMINANCE4_SGIS = 0x8120; - public static final int GL_QUAD_LUMINANCE8_SGIS = 0x8121; - public static final int GL_QUAD_INTENSITY4_SGIS = 0x8122; - public static final int GL_QUAD_INTENSITY8_SGIS = 0x8123; - public static final int GL_DUAL_TEXTURE_SELECT_SGIS = 0x8124; - public static final int GL_QUAD_TEXTURE_SELECT_SGIS = 0x8125; +public interface GLSGISTextureSelect { + int GL_DUAL_ALPHA4_SGIS = 0x8110; + int GL_DUAL_ALPHA8_SGIS = 0x8111; + int GL_DUAL_ALPHA12_SGIS = 0x8112; + int GL_DUAL_ALPHA16_SGIS = 0x8113; + int GL_DUAL_LUMINANCE4_SGIS = 0x8114; + int GL_DUAL_LUMINANCE8_SGIS = 0x8115; + int GL_DUAL_LUMINANCE12_SGIS = 0x8116; + int GL_DUAL_LUMINANCE16_SGIS = 0x8117; + int GL_DUAL_INTENSITY4_SGIS = 0x8118; + int GL_DUAL_INTENSITY8_SGIS = 0x8119; + int GL_DUAL_INTENSITY12_SGIS = 0x811A; + int GL_DUAL_INTENSITY16_SGIS = 0x811B; + int GL_DUAL_LUMINANCE_ALPHA4_SGIS = 0x811C; + int GL_DUAL_LUMINANCE_ALPHA8_SGIS = 0x811D; + int GL_QUAD_ALPHA4_SGIS = 0x811E; + int GL_QUAD_ALPHA8_SGIS = 0x811F; + int GL_QUAD_LUMINANCE4_SGIS = 0x8120; + int GL_QUAD_LUMINANCE8_SGIS = 0x8121; + int GL_QUAD_INTENSITY4_SGIS = 0x8122; + int GL_QUAD_INTENSITY8_SGIS = 0x8123; + int GL_DUAL_TEXTURE_SELECT_SGIS = 0x8124; + int GL_QUAD_TEXTURE_SELECT_SGIS = 0x8125; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGITextureColorTable.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGITextureColorTable.java index d57f7017..887437c0 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGITextureColorTable.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGITextureColorTable.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGI_texture_color_table} */ -public final class GLSGITextureColorTable { - public static final int GL_TEXTURE_COLOR_TABLE_SGI = 0x80BC; - public static final int GL_PROXY_TEXTURE_COLOR_TABLE_SGI = 0x80BD; +public interface GLSGITextureColorTable { + int GL_TEXTURE_COLOR_TABLE_SGI = 0x80BC; + int GL_PROXY_TEXTURE_COLOR_TABLE_SGI = 0x80BD; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXAsync.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXAsync.java index 4800da97..bea9e7fc 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXAsync.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXAsync.java @@ -16,73 +16,38 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_async} */ -public final class GLSGIXAsync { - public static final int GL_ASYNC_MARKER_SGIX = 0x8329; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGIX_async) return; - ext.glAsyncMarkerSGIX = load.invoke("glAsyncMarkerSGIX", ofVoid(JAVA_INT)); - ext.glFinishAsyncSGIX = load.invoke("glFinishAsyncSGIX", of(JAVA_INT, ADDRESS)); - ext.glPollAsyncSGIX = load.invoke("glPollAsyncSGIX", of(JAVA_INT, ADDRESS)); - ext.glGenAsyncMarkersSGIX = load.invoke("glGenAsyncMarkersSGIX", of(JAVA_INT, JAVA_INT)); - ext.glDeleteAsyncMarkersSGIX = load.invoke("glDeleteAsyncMarkersSGIX", ofVoid(JAVA_INT, JAVA_INT)); - ext.glIsAsyncMarkerSGIX = load.invoke("glIsAsyncMarkerSGIX", of(JAVA_BYTE, JAVA_INT)); - } +public interface GLSGIXAsync { + int GL_ASYNC_MARKER_SGIX = 0x8329; - public static void glAsyncMarkerSGIX(int marker) { - final var ext = getExtCapabilities(); - try { - check(ext.glAsyncMarkerSGIX).invokeExact(marker); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glAsyncMarkerSGIX(int marker) { + throw new ContextException(); } - public static int glFinishAsyncSGIX(@NativeType("GLuint *") MemorySegment markerp) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glFinishAsyncSGIX).invokeExact(markerp); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glFinishAsyncSGIX(@NativeType("GLuint *") MemorySegment markerp) { + throw new ContextException(); } - public static int glPollAsyncSGIX(@NativeType("GLuint *") MemorySegment markerp) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glPollAsyncSGIX).invokeExact(markerp); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glPollAsyncSGIX(@NativeType("GLuint *") MemorySegment markerp) { + throw new ContextException(); } - public static int glGenAsyncMarkersSGIX(int range) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glGenAsyncMarkersSGIX).invokeExact(range); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glGenAsyncMarkersSGIX(int range) { + throw new ContextException(); } - public static void glDeleteAsyncMarkersSGIX(int marker, int range) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeleteAsyncMarkersSGIX).invokeExact(marker, range); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDeleteAsyncMarkersSGIX(int marker, int range) { + throw new ContextException(); } - public static boolean glIsAsyncMarkerSGIX(int marker) { - final var ext = getExtCapabilities(); - try { - return (boolean) - check(ext.glIsAsyncMarkerSGIX).invokeExact(marker); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default boolean glIsAsyncMarkerSGIX(int marker) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXAsyncHistogram.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXAsyncHistogram.java index 472ac076..443c076e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXAsyncHistogram.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXAsyncHistogram.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_async_histogram} */ -public final class GLSGIXAsyncHistogram { - public static final int GL_ASYNC_HISTOGRAM_SGIX = 0x832C; - public static final int GL_MAX_ASYNC_HISTOGRAM_SGIX = 0x832D; +public interface GLSGIXAsyncHistogram { + int GL_ASYNC_HISTOGRAM_SGIX = 0x832C; + int GL_MAX_ASYNC_HISTOGRAM_SGIX = 0x832D; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXAsyncPixel.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXAsyncPixel.java index 37f06947..4fa75c92 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXAsyncPixel.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXAsyncPixel.java @@ -16,22 +16,18 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_async_pixel} */ -public final class GLSGIXAsyncPixel { - public static final int GL_ASYNC_TEX_IMAGE_SGIX = 0x835C; - public static final int GL_ASYNC_DRAW_PIXELS_SGIX = 0x835D; - public static final int GL_ASYNC_READ_PIXELS_SGIX = 0x835E; - public static final int GL_MAX_ASYNC_TEX_IMAGE_SGIX = 0x835F; - public static final int GL_MAX_ASYNC_DRAW_PIXELS_SGIX = 0x8360; - public static final int GL_MAX_ASYNC_READ_PIXELS_SGIX = 0x8361; +public interface GLSGIXAsyncPixel { + int GL_ASYNC_TEX_IMAGE_SGIX = 0x835C; + int GL_ASYNC_DRAW_PIXELS_SGIX = 0x835D; + int GL_ASYNC_READ_PIXELS_SGIX = 0x835E; + int GL_MAX_ASYNC_TEX_IMAGE_SGIX = 0x835F; + int GL_MAX_ASYNC_DRAW_PIXELS_SGIX = 0x8360; + int GL_MAX_ASYNC_READ_PIXELS_SGIX = 0x8361; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXBlendAlphaMinmax.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXBlendAlphaMinmax.java index 7b68ac9d..266d108c 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXBlendAlphaMinmax.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXBlendAlphaMinmax.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_blend_alpha_minmax} */ -public final class GLSGIXBlendAlphaMinmax { - public static final int GL_ALPHA_MIN_SGIX = 0x8320; - public static final int GL_ALPHA_MAX_SGIX = 0x8321; +public interface GLSGIXBlendAlphaMinmax { + int GL_ALPHA_MIN_SGIX = 0x8320; + int GL_ALPHA_MAX_SGIX = 0x8321; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXCalligraphicFragment.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXCalligraphicFragment.java index 1ab23c28..cdb01bd6 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXCalligraphicFragment.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXCalligraphicFragment.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_calligraphic_fragment} */ -public final class GLSGIXCalligraphicFragment { - public static final int GL_CALLIGRAPHIC_FRAGMENT_SGIX = 0x8183; +public interface GLSGIXCalligraphicFragment { + int GL_CALLIGRAPHIC_FRAGMENT_SGIX = 0x8183; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXClipmap.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXClipmap.java index 4fa16086..af7c37a1 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXClipmap.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXClipmap.java @@ -16,28 +16,24 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_clipmap} */ -public final class GLSGIXClipmap { - public static final int GL_LINEAR_CLIPMAP_LINEAR_SGIX = 0x8170; - public static final int GL_TEXTURE_CLIPMAP_CENTER_SGIX = 0x8171; - public static final int GL_TEXTURE_CLIPMAP_FRAME_SGIX = 0x8172; - public static final int GL_TEXTURE_CLIPMAP_OFFSET_SGIX = 0x8173; - public static final int GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX = 0x8174; - public static final int GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX = 0x8175; - public static final int GL_TEXTURE_CLIPMAP_DEPTH_SGIX = 0x8176; - public static final int GL_MAX_CLIPMAP_DEPTH_SGIX = 0x8177; - public static final int GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX = 0x8178; - public static final int GL_NEAREST_CLIPMAP_NEAREST_SGIX = 0x844D; - public static final int GL_NEAREST_CLIPMAP_LINEAR_SGIX = 0x844E; - public static final int GL_LINEAR_CLIPMAP_NEAREST_SGIX = 0x844F; +public interface GLSGIXClipmap { + int GL_LINEAR_CLIPMAP_LINEAR_SGIX = 0x8170; + int GL_TEXTURE_CLIPMAP_CENTER_SGIX = 0x8171; + int GL_TEXTURE_CLIPMAP_FRAME_SGIX = 0x8172; + int GL_TEXTURE_CLIPMAP_OFFSET_SGIX = 0x8173; + int GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX = 0x8174; + int GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX = 0x8175; + int GL_TEXTURE_CLIPMAP_DEPTH_SGIX = 0x8176; + int GL_MAX_CLIPMAP_DEPTH_SGIX = 0x8177; + int GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX = 0x8178; + int GL_NEAREST_CLIPMAP_NEAREST_SGIX = 0x844D; + int GL_NEAREST_CLIPMAP_LINEAR_SGIX = 0x844E; + int GL_LINEAR_CLIPMAP_NEAREST_SGIX = 0x844F; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXConvolutionAccuracy.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXConvolutionAccuracy.java index 903f7e2d..f3733f28 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXConvolutionAccuracy.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXConvolutionAccuracy.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_convolution_accuracy} */ -public final class GLSGIXConvolutionAccuracy { - public static final int GL_CONVOLUTION_HINT_SGIX = 0x8316; +public interface GLSGIXConvolutionAccuracy { + int GL_CONVOLUTION_HINT_SGIX = 0x8316; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXDepthTexture.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXDepthTexture.java index 6c28a1ba..eed03684 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXDepthTexture.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXDepthTexture.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_depth_texture} */ -public final class GLSGIXDepthTexture { - public static final int GL_DEPTH_COMPONENT16_SGIX = 0x81A5; - public static final int GL_DEPTH_COMPONENT24_SGIX = 0x81A6; - public static final int GL_DEPTH_COMPONENT32_SGIX = 0x81A7; +public interface GLSGIXDepthTexture { + int GL_DEPTH_COMPONENT16_SGIX = 0x81A5; + int GL_DEPTH_COMPONENT24_SGIX = 0x81A6; + int GL_DEPTH_COMPONENT32_SGIX = 0x81A7; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXFlushRaster.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXFlushRaster.java index 3f1ccd5a..cbbc72a5 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXFlushRaster.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXFlushRaster.java @@ -16,28 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_flush_raster} */ -public final class GLSGIXFlushRaster { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGIX_flush_raster) return; - ext.glFlushRasterSGIX = load.invoke("glFlushRasterSGIX", ofVoid()); - } +public interface GLSGIXFlushRaster { - public static void glFlushRasterSGIX() { - final var ext = getExtCapabilities(); - try { - check(ext.glFlushRasterSGIX).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFlushRasterSGIX() { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXFogOffset.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXFogOffset.java index 6080755c..5c4bceeb 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXFogOffset.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXFogOffset.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_fog_offset} */ -public final class GLSGIXFogOffset { - public static final int GL_FOG_OFFSET_SGIX = 0x8198; - public static final int GL_FOG_OFFSET_VALUE_SGIX = 0x8199; +public interface GLSGIXFogOffset { + int GL_FOG_OFFSET_SGIX = 0x8198; + int GL_FOG_OFFSET_VALUE_SGIX = 0x8199; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXFragmentLighting.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXFragmentLighting.java index f5056c24..33217597 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXFragmentLighting.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXFragmentLighting.java @@ -16,184 +16,105 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_fragment_lighting} */ -public final class GLSGIXFragmentLighting { - public static final int GL_FRAGMENT_LIGHTING_SGIX = 0x8400; - public static final int GL_FRAGMENT_COLOR_MATERIAL_SGIX = 0x8401; - public static final int GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX = 0x8402; - public static final int GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX = 0x8403; - public static final int GL_MAX_FRAGMENT_LIGHTS_SGIX = 0x8404; - public static final int GL_MAX_ACTIVE_LIGHTS_SGIX = 0x8405; - public static final int GL_CURRENT_RASTER_NORMAL_SGIX = 0x8406; - public static final int GL_LIGHT_ENV_MODE_SGIX = 0x8407; - public static final int GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX = 0x8408; - public static final int GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX = 0x8409; - public static final int GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX = 0x840A; - public static final int GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX = 0x840B; - public static final int GL_FRAGMENT_LIGHT0_SGIX = 0x840C; - public static final int GL_FRAGMENT_LIGHT1_SGIX = 0x840D; - public static final int GL_FRAGMENT_LIGHT2_SGIX = 0x840E; - public static final int GL_FRAGMENT_LIGHT3_SGIX = 0x840F; - public static final int GL_FRAGMENT_LIGHT4_SGIX = 0x8410; - public static final int GL_FRAGMENT_LIGHT5_SGIX = 0x8411; - public static final int GL_FRAGMENT_LIGHT6_SGIX = 0x8412; - public static final int GL_FRAGMENT_LIGHT7_SGIX = 0x8413; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGIX_fragment_lighting) return; - ext.glFragmentColorMaterialSGIX = load.invoke("glFragmentColorMaterialSGIX", ofVoid(JAVA_INT, JAVA_INT)); - ext.glFragmentLightfSGIX = load.invoke("glFragmentLightfSGIX", ofVoid(JAVA_INT, JAVA_INT, JAVA_FLOAT)); - ext.glFragmentLightfvSGIX = load.invoke("glFragmentLightfvSGIX", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glFragmentLightiSGIX = load.invoke("glFragmentLightiSGIX", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glFragmentLightivSGIX = load.invoke("glFragmentLightivSGIX", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glFragmentLightModelfSGIX = load.invoke("glFragmentLightModelfSGIX", ofVoid(JAVA_INT, JAVA_FLOAT)); - ext.glFragmentLightModelfvSGIX = load.invoke("glFragmentLightModelfvSGIX", ofVoid(JAVA_INT, ADDRESS)); - ext.glFragmentLightModeliSGIX = load.invoke("glFragmentLightModeliSGIX", ofVoid(JAVA_INT, JAVA_INT)); - ext.glFragmentLightModelivSGIX = load.invoke("glFragmentLightModelivSGIX", ofVoid(JAVA_INT, ADDRESS)); - ext.glFragmentMaterialfSGIX = load.invoke("glFragmentMaterialfSGIX", ofVoid(JAVA_INT, JAVA_INT, JAVA_FLOAT)); - ext.glFragmentMaterialfvSGIX = load.invoke("glFragmentMaterialfvSGIX", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glFragmentMaterialiSGIX = load.invoke("glFragmentMaterialiSGIX", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glFragmentMaterialivSGIX = load.invoke("glFragmentMaterialivSGIX", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetFragmentLightfvSGIX = load.invoke("glGetFragmentLightfvSGIX", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetFragmentLightivSGIX = load.invoke("glGetFragmentLightivSGIX", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetFragmentMaterialfvSGIX = load.invoke("glGetFragmentMaterialfvSGIX", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetFragmentMaterialivSGIX = load.invoke("glGetFragmentMaterialivSGIX", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glLightEnviSGIX = load.invoke("glLightEnviSGIX", ofVoid(JAVA_INT, JAVA_INT)); - } - - public static void glFragmentColorMaterialSGIX(int face, int mode) { - final var ext = getExtCapabilities(); - try { - check(ext.glFragmentColorMaterialSGIX).invokeExact(face, mode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glFragmentLightfSGIX(int light, int pname, float param) { - final var ext = getExtCapabilities(); - try { - check(ext.glFragmentLightfSGIX).invokeExact(light, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glFragmentLightfvSGIX(int light, int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glFragmentLightfvSGIX).invokeExact(light, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glFragmentLightiSGIX(int light, int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glFragmentLightiSGIX).invokeExact(light, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glFragmentLightivSGIX(int light, int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glFragmentLightivSGIX).invokeExact(light, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glFragmentLightModelfSGIX(int pname, float param) { - final var ext = getExtCapabilities(); - try { - check(ext.glFragmentLightModelfSGIX).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glFragmentLightModelfvSGIX(int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glFragmentLightModelfvSGIX).invokeExact(pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glFragmentLightModeliSGIX(int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glFragmentLightModeliSGIX).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glFragmentLightModelivSGIX(int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glFragmentLightModelivSGIX).invokeExact(pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glFragmentMaterialfSGIX(int face, int pname, float param) { - final var ext = getExtCapabilities(); - try { - check(ext.glFragmentMaterialfSGIX).invokeExact(face, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glFragmentMaterialfvSGIX(int face, int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glFragmentMaterialfvSGIX).invokeExact(face, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glFragmentMaterialiSGIX(int face, int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glFragmentMaterialiSGIX).invokeExact(face, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLSGIXFragmentLighting { + int GL_FRAGMENT_LIGHTING_SGIX = 0x8400; + int GL_FRAGMENT_COLOR_MATERIAL_SGIX = 0x8401; + int GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX = 0x8402; + int GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX = 0x8403; + int GL_MAX_FRAGMENT_LIGHTS_SGIX = 0x8404; + int GL_MAX_ACTIVE_LIGHTS_SGIX = 0x8405; + int GL_CURRENT_RASTER_NORMAL_SGIX = 0x8406; + int GL_LIGHT_ENV_MODE_SGIX = 0x8407; + int GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX = 0x8408; + int GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX = 0x8409; + int GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX = 0x840A; + int GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX = 0x840B; + int GL_FRAGMENT_LIGHT0_SGIX = 0x840C; + int GL_FRAGMENT_LIGHT1_SGIX = 0x840D; + int GL_FRAGMENT_LIGHT2_SGIX = 0x840E; + int GL_FRAGMENT_LIGHT3_SGIX = 0x840F; + int GL_FRAGMENT_LIGHT4_SGIX = 0x8410; + int GL_FRAGMENT_LIGHT5_SGIX = 0x8411; + int GL_FRAGMENT_LIGHT6_SGIX = 0x8412; + int GL_FRAGMENT_LIGHT7_SGIX = 0x8413; + + default void glFragmentColorMaterialSGIX(int face, int mode) { + throw new ContextException(); + } + + default void glFragmentLightfSGIX(int light, int pname, float param) { + throw new ContextException(); + } + + default void glFragmentLightfvSGIX(int light, int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); + } + + default void glFragmentLightiSGIX(int light, int pname, int param) { + throw new ContextException(); + } + + default void glFragmentLightivSGIX(int light, int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); + } + + default void glFragmentLightModelfSGIX(int pname, float param) { + throw new ContextException(); + } + + default void glFragmentLightModelfvSGIX(int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); + } + + default void glFragmentLightModeliSGIX(int pname, int param) { + throw new ContextException(); + } + + default void glFragmentLightModelivSGIX(int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); + } + + default void glFragmentMaterialfSGIX(int face, int pname, float param) { + throw new ContextException(); + } + + default void glFragmentMaterialfvSGIX(int face, int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); + } + + default void glFragmentMaterialiSGIX(int face, int pname, int param) { + throw new ContextException(); } - public static void glFragmentMaterialivSGIX(int face, int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glFragmentMaterialivSGIX).invokeExact(face, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFragmentMaterialivSGIX(int face, int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetFragmentLightfvSGIX(int light, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetFragmentLightfvSGIX).invokeExact(light, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetFragmentLightfvSGIX(int light, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetFragmentLightivSGIX(int light, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetFragmentLightivSGIX).invokeExact(light, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetFragmentLightivSGIX(int light, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glGetFragmentMaterialfvSGIX(int face, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetFragmentMaterialfvSGIX).invokeExact(face, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetFragmentMaterialfvSGIX(int face, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetFragmentMaterialivSGIX(int face, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetFragmentMaterialivSGIX).invokeExact(face, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetFragmentMaterialivSGIX(int face, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glLightEnviSGIX(int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glLightEnviSGIX).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glLightEnviSGIX(int pname, int param) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXFramezoom.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXFramezoom.java index 7a426efe..457b47a2 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXFramezoom.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXFramezoom.java @@ -16,31 +16,20 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_framezoom} */ -public final class GLSGIXFramezoom { - public static final int GL_FRAMEZOOM_SGIX = 0x818B; - public static final int GL_FRAMEZOOM_FACTOR_SGIX = 0x818C; - public static final int GL_MAX_FRAMEZOOM_FACTOR_SGIX = 0x818D; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGIX_framezoom) return; - ext.glFrameZoomSGIX = load.invoke("glFrameZoomSGIX", ofVoid(JAVA_INT)); - } +public interface GLSGIXFramezoom { + int GL_FRAMEZOOM_SGIX = 0x818B; + int GL_FRAMEZOOM_FACTOR_SGIX = 0x818C; + int GL_MAX_FRAMEZOOM_FACTOR_SGIX = 0x818D; - public static void glFrameZoomSGIX(int factor) { - final var ext = getExtCapabilities(); - try { - check(ext.glFrameZoomSGIX).invokeExact(factor); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFrameZoomSGIX(int factor) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXIglooInterface.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXIglooInterface.java index 60f018e1..ef4e2d7f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXIglooInterface.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXIglooInterface.java @@ -16,28 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_igloo_interface} */ -public final class GLSGIXIglooInterface { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGIX_igloo_interface) return; - ext.glIglooInterfaceSGIX = load.invoke("glIglooInterfaceSGIX", ofVoid(JAVA_INT, ADDRESS)); - } +public interface GLSGIXIglooInterface { - public static void glIglooInterfaceSGIX(int pname, @NativeType("const void *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glIglooInterfaceSGIX).invokeExact(pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glIglooInterfaceSGIX(int pname, @NativeType("const void *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXInstruments.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXInstruments.java index a9915749..95f6360f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXInstruments.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXInstruments.java @@ -16,72 +16,39 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_instruments} */ -public final class GLSGIXInstruments { - public static final int GL_INSTRUMENT_BUFFER_POINTER_SGIX = 0x8180; - public static final int GL_INSTRUMENT_MEASUREMENTS_SGIX = 0x8181; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGIX_instruments) return; - ext.glGetInstrumentsSGIX = load.invoke("glGetInstrumentsSGIX", of(JAVA_INT)); - ext.glInstrumentsBufferSGIX = load.invoke("glInstrumentsBufferSGIX", ofVoid(JAVA_INT, ADDRESS)); - ext.glPollInstrumentsSGIX = load.invoke("glPollInstrumentsSGIX", of(JAVA_INT, ADDRESS)); - ext.glReadInstrumentsSGIX = load.invoke("glReadInstrumentsSGIX", ofVoid(JAVA_INT)); - ext.glStartInstrumentsSGIX = load.invoke("glStartInstrumentsSGIX", ofVoid()); - ext.glStopInstrumentsSGIX = load.invoke("glStopInstrumentsSGIX", ofVoid(JAVA_INT)); - } +public interface GLSGIXInstruments { + int GL_INSTRUMENT_BUFFER_POINTER_SGIX = 0x8180; + int GL_INSTRUMENT_MEASUREMENTS_SGIX = 0x8181; - public static int glGetInstrumentsSGIX() { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glGetInstrumentsSGIX).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glGetInstrumentsSGIX() { + throw new ContextException(); } - public static void glInstrumentsBufferSGIX(int size, @NativeType("GLint *") MemorySegment buffer) { - final var ext = getExtCapabilities(); - try { - check(ext.glInstrumentsBufferSGIX).invokeExact(size, buffer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glInstrumentsBufferSGIX(int size, @NativeType("GLint *") MemorySegment buffer) { + throw new ContextException(); } - public static int glPollInstrumentsSGIX(@NativeType("GLint *") MemorySegment marker_p) { - final var ext = getExtCapabilities(); - try { - return (int) - check(ext.glPollInstrumentsSGIX).invokeExact(marker_p); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default int glPollInstrumentsSGIX(@NativeType("GLint *") MemorySegment marker_p) { + throw new ContextException(); } - public static void glReadInstrumentsSGIX(int marker) { - final var ext = getExtCapabilities(); - try { - check(ext.glReadInstrumentsSGIX).invokeExact(marker); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReadInstrumentsSGIX(int marker) { + throw new ContextException(); } - public static void glStartInstrumentsSGIX() { - final var ext = getExtCapabilities(); - try { - check(ext.glStartInstrumentsSGIX).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glStartInstrumentsSGIX() { + throw new ContextException(); } - public static void glStopInstrumentsSGIX(int marker) { - final var ext = getExtCapabilities(); - try { - check(ext.glStopInstrumentsSGIX).invokeExact(marker); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glStopInstrumentsSGIX(int marker) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXInterlace.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXInterlace.java index 2e2c7ceb..8719b39e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXInterlace.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXInterlace.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_interlace} */ -public final class GLSGIXInterlace { - public static final int GL_INTERLACE_SGIX = 0x8094; +public interface GLSGIXInterlace { + int GL_INTERLACE_SGIX = 0x8094; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXIrInstrument1.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXIrInstrument1.java index e8a83df1..9ffd3d8c 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXIrInstrument1.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXIrInstrument1.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_ir_instrument1} */ -public final class GLSGIXIrInstrument1 { - public static final int GL_IR_INSTRUMENT1_SGIX = 0x817F; +public interface GLSGIXIrInstrument1 { + int GL_IR_INSTRUMENT1_SGIX = 0x817F; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXListPriority.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXListPriority.java index 94a8d12d..a6fa9f81 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXListPriority.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXListPriority.java @@ -16,69 +16,38 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_list_priority} */ -public final class GLSGIXListPriority { - public static final int GL_LIST_PRIORITY_SGIX = 0x8182; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGIX_list_priority) return; - ext.glGetListParameterfvSGIX = load.invoke("glGetListParameterfvSGIX", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glGetListParameterivSGIX = load.invoke("glGetListParameterivSGIX", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glListParameterfSGIX = load.invoke("glListParameterfSGIX", ofVoid(JAVA_INT, JAVA_INT, JAVA_FLOAT)); - ext.glListParameterfvSGIX = load.invoke("glListParameterfvSGIX", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - ext.glListParameteriSGIX = load.invoke("glListParameteriSGIX", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT)); - ext.glListParameterivSGIX = load.invoke("glListParameterivSGIX", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLSGIXListPriority { + int GL_LIST_PRIORITY_SGIX = 0x8182; - public static void glGetListParameterfvSGIX(int list, int pname, @NativeType("GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetListParameterfvSGIX).invokeExact(list, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetListParameterfvSGIX(int list, int pname, @NativeType("GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glGetListParameterivSGIX(int list, int pname, @NativeType("GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glGetListParameterivSGIX).invokeExact(list, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGetListParameterivSGIX(int list, int pname, @NativeType("GLint *") MemorySegment params) { + throw new ContextException(); } - public static void glListParameterfSGIX(int list, int pname, float param) { - final var ext = getExtCapabilities(); - try { - check(ext.glListParameterfSGIX).invokeExact(list, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glListParameterfSGIX(int list, int pname, float param) { + throw new ContextException(); } - public static void glListParameterfvSGIX(int list, int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glListParameterfvSGIX).invokeExact(list, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glListParameterfvSGIX(int list, int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glListParameteriSGIX(int list, int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glListParameteriSGIX).invokeExact(list, pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glListParameteriSGIX(int list, int pname, int param) { + throw new ContextException(); } - public static void glListParameterivSGIX(int list, int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glListParameterivSGIX).invokeExact(list, pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glListParameterivSGIX(int list, int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXPixelTexture.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXPixelTexture.java index 3e91ca30..ec5f03f8 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXPixelTexture.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXPixelTexture.java @@ -16,30 +16,19 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_pixel_texture} */ -public final class GLSGIXPixelTexture { - public static final int GL_PIXEL_TEX_GEN_SGIX = 0x8139; - public static final int GL_PIXEL_TEX_GEN_MODE_SGIX = 0x832B; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGIX_pixel_texture) return; - ext.glPixelTexGenSGIX = load.invoke("glPixelTexGenSGIX", ofVoid(JAVA_INT)); - } +public interface GLSGIXPixelTexture { + int GL_PIXEL_TEX_GEN_SGIX = 0x8139; + int GL_PIXEL_TEX_GEN_MODE_SGIX = 0x832B; - public static void glPixelTexGenSGIX(int mode) { - final var ext = getExtCapabilities(); - try { - check(ext.glPixelTexGenSGIX).invokeExact(mode); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glPixelTexGenSGIX(int mode) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXPixelTiles.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXPixelTiles.java index e49f8eb3..79857476 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXPixelTiles.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXPixelTiles.java @@ -16,24 +16,20 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_pixel_tiles} */ -public final class GLSGIXPixelTiles { - public static final int GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX = 0x813E; - public static final int GL_PIXEL_TILE_CACHE_INCREMENT_SGIX = 0x813F; - public static final int GL_PIXEL_TILE_WIDTH_SGIX = 0x8140; - public static final int GL_PIXEL_TILE_HEIGHT_SGIX = 0x8141; - public static final int GL_PIXEL_TILE_GRID_WIDTH_SGIX = 0x8142; - public static final int GL_PIXEL_TILE_GRID_HEIGHT_SGIX = 0x8143; - public static final int GL_PIXEL_TILE_GRID_DEPTH_SGIX = 0x8144; - public static final int GL_PIXEL_TILE_CACHE_SIZE_SGIX = 0x8145; +public interface GLSGIXPixelTiles { + int GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX = 0x813E; + int GL_PIXEL_TILE_CACHE_INCREMENT_SGIX = 0x813F; + int GL_PIXEL_TILE_WIDTH_SGIX = 0x8140; + int GL_PIXEL_TILE_HEIGHT_SGIX = 0x8141; + int GL_PIXEL_TILE_GRID_WIDTH_SGIX = 0x8142; + int GL_PIXEL_TILE_GRID_HEIGHT_SGIX = 0x8143; + int GL_PIXEL_TILE_GRID_DEPTH_SGIX = 0x8144; + int GL_PIXEL_TILE_CACHE_SIZE_SGIX = 0x8145; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXPolynomialFFD.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXPolynomialFFD.java index 04486bd7..1a937dce 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXPolynomialFFD.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXPolynomialFFD.java @@ -16,58 +16,35 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_polynomial_ffd} */ -public final class GLSGIXPolynomialFFD { - public static final int GL_TEXTURE_DEFORMATION_BIT_SGIX = 0x00000001; - public static final int GL_GEOMETRY_DEFORMATION_BIT_SGIX = 0x00000002; - public static final int GL_GEOMETRY_DEFORMATION_SGIX = 0x8194; - public static final int GL_TEXTURE_DEFORMATION_SGIX = 0x8195; - public static final int GL_DEFORMATIONS_MASK_SGIX = 0x8196; - public static final int GL_MAX_DEFORMATION_ORDER_SGIX = 0x8197; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGIX_polynomial_ffd) return; - ext.glDeformationMap3dSGIX = load.invoke("glDeformationMap3dSGIX", ofVoid(JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_INT, JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_INT, JAVA_INT, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glDeformationMap3fSGIX = load.invoke("glDeformationMap3fSGIX", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_INT, JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_INT, JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_INT, JAVA_INT, ADDRESS)); - ext.glDeformSGIX = load.invoke("glDeformSGIX", ofVoid(JAVA_INT)); - ext.glLoadIdentityDeformationMapSGIX = load.invoke("glLoadIdentityDeformationMapSGIX", ofVoid(JAVA_INT)); - } - - public static void glDeformationMap3dSGIX(int target, double u1, double u2, int ustride, int uorder, double v1, double v2, int vstride, int vorder, double w1, double w2, int wstride, int worder, @NativeType("const GLdouble *") MemorySegment points) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeformationMap3dSGIX).invokeExact(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, w1, w2, wstride, worder, points); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLSGIXPolynomialFFD { + int GL_TEXTURE_DEFORMATION_BIT_SGIX = 0x00000001; + int GL_GEOMETRY_DEFORMATION_BIT_SGIX = 0x00000002; + int GL_GEOMETRY_DEFORMATION_SGIX = 0x8194; + int GL_TEXTURE_DEFORMATION_SGIX = 0x8195; + int GL_DEFORMATIONS_MASK_SGIX = 0x8196; + int GL_MAX_DEFORMATION_ORDER_SGIX = 0x8197; + + default void glDeformationMap3dSGIX(int target, double u1, double u2, int ustride, int uorder, double v1, double v2, int vstride, int vorder, double w1, double w2, int wstride, int worder, @NativeType("const GLdouble *") MemorySegment points) { + throw new ContextException(); } - public static void glDeformationMap3fSGIX(int target, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, float w1, float w2, int wstride, int worder, @NativeType("const GLfloat *") MemorySegment points) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeformationMap3fSGIX).invokeExact(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, w1, w2, wstride, worder, points); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDeformationMap3fSGIX(int target, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, float w1, float w2, int wstride, int worder, @NativeType("const GLfloat *") MemorySegment points) { + throw new ContextException(); } - public static void glDeformSGIX(int mask) { - final var ext = getExtCapabilities(); - try { - check(ext.glDeformSGIX).invokeExact(mask); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDeformSGIX(int mask) { + throw new ContextException(); } - public static void glLoadIdentityDeformationMapSGIX(int mask) { - final var ext = getExtCapabilities(); - try { - check(ext.glLoadIdentityDeformationMapSGIX).invokeExact(mask); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glLoadIdentityDeformationMapSGIX(int mask) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXReferencePlane.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXReferencePlane.java index 7ee332d8..5c756126 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXReferencePlane.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXReferencePlane.java @@ -16,30 +16,19 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_reference_plane} */ -public final class GLSGIXReferencePlane { - public static final int GL_REFERENCE_PLANE_SGIX = 0x817D; - public static final int GL_REFERENCE_PLANE_EQUATION_SGIX = 0x817E; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGIX_reference_plane) return; - ext.glReferencePlaneSGIX = load.invoke("glReferencePlaneSGIX", ofVoid(ADDRESS)); - } +public interface GLSGIXReferencePlane { + int GL_REFERENCE_PLANE_SGIX = 0x817D; + int GL_REFERENCE_PLANE_EQUATION_SGIX = 0x817E; - public static void glReferencePlaneSGIX(@NativeType("const GLdouble *") MemorySegment equation) { - final var ext = getExtCapabilities(); - try { - check(ext.glReferencePlaneSGIX).invokeExact(equation); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReferencePlaneSGIX(@NativeType("const GLdouble *") MemorySegment equation) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXResample.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXResample.java index 8c18028f..31d0b3c9 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXResample.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXResample.java @@ -16,21 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_resample} */ -public final class GLSGIXResample { - public static final int GL_PACK_RESAMPLE_SGIX = 0x842E; - public static final int GL_UNPACK_RESAMPLE_SGIX = 0x842F; - public static final int GL_RESAMPLE_REPLICATE_SGIX = 0x8433; - public static final int GL_RESAMPLE_ZERO_FILL_SGIX = 0x8434; - public static final int GL_RESAMPLE_DECIMATE_SGIX = 0x8430; +public interface GLSGIXResample { + int GL_PACK_RESAMPLE_SGIX = 0x842E; + int GL_UNPACK_RESAMPLE_SGIX = 0x842F; + int GL_RESAMPLE_REPLICATE_SGIX = 0x8433; + int GL_RESAMPLE_ZERO_FILL_SGIX = 0x8434; + int GL_RESAMPLE_DECIMATE_SGIX = 0x8430; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXScalebiasHint.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXScalebiasHint.java index a3ea2b9b..a5e815e1 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXScalebiasHint.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXScalebiasHint.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_scalebias_hint} */ -public final class GLSGIXScalebiasHint { - public static final int GL_SCALEBIAS_HINT_SGIX = 0x8322; +public interface GLSGIXScalebiasHint { + int GL_SCALEBIAS_HINT_SGIX = 0x8322; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXShadow.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXShadow.java index 1c3ac066..ade15f9b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXShadow.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXShadow.java @@ -16,20 +16,16 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_shadow} */ -public final class GLSGIXShadow { - public static final int GL_TEXTURE_COMPARE_SGIX = 0x819A; - public static final int GL_TEXTURE_COMPARE_OPERATOR_SGIX = 0x819B; - public static final int GL_TEXTURE_LEQUAL_R_SGIX = 0x819C; - public static final int GL_TEXTURE_GEQUAL_R_SGIX = 0x819D; +public interface GLSGIXShadow { + int GL_TEXTURE_COMPARE_SGIX = 0x819A; + int GL_TEXTURE_COMPARE_OPERATOR_SGIX = 0x819B; + int GL_TEXTURE_LEQUAL_R_SGIX = 0x819C; + int GL_TEXTURE_GEQUAL_R_SGIX = 0x819D; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXShadowAmbient.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXShadowAmbient.java index 7c567206..eccd9af4 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXShadowAmbient.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXShadowAmbient.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_shadow_ambient} */ -public final class GLSGIXShadowAmbient { - public static final int GL_SHADOW_AMBIENT_SGIX = 0x80BF; +public interface GLSGIXShadowAmbient { + int GL_SHADOW_AMBIENT_SGIX = 0x80BF; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXSprite.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXSprite.java index 21e8553b..e4261587 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXSprite.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXSprite.java @@ -16,59 +16,36 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_sprite} */ -public final class GLSGIXSprite { - public static final int GL_SPRITE_SGIX = 0x8148; - public static final int GL_SPRITE_MODE_SGIX = 0x8149; - public static final int GL_SPRITE_AXIS_SGIX = 0x814A; - public static final int GL_SPRITE_TRANSLATION_SGIX = 0x814B; - public static final int GL_SPRITE_AXIAL_SGIX = 0x814C; - public static final int GL_SPRITE_OBJECT_ALIGNED_SGIX = 0x814D; - public static final int GL_SPRITE_EYE_ALIGNED_SGIX = 0x814E; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGIX_sprite) return; - ext.glSpriteParameterfSGIX = load.invoke("glSpriteParameterfSGIX", ofVoid(JAVA_INT, JAVA_FLOAT)); - ext.glSpriteParameterfvSGIX = load.invoke("glSpriteParameterfvSGIX", ofVoid(JAVA_INT, ADDRESS)); - ext.glSpriteParameteriSGIX = load.invoke("glSpriteParameteriSGIX", ofVoid(JAVA_INT, JAVA_INT)); - ext.glSpriteParameterivSGIX = load.invoke("glSpriteParameterivSGIX", ofVoid(JAVA_INT, ADDRESS)); - } - - public static void glSpriteParameterfSGIX(int pname, float param) { - final var ext = getExtCapabilities(); - try { - check(ext.glSpriteParameterfSGIX).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLSGIXSprite { + int GL_SPRITE_SGIX = 0x8148; + int GL_SPRITE_MODE_SGIX = 0x8149; + int GL_SPRITE_AXIS_SGIX = 0x814A; + int GL_SPRITE_TRANSLATION_SGIX = 0x814B; + int GL_SPRITE_AXIAL_SGIX = 0x814C; + int GL_SPRITE_OBJECT_ALIGNED_SGIX = 0x814D; + int GL_SPRITE_EYE_ALIGNED_SGIX = 0x814E; + + default void glSpriteParameterfSGIX(int pname, float param) { + throw new ContextException(); } - public static void glSpriteParameterfvSGIX(int pname, @NativeType("const GLfloat *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glSpriteParameterfvSGIX).invokeExact(pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSpriteParameterfvSGIX(int pname, @NativeType("const GLfloat *") MemorySegment params) { + throw new ContextException(); } - public static void glSpriteParameteriSGIX(int pname, int param) { - final var ext = getExtCapabilities(); - try { - check(ext.glSpriteParameteriSGIX).invokeExact(pname, param); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSpriteParameteriSGIX(int pname, int param) { + throw new ContextException(); } - public static void glSpriteParameterivSGIX(int pname, @NativeType("const GLint *") MemorySegment params) { - final var ext = getExtCapabilities(); - try { - check(ext.glSpriteParameterivSGIX).invokeExact(pname, params); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glSpriteParameterivSGIX(int pname, @NativeType("const GLint *") MemorySegment params) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXSubsample.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXSubsample.java index 608b0f6e..63f3f4d9 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXSubsample.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXSubsample.java @@ -16,21 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_subsample} */ -public final class GLSGIXSubsample { - public static final int GL_PACK_SUBSAMPLE_RATE_SGIX = 0x85A0; - public static final int GL_UNPACK_SUBSAMPLE_RATE_SGIX = 0x85A1; - public static final int GL_PIXEL_SUBSAMPLE_4444_SGIX = 0x85A2; - public static final int GL_PIXEL_SUBSAMPLE_2424_SGIX = 0x85A3; - public static final int GL_PIXEL_SUBSAMPLE_4242_SGIX = 0x85A4; +public interface GLSGIXSubsample { + int GL_PACK_SUBSAMPLE_RATE_SGIX = 0x85A0; + int GL_UNPACK_SUBSAMPLE_RATE_SGIX = 0x85A1; + int GL_PIXEL_SUBSAMPLE_4444_SGIX = 0x85A2; + int GL_PIXEL_SUBSAMPLE_2424_SGIX = 0x85A3; + int GL_PIXEL_SUBSAMPLE_4242_SGIX = 0x85A4; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTagSampleBuffer.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTagSampleBuffer.java index 2ee333a3..b9710417 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTagSampleBuffer.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTagSampleBuffer.java @@ -16,28 +16,17 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_tag_sample_buffer} */ -public final class GLSGIXTagSampleBuffer { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SGIX_tag_sample_buffer) return; - ext.glTagSampleBufferSGIX = load.invoke("glTagSampleBufferSGIX", ofVoid()); - } +public interface GLSGIXTagSampleBuffer { - public static void glTagSampleBufferSGIX() { - final var ext = getExtCapabilities(); - try { - check(ext.glTagSampleBufferSGIX).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTagSampleBufferSGIX() { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTextureAddEnv.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTextureAddEnv.java index caf3ba8a..91cf1fad 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTextureAddEnv.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTextureAddEnv.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_texture_add_env} */ -public final class GLSGIXTextureAddEnv { - public static final int GL_TEXTURE_ENV_BIAS_SGIX = 0x80BE; +public interface GLSGIXTextureAddEnv { + int GL_TEXTURE_ENV_BIAS_SGIX = 0x80BE; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTextureCoordinateClamp.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTextureCoordinateClamp.java index eb6b07af..f51a1cfd 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTextureCoordinateClamp.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTextureCoordinateClamp.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_texture_coordinate_clamp} */ -public final class GLSGIXTextureCoordinateClamp { - public static final int GL_TEXTURE_MAX_CLAMP_S_SGIX = 0x8369; - public static final int GL_TEXTURE_MAX_CLAMP_T_SGIX = 0x836A; - public static final int GL_TEXTURE_MAX_CLAMP_R_SGIX = 0x836B; +public interface GLSGIXTextureCoordinateClamp { + int GL_TEXTURE_MAX_CLAMP_S_SGIX = 0x8369; + int GL_TEXTURE_MAX_CLAMP_T_SGIX = 0x836A; + int GL_TEXTURE_MAX_CLAMP_R_SGIX = 0x836B; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTextureLodBias.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTextureLodBias.java index db96e5d2..405a60f1 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTextureLodBias.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTextureLodBias.java @@ -16,19 +16,15 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_texture_lod_bias} */ -public final class GLSGIXTextureLodBias { - public static final int GL_TEXTURE_LOD_BIAS_S_SGIX = 0x818E; - public static final int GL_TEXTURE_LOD_BIAS_T_SGIX = 0x818F; - public static final int GL_TEXTURE_LOD_BIAS_R_SGIX = 0x8190; +public interface GLSGIXTextureLodBias { + int GL_TEXTURE_LOD_BIAS_S_SGIX = 0x818E; + int GL_TEXTURE_LOD_BIAS_T_SGIX = 0x818F; + int GL_TEXTURE_LOD_BIAS_R_SGIX = 0x8190; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTextureMultiBuffer.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTextureMultiBuffer.java index fd606896..52a8b06b 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTextureMultiBuffer.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTextureMultiBuffer.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_texture_multi_buffer} */ -public final class GLSGIXTextureMultiBuffer { - public static final int GL_TEXTURE_MULTI_BUFFER_HINT_SGIX = 0x812E; +public interface GLSGIXTextureMultiBuffer { + int GL_TEXTURE_MULTI_BUFFER_HINT_SGIX = 0x812E; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTextureScaleBias.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTextureScaleBias.java index ebd00787..5f7edb6a 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTextureScaleBias.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXTextureScaleBias.java @@ -16,20 +16,16 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_texture_scale_bias} */ -public final class GLSGIXTextureScaleBias { - public static final int GL_POST_TEXTURE_FILTER_BIAS_SGIX = 0x8179; - public static final int GL_POST_TEXTURE_FILTER_SCALE_SGIX = 0x817A; - public static final int GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX = 0x817B; - public static final int GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX = 0x817C; +public interface GLSGIXTextureScaleBias { + int GL_POST_TEXTURE_FILTER_BIAS_SGIX = 0x8179; + int GL_POST_TEXTURE_FILTER_SCALE_SGIX = 0x817A; + int GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX = 0x817B; + int GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX = 0x817C; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXVertexPreclip.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXVertexPreclip.java index 9db4a81d..a765d12e 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXVertexPreclip.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXVertexPreclip.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_vertex_preclip} */ -public final class GLSGIXVertexPreclip { - public static final int GL_VERTEX_PRECLIP_SGIX = 0x83EE; - public static final int GL_VERTEX_PRECLIP_HINT_SGIX = 0x83EF; +public interface GLSGIXVertexPreclip { + int GL_VERTEX_PRECLIP_SGIX = 0x83EE; + int GL_VERTEX_PRECLIP_HINT_SGIX = 0x83EF; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXYcrcb.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXYcrcb.java index 5bf0fca2..bd583ee0 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXYcrcb.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXYcrcb.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_ycrcb} */ -public final class GLSGIXYcrcb { - public static final int GL_YCRCB_422_SGIX = 0x81BB; - public static final int GL_YCRCB_444_SGIX = 0x81BC; +public interface GLSGIXYcrcb { + int GL_YCRCB_422_SGIX = 0x81BB; + int GL_YCRCB_444_SGIX = 0x81BC; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXYcrcba.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXYcrcba.java index 4fb14d7a..ef1dcab3 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXYcrcba.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sgi/GLSGIXYcrcba.java @@ -16,18 +16,14 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sgi; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SGIX_ycrcba} */ -public final class GLSGIXYcrcba { - public static final int GL_YCRCB_SGIX = 0x8318; - public static final int GL_YCRCBA_SGIX = 0x8319; +public interface GLSGIXYcrcba { + int GL_YCRCB_SGIX = 0x8318; + int GL_YCRCBA_SGIX = 0x8319; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNConvolutionBorderModes.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNConvolutionBorderModes.java index 91fe640c..e69c1a3d 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNConvolutionBorderModes.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNConvolutionBorderModes.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sun; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SUN_convolution_border_modes} */ -public final class GLSUNConvolutionBorderModes { - public static final int GL_WRAP_BORDER_SUN = 0x81D4; +public interface GLSUNConvolutionBorderModes { + int GL_WRAP_BORDER_SUN = 0x81D4; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNGlobalAlpha.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNGlobalAlpha.java index a77e8314..599153a1 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNGlobalAlpha.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNGlobalAlpha.java @@ -16,86 +16,47 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sun; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SUN_global_alpha} */ -public final class GLSUNGlobalAlpha { - public static final int GL_GLOBAL_ALPHA_SUN = 0x81D9; - public static final int GL_GLOBAL_ALPHA_FACTOR_SUN = 0x81DA; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SUN_global_alpha) return; - ext.glGlobalAlphaFactorbSUN = load.invoke("glGlobalAlphaFactorbSUN", ofVoid(JAVA_BYTE)); - ext.glGlobalAlphaFactorsSUN = load.invoke("glGlobalAlphaFactorsSUN", ofVoid(JAVA_SHORT)); - ext.glGlobalAlphaFactoriSUN = load.invoke("glGlobalAlphaFactoriSUN", ofVoid(JAVA_INT)); - ext.glGlobalAlphaFactorfSUN = load.invoke("glGlobalAlphaFactorfSUN", ofVoid(JAVA_FLOAT)); - ext.glGlobalAlphaFactordSUN = load.invoke("glGlobalAlphaFactordSUN", ofVoid(JAVA_DOUBLE)); - ext.glGlobalAlphaFactorubSUN = load.invoke("glGlobalAlphaFactorubSUN", ofVoid(JAVA_BYTE)); - ext.glGlobalAlphaFactorusSUN = load.invoke("glGlobalAlphaFactorusSUN", ofVoid(JAVA_SHORT)); - ext.glGlobalAlphaFactoruiSUN = load.invoke("glGlobalAlphaFactoruiSUN", ofVoid(JAVA_INT)); - } +public interface GLSUNGlobalAlpha { + int GL_GLOBAL_ALPHA_SUN = 0x81D9; + int GL_GLOBAL_ALPHA_FACTOR_SUN = 0x81DA; - public static void glGlobalAlphaFactorbSUN(byte factor) { - final var ext = getExtCapabilities(); - try { - check(ext.glGlobalAlphaFactorbSUN).invokeExact(factor); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGlobalAlphaFactorbSUN(byte factor) { + throw new ContextException(); } - public static void glGlobalAlphaFactorsSUN(short factor) { - final var ext = getExtCapabilities(); - try { - check(ext.glGlobalAlphaFactorsSUN).invokeExact(factor); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGlobalAlphaFactorsSUN(short factor) { + throw new ContextException(); } - public static void glGlobalAlphaFactoriSUN(int factor) { - final var ext = getExtCapabilities(); - try { - check(ext.glGlobalAlphaFactoriSUN).invokeExact(factor); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGlobalAlphaFactoriSUN(int factor) { + throw new ContextException(); } - public static void glGlobalAlphaFactorfSUN(float factor) { - final var ext = getExtCapabilities(); - try { - check(ext.glGlobalAlphaFactorfSUN).invokeExact(factor); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGlobalAlphaFactorfSUN(float factor) { + throw new ContextException(); } - public static void glGlobalAlphaFactordSUN(double factor) { - final var ext = getExtCapabilities(); - try { - check(ext.glGlobalAlphaFactordSUN).invokeExact(factor); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGlobalAlphaFactordSUN(double factor) { + throw new ContextException(); } - public static void glGlobalAlphaFactorubSUN(byte factor) { - final var ext = getExtCapabilities(); - try { - check(ext.glGlobalAlphaFactorubSUN).invokeExact(factor); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGlobalAlphaFactorubSUN(byte factor) { + throw new ContextException(); } - public static void glGlobalAlphaFactorusSUN(short factor) { - final var ext = getExtCapabilities(); - try { - check(ext.glGlobalAlphaFactorusSUN).invokeExact(factor); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGlobalAlphaFactorusSUN(short factor) { + throw new ContextException(); } - public static void glGlobalAlphaFactoruiSUN(int factor) { - final var ext = getExtCapabilities(); - try { - check(ext.glGlobalAlphaFactoruiSUN).invokeExact(factor); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glGlobalAlphaFactoruiSUN(int factor) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNMeshArray.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNMeshArray.java index 72ac6d17..35955526 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNMeshArray.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNMeshArray.java @@ -16,30 +16,19 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sun; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SUN_mesh_array} */ -public final class GLSUNMeshArray { - public static final int GL_QUAD_MESH_SUN = 0x8614; - public static final int GL_TRIANGLE_MESH_SUN = 0x8615; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SUN_mesh_array) return; - ext.glDrawMeshArraysSUN = load.invoke("glDrawMeshArraysSUN", ofVoid(JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT)); - } +public interface GLSUNMeshArray { + int GL_QUAD_MESH_SUN = 0x8614; + int GL_TRIANGLE_MESH_SUN = 0x8615; - public static void glDrawMeshArraysSUN(int mode, int first, int count, int width) { - final var ext = getExtCapabilities(); - try { - check(ext.glDrawMeshArraysSUN).invokeExact(mode, first, count, width); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glDrawMeshArraysSUN(int mode, int first, int count, int width) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNSliceAccum.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNSliceAccum.java index 9e4b7539..26d115df 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNSliceAccum.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNSliceAccum.java @@ -16,17 +16,13 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sun; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SUN_slice_accum} */ -public final class GLSUNSliceAccum { - public static final int GL_SLICE_ACCUM_SUN = 0x85CC; +public interface GLSUNSliceAccum { + int GL_SLICE_ACCUM_SUN = 0x85CC; } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNTriangleList.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNTriangleList.java index b12bcd9c..01af8271 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNTriangleList.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNTriangleList.java @@ -16,93 +16,58 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sun; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SUN_triangle_list} */ -public final class GLSUNTriangleList { - public static final int GL_RESTART_SUN = 0x0001; - public static final int GL_REPLACE_MIDDLE_SUN = 0x0002; - public static final int GL_REPLACE_OLDEST_SUN = 0x0003; - public static final int GL_TRIANGLE_LIST_SUN = 0x81D7; - public static final int GL_REPLACEMENT_CODE_SUN = 0x81D8; - public static final int GL_REPLACEMENT_CODE_ARRAY_SUN = 0x85C0; - public static final int GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN = 0x85C1; - public static final int GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN = 0x85C2; - public static final int GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN = 0x85C3; - public static final int GL_R1UI_V3F_SUN = 0x85C4; - public static final int GL_R1UI_C4UB_V3F_SUN = 0x85C5; - public static final int GL_R1UI_C3F_V3F_SUN = 0x85C6; - public static final int GL_R1UI_N3F_V3F_SUN = 0x85C7; - public static final int GL_R1UI_C4F_N3F_V3F_SUN = 0x85C8; - public static final int GL_R1UI_T2F_V3F_SUN = 0x85C9; - public static final int GL_R1UI_T2F_N3F_V3F_SUN = 0x85CA; - public static final int GL_R1UI_T2F_C4F_N3F_V3F_SUN = 0x85CB; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SUN_triangle_list) return; - ext.glReplacementCodeuiSUN = load.invoke("glReplacementCodeuiSUN", ofVoid(JAVA_INT)); - ext.glReplacementCodeusSUN = load.invoke("glReplacementCodeusSUN", ofVoid(JAVA_SHORT)); - ext.glReplacementCodeubSUN = load.invoke("glReplacementCodeubSUN", ofVoid(JAVA_BYTE)); - ext.glReplacementCodeuivSUN = load.invoke("glReplacementCodeuivSUN", ofVoid(ADDRESS)); - ext.glReplacementCodeusvSUN = load.invoke("glReplacementCodeusvSUN", ofVoid(ADDRESS)); - ext.glReplacementCodeubvSUN = load.invoke("glReplacementCodeubvSUN", ofVoid(ADDRESS)); - ext.glReplacementCodePointerSUN = load.invoke("glReplacementCodePointerSUN", ofVoid(JAVA_INT, JAVA_INT, ADDRESS)); - } +public interface GLSUNTriangleList { + int GL_RESTART_SUN = 0x0001; + int GL_REPLACE_MIDDLE_SUN = 0x0002; + int GL_REPLACE_OLDEST_SUN = 0x0003; + int GL_TRIANGLE_LIST_SUN = 0x81D7; + int GL_REPLACEMENT_CODE_SUN = 0x81D8; + int GL_REPLACEMENT_CODE_ARRAY_SUN = 0x85C0; + int GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN = 0x85C1; + int GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN = 0x85C2; + int GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN = 0x85C3; + int GL_R1UI_V3F_SUN = 0x85C4; + int GL_R1UI_C4UB_V3F_SUN = 0x85C5; + int GL_R1UI_C3F_V3F_SUN = 0x85C6; + int GL_R1UI_N3F_V3F_SUN = 0x85C7; + int GL_R1UI_C4F_N3F_V3F_SUN = 0x85C8; + int GL_R1UI_T2F_V3F_SUN = 0x85C9; + int GL_R1UI_T2F_N3F_V3F_SUN = 0x85CA; + int GL_R1UI_T2F_C4F_N3F_V3F_SUN = 0x85CB; - public static void glReplacementCodeuiSUN(int code) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeuiSUN).invokeExact(code); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeuiSUN(int code) { + throw new ContextException(); } - public static void glReplacementCodeusSUN(short code) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeusSUN).invokeExact(code); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeusSUN(short code) { + throw new ContextException(); } - public static void glReplacementCodeubSUN(byte code) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeubSUN).invokeExact(code); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeubSUN(byte code) { + throw new ContextException(); } - public static void glReplacementCodeuivSUN(@NativeType("const GLuint *") MemorySegment code) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeuivSUN).invokeExact(code); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeuivSUN(@NativeType("const GLuint *") MemorySegment code) { + throw new ContextException(); } - public static void glReplacementCodeusvSUN(@NativeType("const GLushort *") MemorySegment code) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeusvSUN).invokeExact(code); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeusvSUN(@NativeType("const GLushort *") MemorySegment code) { + throw new ContextException(); } - public static void glReplacementCodeubvSUN(@NativeType("const GLubyte *") MemorySegment code) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeubvSUN).invokeExact(code); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeubvSUN(@NativeType("const GLubyte *") MemorySegment code) { + throw new ContextException(); } - public static void glReplacementCodePointerSUN(int type, int stride, @NativeType("const void **") MemorySegment pointer) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodePointerSUN).invokeExact(type, stride, pointer); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodePointerSUN(int type, int stride, @NativeType("const void **") MemorySegment pointer) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNVertex.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNVertex.java index 2522774b..310f8126 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNVertex.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNVertex.java @@ -16,340 +16,173 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sun; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SUN_vertex} */ -public final class GLSUNVertex { - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SUN_vertex) return; - ext.glColor4ubVertex2fSUN = load.invoke("glColor4ubVertex2fSUN", ofVoid(JAVA_BYTE, JAVA_BYTE, JAVA_BYTE, JAVA_BYTE, JAVA_FLOAT, JAVA_FLOAT)); - ext.glColor4ubVertex2fvSUN = load.invoke("glColor4ubVertex2fvSUN", ofVoid(ADDRESS, ADDRESS)); - ext.glColor4ubVertex3fSUN = load.invoke("glColor4ubVertex3fSUN", ofVoid(JAVA_BYTE, JAVA_BYTE, JAVA_BYTE, JAVA_BYTE, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glColor4ubVertex3fvSUN = load.invoke("glColor4ubVertex3fvSUN", ofVoid(ADDRESS, ADDRESS)); - ext.glColor3fVertex3fSUN = load.invoke("glColor3fVertex3fSUN", ofVoid(JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glColor3fVertex3fvSUN = load.invoke("glColor3fVertex3fvSUN", ofVoid(ADDRESS, ADDRESS)); - ext.glNormal3fVertex3fSUN = load.invoke("glNormal3fVertex3fSUN", ofVoid(JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glNormal3fVertex3fvSUN = load.invoke("glNormal3fVertex3fvSUN", ofVoid(ADDRESS, ADDRESS)); - ext.glColor4fNormal3fVertex3fSUN = load.invoke("glColor4fNormal3fVertex3fSUN", ofVoid(JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glColor4fNormal3fVertex3fvSUN = load.invoke("glColor4fNormal3fVertex3fvSUN", ofVoid(ADDRESS, ADDRESS, ADDRESS)); - ext.glTexCoord2fVertex3fSUN = load.invoke("glTexCoord2fVertex3fSUN", ofVoid(JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glTexCoord2fVertex3fvSUN = load.invoke("glTexCoord2fVertex3fvSUN", ofVoid(ADDRESS, ADDRESS)); - ext.glTexCoord4fVertex4fSUN = load.invoke("glTexCoord4fVertex4fSUN", ofVoid(JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glTexCoord4fVertex4fvSUN = load.invoke("glTexCoord4fVertex4fvSUN", ofVoid(ADDRESS, ADDRESS)); - ext.glTexCoord2fColor4ubVertex3fSUN = load.invoke("glTexCoord2fColor4ubVertex3fSUN", ofVoid(JAVA_FLOAT, JAVA_FLOAT, JAVA_BYTE, JAVA_BYTE, JAVA_BYTE, JAVA_BYTE, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glTexCoord2fColor4ubVertex3fvSUN = load.invoke("glTexCoord2fColor4ubVertex3fvSUN", ofVoid(ADDRESS, ADDRESS, ADDRESS)); - ext.glTexCoord2fColor3fVertex3fSUN = load.invoke("glTexCoord2fColor3fVertex3fSUN", ofVoid(JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glTexCoord2fColor3fVertex3fvSUN = load.invoke("glTexCoord2fColor3fVertex3fvSUN", ofVoid(ADDRESS, ADDRESS, ADDRESS)); - ext.glTexCoord2fNormal3fVertex3fSUN = load.invoke("glTexCoord2fNormal3fVertex3fSUN", ofVoid(JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glTexCoord2fNormal3fVertex3fvSUN = load.invoke("glTexCoord2fNormal3fVertex3fvSUN", ofVoid(ADDRESS, ADDRESS, ADDRESS)); - ext.glTexCoord2fColor4fNormal3fVertex3fSUN = load.invoke("glTexCoord2fColor4fNormal3fVertex3fSUN", ofVoid(JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glTexCoord2fColor4fNormal3fVertex3fvSUN = load.invoke("glTexCoord2fColor4fNormal3fVertex3fvSUN", ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS)); - ext.glTexCoord4fColor4fNormal3fVertex4fSUN = load.invoke("glTexCoord4fColor4fNormal3fVertex4fSUN", ofVoid(JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glTexCoord4fColor4fNormal3fVertex4fvSUN = load.invoke("glTexCoord4fColor4fNormal3fVertex4fvSUN", ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS)); - ext.glReplacementCodeuiVertex3fSUN = load.invoke("glReplacementCodeuiVertex3fSUN", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glReplacementCodeuiVertex3fvSUN = load.invoke("glReplacementCodeuiVertex3fvSUN", ofVoid(ADDRESS, ADDRESS)); - ext.glReplacementCodeuiColor4ubVertex3fSUN = load.invoke("glReplacementCodeuiColor4ubVertex3fSUN", ofVoid(JAVA_INT, JAVA_BYTE, JAVA_BYTE, JAVA_BYTE, JAVA_BYTE, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glReplacementCodeuiColor4ubVertex3fvSUN = load.invoke("glReplacementCodeuiColor4ubVertex3fvSUN", ofVoid(ADDRESS, ADDRESS, ADDRESS)); - ext.glReplacementCodeuiColor3fVertex3fSUN = load.invoke("glReplacementCodeuiColor3fVertex3fSUN", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glReplacementCodeuiColor3fVertex3fvSUN = load.invoke("glReplacementCodeuiColor3fVertex3fvSUN", ofVoid(ADDRESS, ADDRESS, ADDRESS)); - ext.glReplacementCodeuiNormal3fVertex3fSUN = load.invoke("glReplacementCodeuiNormal3fVertex3fSUN", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glReplacementCodeuiNormal3fVertex3fvSUN = load.invoke("glReplacementCodeuiNormal3fVertex3fvSUN", ofVoid(ADDRESS, ADDRESS, ADDRESS)); - ext.glReplacementCodeuiColor4fNormal3fVertex3fSUN = load.invoke("glReplacementCodeuiColor4fNormal3fVertex3fSUN", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glReplacementCodeuiColor4fNormal3fVertex3fvSUN = load.invoke("glReplacementCodeuiColor4fNormal3fVertex3fvSUN", ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS)); - ext.glReplacementCodeuiTexCoord2fVertex3fSUN = load.invoke("glReplacementCodeuiTexCoord2fVertex3fSUN", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glReplacementCodeuiTexCoord2fVertex3fvSUN = load.invoke("glReplacementCodeuiTexCoord2fVertex3fvSUN", ofVoid(ADDRESS, ADDRESS, ADDRESS)); - ext.glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = load.invoke("glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = load.invoke("glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN", ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS)); - ext.glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = load.invoke("glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN", ofVoid(JAVA_INT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT, JAVA_FLOAT)); - ext.glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = load.invoke("glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN", ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS)); - } - - public static void glColor4ubVertex2fSUN(byte r, byte g, byte b, byte a, float x, float y) { - final var ext = getExtCapabilities(); - try { - check(ext.glColor4ubVertex2fSUN).invokeExact(r, g, b, a, x, y); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glColor4ubVertex2fvSUN(@NativeType("const GLubyte *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glColor4ubVertex2fvSUN).invokeExact(c, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glColor4ubVertex3fSUN(byte r, byte g, byte b, byte a, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glColor4ubVertex3fSUN).invokeExact(r, g, b, a, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glColor4ubVertex3fvSUN(@NativeType("const GLubyte *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glColor4ubVertex3fvSUN).invokeExact(c, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glColor3fVertex3fSUN(float r, float g, float b, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glColor3fVertex3fSUN).invokeExact(r, g, b, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glColor3fVertex3fvSUN(@NativeType("const GLfloat *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glColor3fVertex3fvSUN).invokeExact(c, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glNormal3fVertex3fSUN(float nx, float ny, float nz, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glNormal3fVertex3fSUN).invokeExact(nx, ny, nz, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glNormal3fVertex3fvSUN(@NativeType("const GLfloat *") MemorySegment n, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glNormal3fVertex3fvSUN).invokeExact(n, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glColor4fNormal3fVertex3fSUN(float r, float g, float b, float a, float nx, float ny, float nz, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glColor4fNormal3fVertex3fSUN).invokeExact(r, g, b, a, nx, ny, nz, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } - } - - public static void glColor4fNormal3fVertex3fvSUN(@NativeType("const GLfloat *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment n, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glColor4fNormal3fVertex3fvSUN).invokeExact(c, n, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } +public interface GLSUNVertex { + + default void glColor4ubVertex2fSUN(byte r, byte g, byte b, byte a, float x, float y) { + throw new ContextException(); + } + + default void glColor4ubVertex2fvSUN(@NativeType("const GLubyte *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); + } + + default void glColor4ubVertex3fSUN(byte r, byte g, byte b, byte a, float x, float y, float z) { + throw new ContextException(); + } + + default void glColor4ubVertex3fvSUN(@NativeType("const GLubyte *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); + } + + default void glColor3fVertex3fSUN(float r, float g, float b, float x, float y, float z) { + throw new ContextException(); + } + + default void glColor3fVertex3fvSUN(@NativeType("const GLfloat *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); + } + + default void glNormal3fVertex3fSUN(float nx, float ny, float nz, float x, float y, float z) { + throw new ContextException(); + } + + default void glNormal3fVertex3fvSUN(@NativeType("const GLfloat *") MemorySegment n, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); + } + + default void glColor4fNormal3fVertex3fSUN(float r, float g, float b, float a, float nx, float ny, float nz, float x, float y, float z) { + throw new ContextException(); + } + + default void glColor4fNormal3fVertex3fvSUN(@NativeType("const GLfloat *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment n, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glTexCoord2fVertex3fSUN(float s, float t, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord2fVertex3fSUN).invokeExact(s, t, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord2fVertex3fSUN(float s, float t, float x, float y, float z) { + throw new ContextException(); } - public static void glTexCoord2fVertex3fvSUN(@NativeType("const GLfloat *") MemorySegment tc, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord2fVertex3fvSUN).invokeExact(tc, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord2fVertex3fvSUN(@NativeType("const GLfloat *") MemorySegment tc, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glTexCoord4fVertex4fSUN(float s, float t, float p, float q, float x, float y, float z, float w) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord4fVertex4fSUN).invokeExact(s, t, p, q, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord4fVertex4fSUN(float s, float t, float p, float q, float x, float y, float z, float w) { + throw new ContextException(); } - public static void glTexCoord4fVertex4fvSUN(@NativeType("const GLfloat *") MemorySegment tc, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord4fVertex4fvSUN).invokeExact(tc, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord4fVertex4fvSUN(@NativeType("const GLfloat *") MemorySegment tc, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glTexCoord2fColor4ubVertex3fSUN(float s, float t, byte r, byte g, byte b, byte a, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord2fColor4ubVertex3fSUN).invokeExact(s, t, r, g, b, a, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord2fColor4ubVertex3fSUN(float s, float t, byte r, byte g, byte b, byte a, float x, float y, float z) { + throw new ContextException(); } - public static void glTexCoord2fColor4ubVertex3fvSUN(@NativeType("const GLfloat *") MemorySegment tc, @NativeType("const GLubyte *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord2fColor4ubVertex3fvSUN).invokeExact(tc, c, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord2fColor4ubVertex3fvSUN(@NativeType("const GLfloat *") MemorySegment tc, @NativeType("const GLubyte *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glTexCoord2fColor3fVertex3fSUN(float s, float t, float r, float g, float b, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord2fColor3fVertex3fSUN).invokeExact(s, t, r, g, b, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord2fColor3fVertex3fSUN(float s, float t, float r, float g, float b, float x, float y, float z) { + throw new ContextException(); } - public static void glTexCoord2fColor3fVertex3fvSUN(@NativeType("const GLfloat *") MemorySegment tc, @NativeType("const GLfloat *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord2fColor3fVertex3fvSUN).invokeExact(tc, c, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord2fColor3fVertex3fvSUN(@NativeType("const GLfloat *") MemorySegment tc, @NativeType("const GLfloat *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glTexCoord2fNormal3fVertex3fSUN(float s, float t, float nx, float ny, float nz, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord2fNormal3fVertex3fSUN).invokeExact(s, t, nx, ny, nz, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord2fNormal3fVertex3fSUN(float s, float t, float nx, float ny, float nz, float x, float y, float z) { + throw new ContextException(); } - public static void glTexCoord2fNormal3fVertex3fvSUN(@NativeType("const GLfloat *") MemorySegment tc, @NativeType("const GLfloat *") MemorySegment n, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord2fNormal3fVertex3fvSUN).invokeExact(tc, n, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord2fNormal3fVertex3fvSUN(@NativeType("const GLfloat *") MemorySegment tc, @NativeType("const GLfloat *") MemorySegment n, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glTexCoord2fColor4fNormal3fVertex3fSUN(float s, float t, float r, float g, float b, float a, float nx, float ny, float nz, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord2fColor4fNormal3fVertex3fSUN).invokeExact(s, t, r, g, b, a, nx, ny, nz, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord2fColor4fNormal3fVertex3fSUN(float s, float t, float r, float g, float b, float a, float nx, float ny, float nz, float x, float y, float z) { + throw new ContextException(); } - public static void glTexCoord2fColor4fNormal3fVertex3fvSUN(@NativeType("const GLfloat *") MemorySegment tc, @NativeType("const GLfloat *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment n, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord2fColor4fNormal3fVertex3fvSUN).invokeExact(tc, c, n, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord2fColor4fNormal3fVertex3fvSUN(@NativeType("const GLfloat *") MemorySegment tc, @NativeType("const GLfloat *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment n, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glTexCoord4fColor4fNormal3fVertex4fSUN(float s, float t, float p, float q, float r, float g, float b, float a, float nx, float ny, float nz, float x, float y, float z, float w) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord4fColor4fNormal3fVertex4fSUN).invokeExact(s, t, p, q, r, g, b, a, nx, ny, nz, x, y, z, w); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord4fColor4fNormal3fVertex4fSUN(float s, float t, float p, float q, float r, float g, float b, float a, float nx, float ny, float nz, float x, float y, float z, float w) { + throw new ContextException(); } - public static void glTexCoord4fColor4fNormal3fVertex4fvSUN(@NativeType("const GLfloat *") MemorySegment tc, @NativeType("const GLfloat *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment n, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glTexCoord4fColor4fNormal3fVertex4fvSUN).invokeExact(tc, c, n, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glTexCoord4fColor4fNormal3fVertex4fvSUN(@NativeType("const GLfloat *") MemorySegment tc, @NativeType("const GLfloat *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment n, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glReplacementCodeuiVertex3fSUN(int rc, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeuiVertex3fSUN).invokeExact(rc, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeuiVertex3fSUN(int rc, float x, float y, float z) { + throw new ContextException(); } - public static void glReplacementCodeuiVertex3fvSUN(@NativeType("const GLuint *") MemorySegment rc, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeuiVertex3fvSUN).invokeExact(rc, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeuiVertex3fvSUN(@NativeType("const GLuint *") MemorySegment rc, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glReplacementCodeuiColor4ubVertex3fSUN(int rc, byte r, byte g, byte b, byte a, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeuiColor4ubVertex3fSUN).invokeExact(rc, r, g, b, a, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeuiColor4ubVertex3fSUN(int rc, byte r, byte g, byte b, byte a, float x, float y, float z) { + throw new ContextException(); } - public static void glReplacementCodeuiColor4ubVertex3fvSUN(@NativeType("const GLuint *") MemorySegment rc, @NativeType("const GLubyte *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeuiColor4ubVertex3fvSUN).invokeExact(rc, c, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeuiColor4ubVertex3fvSUN(@NativeType("const GLuint *") MemorySegment rc, @NativeType("const GLubyte *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glReplacementCodeuiColor3fVertex3fSUN(int rc, float r, float g, float b, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeuiColor3fVertex3fSUN).invokeExact(rc, r, g, b, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeuiColor3fVertex3fSUN(int rc, float r, float g, float b, float x, float y, float z) { + throw new ContextException(); } - public static void glReplacementCodeuiColor3fVertex3fvSUN(@NativeType("const GLuint *") MemorySegment rc, @NativeType("const GLfloat *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeuiColor3fVertex3fvSUN).invokeExact(rc, c, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeuiColor3fVertex3fvSUN(@NativeType("const GLuint *") MemorySegment rc, @NativeType("const GLfloat *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glReplacementCodeuiNormal3fVertex3fSUN(int rc, float nx, float ny, float nz, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeuiNormal3fVertex3fSUN).invokeExact(rc, nx, ny, nz, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeuiNormal3fVertex3fSUN(int rc, float nx, float ny, float nz, float x, float y, float z) { + throw new ContextException(); } - public static void glReplacementCodeuiNormal3fVertex3fvSUN(@NativeType("const GLuint *") MemorySegment rc, @NativeType("const GLfloat *") MemorySegment n, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeuiNormal3fVertex3fvSUN).invokeExact(rc, n, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeuiNormal3fVertex3fvSUN(@NativeType("const GLuint *") MemorySegment rc, @NativeType("const GLfloat *") MemorySegment n, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glReplacementCodeuiColor4fNormal3fVertex3fSUN(int rc, float r, float g, float b, float a, float nx, float ny, float nz, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeuiColor4fNormal3fVertex3fSUN).invokeExact(rc, r, g, b, a, nx, ny, nz, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeuiColor4fNormal3fVertex3fSUN(int rc, float r, float g, float b, float a, float nx, float ny, float nz, float x, float y, float z) { + throw new ContextException(); } - public static void glReplacementCodeuiColor4fNormal3fVertex3fvSUN(@NativeType("const GLuint *") MemorySegment rc, @NativeType("const GLfloat *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment n, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeuiColor4fNormal3fVertex3fvSUN).invokeExact(rc, c, n, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeuiColor4fNormal3fVertex3fvSUN(@NativeType("const GLuint *") MemorySegment rc, @NativeType("const GLfloat *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment n, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glReplacementCodeuiTexCoord2fVertex3fSUN(int rc, float s, float t, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeuiTexCoord2fVertex3fSUN).invokeExact(rc, s, t, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeuiTexCoord2fVertex3fSUN(int rc, float s, float t, float x, float y, float z) { + throw new ContextException(); } - public static void glReplacementCodeuiTexCoord2fVertex3fvSUN(@NativeType("const GLuint *") MemorySegment rc, @NativeType("const GLfloat *") MemorySegment tc, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeuiTexCoord2fVertex3fvSUN).invokeExact(rc, tc, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeuiTexCoord2fVertex3fvSUN(@NativeType("const GLuint *") MemorySegment rc, @NativeType("const GLfloat *") MemorySegment tc, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN(int rc, float s, float t, float nx, float ny, float nz, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN).invokeExact(rc, s, t, nx, ny, nz, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN(int rc, float s, float t, float nx, float ny, float nz, float x, float y, float z) { + throw new ContextException(); } - public static void glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN(@NativeType("const GLuint *") MemorySegment rc, @NativeType("const GLfloat *") MemorySegment tc, @NativeType("const GLfloat *") MemorySegment n, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN).invokeExact(rc, tc, n, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN(@NativeType("const GLuint *") MemorySegment rc, @NativeType("const GLfloat *") MemorySegment tc, @NativeType("const GLfloat *") MemorySegment n, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } - public static void glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN(int rc, float s, float t, float r, float g, float b, float a, float nx, float ny, float nz, float x, float y, float z) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN).invokeExact(rc, s, t, r, g, b, a, nx, ny, nz, x, y, z); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN(int rc, float s, float t, float r, float g, float b, float a, float nx, float ny, float nz, float x, float y, float z) { + throw new ContextException(); } - public static void glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN(@NativeType("const GLuint *") MemorySegment rc, @NativeType("const GLfloat *") MemorySegment tc, @NativeType("const GLfloat *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment n, @NativeType("const GLfloat *") MemorySegment v) { - final var ext = getExtCapabilities(); - try { - check(ext.glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN).invokeExact(rc, tc, c, n, v); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN(@NativeType("const GLuint *") MemorySegment rc, @NativeType("const GLfloat *") MemorySegment tc, @NativeType("const GLfloat *") MemorySegment c, @NativeType("const GLfloat *") MemorySegment n, @NativeType("const GLfloat *") MemorySegment v) { + throw new ContextException(); } } diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNXConstantData.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNXConstantData.java index d8078f39..29a61365 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNXConstantData.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/ext/sun/GLSUNXConstantData.java @@ -16,30 +16,19 @@ // This file is auto-generated. DO NOT EDIT! package overrungl.opengl.ext.sun; - -import overrungl.*; +import overrungl.NativeType; import overrungl.opengl.*; import java.lang.foreign.*; -import static java.lang.foreign.FunctionDescriptor.*; -import static java.lang.foreign.ValueLayout.*; -import static overrungl.opengl.GLLoader.*; /** * {@code GL_SUNX_constant_data} */ -public final class GLSUNXConstantData { - public static final int GL_UNPACK_CONSTANT_DATA_SUNX = 0x81D5; - public static final int GL_TEXTURE_CONSTANT_DATA_SUNX = 0x81D6; - public static void load(GLExtCaps ext, GLLoadFunc load) { - if (!ext.GL_SUNX_constant_data) return; - ext.glFinishTextureSUNX = load.invoke("glFinishTextureSUNX", ofVoid()); - } +public interface GLSUNXConstantData { + int GL_UNPACK_CONSTANT_DATA_SUNX = 0x81D5; + int GL_TEXTURE_CONSTANT_DATA_SUNX = 0x81D6; - public static void glFinishTextureSUNX() { - final var ext = getExtCapabilities(); - try { - check(ext.glFinishTextureSUNX).invokeExact(); - } catch (Throwable e) { throw new AssertionError("should not reach here", e); } + default void glFinishTextureSUNX() { + throw new ContextException(); } } 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 1443f4c0..eebb8566 100644 --- a/modules/samples/src/test/java/overrungl/demo/glfw/GLFWWindowIconTest.java +++ b/modules/samples/src/test/java/overrungl/demo/glfw/GLFWWindowIconTest.java @@ -42,6 +42,7 @@ public final class GLFWWindowIconTest { private final GLFW glfw = GLFW.INSTANCE; private MemorySegment window; + private GL gl; public void run() { try (var arena = Arena.ofShared()) { @@ -91,7 +92,7 @@ private void init(Arena arena) { } }); glfw.setFramebufferSizeCallback(window, (_, width, height) -> - GL.viewport(0, 0, width, height)); + gl.viewport(0, 0, width, height)); var vidMode = glfw.getVideoMode(glfw.getPrimaryMonitor()); if (vidMode != null) { var size = glfw.getWindowSize(window); @@ -109,14 +110,14 @@ private void init(Arena arena) { } private void load() { - Objects.requireNonNull(GLLoader.load(glfw::getProcAddress, true), "Failed to load OpenGL"); + gl = Objects.requireNonNull(GLLoader.load(GLLoader.loadFlags(glfw::getProcAddress)), "Failed to load OpenGL"); - GL.clearColor(0.4f, 0.6f, 0.9f, 1.0f); + gl.clearColor(0.4f, 0.6f, 0.9f, 1.0f); } private void loop() { while (!glfw.windowShouldClose(window)) { - GL.clear(GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT); + gl.clear(GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT); glfw.swapBuffers(window); 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 8be40f99..d9aa2633 100644 --- a/modules/samples/src/test/java/overrungl/demo/nfd/NFDTest.java +++ b/modules/samples/src/test/java/overrungl/demo/nfd/NFDTest.java @@ -16,11 +16,11 @@ package overrungl.demo.nfd; +import overrun.marshal.MemoryStack; import overrungl.nfd.NFD; import overrungl.nfd.NFDEnumerator; import overrungl.nfd.NFDNFilterItem; import overrungl.nfd.NFDResult; -import overrungl.util.MemoryStack; import overrungl.util.value.Pair; import java.lang.foreign.MemorySegment; @@ -70,7 +70,7 @@ private static void openDialogMultiple() { nfd.init(); try (MemoryStack stack = MemoryStack.stackPush()) { - MemorySegment pOutPaths = stack.callocPointer(); + MemorySegment pOutPaths = stack.segments(MemorySegment.NULL); String[] outPath = new String[1]; // prepare filters for the dialog @@ -111,7 +111,7 @@ private static void openDialogMultipleEnum() { nfd.init(); try (MemoryStack stack = MemoryStack.stackPush()) { - MemorySegment pOutPaths = stack.callocPointer(); + MemorySegment pOutPaths = stack.segments(MemorySegment.NULL); // prepare filters for the dialog final NFDNFilterItem filterItem = NFDNFilterItem.create(stack, @@ -196,10 +196,10 @@ private static void saveDialog() { } public static void main(String[] args) { -// openDialog(); -// openDialogMultiple(); -// openDialogMultipleEnum(); -// pickFolder(); + openDialog(); + openDialogMultiple(); + openDialogMultipleEnum(); + pickFolder(); saveDialog(); } } 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 5cc93b34..1bf236b4 100644 --- a/modules/samples/src/test/java/overrungl/demo/opengl/GL10Test.java +++ b/modules/samples/src/test/java/overrungl/demo/opengl/GL10Test.java @@ -16,11 +16,11 @@ package overrungl.demo.opengl; -import overrungl.glfw.GLFWCallbacks; import overrungl.glfw.GLFW; +import overrungl.glfw.GLFWCallbacks; import overrungl.glfw.GLFWErrorCallback; import overrungl.opengl.GL; -import overrungl.opengl.GL10; +import overrungl.opengl.GLLegacy; import overrungl.opengl.GLLoader; import overrungl.util.CheckUtil; @@ -36,6 +36,7 @@ public final class GL10Test { private final GLFW glfw = GLFW.INSTANCE; private MemorySegment window; + private GLLegacy gl; public void run() { init(); @@ -63,7 +64,7 @@ private void init() { } }); glfw.setFramebufferSizeCallback(window, (_, width, height) -> - GL.viewport(0, 0, width, height)); + gl.viewport(0, 0, width, height)); var vidMode = glfw.getVideoMode(glfw.getPrimaryMonitor()); if (vidMode != null) { var size = glfw.getWindowSize(window); @@ -81,24 +82,24 @@ private void init() { } private void load() { - Objects.requireNonNull(GLLoader.load(glfw::getProcAddress), "Failed to load OpenGL"); + gl = Objects.requireNonNull(GLLoader.loadLegacy(GLLoader.loadFlags(glfw::getProcAddress)), "Failed to load OpenGL"); - GL.clearColor(0.4f, 0.6f, 0.9f, 1.0f); + gl.clearColor(0.4f, 0.6f, 0.9f, 1.0f); } private void loop() { while (!glfw.windowShouldClose(window)) { - GL.clear(GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT); + gl.clear(GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT); // Draw triangle - GL10.begin(GL.TRIANGLES); - GL10.color3f(1f, 0f, 0f); - GL10.vertex2f(0.0f, 0.5f); - GL10.color3f(0f, 1f, 0f); - GL10.vertex2f(-0.5f, -0.5f); - GL10.color3f(0f, 0f, 1f); - GL10.vertex2f(0.5f, -0.5f); - GL10.end(); + gl.begin(GL.TRIANGLES); + gl.color3f(1f, 0f, 0f); + gl.vertex2f(0.0f, 0.5f); + gl.color3f(0f, 1f, 0f); + gl.vertex2f(-0.5f, -0.5f); + gl.color3f(0f, 0f, 1f); + gl.vertex2f(0.5f, -0.5f); + gl.end(); glfw.swapBuffers(window); 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 076543de..c6a7f462 100644 --- a/modules/samples/src/test/java/overrungl/demo/opengl/GL15Test.java +++ b/modules/samples/src/test/java/overrungl/demo/opengl/GL15Test.java @@ -22,6 +22,7 @@ import overrungl.glfw.GLFWErrorCallback; import overrungl.opengl.GL; import overrungl.opengl.GL11; +import overrungl.opengl.GLLegacy; import overrungl.opengl.GLLoader; import overrungl.stb.STBImage; import overrungl.util.CheckUtil; @@ -42,6 +43,7 @@ public final class GL15Test { private final GLFW glfw = GLFW.INSTANCE; private MemorySegment window; + private GLLegacy gl; private int vbo, tex; public void run() { @@ -51,8 +53,8 @@ public void run() { } loop(); - GL.deleteBuffer(vbo); - GL.deleteTexture(tex); + gl.deleteBuffers(vbo); + gl.deleteTextures(tex); GLFWCallbacks.free(window); glfw.destroyWindow(window); @@ -75,7 +77,7 @@ private void init() { } }); glfw.setFramebufferSizeCallback(window, (_, width, height) -> - GL.viewport(0, 0, width, height)); + gl.viewport(0, 0, width, height)); var vidMode = glfw.getVideoMode(glfw.getPrimaryMonitor()); if (vidMode != null) { var size = glfw.getWindowSize(window); @@ -93,25 +95,25 @@ private void init() { } private void load(Arena arena) { - Objects.requireNonNull(GLLoader.load(glfw::getProcAddress), "Failed to load OpenGL"); + gl = Objects.requireNonNull(GLLoader.loadLegacy(GLLoader.loadFlags(glfw::getProcAddress)), "Failed to load OpenGL"); - GL.clearColor(0.4f, 0.6f, 0.9f, 1.0f); - GL.enable(GL.TEXTURE_2D); + gl.clearColor(0.4f, 0.6f, 0.9f, 1.0f); + gl.enable(GL.TEXTURE_2D); - vbo = GL.genBuffer(); - GL.bindBuffer(GL.ARRAY_BUFFER, vbo); - GL.bufferData(arena, GL.ARRAY_BUFFER, new float[]{ + vbo = gl.genBuffers(); + gl.bindBuffer(GL.ARRAY_BUFFER, vbo); + gl.bufferData(arena, GL.ARRAY_BUFFER, new float[]{ // Vertex Color Tex-coord 0.0f, 0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -0.5f, -0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.5f, -0.5f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f }, GL.STATIC_DRAW); - GL.bindBuffer(GL.ARRAY_BUFFER, 0); + gl.bindBuffer(GL.ARRAY_BUFFER, 0); - tex = GL.genTexture(); - GL.bindTexture(GL.TEXTURE_2D, tex); - GL.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_MAG_FILTER, GL.NEAREST); - GL.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_MIN_FILTER, GL.NEAREST); + tex = gl.genTextures(); + gl.bindTexture(GL.TEXTURE_2D, tex); + gl.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_MAG_FILTER, GL.NEAREST); + gl.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_MIN_FILTER, GL.NEAREST); try { final STBImage stbImage = STBImage.INSTANCE; var px = arena.allocate(JAVA_INT); @@ -121,7 +123,7 @@ private void load(Arena arena) { IOUtil.ioResourceToSegment(arena, "image.png", 256, 128), px, py, pc, STBImage.RGB ); - GL.texImage2D(GL.TEXTURE_2D, + gl.texImage2D(GL.TEXTURE_2D, 0, GL.RGB, px.get(JAVA_INT, 0), @@ -134,30 +136,30 @@ private void load(Arena arena) { } catch (IOException e) { throw new RuntimeException(e); } - GL.bindTexture(GL.TEXTURE_2D, 0); + gl.bindTexture(GL.TEXTURE_2D, 0); } private void loop() { while (!glfw.windowShouldClose(window)) { - GL.clear(GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT); + gl.clear(GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT); // Draw triangle - GL.bindTexture(GL.TEXTURE_2D, tex); - GL.bindBuffer(GL.ARRAY_BUFFER, vbo); - GL11.enableClientState(GL11.VERTEX_ARRAY); - GL11.enableClientState(GL11.COLOR_ARRAY); - GL11.enableClientState(GL11.TEXTURE_COORD_ARRAY); + gl.bindTexture(GL.TEXTURE_2D, tex); + gl.bindBuffer(GL.ARRAY_BUFFER, vbo); + gl.enableClientState(GL11.VERTEX_ARRAY); + gl.enableClientState(GL11.COLOR_ARRAY); + gl.enableClientState(GL11.TEXTURE_COORD_ARRAY); // 8 double words = 32 bytes final int stride = 8 << 2; - GL11.vertexPointer(3, GL.FLOAT, stride, MemorySegment.NULL); - GL11.colorPointer(3, GL.FLOAT, stride, MemorySegment.ofAddress(3 << 2)); - GL11.texCoordPointer(2, GL.FLOAT, stride, MemorySegment.ofAddress(6 << 2)); - GL.drawArrays(GL.TRIANGLES, 0, 3); - GL11.disableClientState(GL11.VERTEX_ARRAY); - GL11.disableClientState(GL11.COLOR_ARRAY); - GL11.disableClientState(GL11.TEXTURE_COORD_ARRAY); - GL.bindBuffer(GL.ARRAY_BUFFER, 0); - GL.bindTexture(GL.TEXTURE_2D, 0); + gl.vertexPointer(3, GL.FLOAT, stride, MemorySegment.NULL); + gl.colorPointer(3, GL.FLOAT, stride, MemorySegment.ofAddress(3 << 2)); + gl.texCoordPointer(2, GL.FLOAT, stride, MemorySegment.ofAddress(6 << 2)); + gl.drawArrays(GL.TRIANGLES, 0, 3); + gl.disableClientState(GL11.VERTEX_ARRAY); + gl.disableClientState(GL11.COLOR_ARRAY); + gl.disableClientState(GL11.TEXTURE_COORD_ARRAY); + gl.bindBuffer(GL.ARRAY_BUFFER, 0); + gl.bindTexture(GL.TEXTURE_2D, 0); glfw.swapBuffers(window); 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 95200ff4..be22c150 100644 --- a/modules/samples/src/test/java/overrungl/demo/opengl/GL30Test.java +++ b/modules/samples/src/test/java/overrungl/demo/opengl/GL30Test.java @@ -16,14 +16,14 @@ package overrungl.demo.opengl; +import overrun.marshal.MemoryStack; import overrungl.demo.util.IOUtil; -import overrungl.glfw.GLFWCallbacks; import overrungl.glfw.GLFW; +import overrungl.glfw.GLFWCallbacks; import overrungl.glfw.GLFWErrorCallback; import overrungl.opengl.GL; import overrungl.opengl.GLLoader; import overrungl.stb.STBImage; -import overrungl.util.MemoryStack; import overrungl.util.CheckUtil; import java.io.IOException; @@ -42,6 +42,7 @@ public final class GL30Test { private final GLFW glfw = GLFW.INSTANCE; private MemorySegment window; + private GL gl; private int program; private int colorFactor; private int vao, vbo, ebo; @@ -54,11 +55,10 @@ public void run() { } loop(); - GL.deleteProgram(program); - GL.deleteVertexArray(vao); - GL.deleteBuffer(vbo); - GL.deleteBuffer(ebo); - GL.deleteTexture(tex); + gl.deleteProgram(program); + gl.deleteVertexArrays(vao); + gl.deleteBuffers(vbo, ebo); + gl.deleteTextures(tex); GLFWCallbacks.free(window); glfw.destroyWindow(window); @@ -81,7 +81,7 @@ private void init() { } }); glfw.setFramebufferSizeCallback(window, (_, width, height) -> - GL.viewport(0, 0, width, height)); + gl.viewport(0, 0, width, height)); var vidMode = glfw.getVideoMode(glfw.getPrimaryMonitor()); if (vidMode != null) { var size = glfw.getWindowSize(window); @@ -99,14 +99,14 @@ private void init() { } private void load(Arena arena) { - Objects.requireNonNull(GLLoader.load(glfw::getProcAddress, true), "Failed to load OpenGL"); + gl = Objects.requireNonNull(GLLoader.load(GLLoader.loadFlags(glfw::getProcAddress)), "Failed to load OpenGL"); - GL.clearColor(0.4f, 0.6f, 0.9f, 1.0f); + gl.clearColor(0.4f, 0.6f, 0.9f, 1.0f); - tex = GL.genTexture(); - GL.bindTexture(GL.TEXTURE_2D, tex); - GL.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_MAG_FILTER, GL.NEAREST); - GL.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_MIN_FILTER, GL.NEAREST); + tex = gl.genTextures(); + gl.bindTexture(GL.TEXTURE_2D, tex); + gl.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_MAG_FILTER, GL.NEAREST); + gl.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_MIN_FILTER, GL.NEAREST); try (MemoryStack stack = MemoryStack.stackPush()) { final STBImage stbImage = STBImage.INSTANCE; var px = stack.allocate(JAVA_INT); @@ -116,7 +116,7 @@ private void load(Arena arena) { IOUtil.ioResourceToSegment(arena, "image.png", 256), px, py, pc, STBImage.RGB ); - GL.texImage2D(GL.TEXTURE_2D, + gl.texImage2D(GL.TEXTURE_2D, 0, GL.RGB, px.get(JAVA_INT, 0), @@ -129,11 +129,11 @@ private void load(Arena arena) { } catch (IOException e) { throw new RuntimeException(e); } - GL.bindTexture(GL.TEXTURE_2D, 0); - program = GL.createProgram(); - int vsh = GL.createShader(GL.VERTEX_SHADER); - int fsh = GL.createShader(GL.FRAGMENT_SHADER); - GL.shaderSource(vsh, """ + gl.bindTexture(GL.TEXTURE_2D, 0); + program = gl.createProgram(); + int vsh = gl.createShader(GL.VERTEX_SHADER); + int fsh = gl.createShader(GL.FRAGMENT_SHADER); + gl.shaderSource(vsh, """ #version 130 in vec3 position; @@ -146,7 +146,7 @@ void main() { texCoord = uv; } """); - GL.shaderSource(fsh, """ + gl.shaderSource(fsh, """ #version 130 in vec2 texCoord; @@ -160,60 +160,60 @@ void main() { fragColor = colorFactor * texture(sampler, texCoord); } """); - GL.compileShader(vsh); - GL.compileShader(fsh); - GL.attachShader(program, vsh); - GL.attachShader(program, fsh); - GL.bindAttribLocation(program, 0, "position"); - GL.bindAttribLocation(program, 1, "uv"); - GL.linkProgram(program); - GL.detachShader(program, vsh); - GL.detachShader(program, fsh); - GL.deleteShader(vsh); - GL.deleteShader(fsh); - GL.useProgram(program); - GL.uniform1i(GL.getUniformLocation(program, "sampler"), 0); - GL.useProgram(0); - - vao = GL.genVertexArray(); - GL.bindVertexArray(vao); - vbo = GL.genBuffer(); - GL.bindBuffer(GL.ARRAY_BUFFER, vbo); - GL.bufferData(arena, GL.ARRAY_BUFFER, new float[]{ + gl.compileShader(vsh); + gl.compileShader(fsh); + gl.attachShader(program, vsh); + gl.attachShader(program, fsh); + gl.bindAttribLocation(program, 0, "position"); + gl.bindAttribLocation(program, 1, "uv"); + gl.linkProgram(program); + gl.detachShader(program, vsh); + gl.detachShader(program, fsh); + gl.deleteShader(vsh); + gl.deleteShader(fsh); + gl.useProgram(program); + gl.uniform1i(gl.getUniformLocation(program, "sampler"), 0); + gl.useProgram(0); + + vao = gl.genVertexArrays(); + gl.bindVertexArray(vao); + vbo = gl.genBuffers(); + gl.bindBuffer(GL.ARRAY_BUFFER, vbo); + gl.bufferData(arena, GL.ARRAY_BUFFER, new float[]{ // Vertex UV -0.5f, 0.5f, 0.0f, 0.0f, 0.0f, -0.5f, -0.5f, 0.0f, 0.0f, 1.0f, 0.5f, -0.5f, 0.0f, 1.0f, 1.0f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f }, GL.STATIC_DRAW); - ebo = GL.genBuffer(); - GL.bindBuffer(GL.ELEMENT_ARRAY_BUFFER, ebo); - GL.bufferData(arena, GL.ELEMENT_ARRAY_BUFFER, new byte[]{ + ebo = gl.genBuffers(); + gl.bindBuffer(GL.ELEMENT_ARRAY_BUFFER, ebo); + gl.bufferData(arena, GL.ELEMENT_ARRAY_BUFFER, new byte[]{ 0, 1, 2, 0, 2, 3 }, GL.STATIC_DRAW); - GL.enableVertexAttribArray(0); - GL.enableVertexAttribArray(1); - GL.vertexAttribPointer(0, 3, GL.FLOAT, false, 20, MemorySegment.NULL); - GL.vertexAttribPointer(1, 2, GL.FLOAT, false, 20, MemorySegment.ofAddress(12)); - GL.bindBuffer(GL.ARRAY_BUFFER, 0); - GL.bindVertexArray(0); - - colorFactor = GL.getUniformLocation(program, "colorFactor"); + gl.enableVertexAttribArray(0); + gl.enableVertexAttribArray(1); + gl.vertexAttribPointer(0, 3, GL.FLOAT, false, 20, MemorySegment.NULL); + gl.vertexAttribPointer(1, 2, GL.FLOAT, false, 20, MemorySegment.ofAddress(12)); + gl.bindBuffer(GL.ARRAY_BUFFER, 0); + gl.bindVertexArray(0); + + colorFactor = gl.getUniformLocation(program, "colorFactor"); } private void loop() { while (!glfw.windowShouldClose(window)) { - GL.clear(GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT); + gl.clear(GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT); // Draw triangle - GL.bindTexture(GL.TEXTURE_2D, tex); - GL.useProgram(program); - GL.uniform1f(colorFactor, (float) ((Math.sin(glfw.getTime() * 2) + 1 * 0.5) * 0.6 + 0.4)); - GL.bindVertexArray(vao); - GL.drawElements(GL.TRIANGLES, 6, GL.UNSIGNED_BYTE, MemorySegment.NULL); - GL.bindVertexArray(0); - GL.useProgram(0); - GL.bindTexture(GL.TEXTURE_2D, 0); + gl.bindTexture(GL.TEXTURE_2D, tex); + gl.useProgram(program); + gl.uniform1f(colorFactor, (float) ((Math.sin(glfw.getTime() * 2) + 1 * 0.5) * 0.6 + 0.4)); + gl.bindVertexArray(vao); + gl.drawElements(GL.TRIANGLES, 6, GL.UNSIGNED_BYTE, MemorySegment.NULL); + gl.bindVertexArray(0); + gl.useProgram(0); + gl.bindTexture(GL.TEXTURE_2D, 0); glfw.swapBuffers(window); 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 7eef2b79..04da4825 100644 --- a/modules/samples/src/test/java/overrungl/demo/opengl/GL33Test.java +++ b/modules/samples/src/test/java/overrungl/demo/opengl/GL33Test.java @@ -18,14 +18,14 @@ import org.joml.Matrix4f; import org.overrun.timer.Timer; -import overrungl.glfw.GLFWCallbacks; import overrungl.glfw.GLFW; +import overrungl.glfw.GLFWCallbacks; import overrungl.glfw.GLFWErrorCallback; import overrungl.joml.Matrixn; import overrungl.opengl.GL; +import overrungl.opengl.GLFlags; import overrungl.opengl.GLLoader; import overrungl.opengl.GLUtil; -import overrungl.util.MemoryStack; import overrungl.util.CheckUtil; import java.lang.foreign.Arena; @@ -45,6 +45,7 @@ public class GL33Test { private static final boolean VSYNC = true; private final GLFW glfw = GLFW.INSTANCE; private MemorySegment window; + private GL gl; private int program; private int rotationMat; private int vao, vbo, ebo, mbo; @@ -61,12 +62,9 @@ public void run() { } loop(); - GL.deleteProgram(program); - GL.deleteVertexArray(vao); - // Optimization when many buffer objects need to be deleted - try (final MemoryStack stack = MemoryStack.stackPush()) { - GL.deleteBuffers(3, stack.ints(vbo, ebo, mbo)); - } + gl.deleteProgram(program); + gl.deleteVertexArrays(vao); + gl.deleteBuffers(vbo, ebo, mbo); GLFWCallbacks.free(window); glfw.destroyWindow(window); @@ -85,6 +83,7 @@ private void init() { glfw.windowHint(GLFW.CONTEXT_VERSION_MAJOR, 3); glfw.windowHint(GLFW.CONTEXT_VERSION_MINOR, 3); glfw.windowHint(GLFW.OPENGL_PROFILE, GLFW.OPENGL_CORE_PROFILE); + glfw.windowHint(GLFW.OPENGL_DEBUG_CONTEXT, true); window = glfw.createWindow(640, 480, WND_TITLE, MemorySegment.NULL, MemorySegment.NULL); CheckUtil.checkNotNullptr(window, "Failed to create the GLFW window"); glfw.setKeyCallback(window, (_, key, _, action, _) -> { @@ -93,7 +92,7 @@ private void init() { } }); glfw.setFramebufferSizeCallback(window, (_, width, height) -> - GL.viewport(0, 0, width, height)); + gl.viewport(0, 0, width, height)); var vidMode = glfw.getVideoMode(glfw.getPrimaryMonitor()); if (vidMode != null) { var size = glfw.getWindowSize(window); @@ -111,14 +110,15 @@ private void init() { } private void load(Arena arena) { - Objects.requireNonNull(GLLoader.load(glfw::getProcAddress, true), "Failed to load OpenGL"); - - debugProc = GLUtil.setupDebugMessageCallback(); - GL.clearColor(0.4f, 0.6f, 0.9f, 1.0f); - program = GL.createProgram(); - int vsh = GL.createShader(GL.VERTEX_SHADER); - int fsh = GL.createShader(GL.FRAGMENT_SHADER); - GL.shaderSource(vsh, """ + final GLFlags flags = GLLoader.loadFlags(glfw::getProcAddress); + gl = Objects.requireNonNull(GLLoader.load(flags), "Failed to load OpenGL"); + + debugProc = GLUtil.setupDebugMessageCallback(gl, flags, () -> GLLoader.loadExtension(flags)); + gl.clearColor(0.4f, 0.6f, 0.9f, 1.0f); + program = gl.createProgram(); + int vsh = gl.createShader(GL.VERTEX_SHADER); + int fsh = gl.createShader(GL.FRAGMENT_SHADER); + gl.shaderSource(vsh, """ #version 330 layout (location = 0) in vec3 position; @@ -134,7 +134,7 @@ void main() { vertexColor = color; } """); - GL.shaderSource(fsh, """ + gl.shaderSource(fsh, """ #version 330 in vec3 vertexColor; @@ -145,39 +145,39 @@ void main() { fragColor = vec4(vertexColor, 1.0); } """); - GL.compileShader(vsh); - GL.compileShader(fsh); - GL.attachShader(program, vsh); - GL.attachShader(program, fsh); - GL.linkProgram(program); - GL.detachShader(program, vsh); - GL.detachShader(program, fsh); - GL.deleteShader(vsh); - GL.deleteShader(fsh); - rotationMat = GL.getUniformLocation(program, "rotationMat"); - - vao = GL.genVertexArray(); - GL.bindVertexArray(vao); - vbo = GL.genBuffer(); - GL.bindBuffer(GL.ARRAY_BUFFER, vbo); - GL.bufferData(arena, GL.ARRAY_BUFFER, new float[]{ + gl.compileShader(vsh); + gl.compileShader(fsh); + gl.attachShader(program, vsh); + gl.attachShader(program, fsh); + gl.linkProgram(program); + gl.detachShader(program, vsh); + gl.detachShader(program, fsh); + gl.deleteShader(vsh); + gl.deleteShader(fsh); + rotationMat = gl.getUniformLocation(program, "rotationMat"); + + vao = gl.genVertexArrays(); + gl.bindVertexArray(vao); + vbo = gl.genBuffers(); + gl.bindBuffer(GL.ARRAY_BUFFER, vbo); + gl.bufferData(arena, GL.ARRAY_BUFFER, new float[]{ // Vertex Color -0.5f, 0.5f, 0.0f, 1.0f, 0.0f, 0.0f, -0.5f, -0.5f, 0.0f, 0.0f, 0.0f, 1.0f, 0.5f, -0.5f, 0.0f, 1.0f, 1.0f, 0.0f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.0f }, GL.STATIC_DRAW); - ebo = GL.genBuffer(); - GL.bindBuffer(GL.ELEMENT_ARRAY_BUFFER, ebo); - GL.bufferData(arena, GL.ELEMENT_ARRAY_BUFFER, new byte[]{ + ebo = gl.genBuffers(); + gl.bindBuffer(GL.ELEMENT_ARRAY_BUFFER, ebo); + gl.bufferData(arena, GL.ELEMENT_ARRAY_BUFFER, new byte[]{ 0, 1, 2, 2, 3, 0 }, GL.STATIC_DRAW); - GL.enableVertexAttribArray(0); - GL.enableVertexAttribArray(1); - GL.vertexAttribPointer(0, 3, GL.FLOAT, false, 24, MemorySegment.NULL); - GL.vertexAttribPointer(1, 3, GL.FLOAT, false, 24, MemorySegment.ofAddress(12)); - mbo = GL.genBuffer(); - GL.bindBuffer(GL.ARRAY_BUFFER, mbo); + gl.enableVertexAttribArray(0); + gl.enableVertexAttribArray(1); + gl.vertexAttribPointer(0, 3, GL.FLOAT, false, 24, MemorySegment.NULL); + gl.vertexAttribPointer(1, 3, GL.FLOAT, false, 24, MemorySegment.ofAddress(12)); + mbo = gl.genBuffers(); + gl.bindBuffer(GL.ARRAY_BUFFER, mbo); var mat = new Matrix4f(); var iseq = MemoryLayout.sequenceLayout( INSTANCE_COUNT, @@ -202,21 +202,21 @@ void main() { i * Matrixn.MAT4F.byteSize(), matrices); } - GL.bufferData(GL.ARRAY_BUFFER, matrices, GL.STATIC_DRAW); - GL.enableVertexAttribArray(2); - GL.enableVertexAttribArray(3); - GL.enableVertexAttribArray(4); - GL.enableVertexAttribArray(5); - GL.vertexAttribPointer(2, 4, GL.FLOAT, false, 64, MemorySegment.NULL); - GL.vertexAttribPointer(3, 4, GL.FLOAT, false, 64, MemorySegment.ofAddress(16)); - GL.vertexAttribPointer(4, 4, GL.FLOAT, false, 64, MemorySegment.ofAddress(32)); - GL.vertexAttribPointer(5, 4, GL.FLOAT, false, 64, MemorySegment.ofAddress(48)); - GL.vertexAttribDivisor(2, 1); - GL.vertexAttribDivisor(3, 1); - GL.vertexAttribDivisor(4, 1); - GL.vertexAttribDivisor(5, 1); - GL.bindBuffer(GL.ARRAY_BUFFER, 0); - GL.bindVertexArray(0); + gl.bufferData(GL.ARRAY_BUFFER, matrices, GL.STATIC_DRAW); + gl.enableVertexAttribArray(2); + gl.enableVertexAttribArray(3); + gl.enableVertexAttribArray(4); + gl.enableVertexAttribArray(5); + gl.vertexAttribPointer(2, 4, GL.FLOAT, false, 64, MemorySegment.NULL); + gl.vertexAttribPointer(3, 4, GL.FLOAT, false, 64, MemorySegment.ofAddress(16)); + gl.vertexAttribPointer(4, 4, GL.FLOAT, false, 64, MemorySegment.ofAddress(32)); + gl.vertexAttribPointer(5, 4, GL.FLOAT, false, 64, MemorySegment.ofAddress(48)); + gl.vertexAttribDivisor(2, 1); + gl.vertexAttribDivisor(3, 1); + gl.vertexAttribDivisor(4, 1); + gl.vertexAttribDivisor(5, 1); + gl.bindBuffer(GL.ARRAY_BUFFER, 0); + gl.bindVertexArray(0); } private void loop() { @@ -229,20 +229,20 @@ private void loop() { timer.advanceTime(); timer.performTicks(null); - GL.clear(GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT); + gl.clear(GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT); // Draw triangle - GL.useProgram(program); + gl.useProgram(program); // rotate 90deg per second matrix.rotateZ((float) Math.toRadians(90 * timer.deltaTime())); Matrixn.put(matrix, pRotationMat); - GL.uniformMatrix4fv(rotationMat, 1, false, pRotationMat); - GL.bindVertexArray(vao); - GL.drawElementsInstanced(GL.TRIANGLES, 6, GL.UNSIGNED_BYTE, MemorySegment.NULL, INSTANCE_COUNT); - GL.bindVertexArray(0); - GL.useProgram(0); + gl.uniformMatrix4fv(rotationMat, 1, false, pRotationMat); + gl.bindVertexArray(vao); + gl.drawElementsInstanced(GL.TRIANGLES, 6, GL.UNSIGNED_BYTE, MemorySegment.NULL, INSTANCE_COUNT); + gl.bindVertexArray(0); + gl.useProgram(0); glfw.swapBuffers(window);