diff options
author | Kenneth Russel <[email protected]> | 2009-03-19 06:39:36 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2009-03-19 06:39:36 +0000 |
commit | 45eac4e00b9b9dd935265c2ab25a61a2cf3cbf63 (patch) | |
tree | 3f1b3f3c0bee714b01acccdff54c29b378b0eb45 /src/jogl/classes/javax/media/opengl/GLProfile.java | |
parent | 0da2cacaab3c6862df6ca05abdbf0a7d9e9e5451 (diff) |
Moved remaining portions of fixed function emulation out of core JOGL
public and implementation packages and into
com.sun.opengl.util.glsl.fixed.* and other subpackages of
com.sun.opengl.util. Renamed javax.media.opengl.sub.GLObject to
javax.media.opengl.GLBase. Moved interfaces in
javax.media.opengl.sub.fixed to javax.media.opengl.fixedfunc and
changed naming convention. Moved all classes in
javax.media.opengl.util to com.sun.opengl.util. Moved
com.sun.opengl.impl.packrect to com.sun.opengl.util.packrect. Renamed
InternalBufferUtils to InternalBufferUtil to match naming convention
and copied in needed routines for GLU and other classes. Fixed build
breakage when specifying rootrel.build property; reintroduced
build-temp directory. Updated demos.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1886 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/GLProfile.java')
-rw-r--r-- | src/jogl/classes/javax/media/opengl/GLProfile.java | 79 |
1 files changed, 46 insertions, 33 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index 54bf63dda..0d20f1a4d 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -36,7 +36,7 @@ package javax.media.opengl; -import javax.media.opengl.sub.fixed.*; +import javax.media.opengl.fixedfunc.*; import java.lang.reflect.*; import java.security.*; import com.sun.opengl.impl.*; @@ -235,7 +235,7 @@ public class GLProfile { } } - public static String getGLTypeName(int type) { + private static String getGLTypeName(int type) { switch (type) { case GL.GL_UNSIGNED_BYTE: return "GL_UNSIGNED_BYTE"; @@ -265,6 +265,20 @@ public class GLProfile { return null; } + private static String getGLArrayName(int array) { + switch(array) { + case GLPointerFunc.GL_VERTEX_ARRAY: + return "GL_VERTEX_ARRAY"; + case GLPointerFunc.GL_NORMAL_ARRAY: + return "GL_NORMAL_ARRAY"; + case GLPointerFunc.GL_COLOR_ARRAY: + return "GL_COLOR_ARRAY"; + case GLPointerFunc.GL_TEXTURE_COORD_ARRAY: + return "GL_TEXTURE_COORD_ARRAY"; + } + return null; + } + /** * General validation if type is a valid GL data type * for the current profile @@ -297,19 +311,19 @@ public class GLProfile { return false; } - public static boolean isValidateArrayDataType(int index, int comps, int type, - boolean isVertexAttribPointer, boolean throwException) { - String indexName = GLContext.getPredefinedArrayIndexName(index); + public static boolean isValidArrayDataType(int index, int comps, int type, + boolean isVertexAttribPointer, boolean throwException) { + String arrayName = getGLArrayName(index); if(GLProfile.isGLES1()) { if(isVertexAttribPointer) { if(throwException) { - throw new GLException("Illegal array type for "+indexName+" on profile GLES1: VertexAttribPointer"); + throw new GLException("Illegal array type for "+arrayName+" on profile GLES1: VertexAttribPointer"); } return false; } switch(index) { - case GLPointerIf.GL_VERTEX_ARRAY: - case GLPointerIf.GL_TEXTURE_COORD_ARRAY: + case GLPointerFunc.GL_VERTEX_ARRAY: + case GLPointerFunc.GL_TEXTURE_COORD_ARRAY: switch(type) { case GL.GL_BYTE: case GL.GL_SHORT: @@ -318,7 +332,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal data type for "+indexName+" on profile GLES1: "+type); + throw new GLException("Illegal data type for "+arrayName+" on profile GLES1: "+type); } return false; } @@ -330,12 +344,12 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal component number for "+indexName+" on profile GLES1: "+comps); + throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps); } return false; } break; - case GLPointerIf.GL_NORMAL_ARRAY: + case GLPointerFunc.GL_NORMAL_ARRAY: switch(type) { case GL.GL_BYTE: case GL.GL_SHORT: @@ -344,7 +358,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal data type for "+indexName+" on profile GLES1: "+type); + throw new GLException("Illegal data type for "+arrayName+" on profile GLES1: "+type); } return false; } @@ -354,12 +368,12 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal component number for "+indexName+" on profile GLES1: "+comps); + throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps); } return false; } break; - case GLPointerIf.GL_COLOR_ARRAY: + case GLPointerFunc.GL_COLOR_ARRAY: switch(type) { case GL.GL_UNSIGNED_BYTE: case GL.GL_FIXED: @@ -367,7 +381,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal data type for "+indexName+" on profile GLES1: "+type); + throw new GLException("Illegal data type for "+arrayName+" on profile GLES1: "+type); } return false; } @@ -377,7 +391,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal component number for "+indexName+" on profile GLES1: "+comps); + throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps); } return false; } @@ -396,7 +410,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal data type for "+indexName+" on profile GLES2: "+type); + throw new GLException("Illegal data type for "+arrayName+" on profile GLES2: "+type); } return false; } @@ -409,7 +423,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal component number for "+indexName+" on profile GLES1: "+comps); + throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps); } return false; } @@ -427,7 +441,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal data type for "+indexName+" on profile GL2: "+type); + throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type); } return false; } @@ -440,13 +454,13 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal component number for "+indexName+" on profile GL2: "+comps); + throw new GLException("Illegal component number for "+arrayName+" on profile GL2: "+comps); } return false; } } else { switch(index) { - case GLPointerIf.GL_VERTEX_ARRAY: + case GLPointerFunc.GL_VERTEX_ARRAY: switch(type) { case GL.GL_SHORT: case GL.GL_FLOAT: @@ -455,7 +469,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal data type for "+indexName+" on profile GL2: "+type); + throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type); } return false; } @@ -467,12 +481,12 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal component number for "+indexName+" on profile GL2: "+comps); + throw new GLException("Illegal component number for "+arrayName+" on profile GL2: "+comps); } return false; } break; - case GLPointerIf.GL_NORMAL_ARRAY: + case GLPointerFunc.GL_NORMAL_ARRAY: switch(type) { case GL.GL_BYTE: case GL.GL_SHORT: @@ -482,7 +496,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal data type for "+indexName+" on profile GL2: "+type); + throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type); } return false; } @@ -492,12 +506,12 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal component number for "+indexName+" on profile GLES1: "+comps); + throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps); } return false; } break; - case GLPointerIf.GL_COLOR_ARRAY: + case GLPointerFunc.GL_COLOR_ARRAY: switch(type) { case GL.GL_UNSIGNED_BYTE: case GL.GL_BYTE: @@ -510,7 +524,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal data type for "+indexName+" on profile GL2: "+type); + throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type); } return false; } @@ -521,12 +535,12 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal component number for "+indexName+" on profile GL2: "+comps); + throw new GLException("Illegal component number for "+arrayName+" on profile GL2: "+comps); } return false; } break; - case GLPointerIf.GL_TEXTURE_COORD_ARRAY: + case GLPointerFunc.GL_TEXTURE_COORD_ARRAY: switch(type) { case GL.GL_SHORT: case GL.GL_FLOAT: @@ -535,7 +549,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal data type for "+indexName+" on profile GL2: "+type); + throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type); } return false; } @@ -548,7 +562,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal component number for "+indexName+" on profile GL2: "+comps); + throw new GLException("Illegal component number for "+arrayName+" on profile GL2: "+comps); } return false; } @@ -558,5 +572,4 @@ public class GLProfile { } return true; } - } |