JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
EGLProcAddressTable.java
Go to the documentation of this file.
1/* !---- DO NOT EDIT: This file autogenerated by com/jogamp/gluegen/opengl/GLEmitter.java on Sat Jul 12 19:19:37 CEST 2025 ----! */
2/* !---- Java-Unit: [pkg com.jogamp.opengl.egl, cls EGLProcAddressTable], ../build/jogl/gensrc/classes/com/jogamp/opengl/egl/EGLProcAddressTable.java ----! */
3
4package com.jogamp.opengl.egl;
5
6import java.util.*;
7import com.jogamp.opengl.*;
8import com.jogamp.opengl.fixedfunc.*;
9import jogamp.opengl.*;
10import com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver;
11import com.jogamp.gluegen.runtime.ProcAddressTable;
12import com.jogamp.common.util.SecurityUtil;
13
14/**
15 * This table is a cache of pointers to the dynamically-linkable C library.
16 * @see ProcAddressTable
17 */
18/* pp */ final class EGLProcAddressTable extends ProcAddressTable {
19
20
21 public EGLProcAddressTable(){ super(); }
22
23 public EGLProcAddressTable(com.jogamp.gluegen.runtime.FunctionAddressResolver resolver){ super(resolver); }
24
25 /* pp */ long _addressof_eglChooseConfig;
26 /* pp */ long _addressof_eglCopyBuffers;
27 /* pp */ long _addressof_eglCreateContext;
28 /* pp */ long _addressof_eglCreatePbufferSurface;
29 /* pp */ long _addressof_eglCreatePixmapSurface;
30 /* pp */ long _addressof_eglCreateWindowSurface;
31 /* pp */ long _addressof_eglDestroyContext;
32 /* pp */ long _addressof_eglDestroySurface;
33 /* pp */ long _addressof_eglGetConfigAttrib;
34 /* pp */ long _addressof_eglGetConfigs;
35 /* pp */ long _addressof_eglGetCurrentDisplay;
36 /* pp */ long _addressof_eglGetCurrentSurface;
37 /* pp */ long _addressof_eglGetDisplay;
38 /* pp */ long _addressof_eglGetError;
39 /* pp */ long _addressof_eglInitialize;
40 /* pp */ long _addressof_eglMakeCurrent;
41 /* pp */ long _addressof_eglQueryContext;
42 /* pp */ long _addressof_eglQueryString;
43 /* pp */ long _addressof_eglQuerySurface;
44 /* pp */ long _addressof_eglSwapBuffers;
45 /* pp */ long _addressof_eglTerminate;
46 /* pp */ long _addressof_eglWaitGL;
47 /* pp */ long _addressof_eglWaitNative;
48 /* pp */ long _addressof_eglBindTexImage;
49 /* pp */ long _addressof_eglReleaseTexImage;
50 /* pp */ long _addressof_eglSurfaceAttrib;
51 /* pp */ long _addressof_eglSwapInterval;
52 /* pp */ long _addressof_eglBindAPI;
53 /* pp */ long _addressof_eglQueryAPI;
54 /* pp */ long _addressof_eglCreatePbufferFromClientBuffer;
55 /* pp */ long _addressof_eglReleaseThread;
56 /* pp */ long _addressof_eglWaitClient;
57 /* pp */ long _addressof_eglGetCurrentContext;
58 /* pp */ long _addressof_eglCreateSync;
59 /* pp */ long _addressof_eglDestroySync;
60 /* pp */ long _addressof_eglClientWaitSync;
61 /* pp */ long _addressof_eglGetSyncAttrib;
62 /* pp */ long _addressof_eglCreateImage;
63 /* pp */ long _addressof_eglDestroyImage;
64 /* pp */ long _addressof_eglGetPlatformDisplay;
65 /* pp */ long _addressof_eglCreatePlatformWindowSurface;
66 /* pp */ long _addressof_eglCreatePlatformPixmapSurface;
67 /* pp */ long _addressof_eglWaitSync;
68 @Override
69 protected boolean isFunctionAvailableImpl(String functionNameUsr) throws IllegalArgumentException {
70 final String functionNameBase = com.jogamp.gluegen.runtime.opengl.GLNameResolver.normalizeVEN(com.jogamp.gluegen.runtime.opengl.GLNameResolver.normalizeARB(functionNameUsr, true), true);
71 final String addressFieldNameBase = "_addressof_" + functionNameBase;
72 final int funcNamePermNum = com.jogamp.gluegen.runtime.opengl.GLNameResolver.getFuncNamePermutationNumber(functionNameBase);
73 final java.lang.reflect.Field addressField = com.jogamp.common.util.SecurityUtil.doPrivileged(new java.security.PrivilegedAction<java.lang.reflect.Field>() {
74 public final java.lang.reflect.Field run() {
75 java.lang.reflect.Field addressField = null;
76 for(int i = 0; i < funcNamePermNum; i++) {
77 final String addressFieldName = com.jogamp.gluegen.runtime.opengl.GLNameResolver.getFuncNamePermutation(addressFieldNameBase, i);
78 try {
79 addressField = EGLProcAddressTable.class.getDeclaredField( addressFieldName );
80 addressField.setAccessible(true); // we need to read the protected value!
81 return addressField;
82 } catch (NoSuchFieldException ex) { }
83 }
84 return null;
85 } } );
86
87 if(null==addressField) {
88 // The user is calling a bogus function or one which is not
89 // runtime linked
90 throw new RuntimeException(
91 "WARNING: Address field query failed for \"" + functionNameBase + "\"/\"" + functionNameUsr +
92 "\"; it's either statically linked or address field is not a known " +
93 "function");
94 }
95 try {
96 return 0 != addressField.getLong(this);
97 } catch (Exception e) {
98 throw new RuntimeException(
99 "WARNING: Address query failed for \"" + functionNameBase + "\"/\"" + functionNameUsr +
100 "\"; it's either statically linked or is not a known " +
101 "function", e);
102 }
103 }
104 @Override
105 public long getAddressFor(String functionNameUsr) throws SecurityException, IllegalArgumentException {
106 SecurityUtil.checkAllLinkPermission();
107 final String functionNameBase = com.jogamp.gluegen.runtime.opengl.GLNameResolver.normalizeVEN(com.jogamp.gluegen.runtime.opengl.GLNameResolver.normalizeARB(functionNameUsr, true), true);
108 final String addressFieldNameBase = "_addressof_" + functionNameBase;
109 final int funcNamePermNum = com.jogamp.gluegen.runtime.opengl.GLNameResolver.getFuncNamePermutationNumber(functionNameBase);
110 final java.lang.reflect.Field addressField = com.jogamp.common.util.SecurityUtil.doPrivileged(new java.security.PrivilegedAction<java.lang.reflect.Field>() {
111 public final java.lang.reflect.Field run() {
112 java.lang.reflect.Field addressField = null;
113 for(int i = 0; i < funcNamePermNum; i++) {
114 final String addressFieldName = com.jogamp.gluegen.runtime.opengl.GLNameResolver.getFuncNamePermutation(addressFieldNameBase, i);
115 try {
116 addressField = EGLProcAddressTable.class.getDeclaredField( addressFieldName );
117 addressField.setAccessible(true); // we need to read the protected value!
118 return addressField;
119 } catch (NoSuchFieldException ex) { }
120 }
121 return null;
122 } } );
123
124 if(null==addressField) {
125 // The user is calling a bogus function or one which is not
126 // runtime linked
127 throw new RuntimeException(
128 "WARNING: Address field query failed for \"" + functionNameBase + "\"/\"" + functionNameUsr +
129 "\"; it's either statically linked or address field is not a known " +
130 "function");
131 }
132 try {
133 return addressField.getLong(this);
134 } catch (Exception e) {
135 throw new RuntimeException(
136 "WARNING: Address query failed for \"" + functionNameBase + "\"/\"" + functionNameUsr +
137 "\"; it's either statically linked or is not a known " +
138 "function", e);
139 }
140 }
141} // end of class EGLProcAddressTable