aboutsummaryrefslogtreecommitdiffstats
path: root/make/gl-impl-CustomJavaCode-gl2_es2.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2008-07-18 12:24:17 +0000
committerSven Gothel <[email protected]>2008-07-18 12:24:17 +0000
commite1c716511d4c36b3a6ae82eceeb74147a3001dfe (patch)
tree4357912fc5ee44428476ada1d16d5f265363a1b2 /make/gl-impl-CustomJavaCode-gl2_es2.java
parentdb5aca42f5678f4f44750e8297464ca7bbbbc944 (diff)
- Using new config feature: 'IgnoreExtendedInterfaceSymbols <java class source file>'
and get rid of manual 'Ignore' configs for common stuff in the base interfaces. - Add: GLUnsupportedException: - Using new config feature 'UnsupportedExceptionType GLUnsupportedException' - GLUnsupportedException is used for anything 'UnsupportedOperationException' - GLU: - GLU itself is no more abstract - GLU contains the tesselator implementation - name, return type, modifiers and arguments - createGLU(..) - operated by profile name now. - GLU itself will be used for GLES2 - Cleanup: - gluegen/GL configs .. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1725 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'make/gl-impl-CustomJavaCode-gl2_es2.java')
-rw-r--r--make/gl-impl-CustomJavaCode-gl2_es2.java74
1 files changed, 74 insertions, 0 deletions
diff --git a/make/gl-impl-CustomJavaCode-gl2_es2.java b/make/gl-impl-CustomJavaCode-gl2_es2.java
new file mode 100644
index 000000000..dcc86eb20
--- /dev/null
+++ b/make/gl-impl-CustomJavaCode-gl2_es2.java
@@ -0,0 +1,74 @@
+
+
+ public void glShaderSource(int shader, java.lang.String[] source)
+ {
+ int count = (null!=source)?source.length:0;
+ if(count<=0) {
+ throw new GLException("Method \"glShaderSource\" called with invalid length of source: "+count);
+ }
+ int[] length = new int[count];
+ for(int i=0; i<count; i++) {
+ length[i]=source[i].length();
+ }
+ glShaderSource(shader, count, source, length, 0);
+ }
+
+ public void glShaderSource(IntBuffer shaders, java.lang.String[][] sources)
+ {
+ int sourceNum = (null!=sources)?sources.length:0;
+ int shaderNum = (null!=shaders)?shaders.limit():0;
+ if(shaderNum<=0 || sourceNum<=0 || shaderNum!=sourceNum) {
+ throw new GLException("Method \"glShaderSource\" called with invalid number of shaders and/or sources: shaders="+
+ shaderNum+", sources="+sourceNum);
+ }
+ for(int i=0; i<sourceNum; i++) {
+ glShaderSource(shaders.get(i), sources[i]);
+ }
+ }
+
+ public void glShaderBinary(IntBuffer shaders, int binFormat, java.nio.Buffer bin)
+ {
+ int shaderNum = shaders.limit();
+ if(shaderNum<=0) {
+ throw new GLException("Method \"glShaderBinary\" called with shaders number <= 0");
+ }
+ if(null==bin) {
+ throw new GLException("Method \"glShaderBinary\" without binary (null)");
+ }
+ int binLength = bin.limit();
+ if(0>=binLength) {
+ throw new GLException("Method \"glShaderBinary\" without binary (limit == 0)");
+ }
+ try {
+ glShaderBinary(shaderNum, shaders, binFormat, bin, binLength);
+ } catch (Exception e) { }
+ }
+
+ /**
+ * Wrapper for glShaderBinary and glShaderSource.
+ * Tries binary first, if not null, then the source code, if not null.
+ * The binary trial will fail in case no binary interface exist (GL2 profile),
+ * hence the fallback to the source code.
+ */
+ public void glShaderBinaryOrSource(IntBuffer shaders,
+ int binFormat, java.nio.Buffer bin,
+ java.lang.String[][] sources)
+ {
+ int shaderNum = shaders.limit();
+ if(shaderNum<=0) {
+ throw new GLException("Method \"glShaderBinaryOrSource\" called with shaders number <= 0");
+ }
+ if(null!=bin) {
+ try {
+ glShaderBinary(shaders, binFormat, bin);
+ return; // done
+ } catch (Exception e) { }
+ }
+ if(null!=sources) {
+ glShaderSource(shaders, sources);
+ return; // done
+ }
+ throw new GLException("Method \"glShaderBinaryOrSource\" without binary nor source");
+ }
+
+