4package com.jogamp.opengl.egl;
7import com.jogamp.opengl.*;
8import com.jogamp.opengl.fixedfunc.*;
10import com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver;
11import com.jogamp.gluegen.runtime.ProcAddressTable;
12import com.jogamp.common.util.SecurityUtil;
18 final class EGLProcAddressTable
extends ProcAddressTable {
21 public EGLProcAddressTable(){ super(); }
23 public EGLProcAddressTable(com.jogamp.gluegen.runtime.FunctionAddressResolver resolver){ super(resolver); }
25 long _addressof_eglChooseConfig;
26 long _addressof_eglCopyBuffers;
27 long _addressof_eglCreateContext;
28 long _addressof_eglCreatePbufferSurface;
29 long _addressof_eglCreatePixmapSurface;
30 long _addressof_eglCreateWindowSurface;
31 long _addressof_eglDestroyContext;
32 long _addressof_eglDestroySurface;
33 long _addressof_eglGetConfigAttrib;
34 long _addressof_eglGetConfigs;
35 long _addressof_eglGetCurrentDisplay;
36 long _addressof_eglGetCurrentSurface;
37 long _addressof_eglGetDisplay;
38 long _addressof_eglGetError;
39 long _addressof_eglInitialize;
40 long _addressof_eglMakeCurrent;
41 long _addressof_eglQueryContext;
42 long _addressof_eglQueryString;
43 long _addressof_eglQuerySurface;
44 long _addressof_eglSwapBuffers;
45 long _addressof_eglTerminate;
46 long _addressof_eglWaitGL;
47 long _addressof_eglWaitNative;
48 long _addressof_eglBindTexImage;
49 long _addressof_eglReleaseTexImage;
50 long _addressof_eglSurfaceAttrib;
51 long _addressof_eglSwapInterval;
52 long _addressof_eglBindAPI;
53 long _addressof_eglQueryAPI;
54 long _addressof_eglCreatePbufferFromClientBuffer;
55 long _addressof_eglReleaseThread;
56 long _addressof_eglWaitClient;
57 long _addressof_eglGetCurrentContext;
58 long _addressof_eglCreateSync;
59 long _addressof_eglDestroySync;
60 long _addressof_eglClientWaitSync;
61 long _addressof_eglGetSyncAttrib;
62 long _addressof_eglCreateImage;
63 long _addressof_eglDestroyImage;
64 long _addressof_eglGetPlatformDisplay;
65 long _addressof_eglCreatePlatformWindowSurface;
66 long _addressof_eglCreatePlatformPixmapSurface;
67 long _addressof_eglWaitSync;
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);
79 addressField = EGLProcAddressTable.class.getDeclaredField( addressFieldName );
80 addressField.setAccessible(true);
82 } catch (NoSuchFieldException ex) { }
87 if(
null==addressField) {
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 " +
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 " +
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);
116 addressField = EGLProcAddressTable.class.getDeclaredField( addressFieldName );
117 addressField.setAccessible(true);
119 } catch (NoSuchFieldException ex) { }
124 if(
null==addressField) {
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 " +
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 " +