aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes
diff options
context:
space:
mode:
authorHarvey Harrison <[email protected]>2012-05-03 17:08:57 -0700
committerHarvey Harrison <[email protected]>2012-05-03 17:08:57 -0700
commit7d4db9e9f98a3dd2317b6a8d0289e16ee60c2f0e (patch)
tree63853617ed25e03d51fd535063ddbfad821ddba6 /src/classes
parent529c93b2e141890b244ee1b2728aedf22075d6a2 (diff)
j3dcore: remove the JOGL CG shader support code
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src/classes')
-rwxr-xr-xsrc/classes/jogl/javax/media/j3d/JoglCgShaderInfo.java51
-rwxr-xr-xsrc/classes/jogl/javax/media/j3d/JoglCgShaderParameter.java54
-rwxr-xr-xsrc/classes/jogl/javax/media/j3d/JoglCgShaderProgramInfo.java57
-rw-r--r--src/classes/jogl/javax/media/j3d/JoglContext.java89
4 files changed, 0 insertions, 251 deletions
diff --git a/src/classes/jogl/javax/media/j3d/JoglCgShaderInfo.java b/src/classes/jogl/javax/media/j3d/JoglCgShaderInfo.java
deleted file mode 100755
index 7ad8a5f..0000000
--- a/src/classes/jogl/javax/media/j3d/JoglCgShaderInfo.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * $RCSfile$
- *
- * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * $Revision$
- * $Date$
- * $State$
- */
-
-package javax.media.j3d;
-
-import com.sun.opengl.cg.CGprogram;
-
-class JoglCgShaderInfo extends JoglShaderObject {
- private CGprogram cgShader;
- private int j3dShaderType;
- private int shaderProfile;
-
- JoglCgShaderInfo() {
- super(0);
- }
-
- public void setCgShader(CGprogram shader) { cgShader = shader; }
- public CGprogram getCgShader() { return cgShader; }
- public void setJ3DShaderType(int type) { j3dShaderType = type; }
- public int getJ3DShaderType() { return j3dShaderType; }
- public void setShaderProfile(int shaderProfile) { this.shaderProfile = shaderProfile; }
- public int getShaderProfile() { return shaderProfile; }
-}
diff --git a/src/classes/jogl/javax/media/j3d/JoglCgShaderParameter.java b/src/classes/jogl/javax/media/j3d/JoglCgShaderParameter.java
deleted file mode 100755
index a0aa4d4..0000000
--- a/src/classes/jogl/javax/media/j3d/JoglCgShaderParameter.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * $RCSfile$
- *
- * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * $Revision$
- * $Date$
- * $State$
- */
-
-package javax.media.j3d;
-
-import com.sun.opengl.cg.CGparameter;
-
-class JoglCgShaderParameter extends JoglShaderObject {
- private CGparameter vParam;
- private CGparameter fParam;
-
- JoglCgShaderParameter(CGparameter vParam,
- CGparameter fParam) {
- super(0);
- this.vParam = vParam;
- this.fParam = fParam;
- }
-
- CGparameter vParam() {
- return vParam;
- }
-
- CGparameter fParam() {
- return fParam;
- }
-}
diff --git a/src/classes/jogl/javax/media/j3d/JoglCgShaderProgramInfo.java b/src/classes/jogl/javax/media/j3d/JoglCgShaderProgramInfo.java
deleted file mode 100755
index ad9b6b5..0000000
--- a/src/classes/jogl/javax/media/j3d/JoglCgShaderProgramInfo.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * $RCSfile$
- *
- * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * $Revision$
- * $Date$
- * $State$
- */
-
-package javax.media.j3d;
-
-import com.sun.opengl.cg.CGparameter;
-
-class JoglCgShaderProgramInfo extends JoglShaderObject {
- private JoglCgShaderInfo vShader; // vertex shader
- private JoglCgShaderInfo fShader; // fragment shader
- // Array of parameters for (varying) vertex attributes
- private CGparameter[] vtxAttrs;
-
- JoglCgShaderProgramInfo() {
- super(0);
- }
-
- public JoglCgShaderInfo getVertexShader() { return vShader; }
- public void setVertexShader(JoglCgShaderInfo info) { vShader = info; }
- public JoglCgShaderInfo getFragmentShader() { return fShader; }
- public void setFragmentShader(JoglCgShaderInfo info) { fShader = info; }
- public CGparameter[] getVertexAttributes() { return vtxAttrs; }
- public void setVertexAttributes(CGparameter[] attrs) { vtxAttrs = attrs; }
- public int getNumVertexAttributes() {
- if (vtxAttrs == null)
- return 0;
- return vtxAttrs.length;
- }
-}
diff --git a/src/classes/jogl/javax/media/j3d/JoglContext.java b/src/classes/jogl/javax/media/j3d/JoglContext.java
index 539bcb0..7c3e8cf 100644
--- a/src/classes/jogl/javax/media/j3d/JoglContext.java
+++ b/src/classes/jogl/javax/media/j3d/JoglContext.java
@@ -37,9 +37,6 @@ import java.nio.FloatBuffer;
import javax.media.opengl.GL;
import javax.media.opengl.GLContext;
-import com.sun.opengl.cg.CGcontext;
-import com.sun.opengl.cg.CgGL;
-
/**
* Graphics context objects for Jogl rendering pipeline.
*/
@@ -69,71 +66,6 @@ class JoglContext implements Context {
}
private VertexAttributeImpl vertexAttrImpl;
- class CgVertexAttributeImpl implements VertexAttributeImpl {
- public void vertexAttrPointer(GL gl,
- int index, int size, int type, int stride, Buffer pointer) {
- JoglCgShaderProgramInfo shaderProgramInfo = (JoglCgShaderProgramInfo) shaderProgram;
- if (shaderProgramInfo != null && index < shaderProgramInfo.getNumVertexAttributes()) {
- CgGL.cgGLSetParameterPointer(shaderProgramInfo.getVertexAttributes()[index],
- size, type, stride, pointer);
- } else {
- if (shaderProgramInfo == null) {
- System.err.println(" shaderProgramInfo is null");
- } else {
- System.err.println(" index (" + index + ") out of range: numVtxAttrs = " +
- shaderProgramInfo.getNumVertexAttributes());
- }
- }
- }
-
- public void enableVertexAttrArray(GL gl, int index) {
- JoglCgShaderProgramInfo shaderProgramInfo = (JoglCgShaderProgramInfo) shaderProgram;
- if (shaderProgramInfo != null && index < shaderProgramInfo.getNumVertexAttributes()) {
- CgGL.cgGLEnableClientState(shaderProgramInfo.getVertexAttributes()[index]);
- } else {
- if (shaderProgramInfo == null) {
- System.err.println(" shaderProgramInfo is null");
- } else {
- System.err.println(" index (" + index + ") out of range: numVtxAttrs = " +
- shaderProgramInfo.getNumVertexAttributes());
- }
- }
- }
-
- public void disableVertexAttrArray(GL gl, int index) {
- JoglCgShaderProgramInfo shaderProgramInfo = (JoglCgShaderProgramInfo) shaderProgram;
- if (shaderProgramInfo != null && index < shaderProgramInfo.getNumVertexAttributes()) {
- CgGL.cgGLDisableClientState(shaderProgramInfo.getVertexAttributes()[index]);
- } else {
- if (shaderProgramInfo == null) {
- System.err.println(" shaderProgramInfo is null");
- } else {
- System.err.println(" index (" + index + ") out of range: numVtxAttrs = " +
- shaderProgramInfo.getNumVertexAttributes());
- }
- }
- }
-
- // NOTE: we should never get here. These functions are only called
- // when building display lists for geometry arrays with vertex
- // attributes, and such display lists are disabled in Cg mode.
- public void vertexAttr1fv(GL gl, int index, FloatBuffer buf) {
- throw new RuntimeException("Java 3D ERROR : Assertion failed: invalid call to cgVertexAttr1fv");
- }
-
- public void vertexAttr2fv(GL gl, int index, FloatBuffer buf) {
- throw new RuntimeException("Java 3D ERROR : Assertion failed: invalid call to cgVertexAttr2fv");
- }
-
- public void vertexAttr3fv(GL gl, int index, FloatBuffer buf) {
- throw new RuntimeException("Java 3D ERROR : Assertion failed: invalid call to cgVertexAttr3fv");
- }
-
- public void vertexAttr4fv(GL gl, int index, FloatBuffer buf) {
- throw new RuntimeException("Java 3D ERROR : Assertion failed: invalid call to cgVertexAttr4fv");
- }
- }
-
class GLSLVertexAttributeImpl implements VertexAttributeImpl {
public void vertexAttrPointer(GL gl,
int index, int size, int type, int stride, Buffer pointer) {
@@ -169,11 +101,6 @@ class JoglContext implements Context {
// Only used when GLSL shader library is active
private int glslVertexAttrOffset;
- // Only used when Cg shader library is active
- private CGcontext cgContext;
- private int cgVertexProfile;
- private int cgFragmentProfile;
-
JoglContext(GLContext context) {
this.context = context;
}
@@ -193,14 +120,6 @@ class JoglContext implements Context {
boolean getHasMultisample() { return hasMultisample; }
void setHasMultisample(boolean val){ hasMultisample = val; }
- // Helpers for vertex attribute methods
- void initCgVertexAttributeImpl() {
- if (vertexAttrImpl != null) {
- throw new RuntimeException("Should not initialize the vertex attribute implementation twice");
- }
- vertexAttrImpl = new CgVertexAttributeImpl();
- }
-
void initGLSLVertexAttributeImpl() {
if (vertexAttrImpl != null) {
throw new RuntimeException("Should not initialize the vertex attribute implementation twice");
@@ -244,12 +163,4 @@ class JoglContext implements Context {
// Only used when GLSL shaders are in use
int getGLSLVertexAttrOffset() { return glslVertexAttrOffset; }
void setGLSLVertexAttrOffset(int offset) { glslVertexAttrOffset = offset; }
-
- // Only used when Cg shaders are in use
- CGcontext getCgContext() { return cgContext; }
- void setCgContext(CGcontext c) { cgContext = c; }
- int getCgVertexProfile() { return cgVertexProfile; }
- void setCgVertexProfile(int p) { cgVertexProfile = p; }
- int getCgFragmentProfile() { return cgFragmentProfile; }
- void setCgFragmentProfile(int p) { cgFragmentProfile = p; }
}