diff options
author | Sven Gothel <[email protected]> | 2008-08-21 17:37:13 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2008-08-21 17:37:13 +0000 |
commit | c91152ffe6a86e29c4e6c896eec7af5a40bc7be0 (patch) | |
tree | 21809b8009b7be06558fb0db3d33941dbb8017cf /src/classes/javax/media/opengl | |
parent | a971f95b23fd9f8287acdad1afc2eed75a531bc1 (diff) |
Added missing SystemUtils. Added proper GLSL ArrayData validation
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1763 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/javax/media/opengl')
-rw-r--r-- | src/classes/javax/media/opengl/GLArrayDataClient.java | 2 | ||||
-rw-r--r-- | src/classes/javax/media/opengl/GLArrayDataServer.java | 2 | ||||
-rw-r--r-- | src/classes/javax/media/opengl/GLProfile.java | 59 |
3 files changed, 30 insertions, 33 deletions
diff --git a/src/classes/javax/media/opengl/GLArrayDataClient.java b/src/classes/javax/media/opengl/GLArrayDataClient.java index 2a5b48506..a4b4cae19 100644 --- a/src/classes/javax/media/opengl/GLArrayDataClient.java +++ b/src/classes/javax/media/opengl/GLArrayDataClient.java @@ -58,6 +58,7 @@ public class GLArrayDataClient implements GLArrayData { if(!GLProfile.isGL2ES2()) { throw new GLException("GLArrayDataServer not supported for profile: "+GLProfile.getProfile()); } + GLProfile.isValidateArrayDataType(-1, comps, dataType, true, true); GLArrayDataClient adc = new GLArrayDataClient(); GLArrayHandler glArrayHandler = new GLSLArrayHandler(adc); @@ -72,6 +73,7 @@ public class GLArrayDataClient implements GLArrayData { if(!GLProfile.isGL2ES2()) { throw new GLException("GLArrayDataServer not supported for profile: "+GLProfile.getProfile()); } + GLProfile.isValidateArrayDataType(-1, comps, dataType, true, true); GLArrayDataClient adc = new GLArrayDataClient(); GLArrayHandler glArrayHandler = new GLSLArrayHandler(adc); diff --git a/src/classes/javax/media/opengl/GLArrayDataServer.java b/src/classes/javax/media/opengl/GLArrayDataServer.java index 032e0a6f1..6fcb03a90 100644 --- a/src/classes/javax/media/opengl/GLArrayDataServer.java +++ b/src/classes/javax/media/opengl/GLArrayDataServer.java @@ -106,6 +106,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayData if(!GLProfile.isGL2ES2()) { throw new GLException("GLArrayDataServer not supported for profile: "+GLProfile.getProfile()); } + GLProfile.isValidateArrayDataType(-1, comps, dataType, true, true); GLArrayDataServer ads = new GLArrayDataServer(); GLArrayHandler glArrayHandler = new GLSLArrayHandler(ads); @@ -126,6 +127,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayData if(!GLProfile.isGL2ES2()) { throw new GLException("GLArrayDataServer not supported for profile: "+GLProfile.getProfile()); } + GLProfile.isValidateArrayDataType(-1, comps, dataType, true, true); GLArrayDataServer ads = new GLArrayDataServer(); GLArrayHandler glArrayHandler = new GLSLArrayHandler(ads); diff --git a/src/classes/javax/media/opengl/GLProfile.java b/src/classes/javax/media/opengl/GLProfile.java index 65e103937..ac37305b2 100644 --- a/src/classes/javax/media/opengl/GLProfile.java +++ b/src/classes/javax/media/opengl/GLProfile.java @@ -373,41 +373,34 @@ public class GLProfile { } } else if(GLProfile.isGL2ES12() || GLProfile.isGL2()) { if(isVertexAttribPointer) { - switch(index) { - case GL.GL_VERTEX_ARRAY: - case GL.GL_TEXTURE_COORD_ARRAY: - case GL.GL_NORMAL_ARRAY: - case GL.GL_COLOR_ARRAY: - switch(type) { - case GL.GL_UNSIGNED_BYTE: - case GL.GL_BYTE: - case GL.GL_UNSIGNED_SHORT: - case GL.GL_SHORT: - case GL.GL_FLOAT: - case javax.media.opengl.GL2ES2.GL_INT: - case javax.media.opengl.GL2ES2.GL_UNSIGNED_INT: - case javax.media.opengl.GL2.GL_DOUBLE: - break; - default: - if(throwException) { - throw new GLException("Illegal data type for "+indexName+" on profile GL2: "+type); - } - return false; - } - switch(comps) { - case 0: - case 1: - case 2: - case 3: - case 4: - break; - default: - if(throwException) { - throw new GLException("Illegal component number for "+indexName+" on profile GL2: "+comps); - } - return false; + switch(type) { + case GL.GL_UNSIGNED_BYTE: + case GL.GL_BYTE: + case GL.GL_UNSIGNED_SHORT: + case GL.GL_SHORT: + case GL.GL_FLOAT: + case javax.media.opengl.GL2ES2.GL_INT: + case javax.media.opengl.GL2ES2.GL_UNSIGNED_INT: + case javax.media.opengl.GL2.GL_DOUBLE: + break; + default: + if(throwException) { + throw new GLException("Illegal data type for "+indexName+" on profile GL2: "+type); } + return false; + } + switch(comps) { + case 0: + case 1: + case 2: + case 3: + case 4: break; + default: + if(throwException) { + throw new GLException("Illegal component number for "+indexName+" on profile GL2: "+comps); + } + return false; } } else { switch(index) { |