From af0157a527e2d431199249b047e8fa2c5c3826a9 Mon Sep 17 00:00:00 2001 From: squid233 <60126026+squid233@users.noreply.github.com> Date: Wed, 31 Jan 2024 21:27:36 +0800 Subject: [PATCH] [OpenGL] Rewrite GL45C (WIP) [OpenGL] Reworking GLExtCaps --- .../overrungl/opengl/OpenGLGenerator.kt | 15 +- .../src/main/java/overrungl/opengl/GL15C.java | 20 +- .../src/main/java/overrungl/opengl/GL45C.java | 2158 ++++++----------- .../java/overrungl/opengl/GLCapabilities.java | 76 +- .../main/java/overrungl/opengl/GLExtCaps.java | 1251 +++++----- .../java/overrungl/opengl/GLExtFinder.java | 88 +- .../java/overrungl/opengl/GLLoadFunc.java | 23 +- .../main/java/overrungl/opengl/GLLoader.java | 18 +- .../main/java/overrungl/opengl/GLUtil.java | 43 +- .../demo/glfw/GLFWWindowIconTest.java | 10 +- .../java/overrungl/demo/opengl/GL10Test.java | 30 +- .../java/overrungl/demo/opengl/GL15Test.java | 65 +- .../java/overrungl/demo/opengl/GL30Test.java | 119 +- .../java/overrungl/demo/opengl/GL33Test.java | 128 +- 14 files changed, 1715 insertions(+), 2329 deletions(-) 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..80c87610 100644 --- a/modules/overrungl.opengl/src/generator/kotlin/overrungl/opengl/OpenGLGenerator.kt +++ b/modules/overrungl.opengl/src/generator/kotlin/overrungl/opengl/OpenGLGenerator.kt @@ -3171,10 +3171,12 @@ fun glExtCaps() { |import overrungl.opengl.ext.nv.*; |import overrungl.opengl.ext.sgi.*; |import overrungl.opengl.ext.sun.*; + |import overrun.marshal.Unmarshal; | |import java.lang.foreign.MemorySegment; |import java.lang.foreign.SegmentAllocator; |import java.lang.invoke.MethodHandle; + |import java.util.ArrayList; | |import static java.lang.foreign.ValueLayout.*; |import static overrungl.opengl.GLExtFinder.*; @@ -3218,17 +3220,14 @@ fun glExtCaps() { appendLine(" }\n") appendLine( """ - | boolean findExtensionsGL(int version, SegmentAllocator allocator) { + | boolean findExtensionsGL(SegmentAllocator allocator, GLLoadFunc load, int version) { | 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; + | var list = new ArrayList(700); + | if (!getExtensions(allocator, version, pExts, list, load)) return false; | - | String exts = pExts.getString(0); - | int numExtsI = pNumExtsI.get(JAVA_INT, 0); - | var extsI = pExtsI[0]; + | String exts = Unmarshal.unmarshalAsString(pExts.get(Unmarshal.STR_LAYOUT, 0)); | - | ${caps.joinToString(separator = "\n| ") { "this.$it = hasExtension(version, exts, numExtsI, extsI, \"$it\");" }} + | ${caps.joinToString(separator = "\n| ") { "this.$it = hasExtension(version, exts, list, \"$it\");" }} | | return true; | } 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 24bf01e9..af019620 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL15C.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GL15C.java @@ -99,38 +99,32 @@ default void bufferData(int target, long size, int usage) { @Skip default void bufferData(SegmentAllocator allocator, int target, byte[] data, int usage) { - final MemorySegment segment = Marshal.marshal(allocator, data); - bufferData(target, segment.byteSize(), segment, usage); + bufferData(target, Marshal.marshal(allocator, data), usage); } @Skip default void bufferData(SegmentAllocator allocator, int target, short[] data, int usage) { - final MemorySegment segment = Marshal.marshal(allocator, data); - bufferData(target, segment.byteSize(), segment, usage); + bufferData(target, Marshal.marshal(allocator, data), usage); } @Skip default void bufferData(SegmentAllocator allocator, int target, int[] data, int usage) { - final MemorySegment segment = Marshal.marshal(allocator, data); - bufferData(target, segment.byteSize(), segment, usage); + bufferData(target, Marshal.marshal(allocator, data), usage); } @Skip default void bufferData(SegmentAllocator allocator, int target, long[] data, int usage) { - final MemorySegment segment = Marshal.marshal(allocator, data); - bufferData(target, segment.byteSize(), segment, usage); + bufferData(target, Marshal.marshal(allocator, data), usage); } @Skip default void bufferData(SegmentAllocator allocator, int target, float[] data, int usage) { - final MemorySegment segment = Marshal.marshal(allocator, data); - bufferData(target, segment.byteSize(), segment, usage); + bufferData(target, Marshal.marshal(allocator, data), usage); } @Skip default void bufferData(SegmentAllocator allocator, int target, double[] data, int usage) { - final MemorySegment segment = Marshal.marshal(allocator, data); - bufferData(target, segment.byteSize(), segment, usage); + bufferData(target, Marshal.marshal(allocator, data), usage); } @Entrypoint("glBufferSubData") @@ -386,7 +380,7 @@ default MemorySegment mapBuffer(int target, int access) { long size = 0; if (this instanceof GL32C gl32C) { try { - size = gl32C.getBufferParameteri64v(target, GL30C.BUFFER_MAP_LENGTH); + size = gl32C.getBufferParameteri64v(target, BUFFER_SIZE); } catch (ContextException e) { size = getBufferParameteriv(target, BUFFER_SIZE); } 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 8b0c67ff..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 overrungl.internal.RuntimeHelper; +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 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. @@ -44,1921 +48,1361 @@ * @since 0.1.0 */ public sealed interface 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); - } + 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/GLCapabilities.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLCapabilities.java index 99594848..696b7965 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLCapabilities.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLCapabilities.java @@ -16,9 +16,9 @@ package overrungl.opengl; +import overrun.marshal.MemoryStack; import overrun.marshal.Unmarshal; -import java.lang.foreign.Arena; import java.lang.foreign.FunctionDescriptor; import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; @@ -31,75 +31,9 @@ * @author squid233 * @since 0.1.0 */ +@Deprecated(since = "0.1.0") public final class GLCapabilities { private static final Pattern VERSION_PATTERN = Pattern.compile("^(\\d+)\\.(\\d+).*$"); - /** - * 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 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.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; - /** * The OpenGL context version flags. */ @@ -131,14 +65,12 @@ public int load(GLLoadFunc load) { final MethodHandle glGetString = load.invoke("glGetString", FunctionDescriptor.of(Unmarshal.STR_LAYOUT, ValueLayout.JAVA_INT)); if (glGetString == null) return 0; - GL45C.load(this, load); - int version = findCoreGL(glGetString); ext = new GLExtCaps(this); - try (var arena = Arena.ofConfined()) { - if (!ext.findExtensionsGL(version, arena)) return 0; + try (var stack = MemoryStack.stackPush()) { + if (!ext.findExtensionsGL(stack, load, version)) return 0; } ext.load(load); diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLExtCaps.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLExtCaps.java index 700721e6..704d8434 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLExtCaps.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLExtCaps.java @@ -31,10 +31,12 @@ import overrungl.opengl.ext.nv.*; import overrungl.opengl.ext.sgi.*; import overrungl.opengl.ext.sun.*; +import overrun.marshal.Unmarshal; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; import java.lang.invoke.MethodHandle; +import java.util.ArrayList; import static java.lang.foreign.ValueLayout.*; import static overrungl.opengl.GLExtFinder.*; @@ -439,635 +441,632 @@ void load(GLLoadFunc load) { GLSUNVertex.load(this, load); } - boolean findExtensionsGL(int version, SegmentAllocator allocator) { + boolean findExtensionsGL(SegmentAllocator allocator, GLLoadFunc load, int version) { 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; + var list = new ArrayList(700); + if (!getExtensions(allocator, version, pExts, list, load)) return false; - String exts = pExts.getString(0); - int numExtsI = pNumExtsI.get(JAVA_INT, 0); - var extsI = pExtsI[0]; + String exts = Unmarshal.unmarshalAsString(pExts.get(Unmarshal.STR_LAYOUT, 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"); + this.GL_ARB_ES2_compatibility = hasExtension(version, exts, list, "GL_ARB_ES2_compatibility"); + this.GL_ARB_ES3_1_compatibility = hasExtension(version, exts, list, "GL_ARB_ES3_1_compatibility"); + this.GL_ARB_ES3_2_compatibility = hasExtension(version, exts, list, "GL_ARB_ES3_2_compatibility"); + this.GL_ARB_ES3_compatibility = hasExtension(version, exts, list, "GL_ARB_ES3_compatibility"); + this.GL_ARB_arrays_of_arrays = hasExtension(version, exts, list, "GL_ARB_arrays_of_arrays"); + this.GL_ARB_base_instance = hasExtension(version, exts, list, "GL_ARB_base_instance"); + this.GL_ARB_bindless_texture = hasExtension(version, exts, list, "GL_ARB_bindless_texture"); + this.GL_ARB_blend_func_extended = hasExtension(version, exts, list, "GL_ARB_blend_func_extended"); + this.GL_ARB_buffer_storage = hasExtension(version, exts, list, "GL_ARB_buffer_storage"); + this.GL_ARB_cl_event = hasExtension(version, exts, list, "GL_ARB_cl_event"); + this.GL_ARB_clear_buffer_object = hasExtension(version, exts, list, "GL_ARB_clear_buffer_object"); + this.GL_ARB_clear_texture = hasExtension(version, exts, list, "GL_ARB_clear_texture"); + this.GL_ARB_clip_control = hasExtension(version, exts, list, "GL_ARB_clip_control"); + this.GL_ARB_color_buffer_float = hasExtension(version, exts, list, "GL_ARB_color_buffer_float"); + this.GL_ARB_compatibility = hasExtension(version, exts, list, "GL_ARB_compatibility"); + this.GL_ARB_compressed_texture_pixel_storage = hasExtension(version, exts, list, "GL_ARB_compressed_texture_pixel_storage"); + this.GL_ARB_compute_shader = hasExtension(version, exts, list, "GL_ARB_compute_shader"); + this.GL_ARB_compute_variable_group_size = hasExtension(version, exts, list, "GL_ARB_compute_variable_group_size"); + this.GL_ARB_conditional_render_inverted = hasExtension(version, exts, list, "GL_ARB_conditional_render_inverted"); + this.GL_ARB_conservative_depth = hasExtension(version, exts, list, "GL_ARB_conservative_depth"); + this.GL_ARB_copy_buffer = hasExtension(version, exts, list, "GL_ARB_copy_buffer"); + this.GL_ARB_copy_image = hasExtension(version, exts, list, "GL_ARB_copy_image"); + this.GL_ARB_cull_distance = hasExtension(version, exts, list, "GL_ARB_cull_distance"); + this.GL_ARB_debug_output = hasExtension(version, exts, list, "GL_ARB_debug_output"); + this.GL_ARB_depth_buffer_float = hasExtension(version, exts, list, "GL_ARB_depth_buffer_float"); + this.GL_ARB_depth_clamp = hasExtension(version, exts, list, "GL_ARB_depth_clamp"); + this.GL_ARB_depth_texture = hasExtension(version, exts, list, "GL_ARB_depth_texture"); + this.GL_ARB_derivative_control = hasExtension(version, exts, list, "GL_ARB_derivative_control"); + this.GL_ARB_direct_state_access = hasExtension(version, exts, list, "GL_ARB_direct_state_access"); + this.GL_ARB_draw_buffers = hasExtension(version, exts, list, "GL_ARB_draw_buffers"); + this.GL_ARB_draw_buffers_blend = hasExtension(version, exts, list, "GL_ARB_draw_buffers_blend"); + this.GL_ARB_draw_elements_base_vertex = hasExtension(version, exts, list, "GL_ARB_draw_elements_base_vertex"); + this.GL_ARB_draw_indirect = hasExtension(version, exts, list, "GL_ARB_draw_indirect"); + this.GL_ARB_draw_instanced = hasExtension(version, exts, list, "GL_ARB_draw_instanced"); + this.GL_ARB_enhanced_layouts = hasExtension(version, exts, list, "GL_ARB_enhanced_layouts"); + this.GL_ARB_explicit_attrib_location = hasExtension(version, exts, list, "GL_ARB_explicit_attrib_location"); + this.GL_ARB_explicit_uniform_location = hasExtension(version, exts, list, "GL_ARB_explicit_uniform_location"); + this.GL_ARB_fragment_coord_conventions = hasExtension(version, exts, list, "GL_ARB_fragment_coord_conventions"); + this.GL_ARB_fragment_layer_viewport = hasExtension(version, exts, list, "GL_ARB_fragment_layer_viewport"); + this.GL_ARB_fragment_program = hasExtension(version, exts, list, "GL_ARB_fragment_program"); + this.GL_ARB_fragment_program_shadow = hasExtension(version, exts, list, "GL_ARB_fragment_program_shadow"); + this.GL_ARB_fragment_shader = hasExtension(version, exts, list, "GL_ARB_fragment_shader"); + this.GL_ARB_fragment_shader_interlock = hasExtension(version, exts, list, "GL_ARB_fragment_shader_interlock"); + this.GL_ARB_framebuffer_no_attachments = hasExtension(version, exts, list, "GL_ARB_framebuffer_no_attachments"); + this.GL_ARB_framebuffer_object = hasExtension(version, exts, list, "GL_ARB_framebuffer_object"); + this.GL_ARB_framebuffer_sRGB = hasExtension(version, exts, list, "GL_ARB_framebuffer_sRGB"); + this.GL_ARB_geometry_shader4 = hasExtension(version, exts, list, "GL_ARB_geometry_shader4"); + this.GL_ARB_get_program_binary = hasExtension(version, exts, list, "GL_ARB_get_program_binary"); + this.GL_ARB_get_texture_sub_image = hasExtension(version, exts, list, "GL_ARB_get_texture_sub_image"); + this.GL_ARB_gl_spirv = hasExtension(version, exts, list, "GL_ARB_gl_spirv"); + this.GL_ARB_gpu_shader5 = hasExtension(version, exts, list, "GL_ARB_gpu_shader5"); + this.GL_ARB_gpu_shader_fp64 = hasExtension(version, exts, list, "GL_ARB_gpu_shader_fp64"); + this.GL_ARB_gpu_shader_int64 = hasExtension(version, exts, list, "GL_ARB_gpu_shader_int64"); + this.GL_ARB_half_float_pixel = hasExtension(version, exts, list, "GL_ARB_half_float_pixel"); + this.GL_ARB_half_float_vertex = hasExtension(version, exts, list, "GL_ARB_half_float_vertex"); + this.GL_ARB_imaging = hasExtension(version, exts, list, "GL_ARB_imaging"); + this.GL_ARB_indirect_parameters = hasExtension(version, exts, list, "GL_ARB_indirect_parameters"); + this.GL_ARB_instanced_arrays = hasExtension(version, exts, list, "GL_ARB_instanced_arrays"); + this.GL_ARB_internalformat_query = hasExtension(version, exts, list, "GL_ARB_internalformat_query"); + this.GL_ARB_internalformat_query2 = hasExtension(version, exts, list, "GL_ARB_internalformat_query2"); + this.GL_ARB_invalidate_subdata = hasExtension(version, exts, list, "GL_ARB_invalidate_subdata"); + this.GL_ARB_map_buffer_alignment = hasExtension(version, exts, list, "GL_ARB_map_buffer_alignment"); + this.GL_ARB_map_buffer_range = hasExtension(version, exts, list, "GL_ARB_map_buffer_range"); + this.GL_ARB_matrix_palette = hasExtension(version, exts, list, "GL_ARB_matrix_palette"); + this.GL_ARB_multi_bind = hasExtension(version, exts, list, "GL_ARB_multi_bind"); + this.GL_ARB_multi_draw_indirect = hasExtension(version, exts, list, "GL_ARB_multi_draw_indirect"); + this.GL_ARB_multisample = hasExtension(version, exts, list, "GL_ARB_multisample"); + this.GL_ARB_multitexture = hasExtension(version, exts, list, "GL_ARB_multitexture"); + this.GL_ARB_occlusion_query = hasExtension(version, exts, list, "GL_ARB_occlusion_query"); + this.GL_ARB_occlusion_query2 = hasExtension(version, exts, list, "GL_ARB_occlusion_query2"); + this.GL_ARB_parallel_shader_compile = hasExtension(version, exts, list, "GL_ARB_parallel_shader_compile"); + this.GL_ARB_pipeline_statistics_query = hasExtension(version, exts, list, "GL_ARB_pipeline_statistics_query"); + this.GL_ARB_pixel_buffer_object = hasExtension(version, exts, list, "GL_ARB_pixel_buffer_object"); + this.GL_ARB_point_parameters = hasExtension(version, exts, list, "GL_ARB_point_parameters"); + this.GL_ARB_point_sprite = hasExtension(version, exts, list, "GL_ARB_point_sprite"); + this.GL_ARB_polygon_offset_clamp = hasExtension(version, exts, list, "GL_ARB_polygon_offset_clamp"); + this.GL_ARB_post_depth_coverage = hasExtension(version, exts, list, "GL_ARB_post_depth_coverage"); + this.GL_ARB_program_interface_query = hasExtension(version, exts, list, "GL_ARB_program_interface_query"); + this.GL_ARB_provoking_vertex = hasExtension(version, exts, list, "GL_ARB_provoking_vertex"); + this.GL_ARB_query_buffer_object = hasExtension(version, exts, list, "GL_ARB_query_buffer_object"); + this.GL_ARB_robust_buffer_access_behavior = hasExtension(version, exts, list, "GL_ARB_robust_buffer_access_behavior"); + this.GL_ARB_robustness = hasExtension(version, exts, list, "GL_ARB_robustness"); + this.GL_ARB_robustness_isolation = hasExtension(version, exts, list, "GL_ARB_robustness_isolation"); + this.GL_ARB_sample_locations = hasExtension(version, exts, list, "GL_ARB_sample_locations"); + this.GL_ARB_sample_shading = hasExtension(version, exts, list, "GL_ARB_sample_shading"); + this.GL_ARB_sampler_objects = hasExtension(version, exts, list, "GL_ARB_sampler_objects"); + this.GL_ARB_seamless_cube_map = hasExtension(version, exts, list, "GL_ARB_seamless_cube_map"); + this.GL_ARB_seamless_cubemap_per_texture = hasExtension(version, exts, list, "GL_ARB_seamless_cubemap_per_texture"); + this.GL_ARB_separate_shader_objects = hasExtension(version, exts, list, "GL_ARB_separate_shader_objects"); + this.GL_ARB_shader_atomic_counter_ops = hasExtension(version, exts, list, "GL_ARB_shader_atomic_counter_ops"); + this.GL_ARB_shader_atomic_counters = hasExtension(version, exts, list, "GL_ARB_shader_atomic_counters"); + this.GL_ARB_shader_ballot = hasExtension(version, exts, list, "GL_ARB_shader_ballot"); + this.GL_ARB_shader_bit_encoding = hasExtension(version, exts, list, "GL_ARB_shader_bit_encoding"); + this.GL_ARB_shader_clock = hasExtension(version, exts, list, "GL_ARB_shader_clock"); + this.GL_ARB_shader_draw_parameters = hasExtension(version, exts, list, "GL_ARB_shader_draw_parameters"); + this.GL_ARB_shader_group_vote = hasExtension(version, exts, list, "GL_ARB_shader_group_vote"); + this.GL_ARB_shader_image_load_store = hasExtension(version, exts, list, "GL_ARB_shader_image_load_store"); + this.GL_ARB_shader_image_size = hasExtension(version, exts, list, "GL_ARB_shader_image_size"); + this.GL_ARB_shader_objects = hasExtension(version, exts, list, "GL_ARB_shader_objects"); + this.GL_ARB_shader_precision = hasExtension(version, exts, list, "GL_ARB_shader_precision"); + this.GL_ARB_shader_stencil_export = hasExtension(version, exts, list, "GL_ARB_shader_stencil_export"); + this.GL_ARB_shader_storage_buffer_object = hasExtension(version, exts, list, "GL_ARB_shader_storage_buffer_object"); + this.GL_ARB_shader_subroutine = hasExtension(version, exts, list, "GL_ARB_shader_subroutine"); + this.GL_ARB_shader_texture_image_samples = hasExtension(version, exts, list, "GL_ARB_shader_texture_image_samples"); + this.GL_ARB_shader_texture_lod = hasExtension(version, exts, list, "GL_ARB_shader_texture_lod"); + this.GL_ARB_shader_viewport_layer_array = hasExtension(version, exts, list, "GL_ARB_shader_viewport_layer_array"); + this.GL_ARB_shading_language_100 = hasExtension(version, exts, list, "GL_ARB_shading_language_100"); + this.GL_ARB_shading_language_420pack = hasExtension(version, exts, list, "GL_ARB_shading_language_420pack"); + this.GL_ARB_shading_language_include = hasExtension(version, exts, list, "GL_ARB_shading_language_include"); + this.GL_ARB_shading_language_packing = hasExtension(version, exts, list, "GL_ARB_shading_language_packing"); + this.GL_ARB_shadow = hasExtension(version, exts, list, "GL_ARB_shadow"); + this.GL_ARB_shadow_ambient = hasExtension(version, exts, list, "GL_ARB_shadow_ambient"); + this.GL_ARB_sparse_buffer = hasExtension(version, exts, list, "GL_ARB_sparse_buffer"); + this.GL_ARB_sparse_texture = hasExtension(version, exts, list, "GL_ARB_sparse_texture"); + this.GL_ARB_sparse_texture2 = hasExtension(version, exts, list, "GL_ARB_sparse_texture2"); + this.GL_ARB_sparse_texture_clamp = hasExtension(version, exts, list, "GL_ARB_sparse_texture_clamp"); + this.GL_ARB_spirv_extensions = hasExtension(version, exts, list, "GL_ARB_spirv_extensions"); + this.GL_ARB_stencil_texturing = hasExtension(version, exts, list, "GL_ARB_stencil_texturing"); + this.GL_ARB_sync = hasExtension(version, exts, list, "GL_ARB_sync"); + this.GL_ARB_tessellation_shader = hasExtension(version, exts, list, "GL_ARB_tessellation_shader"); + this.GL_ARB_texture_barrier = hasExtension(version, exts, list, "GL_ARB_texture_barrier"); + this.GL_ARB_texture_border_clamp = hasExtension(version, exts, list, "GL_ARB_texture_border_clamp"); + this.GL_ARB_texture_buffer_object = hasExtension(version, exts, list, "GL_ARB_texture_buffer_object"); + this.GL_ARB_texture_buffer_object_rgb32 = hasExtension(version, exts, list, "GL_ARB_texture_buffer_object_rgb32"); + this.GL_ARB_texture_buffer_range = hasExtension(version, exts, list, "GL_ARB_texture_buffer_range"); + this.GL_ARB_texture_compression = hasExtension(version, exts, list, "GL_ARB_texture_compression"); + this.GL_ARB_texture_compression_bptc = hasExtension(version, exts, list, "GL_ARB_texture_compression_bptc"); + this.GL_ARB_texture_compression_rgtc = hasExtension(version, exts, list, "GL_ARB_texture_compression_rgtc"); + this.GL_ARB_texture_cube_map = hasExtension(version, exts, list, "GL_ARB_texture_cube_map"); + this.GL_ARB_texture_cube_map_array = hasExtension(version, exts, list, "GL_ARB_texture_cube_map_array"); + this.GL_ARB_texture_env_add = hasExtension(version, exts, list, "GL_ARB_texture_env_add"); + this.GL_ARB_texture_env_combine = hasExtension(version, exts, list, "GL_ARB_texture_env_combine"); + this.GL_ARB_texture_env_crossbar = hasExtension(version, exts, list, "GL_ARB_texture_env_crossbar"); + this.GL_ARB_texture_env_dot3 = hasExtension(version, exts, list, "GL_ARB_texture_env_dot3"); + this.GL_ARB_texture_filter_anisotropic = hasExtension(version, exts, list, "GL_ARB_texture_filter_anisotropic"); + this.GL_ARB_texture_filter_minmax = hasExtension(version, exts, list, "GL_ARB_texture_filter_minmax"); + this.GL_ARB_texture_float = hasExtension(version, exts, list, "GL_ARB_texture_float"); + this.GL_ARB_texture_gather = hasExtension(version, exts, list, "GL_ARB_texture_gather"); + this.GL_ARB_texture_mirror_clamp_to_edge = hasExtension(version, exts, list, "GL_ARB_texture_mirror_clamp_to_edge"); + this.GL_ARB_texture_mirrored_repeat = hasExtension(version, exts, list, "GL_ARB_texture_mirrored_repeat"); + this.GL_ARB_texture_multisample = hasExtension(version, exts, list, "GL_ARB_texture_multisample"); + this.GL_ARB_texture_non_power_of_two = hasExtension(version, exts, list, "GL_ARB_texture_non_power_of_two"); + this.GL_ARB_texture_query_levels = hasExtension(version, exts, list, "GL_ARB_texture_query_levels"); + this.GL_ARB_texture_query_lod = hasExtension(version, exts, list, "GL_ARB_texture_query_lod"); + this.GL_ARB_texture_rectangle = hasExtension(version, exts, list, "GL_ARB_texture_rectangle"); + this.GL_ARB_texture_rg = hasExtension(version, exts, list, "GL_ARB_texture_rg"); + this.GL_ARB_texture_rgb10_a2ui = hasExtension(version, exts, list, "GL_ARB_texture_rgb10_a2ui"); + this.GL_ARB_texture_stencil8 = hasExtension(version, exts, list, "GL_ARB_texture_stencil8"); + this.GL_ARB_texture_storage = hasExtension(version, exts, list, "GL_ARB_texture_storage"); + this.GL_ARB_texture_storage_multisample = hasExtension(version, exts, list, "GL_ARB_texture_storage_multisample"); + this.GL_ARB_texture_swizzle = hasExtension(version, exts, list, "GL_ARB_texture_swizzle"); + this.GL_ARB_texture_view = hasExtension(version, exts, list, "GL_ARB_texture_view"); + this.GL_ARB_timer_query = hasExtension(version, exts, list, "GL_ARB_timer_query"); + this.GL_ARB_transform_feedback2 = hasExtension(version, exts, list, "GL_ARB_transform_feedback2"); + this.GL_ARB_transform_feedback3 = hasExtension(version, exts, list, "GL_ARB_transform_feedback3"); + this.GL_ARB_transform_feedback_instanced = hasExtension(version, exts, list, "GL_ARB_transform_feedback_instanced"); + this.GL_ARB_transform_feedback_overflow_query = hasExtension(version, exts, list, "GL_ARB_transform_feedback_overflow_query"); + this.GL_ARB_transpose_matrix = hasExtension(version, exts, list, "GL_ARB_transpose_matrix"); + this.GL_ARB_uniform_buffer_object = hasExtension(version, exts, list, "GL_ARB_uniform_buffer_object"); + this.GL_ARB_vertex_array_bgra = hasExtension(version, exts, list, "GL_ARB_vertex_array_bgra"); + this.GL_ARB_vertex_array_object = hasExtension(version, exts, list, "GL_ARB_vertex_array_object"); + this.GL_ARB_vertex_attrib_64bit = hasExtension(version, exts, list, "GL_ARB_vertex_attrib_64bit"); + this.GL_ARB_vertex_attrib_binding = hasExtension(version, exts, list, "GL_ARB_vertex_attrib_binding"); + this.GL_ARB_vertex_blend = hasExtension(version, exts, list, "GL_ARB_vertex_blend"); + this.GL_ARB_vertex_buffer_object = hasExtension(version, exts, list, "GL_ARB_vertex_buffer_object"); + this.GL_ARB_vertex_program = hasExtension(version, exts, list, "GL_ARB_vertex_program"); + this.GL_ARB_vertex_shader = hasExtension(version, exts, list, "GL_ARB_vertex_shader"); + this.GL_ARB_vertex_type_10f_11f_11f_rev = hasExtension(version, exts, list, "GL_ARB_vertex_type_10f_11f_11f_rev"); + this.GL_ARB_vertex_type_2_10_10_10_rev = hasExtension(version, exts, list, "GL_ARB_vertex_type_2_10_10_10_rev"); + this.GL_ARB_viewport_array = hasExtension(version, exts, list, "GL_ARB_viewport_array"); + this.GL_ARB_window_pos = hasExtension(version, exts, list, "GL_ARB_window_pos"); + this.GL_KHR_blend_equation_advanced = hasExtension(version, exts, list, "GL_KHR_blend_equation_advanced"); + this.GL_KHR_blend_equation_advanced_coherent = hasExtension(version, exts, list, "GL_KHR_blend_equation_advanced_coherent"); + this.GL_KHR_context_flush_control = hasExtension(version, exts, list, "GL_KHR_context_flush_control"); + this.GL_KHR_debug = hasExtension(version, exts, list, "GL_KHR_debug"); + this.GL_KHR_no_error = hasExtension(version, exts, list, "GL_KHR_no_error"); + this.GL_KHR_parallel_shader_compile = hasExtension(version, exts, list, "GL_KHR_parallel_shader_compile"); + this.GL_KHR_robust_buffer_access_behavior = hasExtension(version, exts, list, "GL_KHR_robust_buffer_access_behavior"); + this.GL_KHR_robustness = hasExtension(version, exts, list, "GL_KHR_robustness"); + this.GL_KHR_shader_subgroup = hasExtension(version, exts, list, "GL_KHR_shader_subgroup"); + this.GL_KHR_texture_compression_astc_hdr = hasExtension(version, exts, list, "GL_KHR_texture_compression_astc_hdr"); + this.GL_KHR_texture_compression_astc_ldr = hasExtension(version, exts, list, "GL_KHR_texture_compression_astc_ldr"); + this.GL_KHR_texture_compression_astc_sliced_3d = hasExtension(version, exts, list, "GL_KHR_texture_compression_astc_sliced_3d"); + this.GL_OES_byte_coordinates = hasExtension(version, exts, list, "GL_OES_byte_coordinates"); + this.GL_OES_compressed_paletted_texture = hasExtension(version, exts, list, "GL_OES_compressed_paletted_texture"); + this.GL_OES_fixed_point = hasExtension(version, exts, list, "GL_OES_fixed_point"); + this.GL_OES_query_matrix = hasExtension(version, exts, list, "GL_OES_query_matrix"); + this.GL_OES_read_format = hasExtension(version, exts, list, "GL_OES_read_format"); + this.GL_OES_single_precision = hasExtension(version, exts, list, "GL_OES_single_precision"); + this.GL_3DFX_multisample = hasExtension(version, exts, list, "GL_3DFX_multisample"); + this.GL_3DFX_tbuffer = hasExtension(version, exts, list, "GL_3DFX_tbuffer"); + this.GL_3DFX_texture_compression_FXT1 = hasExtension(version, exts, list, "GL_3DFX_texture_compression_FXT1"); + this.GL_AMD_blend_minmax_factor = hasExtension(version, exts, list, "GL_AMD_blend_minmax_factor"); + this.GL_AMD_conservative_depth = hasExtension(version, exts, list, "GL_AMD_conservative_depth"); + this.GL_AMD_debug_output = hasExtension(version, exts, list, "GL_AMD_debug_output"); + this.GL_AMD_depth_clamp_separate = hasExtension(version, exts, list, "GL_AMD_depth_clamp_separate"); + this.GL_AMD_draw_buffers_blend = hasExtension(version, exts, list, "GL_AMD_draw_buffers_blend"); + this.GL_AMD_framebuffer_multisample_advanced = hasExtension(version, exts, list, "GL_AMD_framebuffer_multisample_advanced"); + this.GL_AMD_framebuffer_sample_positions = hasExtension(version, exts, list, "GL_AMD_framebuffer_sample_positions"); + this.GL_AMD_gcn_shader = hasExtension(version, exts, list, "GL_AMD_gcn_shader"); + this.GL_AMD_gpu_shader_half_float = hasExtension(version, exts, list, "GL_AMD_gpu_shader_half_float"); + this.GL_AMD_gpu_shader_int16 = hasExtension(version, exts, list, "GL_AMD_gpu_shader_int16"); + this.GL_AMD_gpu_shader_int64 = hasExtension(version, exts, list, "GL_AMD_gpu_shader_int64"); + this.GL_AMD_interleaved_elements = hasExtension(version, exts, list, "GL_AMD_interleaved_elements"); + this.GL_AMD_multi_draw_indirect = hasExtension(version, exts, list, "GL_AMD_multi_draw_indirect"); + this.GL_AMD_name_gen_delete = hasExtension(version, exts, list, "GL_AMD_name_gen_delete"); + this.GL_AMD_occlusion_query_event = hasExtension(version, exts, list, "GL_AMD_occlusion_query_event"); + this.GL_AMD_performance_monitor = hasExtension(version, exts, list, "GL_AMD_performance_monitor"); + this.GL_AMD_pinned_memory = hasExtension(version, exts, list, "GL_AMD_pinned_memory"); + this.GL_AMD_query_buffer_object = hasExtension(version, exts, list, "GL_AMD_query_buffer_object"); + this.GL_AMD_sample_positions = hasExtension(version, exts, list, "GL_AMD_sample_positions"); + this.GL_AMD_seamless_cubemap_per_texture = hasExtension(version, exts, list, "GL_AMD_seamless_cubemap_per_texture"); + this.GL_AMD_shader_atomic_counter_ops = hasExtension(version, exts, list, "GL_AMD_shader_atomic_counter_ops"); + this.GL_AMD_shader_ballot = hasExtension(version, exts, list, "GL_AMD_shader_ballot"); + this.GL_AMD_shader_explicit_vertex_parameter = hasExtension(version, exts, list, "GL_AMD_shader_explicit_vertex_parameter"); + this.GL_AMD_shader_gpu_shader_half_float_fetch = hasExtension(version, exts, list, "GL_AMD_shader_gpu_shader_half_float_fetch"); + this.GL_AMD_shader_image_load_store_lod = hasExtension(version, exts, list, "GL_AMD_shader_image_load_store_lod"); + this.GL_AMD_shader_stencil_export = hasExtension(version, exts, list, "GL_AMD_shader_stencil_export"); + this.GL_AMD_shader_trinary_minmax = hasExtension(version, exts, list, "GL_AMD_shader_trinary_minmax"); + this.GL_AMD_sparse_texture = hasExtension(version, exts, list, "GL_AMD_sparse_texture"); + this.GL_AMD_stencil_operation_extended = hasExtension(version, exts, list, "GL_AMD_stencil_operation_extended"); + this.GL_AMD_texture_gather_bias_lod = hasExtension(version, exts, list, "GL_AMD_texture_gather_bias_lod"); + this.GL_AMD_texture_texture4 = hasExtension(version, exts, list, "GL_AMD_texture_texture4"); + this.GL_AMD_transform_feedback3_lines_triangles = hasExtension(version, exts, list, "GL_AMD_transform_feedback3_lines_triangles"); + this.GL_AMD_transform_feedback4 = hasExtension(version, exts, list, "GL_AMD_transform_feedback4"); + this.GL_AMD_vertex_shader_layer = hasExtension(version, exts, list, "GL_AMD_vertex_shader_layer"); + this.GL_AMD_vertex_shader_tessellator = hasExtension(version, exts, list, "GL_AMD_vertex_shader_tessellator"); + this.GL_AMD_vertex_shader_viewport_index = hasExtension(version, exts, list, "GL_AMD_vertex_shader_viewport_index"); + this.GL_APPLE_aux_depth_stencil = hasExtension(version, exts, list, "GL_APPLE_aux_depth_stencil"); + this.GL_APPLE_client_storage = hasExtension(version, exts, list, "GL_APPLE_client_storage"); + this.GL_APPLE_element_array = hasExtension(version, exts, list, "GL_APPLE_element_array"); + this.GL_APPLE_fence = hasExtension(version, exts, list, "GL_APPLE_fence"); + this.GL_APPLE_float_pixels = hasExtension(version, exts, list, "GL_APPLE_float_pixels"); + this.GL_APPLE_flush_buffer_range = hasExtension(version, exts, list, "GL_APPLE_flush_buffer_range"); + this.GL_APPLE_object_purgeable = hasExtension(version, exts, list, "GL_APPLE_object_purgeable"); + this.GL_APPLE_rgb_422 = hasExtension(version, exts, list, "GL_APPLE_rgb_422"); + this.GL_APPLE_row_bytes = hasExtension(version, exts, list, "GL_APPLE_row_bytes"); + this.GL_APPLE_specular_vector = hasExtension(version, exts, list, "GL_APPLE_specular_vector"); + this.GL_APPLE_texture_range = hasExtension(version, exts, list, "GL_APPLE_texture_range"); + this.GL_APPLE_transform_hint = hasExtension(version, exts, list, "GL_APPLE_transform_hint"); + this.GL_APPLE_vertex_array_object = hasExtension(version, exts, list, "GL_APPLE_vertex_array_object"); + this.GL_APPLE_vertex_array_range = hasExtension(version, exts, list, "GL_APPLE_vertex_array_range"); + this.GL_APPLE_vertex_program_evaluators = hasExtension(version, exts, list, "GL_APPLE_vertex_program_evaluators"); + this.GL_APPLE_ycbcr_422 = hasExtension(version, exts, list, "GL_APPLE_ycbcr_422"); + this.GL_ATI_draw_buffers = hasExtension(version, exts, list, "GL_ATI_draw_buffers"); + this.GL_ATI_element_array = hasExtension(version, exts, list, "GL_ATI_element_array"); + this.GL_ATI_envmap_bumpmap = hasExtension(version, exts, list, "GL_ATI_envmap_bumpmap"); + this.GL_ATI_fragment_shader = hasExtension(version, exts, list, "GL_ATI_fragment_shader"); + this.GL_ATI_map_object_buffer = hasExtension(version, exts, list, "GL_ATI_map_object_buffer"); + this.GL_ATI_meminfo = hasExtension(version, exts, list, "GL_ATI_meminfo"); + this.GL_ATI_pixel_format_float = hasExtension(version, exts, list, "GL_ATI_pixel_format_float"); + this.GL_ATI_pn_triangles = hasExtension(version, exts, list, "GL_ATI_pn_triangles"); + this.GL_ATI_separate_stencil = hasExtension(version, exts, list, "GL_ATI_separate_stencil"); + this.GL_ATI_text_fragment_shader = hasExtension(version, exts, list, "GL_ATI_text_fragment_shader"); + this.GL_ATI_texture_env_combine3 = hasExtension(version, exts, list, "GL_ATI_texture_env_combine3"); + this.GL_ATI_texture_float = hasExtension(version, exts, list, "GL_ATI_texture_float"); + this.GL_ATI_texture_mirror_once = hasExtension(version, exts, list, "GL_ATI_texture_mirror_once"); + this.GL_ATI_vertex_array_object = hasExtension(version, exts, list, "GL_ATI_vertex_array_object"); + this.GL_ATI_vertex_attrib_array_object = hasExtension(version, exts, list, "GL_ATI_vertex_attrib_array_object"); + this.GL_ATI_vertex_streams = hasExtension(version, exts, list, "GL_ATI_vertex_streams"); + this.GL_EXT_422_pixels = hasExtension(version, exts, list, "GL_EXT_422_pixels"); + this.GL_EXT_EGL_image_storage = hasExtension(version, exts, list, "GL_EXT_EGL_image_storage"); + this.GL_EXT_EGL_sync = hasExtension(version, exts, list, "GL_EXT_EGL_sync"); + this.GL_EXT_abgr = hasExtension(version, exts, list, "GL_EXT_abgr"); + this.GL_EXT_bgra = hasExtension(version, exts, list, "GL_EXT_bgra"); + this.GL_EXT_bindable_uniform = hasExtension(version, exts, list, "GL_EXT_bindable_uniform"); + this.GL_EXT_blend_color = hasExtension(version, exts, list, "GL_EXT_blend_color"); + this.GL_EXT_blend_equation_separate = hasExtension(version, exts, list, "GL_EXT_blend_equation_separate"); + this.GL_EXT_blend_func_separate = hasExtension(version, exts, list, "GL_EXT_blend_func_separate"); + this.GL_EXT_blend_logic_op = hasExtension(version, exts, list, "GL_EXT_blend_logic_op"); + this.GL_EXT_blend_minmax = hasExtension(version, exts, list, "GL_EXT_blend_minmax"); + this.GL_EXT_blend_subtract = hasExtension(version, exts, list, "GL_EXT_blend_subtract"); + this.GL_EXT_clip_volume_hint = hasExtension(version, exts, list, "GL_EXT_clip_volume_hint"); + this.GL_EXT_cmyka = hasExtension(version, exts, list, "GL_EXT_cmyka"); + this.GL_EXT_color_subtable = hasExtension(version, exts, list, "GL_EXT_color_subtable"); + this.GL_EXT_compiled_vertex_array = hasExtension(version, exts, list, "GL_EXT_compiled_vertex_array"); + this.GL_EXT_convolution = hasExtension(version, exts, list, "GL_EXT_convolution"); + this.GL_EXT_coordinate_frame = hasExtension(version, exts, list, "GL_EXT_coordinate_frame"); + this.GL_EXT_copy_texture = hasExtension(version, exts, list, "GL_EXT_copy_texture"); + this.GL_EXT_cull_vertex = hasExtension(version, exts, list, "GL_EXT_cull_vertex"); + this.GL_EXT_debug_label = hasExtension(version, exts, list, "GL_EXT_debug_label"); + this.GL_EXT_debug_marker = hasExtension(version, exts, list, "GL_EXT_debug_marker"); + this.GL_EXT_depth_bounds_test = hasExtension(version, exts, list, "GL_EXT_depth_bounds_test"); + this.GL_EXT_direct_state_access = hasExtension(version, exts, list, "GL_EXT_direct_state_access"); + this.GL_EXT_draw_buffers2 = hasExtension(version, exts, list, "GL_EXT_draw_buffers2"); + this.GL_EXT_draw_instanced = hasExtension(version, exts, list, "GL_EXT_draw_instanced"); + this.GL_EXT_draw_range_elements = hasExtension(version, exts, list, "GL_EXT_draw_range_elements"); + this.GL_EXT_external_buffer = hasExtension(version, exts, list, "GL_EXT_external_buffer"); + this.GL_EXT_fog_coord = hasExtension(version, exts, list, "GL_EXT_fog_coord"); + this.GL_EXT_framebuffer_blit = hasExtension(version, exts, list, "GL_EXT_framebuffer_blit"); + this.GL_EXT_framebuffer_blit_layers = hasExtension(version, exts, list, "GL_EXT_framebuffer_blit_layers"); + this.GL_EXT_framebuffer_multisample = hasExtension(version, exts, list, "GL_EXT_framebuffer_multisample"); + this.GL_EXT_framebuffer_multisample_blit_scaled = hasExtension(version, exts, list, "GL_EXT_framebuffer_multisample_blit_scaled"); + this.GL_EXT_framebuffer_object = hasExtension(version, exts, list, "GL_EXT_framebuffer_object"); + this.GL_EXT_framebuffer_sRGB = hasExtension(version, exts, list, "GL_EXT_framebuffer_sRGB"); + this.GL_EXT_geometry_shader4 = hasExtension(version, exts, list, "GL_EXT_geometry_shader4"); + this.GL_EXT_gpu_program_parameters = hasExtension(version, exts, list, "GL_EXT_gpu_program_parameters"); + this.GL_EXT_gpu_shader4 = hasExtension(version, exts, list, "GL_EXT_gpu_shader4"); + this.GL_EXT_histogram = hasExtension(version, exts, list, "GL_EXT_histogram"); + this.GL_EXT_index_array_formats = hasExtension(version, exts, list, "GL_EXT_index_array_formats"); + this.GL_EXT_index_func = hasExtension(version, exts, list, "GL_EXT_index_func"); + this.GL_EXT_index_material = hasExtension(version, exts, list, "GL_EXT_index_material"); + this.GL_EXT_index_texture = hasExtension(version, exts, list, "GL_EXT_index_texture"); + this.GL_EXT_light_texture = hasExtension(version, exts, list, "GL_EXT_light_texture"); + this.GL_EXT_memory_object = hasExtension(version, exts, list, "GL_EXT_memory_object"); + this.GL_EXT_memory_object_fd = hasExtension(version, exts, list, "GL_EXT_memory_object_fd"); + this.GL_EXT_memory_object_win32 = hasExtension(version, exts, list, "GL_EXT_memory_object_win32"); + this.GL_EXT_misc_attribute = hasExtension(version, exts, list, "GL_EXT_misc_attribute"); + this.GL_EXT_multi_draw_arrays = hasExtension(version, exts, list, "GL_EXT_multi_draw_arrays"); + this.GL_EXT_multisample = hasExtension(version, exts, list, "GL_EXT_multisample"); + this.GL_EXT_multiview_tessellation_geometry_shader = hasExtension(version, exts, list, "GL_EXT_multiview_tessellation_geometry_shader"); + this.GL_EXT_multiview_texture_multisample = hasExtension(version, exts, list, "GL_EXT_multiview_texture_multisample"); + this.GL_EXT_multiview_timer_query = hasExtension(version, exts, list, "GL_EXT_multiview_timer_query"); + this.GL_EXT_packed_depth_stencil = hasExtension(version, exts, list, "GL_EXT_packed_depth_stencil"); + this.GL_EXT_packed_float = hasExtension(version, exts, list, "GL_EXT_packed_float"); + this.GL_EXT_packed_pixels = hasExtension(version, exts, list, "GL_EXT_packed_pixels"); + this.GL_EXT_paletted_texture = hasExtension(version, exts, list, "GL_EXT_paletted_texture"); + this.GL_EXT_pixel_buffer_object = hasExtension(version, exts, list, "GL_EXT_pixel_buffer_object"); + this.GL_EXT_pixel_transform = hasExtension(version, exts, list, "GL_EXT_pixel_transform"); + this.GL_EXT_pixel_transform_color_table = hasExtension(version, exts, list, "GL_EXT_pixel_transform_color_table"); + this.GL_EXT_point_parameters = hasExtension(version, exts, list, "GL_EXT_point_parameters"); + this.GL_EXT_polygon_offset = hasExtension(version, exts, list, "GL_EXT_polygon_offset"); + this.GL_EXT_polygon_offset_clamp = hasExtension(version, exts, list, "GL_EXT_polygon_offset_clamp"); + this.GL_EXT_post_depth_coverage = hasExtension(version, exts, list, "GL_EXT_post_depth_coverage"); + this.GL_EXT_provoking_vertex = hasExtension(version, exts, list, "GL_EXT_provoking_vertex"); + this.GL_EXT_raster_multisample = hasExtension(version, exts, list, "GL_EXT_raster_multisample"); + this.GL_EXT_rescale_normal = hasExtension(version, exts, list, "GL_EXT_rescale_normal"); + this.GL_EXT_secondary_color = hasExtension(version, exts, list, "GL_EXT_secondary_color"); + this.GL_EXT_semaphore = hasExtension(version, exts, list, "GL_EXT_semaphore"); + this.GL_EXT_semaphore_fd = hasExtension(version, exts, list, "GL_EXT_semaphore_fd"); + this.GL_EXT_semaphore_win32 = hasExtension(version, exts, list, "GL_EXT_semaphore_win32"); + this.GL_EXT_separate_shader_objects = hasExtension(version, exts, list, "GL_EXT_separate_shader_objects"); + this.GL_EXT_separate_specular_color = hasExtension(version, exts, list, "GL_EXT_separate_specular_color"); + this.GL_EXT_shader_framebuffer_fetch = hasExtension(version, exts, list, "GL_EXT_shader_framebuffer_fetch"); + this.GL_EXT_shader_framebuffer_fetch_non_coherent = hasExtension(version, exts, list, "GL_EXT_shader_framebuffer_fetch_non_coherent"); + this.GL_EXT_shader_image_load_formatted = hasExtension(version, exts, list, "GL_EXT_shader_image_load_formatted"); + this.GL_EXT_shader_image_load_store = hasExtension(version, exts, list, "GL_EXT_shader_image_load_store"); + this.GL_EXT_shader_integer_mix = hasExtension(version, exts, list, "GL_EXT_shader_integer_mix"); + this.GL_EXT_shader_samples_identical = hasExtension(version, exts, list, "GL_EXT_shader_samples_identical"); + this.GL_EXT_shadow_funcs = hasExtension(version, exts, list, "GL_EXT_shadow_funcs"); + this.GL_EXT_shared_texture_palette = hasExtension(version, exts, list, "GL_EXT_shared_texture_palette"); + this.GL_EXT_sparse_texture2 = hasExtension(version, exts, list, "GL_EXT_sparse_texture2"); + this.GL_EXT_stencil_clear_tag = hasExtension(version, exts, list, "GL_EXT_stencil_clear_tag"); + this.GL_EXT_stencil_two_side = hasExtension(version, exts, list, "GL_EXT_stencil_two_side"); + this.GL_EXT_stencil_wrap = hasExtension(version, exts, list, "GL_EXT_stencil_wrap"); + this.GL_EXT_subtexture = hasExtension(version, exts, list, "GL_EXT_subtexture"); + this.GL_EXT_texture = hasExtension(version, exts, list, "GL_EXT_texture"); + this.GL_EXT_texture3D = hasExtension(version, exts, list, "GL_EXT_texture3D"); + this.GL_EXT_texture_array = hasExtension(version, exts, list, "GL_EXT_texture_array"); + this.GL_EXT_texture_buffer_object = hasExtension(version, exts, list, "GL_EXT_texture_buffer_object"); + this.GL_EXT_texture_compression_latc = hasExtension(version, exts, list, "GL_EXT_texture_compression_latc"); + this.GL_EXT_texture_compression_rgtc = hasExtension(version, exts, list, "GL_EXT_texture_compression_rgtc"); + this.GL_EXT_texture_compression_s3tc = hasExtension(version, exts, list, "GL_EXT_texture_compression_s3tc"); + this.GL_EXT_texture_cube_map = hasExtension(version, exts, list, "GL_EXT_texture_cube_map"); + this.GL_EXT_texture_env_add = hasExtension(version, exts, list, "GL_EXT_texture_env_add"); + this.GL_EXT_texture_env_combine = hasExtension(version, exts, list, "GL_EXT_texture_env_combine"); + this.GL_EXT_texture_env_dot3 = hasExtension(version, exts, list, "GL_EXT_texture_env_dot3"); + this.GL_EXT_texture_filter_anisotropic = hasExtension(version, exts, list, "GL_EXT_texture_filter_anisotropic"); + this.GL_EXT_texture_filter_minmax = hasExtension(version, exts, list, "GL_EXT_texture_filter_minmax"); + this.GL_EXT_texture_integer = hasExtension(version, exts, list, "GL_EXT_texture_integer"); + this.GL_EXT_texture_lod_bias = hasExtension(version, exts, list, "GL_EXT_texture_lod_bias"); + this.GL_EXT_texture_mirror_clamp = hasExtension(version, exts, list, "GL_EXT_texture_mirror_clamp"); + this.GL_EXT_texture_object = hasExtension(version, exts, list, "GL_EXT_texture_object"); + this.GL_EXT_texture_perturb_normal = hasExtension(version, exts, list, "GL_EXT_texture_perturb_normal"); + this.GL_EXT_texture_sRGB = hasExtension(version, exts, list, "GL_EXT_texture_sRGB"); + this.GL_EXT_texture_sRGB_R8 = hasExtension(version, exts, list, "GL_EXT_texture_sRGB_R8"); + this.GL_EXT_texture_sRGB_RG8 = hasExtension(version, exts, list, "GL_EXT_texture_sRGB_RG8"); + this.GL_EXT_texture_sRGB_decode = hasExtension(version, exts, list, "GL_EXT_texture_sRGB_decode"); + this.GL_EXT_texture_shadow_lod = hasExtension(version, exts, list, "GL_EXT_texture_shadow_lod"); + this.GL_EXT_texture_shared_exponent = hasExtension(version, exts, list, "GL_EXT_texture_shared_exponent"); + this.GL_EXT_texture_snorm = hasExtension(version, exts, list, "GL_EXT_texture_snorm"); + this.GL_EXT_texture_storage = hasExtension(version, exts, list, "GL_EXT_texture_storage"); + this.GL_EXT_texture_swizzle = hasExtension(version, exts, list, "GL_EXT_texture_swizzle"); + this.GL_EXT_timer_query = hasExtension(version, exts, list, "GL_EXT_timer_query"); + this.GL_EXT_transform_feedback = hasExtension(version, exts, list, "GL_EXT_transform_feedback"); + this.GL_EXT_vertex_array = hasExtension(version, exts, list, "GL_EXT_vertex_array"); + this.GL_EXT_vertex_array_bgra = hasExtension(version, exts, list, "GL_EXT_vertex_array_bgra"); + this.GL_EXT_vertex_attrib_64bit = hasExtension(version, exts, list, "GL_EXT_vertex_attrib_64bit"); + this.GL_EXT_vertex_shader = hasExtension(version, exts, list, "GL_EXT_vertex_shader"); + this.GL_EXT_vertex_weighting = hasExtension(version, exts, list, "GL_EXT_vertex_weighting"); + this.GL_EXT_win32_keyed_mutex = hasExtension(version, exts, list, "GL_EXT_win32_keyed_mutex"); + this.GL_EXT_window_rectangles = hasExtension(version, exts, list, "GL_EXT_window_rectangles"); + this.GL_EXT_x11_sync_object = hasExtension(version, exts, list, "GL_EXT_x11_sync_object"); + this.GL_GREMEDY_frame_terminator = hasExtension(version, exts, list, "GL_GREMEDY_frame_terminator"); + this.GL_GREMEDY_string_marker = hasExtension(version, exts, list, "GL_GREMEDY_string_marker"); + this.GL_HP_convolution_border_modes = hasExtension(version, exts, list, "GL_HP_convolution_border_modes"); + this.GL_HP_image_transform = hasExtension(version, exts, list, "GL_HP_image_transform"); + this.GL_HP_occlusion_test = hasExtension(version, exts, list, "GL_HP_occlusion_test"); + this.GL_HP_texture_lighting = hasExtension(version, exts, list, "GL_HP_texture_lighting"); + this.GL_IBM_cull_vertex = hasExtension(version, exts, list, "GL_IBM_cull_vertex"); + this.GL_IBM_multimode_draw_arrays = hasExtension(version, exts, list, "GL_IBM_multimode_draw_arrays"); + this.GL_IBM_rasterpos_clip = hasExtension(version, exts, list, "GL_IBM_rasterpos_clip"); + this.GL_IBM_static_data = hasExtension(version, exts, list, "GL_IBM_static_data"); + this.GL_IBM_texture_mirrored_repeat = hasExtension(version, exts, list, "GL_IBM_texture_mirrored_repeat"); + this.GL_IBM_vertex_array_lists = hasExtension(version, exts, list, "GL_IBM_vertex_array_lists"); + this.GL_INGR_blend_func_separate = hasExtension(version, exts, list, "GL_INGR_blend_func_separate"); + this.GL_INGR_color_clamp = hasExtension(version, exts, list, "GL_INGR_color_clamp"); + this.GL_INGR_interlace_read = hasExtension(version, exts, list, "GL_INGR_interlace_read"); + this.GL_INTEL_blackhole_render = hasExtension(version, exts, list, "GL_INTEL_blackhole_render"); + this.GL_INTEL_conservative_rasterization = hasExtension(version, exts, list, "GL_INTEL_conservative_rasterization"); + this.GL_INTEL_fragment_shader_ordering = hasExtension(version, exts, list, "GL_INTEL_fragment_shader_ordering"); + this.GL_INTEL_framebuffer_CMAA = hasExtension(version, exts, list, "GL_INTEL_framebuffer_CMAA"); + this.GL_INTEL_map_texture = hasExtension(version, exts, list, "GL_INTEL_map_texture"); + this.GL_INTEL_parallel_arrays = hasExtension(version, exts, list, "GL_INTEL_parallel_arrays"); + this.GL_INTEL_performance_query = hasExtension(version, exts, list, "GL_INTEL_performance_query"); + this.GL_MESAX_texture_stack = hasExtension(version, exts, list, "GL_MESAX_texture_stack"); + this.GL_MESA_framebuffer_flip_x = hasExtension(version, exts, list, "GL_MESA_framebuffer_flip_x"); + this.GL_MESA_framebuffer_flip_y = hasExtension(version, exts, list, "GL_MESA_framebuffer_flip_y"); + this.GL_MESA_framebuffer_swap_xy = hasExtension(version, exts, list, "GL_MESA_framebuffer_swap_xy"); + this.GL_MESA_pack_invert = hasExtension(version, exts, list, "GL_MESA_pack_invert"); + this.GL_MESA_program_binary_formats = hasExtension(version, exts, list, "GL_MESA_program_binary_formats"); + this.GL_MESA_resize_buffers = hasExtension(version, exts, list, "GL_MESA_resize_buffers"); + this.GL_MESA_shader_integer_functions = hasExtension(version, exts, list, "GL_MESA_shader_integer_functions"); + this.GL_MESA_tile_raster_order = hasExtension(version, exts, list, "GL_MESA_tile_raster_order"); + this.GL_MESA_window_pos = hasExtension(version, exts, list, "GL_MESA_window_pos"); + this.GL_MESA_ycbcr_texture = hasExtension(version, exts, list, "GL_MESA_ycbcr_texture"); + this.GL_NVX_blend_equation_advanced_multi_draw_buffers = hasExtension(version, exts, list, "GL_NVX_blend_equation_advanced_multi_draw_buffers"); + this.GL_NVX_conditional_render = hasExtension(version, exts, list, "GL_NVX_conditional_render"); + this.GL_NVX_gpu_memory_info = hasExtension(version, exts, list, "GL_NVX_gpu_memory_info"); + this.GL_NVX_gpu_multicast2 = hasExtension(version, exts, list, "GL_NVX_gpu_multicast2"); + this.GL_NVX_linked_gpu_multicast = hasExtension(version, exts, list, "GL_NVX_linked_gpu_multicast"); + this.GL_NVX_progress_fence = hasExtension(version, exts, list, "GL_NVX_progress_fence"); + this.GL_NV_alpha_to_coverage_dither_control = hasExtension(version, exts, list, "GL_NV_alpha_to_coverage_dither_control"); + this.GL_NV_bindless_multi_draw_indirect = hasExtension(version, exts, list, "GL_NV_bindless_multi_draw_indirect"); + this.GL_NV_bindless_multi_draw_indirect_count = hasExtension(version, exts, list, "GL_NV_bindless_multi_draw_indirect_count"); + this.GL_NV_bindless_texture = hasExtension(version, exts, list, "GL_NV_bindless_texture"); + this.GL_NV_blend_equation_advanced = hasExtension(version, exts, list, "GL_NV_blend_equation_advanced"); + this.GL_NV_blend_equation_advanced_coherent = hasExtension(version, exts, list, "GL_NV_blend_equation_advanced_coherent"); + this.GL_NV_blend_minmax_factor = hasExtension(version, exts, list, "GL_NV_blend_minmax_factor"); + this.GL_NV_blend_square = hasExtension(version, exts, list, "GL_NV_blend_square"); + this.GL_NV_clip_space_w_scaling = hasExtension(version, exts, list, "GL_NV_clip_space_w_scaling"); + this.GL_NV_command_list = hasExtension(version, exts, list, "GL_NV_command_list"); + this.GL_NV_compute_program5 = hasExtension(version, exts, list, "GL_NV_compute_program5"); + this.GL_NV_compute_shader_derivatives = hasExtension(version, exts, list, "GL_NV_compute_shader_derivatives"); + this.GL_NV_conditional_render = hasExtension(version, exts, list, "GL_NV_conditional_render"); + this.GL_NV_conservative_raster = hasExtension(version, exts, list, "GL_NV_conservative_raster"); + this.GL_NV_conservative_raster_dilate = hasExtension(version, exts, list, "GL_NV_conservative_raster_dilate"); + this.GL_NV_conservative_raster_pre_snap = hasExtension(version, exts, list, "GL_NV_conservative_raster_pre_snap"); + this.GL_NV_conservative_raster_pre_snap_triangles = hasExtension(version, exts, list, "GL_NV_conservative_raster_pre_snap_triangles"); + this.GL_NV_conservative_raster_underestimation = hasExtension(version, exts, list, "GL_NV_conservative_raster_underestimation"); + this.GL_NV_copy_depth_to_color = hasExtension(version, exts, list, "GL_NV_copy_depth_to_color"); + this.GL_NV_copy_image = hasExtension(version, exts, list, "GL_NV_copy_image"); + this.GL_NV_deep_texture3D = hasExtension(version, exts, list, "GL_NV_deep_texture3D"); + this.GL_NV_depth_buffer_float = hasExtension(version, exts, list, "GL_NV_depth_buffer_float"); + this.GL_NV_depth_clamp = hasExtension(version, exts, list, "GL_NV_depth_clamp"); + this.GL_NV_draw_texture = hasExtension(version, exts, list, "GL_NV_draw_texture"); + this.GL_NV_draw_vulkan_image = hasExtension(version, exts, list, "GL_NV_draw_vulkan_image"); + this.GL_NV_evaluators = hasExtension(version, exts, list, "GL_NV_evaluators"); + this.GL_NV_explicit_multisample = hasExtension(version, exts, list, "GL_NV_explicit_multisample"); + this.GL_NV_fence = hasExtension(version, exts, list, "GL_NV_fence"); + this.GL_NV_fill_rectangle = hasExtension(version, exts, list, "GL_NV_fill_rectangle"); + this.GL_NV_float_buffer = hasExtension(version, exts, list, "GL_NV_float_buffer"); + this.GL_NV_fog_distance = hasExtension(version, exts, list, "GL_NV_fog_distance"); + this.GL_NV_fragment_coverage_to_color = hasExtension(version, exts, list, "GL_NV_fragment_coverage_to_color"); + this.GL_NV_fragment_program = hasExtension(version, exts, list, "GL_NV_fragment_program"); + this.GL_NV_fragment_program2 = hasExtension(version, exts, list, "GL_NV_fragment_program2"); + this.GL_NV_fragment_program4 = hasExtension(version, exts, list, "GL_NV_fragment_program4"); + this.GL_NV_fragment_program_option = hasExtension(version, exts, list, "GL_NV_fragment_program_option"); + this.GL_NV_fragment_shader_barycentric = hasExtension(version, exts, list, "GL_NV_fragment_shader_barycentric"); + this.GL_NV_fragment_shader_interlock = hasExtension(version, exts, list, "GL_NV_fragment_shader_interlock"); + this.GL_NV_framebuffer_mixed_samples = hasExtension(version, exts, list, "GL_NV_framebuffer_mixed_samples"); + this.GL_NV_framebuffer_multisample_coverage = hasExtension(version, exts, list, "GL_NV_framebuffer_multisample_coverage"); + this.GL_NV_geometry_program4 = hasExtension(version, exts, list, "GL_NV_geometry_program4"); + this.GL_NV_geometry_shader4 = hasExtension(version, exts, list, "GL_NV_geometry_shader4"); + this.GL_NV_geometry_shader_passthrough = hasExtension(version, exts, list, "GL_NV_geometry_shader_passthrough"); + this.GL_NV_gpu_multicast = hasExtension(version, exts, list, "GL_NV_gpu_multicast"); + this.GL_NV_gpu_program4 = hasExtension(version, exts, list, "GL_NV_gpu_program4"); + this.GL_NV_gpu_program5 = hasExtension(version, exts, list, "GL_NV_gpu_program5"); + this.GL_NV_gpu_program5_mem_extended = hasExtension(version, exts, list, "GL_NV_gpu_program5_mem_extended"); + this.GL_NV_gpu_shader5 = hasExtension(version, exts, list, "GL_NV_gpu_shader5"); + this.GL_NV_half_float = hasExtension(version, exts, list, "GL_NV_half_float"); + this.GL_NV_internalformat_sample_query = hasExtension(version, exts, list, "GL_NV_internalformat_sample_query"); + this.GL_NV_light_max_exponent = hasExtension(version, exts, list, "GL_NV_light_max_exponent"); + this.GL_NV_memory_attachment = hasExtension(version, exts, list, "GL_NV_memory_attachment"); + this.GL_NV_memory_object_sparse = hasExtension(version, exts, list, "GL_NV_memory_object_sparse"); + this.GL_NV_mesh_shader = hasExtension(version, exts, list, "GL_NV_mesh_shader"); + this.GL_NV_multisample_coverage = hasExtension(version, exts, list, "GL_NV_multisample_coverage"); + this.GL_NV_multisample_filter_hint = hasExtension(version, exts, list, "GL_NV_multisample_filter_hint"); + this.GL_NV_occlusion_query = hasExtension(version, exts, list, "GL_NV_occlusion_query"); + this.GL_NV_packed_depth_stencil = hasExtension(version, exts, list, "GL_NV_packed_depth_stencil"); + this.GL_NV_parameter_buffer_object = hasExtension(version, exts, list, "GL_NV_parameter_buffer_object"); + this.GL_NV_parameter_buffer_object2 = hasExtension(version, exts, list, "GL_NV_parameter_buffer_object2"); + this.GL_NV_path_rendering = hasExtension(version, exts, list, "GL_NV_path_rendering"); + this.GL_NV_path_rendering_shared_edge = hasExtension(version, exts, list, "GL_NV_path_rendering_shared_edge"); + this.GL_NV_pixel_data_range = hasExtension(version, exts, list, "GL_NV_pixel_data_range"); + this.GL_NV_point_sprite = hasExtension(version, exts, list, "GL_NV_point_sprite"); + this.GL_NV_present_video = hasExtension(version, exts, list, "GL_NV_present_video"); + this.GL_NV_primitive_restart = hasExtension(version, exts, list, "GL_NV_primitive_restart"); + this.GL_NV_primitive_shading_rate = hasExtension(version, exts, list, "GL_NV_primitive_shading_rate"); + this.GL_NV_query_resource = hasExtension(version, exts, list, "GL_NV_query_resource"); + this.GL_NV_query_resource_tag = hasExtension(version, exts, list, "GL_NV_query_resource_tag"); + this.GL_NV_register_combiners = hasExtension(version, exts, list, "GL_NV_register_combiners"); + this.GL_NV_register_combiners2 = hasExtension(version, exts, list, "GL_NV_register_combiners2"); + this.GL_NV_representative_fragment_test = hasExtension(version, exts, list, "GL_NV_representative_fragment_test"); + this.GL_NV_robustness_video_memory_purge = hasExtension(version, exts, list, "GL_NV_robustness_video_memory_purge"); + this.GL_NV_sample_locations = hasExtension(version, exts, list, "GL_NV_sample_locations"); + this.GL_NV_sample_mask_override_coverage = hasExtension(version, exts, list, "GL_NV_sample_mask_override_coverage"); + this.GL_NV_scissor_exclusive = hasExtension(version, exts, list, "GL_NV_scissor_exclusive"); + this.GL_NV_shader_atomic_counters = hasExtension(version, exts, list, "GL_NV_shader_atomic_counters"); + this.GL_NV_shader_atomic_float = hasExtension(version, exts, list, "GL_NV_shader_atomic_float"); + this.GL_NV_shader_atomic_float64 = hasExtension(version, exts, list, "GL_NV_shader_atomic_float64"); + this.GL_NV_shader_atomic_fp16_vector = hasExtension(version, exts, list, "GL_NV_shader_atomic_fp16_vector"); + this.GL_NV_shader_atomic_int64 = hasExtension(version, exts, list, "GL_NV_shader_atomic_int64"); + this.GL_NV_shader_buffer_load = hasExtension(version, exts, list, "GL_NV_shader_buffer_load"); + this.GL_NV_shader_buffer_store = hasExtension(version, exts, list, "GL_NV_shader_buffer_store"); + this.GL_NV_shader_storage_buffer_object = hasExtension(version, exts, list, "GL_NV_shader_storage_buffer_object"); + this.GL_NV_shader_subgroup_partitioned = hasExtension(version, exts, list, "GL_NV_shader_subgroup_partitioned"); + this.GL_NV_shader_texture_footprint = hasExtension(version, exts, list, "GL_NV_shader_texture_footprint"); + this.GL_NV_shader_thread_group = hasExtension(version, exts, list, "GL_NV_shader_thread_group"); + this.GL_NV_shader_thread_shuffle = hasExtension(version, exts, list, "GL_NV_shader_thread_shuffle"); + this.GL_NV_shading_rate_image = hasExtension(version, exts, list, "GL_NV_shading_rate_image"); + this.GL_NV_stereo_view_rendering = hasExtension(version, exts, list, "GL_NV_stereo_view_rendering"); + this.GL_NV_tessellation_program5 = hasExtension(version, exts, list, "GL_NV_tessellation_program5"); + this.GL_NV_texgen_emboss = hasExtension(version, exts, list, "GL_NV_texgen_emboss"); + this.GL_NV_texgen_reflection = hasExtension(version, exts, list, "GL_NV_texgen_reflection"); + this.GL_NV_texture_barrier = hasExtension(version, exts, list, "GL_NV_texture_barrier"); + this.GL_NV_texture_compression_vtc = hasExtension(version, exts, list, "GL_NV_texture_compression_vtc"); + this.GL_NV_texture_env_combine4 = hasExtension(version, exts, list, "GL_NV_texture_env_combine4"); + this.GL_NV_texture_expand_normal = hasExtension(version, exts, list, "GL_NV_texture_expand_normal"); + this.GL_NV_texture_multisample = hasExtension(version, exts, list, "GL_NV_texture_multisample"); + this.GL_NV_texture_rectangle = hasExtension(version, exts, list, "GL_NV_texture_rectangle"); + this.GL_NV_texture_rectangle_compressed = hasExtension(version, exts, list, "GL_NV_texture_rectangle_compressed"); + this.GL_NV_texture_shader = hasExtension(version, exts, list, "GL_NV_texture_shader"); + this.GL_NV_texture_shader2 = hasExtension(version, exts, list, "GL_NV_texture_shader2"); + this.GL_NV_texture_shader3 = hasExtension(version, exts, list, "GL_NV_texture_shader3"); + this.GL_NV_timeline_semaphore = hasExtension(version, exts, list, "GL_NV_timeline_semaphore"); + this.GL_NV_transform_feedback = hasExtension(version, exts, list, "GL_NV_transform_feedback"); + this.GL_NV_transform_feedback2 = hasExtension(version, exts, list, "GL_NV_transform_feedback2"); + this.GL_NV_uniform_buffer_std430_layout = hasExtension(version, exts, list, "GL_NV_uniform_buffer_std430_layout"); + this.GL_NV_uniform_buffer_unified_memory = hasExtension(version, exts, list, "GL_NV_uniform_buffer_unified_memory"); + this.GL_NV_vdpau_interop = hasExtension(version, exts, list, "GL_NV_vdpau_interop"); + this.GL_NV_vdpau_interop2 = hasExtension(version, exts, list, "GL_NV_vdpau_interop2"); + this.GL_NV_vertex_array_range = hasExtension(version, exts, list, "GL_NV_vertex_array_range"); + this.GL_NV_vertex_array_range2 = hasExtension(version, exts, list, "GL_NV_vertex_array_range2"); + this.GL_NV_vertex_attrib_integer_64bit = hasExtension(version, exts, list, "GL_NV_vertex_attrib_integer_64bit"); + this.GL_NV_vertex_buffer_unified_memory = hasExtension(version, exts, list, "GL_NV_vertex_buffer_unified_memory"); + this.GL_NV_vertex_program = hasExtension(version, exts, list, "GL_NV_vertex_program"); + this.GL_NV_vertex_program1_1 = hasExtension(version, exts, list, "GL_NV_vertex_program1_1"); + this.GL_NV_vertex_program2 = hasExtension(version, exts, list, "GL_NV_vertex_program2"); + this.GL_NV_vertex_program2_option = hasExtension(version, exts, list, "GL_NV_vertex_program2_option"); + this.GL_NV_vertex_program3 = hasExtension(version, exts, list, "GL_NV_vertex_program3"); + this.GL_NV_vertex_program4 = hasExtension(version, exts, list, "GL_NV_vertex_program4"); + this.GL_NV_video_capture = hasExtension(version, exts, list, "GL_NV_video_capture"); + this.GL_NV_viewport_array2 = hasExtension(version, exts, list, "GL_NV_viewport_array2"); + this.GL_NV_viewport_swizzle = hasExtension(version, exts, list, "GL_NV_viewport_swizzle"); + this.GL_OML_interlace = hasExtension(version, exts, list, "GL_OML_interlace"); + this.GL_OML_resample = hasExtension(version, exts, list, "GL_OML_resample"); + this.GL_OML_subsample = hasExtension(version, exts, list, "GL_OML_subsample"); + this.GL_OVR_multiview = hasExtension(version, exts, list, "GL_OVR_multiview"); + this.GL_OVR_multiview2 = hasExtension(version, exts, list, "GL_OVR_multiview2"); + this.GL_PGI_misc_hints = hasExtension(version, exts, list, "GL_PGI_misc_hints"); + this.GL_PGI_vertex_hints = hasExtension(version, exts, list, "GL_PGI_vertex_hints"); + this.GL_REND_screen_coordinates = hasExtension(version, exts, list, "GL_REND_screen_coordinates"); + this.GL_S3_s3tc = hasExtension(version, exts, list, "GL_S3_s3tc"); + this.GL_SGIS_detail_texture = hasExtension(version, exts, list, "GL_SGIS_detail_texture"); + this.GL_SGIS_fog_function = hasExtension(version, exts, list, "GL_SGIS_fog_function"); + this.GL_SGIS_generate_mipmap = hasExtension(version, exts, list, "GL_SGIS_generate_mipmap"); + this.GL_SGIS_multisample = hasExtension(version, exts, list, "GL_SGIS_multisample"); + this.GL_SGIS_pixel_texture = hasExtension(version, exts, list, "GL_SGIS_pixel_texture"); + this.GL_SGIS_point_line_texgen = hasExtension(version, exts, list, "GL_SGIS_point_line_texgen"); + this.GL_SGIS_point_parameters = hasExtension(version, exts, list, "GL_SGIS_point_parameters"); + this.GL_SGIS_sharpen_texture = hasExtension(version, exts, list, "GL_SGIS_sharpen_texture"); + this.GL_SGIS_texture4D = hasExtension(version, exts, list, "GL_SGIS_texture4D"); + this.GL_SGIS_texture_border_clamp = hasExtension(version, exts, list, "GL_SGIS_texture_border_clamp"); + this.GL_SGIS_texture_color_mask = hasExtension(version, exts, list, "GL_SGIS_texture_color_mask"); + this.GL_SGIS_texture_edge_clamp = hasExtension(version, exts, list, "GL_SGIS_texture_edge_clamp"); + this.GL_SGIS_texture_filter4 = hasExtension(version, exts, list, "GL_SGIS_texture_filter4"); + this.GL_SGIS_texture_lod = hasExtension(version, exts, list, "GL_SGIS_texture_lod"); + this.GL_SGIS_texture_select = hasExtension(version, exts, list, "GL_SGIS_texture_select"); + this.GL_SGIX_async = hasExtension(version, exts, list, "GL_SGIX_async"); + this.GL_SGIX_async_histogram = hasExtension(version, exts, list, "GL_SGIX_async_histogram"); + this.GL_SGIX_async_pixel = hasExtension(version, exts, list, "GL_SGIX_async_pixel"); + this.GL_SGIX_blend_alpha_minmax = hasExtension(version, exts, list, "GL_SGIX_blend_alpha_minmax"); + this.GL_SGIX_calligraphic_fragment = hasExtension(version, exts, list, "GL_SGIX_calligraphic_fragment"); + this.GL_SGIX_clipmap = hasExtension(version, exts, list, "GL_SGIX_clipmap"); + this.GL_SGIX_convolution_accuracy = hasExtension(version, exts, list, "GL_SGIX_convolution_accuracy"); + this.GL_SGIX_depth_pass_instrument = hasExtension(version, exts, list, "GL_SGIX_depth_pass_instrument"); + this.GL_SGIX_depth_texture = hasExtension(version, exts, list, "GL_SGIX_depth_texture"); + this.GL_SGIX_flush_raster = hasExtension(version, exts, list, "GL_SGIX_flush_raster"); + this.GL_SGIX_fog_offset = hasExtension(version, exts, list, "GL_SGIX_fog_offset"); + this.GL_SGIX_fragment_lighting = hasExtension(version, exts, list, "GL_SGIX_fragment_lighting"); + this.GL_SGIX_framezoom = hasExtension(version, exts, list, "GL_SGIX_framezoom"); + this.GL_SGIX_igloo_interface = hasExtension(version, exts, list, "GL_SGIX_igloo_interface"); + this.GL_SGIX_instruments = hasExtension(version, exts, list, "GL_SGIX_instruments"); + this.GL_SGIX_interlace = hasExtension(version, exts, list, "GL_SGIX_interlace"); + this.GL_SGIX_ir_instrument1 = hasExtension(version, exts, list, "GL_SGIX_ir_instrument1"); + this.GL_SGIX_list_priority = hasExtension(version, exts, list, "GL_SGIX_list_priority"); + this.GL_SGIX_pixel_texture = hasExtension(version, exts, list, "GL_SGIX_pixel_texture"); + this.GL_SGIX_pixel_tiles = hasExtension(version, exts, list, "GL_SGIX_pixel_tiles"); + this.GL_SGIX_polynomial_ffd = hasExtension(version, exts, list, "GL_SGIX_polynomial_ffd"); + this.GL_SGIX_reference_plane = hasExtension(version, exts, list, "GL_SGIX_reference_plane"); + this.GL_SGIX_resample = hasExtension(version, exts, list, "GL_SGIX_resample"); + this.GL_SGIX_scalebias_hint = hasExtension(version, exts, list, "GL_SGIX_scalebias_hint"); + this.GL_SGIX_shadow = hasExtension(version, exts, list, "GL_SGIX_shadow"); + this.GL_SGIX_shadow_ambient = hasExtension(version, exts, list, "GL_SGIX_shadow_ambient"); + this.GL_SGIX_sprite = hasExtension(version, exts, list, "GL_SGIX_sprite"); + this.GL_SGIX_subsample = hasExtension(version, exts, list, "GL_SGIX_subsample"); + this.GL_SGIX_tag_sample_buffer = hasExtension(version, exts, list, "GL_SGIX_tag_sample_buffer"); + this.GL_SGIX_texture_add_env = hasExtension(version, exts, list, "GL_SGIX_texture_add_env"); + this.GL_SGIX_texture_coordinate_clamp = hasExtension(version, exts, list, "GL_SGIX_texture_coordinate_clamp"); + this.GL_SGIX_texture_lod_bias = hasExtension(version, exts, list, "GL_SGIX_texture_lod_bias"); + this.GL_SGIX_texture_multi_buffer = hasExtension(version, exts, list, "GL_SGIX_texture_multi_buffer"); + this.GL_SGIX_texture_scale_bias = hasExtension(version, exts, list, "GL_SGIX_texture_scale_bias"); + this.GL_SGIX_vertex_preclip = hasExtension(version, exts, list, "GL_SGIX_vertex_preclip"); + this.GL_SGIX_ycrcb = hasExtension(version, exts, list, "GL_SGIX_ycrcb"); + this.GL_SGIX_ycrcb_subsample = hasExtension(version, exts, list, "GL_SGIX_ycrcb_subsample"); + this.GL_SGIX_ycrcba = hasExtension(version, exts, list, "GL_SGIX_ycrcba"); + this.GL_SGI_color_matrix = hasExtension(version, exts, list, "GL_SGI_color_matrix"); + this.GL_SGI_color_table = hasExtension(version, exts, list, "GL_SGI_color_table"); + this.GL_SGI_texture_color_table = hasExtension(version, exts, list, "GL_SGI_texture_color_table"); + this.GL_SUNX_constant_data = hasExtension(version, exts, list, "GL_SUNX_constant_data"); + this.GL_SUN_convolution_border_modes = hasExtension(version, exts, list, "GL_SUN_convolution_border_modes"); + this.GL_SUN_global_alpha = hasExtension(version, exts, list, "GL_SUN_global_alpha"); + this.GL_SUN_mesh_array = hasExtension(version, exts, list, "GL_SUN_mesh_array"); + this.GL_SUN_slice_accum = hasExtension(version, exts, list, "GL_SUN_slice_accum"); + this.GL_SUN_triangle_list = hasExtension(version, exts, list, "GL_SUN_triangle_list"); + this.GL_SUN_vertex = hasExtension(version, exts, list, "GL_SUN_vertex"); + this.GL_WIN_phong_shading = hasExtension(version, exts, list, "GL_WIN_phong_shading"); + this.GL_WIN_specular_fog = hasExtension(version, exts, list, "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 index 7a66c34e..70f7bbcb 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLExtFinder.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLExtFinder.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,10 +16,14 @@ package overrungl.opengl; -import overrungl.internal.RuntimeHelper; +import overrun.marshal.Unmarshal; +import overrungl.NativeType; +import java.lang.foreign.FunctionDescriptor; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; +import java.lang.invoke.MethodHandle; +import java.util.List; import static java.lang.foreign.ValueLayout.ADDRESS; import static java.lang.foreign.ValueLayout.JAVA_INT; @@ -33,50 +37,64 @@ final class GLExtFinder { static boolean getExtensions(SegmentAllocator allocator, int version, - MemorySegment outExts, - MemorySegment outNumExtsI, - MemorySegment[] outExtsI, - GLCapabilities caps) { + @NativeType("const char**") MemorySegment outExts, + List outExtsI, + GLLoadFunc load) { + // < 3.0 if (GLLoader.versionMajor(version) < 3) { - if (caps.glGetString == null) { + final MethodHandle glGetString = load.invoke("glGetString", FunctionDescriptor.of(ADDRESS, JAVA_INT)); + if (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; + try { + outExts.set(ADDRESS, 0, (MemorySegment) glGetString.invokeExact(GL.EXTENSIONS)); + return true; + } catch (Throwable e) { + throw new RuntimeException(e); } - for (int index = 0; index < numExtsI; index++) { - var glStrTmp = GL30C.getStringi(GL10C.EXTENSIONS, index); - extsI.setAtIndex(ADDRESS, index, allocator.allocateFrom(glStrTmp)); + } + + // 3.0 + // method handles + final MethodHandle glGetStringi = load.invoke("glGetStringi", FunctionDescriptor.of(Unmarshal.STR_LAYOUT, JAVA_INT, JAVA_INT)); + if (glGetStringi == null) { + return false; + } + final MethodHandle glGetIntegerv = load.invoke("glGetIntegerv", FunctionDescriptor.ofVoid(JAVA_INT, ADDRESS)); + if (glGetIntegerv == null) { + return false; + } + + // extension count + final MemorySegment pNumExtsI = allocator.allocate(JAVA_INT); + try { + glGetIntegerv.invokeExact(GL.NUM_EXTENSIONS, pNumExtsI); + } catch (Throwable e) { + throw new RuntimeException(e); + } + int numExtsI = pNumExtsI.get(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); } - outNumExtsI.set(JAVA_INT, 0, numExtsI); - outExtsI[0] = extsI; + outExtsI.add(glStrTmp.getString(0L)); } return true; } - static boolean hasExtension(int version, String exts, int numExtsI, MemorySegment extsI, String ext) { + static boolean hasExtension(int version, String exts, List 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 exts != null && ext != null && exts.contains(ext); } - return false; + return extsI.contains(ext); } } 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 0702b585..309518b1 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 @@ -17,13 +17,15 @@ package overrungl.opengl; import org.jetbrains.annotations.Nullable; -import overrungl.FunctionDescriptors; +import overrun.marshal.Unmarshal; import overrungl.internal.RuntimeHelper; import java.lang.foreign.FunctionDescriptor; import java.lang.foreign.Linker; import java.lang.foreign.MemorySegment; +import java.lang.foreign.SymbolLookup; import java.lang.invoke.MethodHandle; +import java.util.Optional; /** * The OpenGL loading function. @@ -48,16 +50,13 @@ 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} + * {@return a symbol lookup of this} */ - @Nullable - default MethodHandle invoke(String procName, FunctionDescriptor 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); + }; } /** @@ -69,7 +68,7 @@ default MethodHandle invoke(String procName, FunctionDescriptor function, Linker * @return a downcall method handle, or {@code null} if the symbol is {@link MemorySegment#NULL} */ @Nullable - default MethodHandle invoke(String procName, FunctionDescriptors function, Linker.Option... options) { + default MethodHandle invoke(String procName, FunctionDescriptor function, Linker.Option... options) { return RuntimeHelper.downcallSafe(invoke(procName), function, options); } } 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 f1d78627..3cca9917 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLLoader.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLLoader.java @@ -19,6 +19,7 @@ import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import overrun.marshal.Downcall; import overrungl.internal.RuntimeHelper; import overrungl.util.CheckUtil; @@ -118,7 +119,7 @@ private static GLCapabilities checkCapabilities(@Nullable GLCapabilities caps) { * @return the OpenGL capabilities, or {@code null} if no OpenGL context found. */ @Nullable - public static GLCapabilities load(GLLoadFunc load) { + public static GL load(GLLoadFunc load) { return load(load, DEFAULT_COMPATIBLE); } @@ -130,12 +131,14 @@ public static GLCapabilities load(GLLoadFunc load) { * @return the OpenGL capabilities, or {@code null} if no OpenGL context found. */ @Nullable - public static GLCapabilities load(GLLoadFunc load, boolean forwardCompatible) { + public static GL load(GLLoadFunc load, boolean forwardCompatible) { var caps = new GLCapabilities(forwardCompatible); // set the global capabilities first setCapabilities(caps); if (caps.load(load) != 0) { - return caps; + return forwardCompatible ? + Downcall.load(GL.class, load.lookup()) : + Downcall.load(GLLegacy.class, load.lookup()); } // reset if failed to load setCapabilities(null); @@ -157,15 +160,6 @@ public static MethodHandle check(@Nullable MethodHandle handle) throws IllegalSt return handle; } - static boolean checkAll(MethodHandle... handles) { - for (var handle : handles) { - if (handle == null) { - return false; - } - } - return true; - } - /** * Pack the version into an integer. * 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..f6788def 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 @@ -43,29 +43,30 @@ 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. * @return the arena. */ @Nullable - public static Arena setupDebugMessageCallback() { - return setupDebugMessageCallback(OverrunGL.apiLogger()); + public static Arena setupDebugMessageCallback(GL gl) { + return setupDebugMessageCallback(gl, 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 logger the output logger. * @return the arena. */ @Nullable - public static Arena setupDebugMessageCallback(Consumer logger) { + public static Arena setupDebugMessageCallback(GL gl, Consumer logger) { var caps = GLLoader.getCapabilities(); if (caps.Ver43 || caps.ext().GL_KHR_debug) { @@ -75,25 +76,25 @@ public static Arena setupDebugMessageCallback(Consumer logger) { 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) { + (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; } @@ -101,17 +102,17 @@ public static Arena setupDebugMessageCallback(Consumer logger) { if (caps.ext().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) -> { + 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); @@ -121,16 +122,16 @@ public static Arena setupDebugMessageCallback(Consumer logger) { if (caps.ext().GL_AMD_debug_output) { apiLog("[GL] Using AMD_debug_output for error logging."); var arena = Arena.ofConfined(); - glDebugMessageCallbackAMD(arena, (id, category, severity, message, userParam) -> { + 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 +143,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/samples/src/test/java/overrungl/demo/glfw/GLFWWindowIconTest.java b/modules/samples/src/test/java/overrungl/demo/glfw/GLFWWindowIconTest.java index e100b196..e5739ba7 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,15 @@ private void init(Arena arena) { } private void load() { - Objects.requireNonNull(GLLoader.load(glfw::getProcAddress), "Failed to load OpenGL"); + gl = GLLoader.load(glfw::getProcAddress); + Objects.requireNonNull(gl, "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/opengl/GL10Test.java b/modules/samples/src/test/java/overrungl/demo/opengl/GL10Test.java index 3fbdf3cb..1d24f492 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,25 @@ private void init() { } private void load() { - Objects.requireNonNull(GLLoader.load(glfw::getProcAddress, false), "Failed to load OpenGL"); + gl = (GLLegacy) GLLoader.load(glfw::getProcAddress, false); + Objects.requireNonNull(gl, "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 15b6a6dc..f3e9d666 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,26 @@ private void init() { } private void load(Arena arena) { - Objects.requireNonNull(GLLoader.load(glfw::getProcAddress, false), "Failed to load OpenGL"); + gl = (GLLegacy) GLLoader.load(glfw::getProcAddress, false); + Objects.requireNonNull(gl, "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 +124,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 +137,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 9e08d070..076b3952 100644 --- a/modules/samples/src/test/java/overrungl/demo/opengl/GL30Test.java +++ b/modules/samples/src/test/java/overrungl/demo/opengl/GL30Test.java @@ -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,15 @@ private void init() { } private void load(Arena arena) { - Objects.requireNonNull(GLLoader.load(glfw::getProcAddress), "Failed to load OpenGL"); + gl = GLLoader.load(glfw::getProcAddress); + Objects.requireNonNull(gl, "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 +117,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 +130,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 +147,7 @@ void main() { texCoord = uv; } """); - GL.shaderSource(fsh, """ + gl.shaderSource(fsh, """ #version 130 in vec2 texCoord; @@ -160,60 +161,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 aab27efd..dc6c0c6e 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,13 @@ 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.GLLoader; import overrungl.opengl.GLUtil; -import overrungl.util.MemoryStack; import overrungl.util.CheckUtil; import java.lang.foreign.Arena; @@ -45,6 +44,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 +61,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); @@ -93,7 +90,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 +108,15 @@ private void init() { } private void load(Arena arena) { - Objects.requireNonNull(GLLoader.load(glfw::getProcAddress), "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, """ + gl = GLLoader.load(glfw::getProcAddress); + Objects.requireNonNull(gl, "Failed to load OpenGL"); + + debugProc = GLUtil.setupDebugMessageCallback(gl); + 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 +132,7 @@ void main() { vertexColor = color; } """); - GL.shaderSource(fsh, """ + gl.shaderSource(fsh, """ #version 330 in vec3 vertexColor; @@ -145,39 +143,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 +200,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 +227,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);