aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarvey Harrison <[email protected]>2012-08-24 18:10:00 -0700
committerHarvey Harrison <[email protected]>2012-08-27 21:01:23 -0700
commitc4a72eb9b4ab2ebf2f3af76f7f48880edad25efd (patch)
treeb76f36086a83beb30ed94b2cad42c0d7e0cea230
parent9cf16c1cd1845a64faf8fe3df6b0b8789690302e (diff)
j3dcore: with the CG shaders removed, this internal interface can be removed
Signed-off-by: Harvey Harrison <[email protected]>
-rw-r--r--src/classes/share/javax/media/j3d/JoglContext.java96
-rw-r--r--src/classes/share/javax/media/j3d/JoglPipeline.java2
2 files changed, 22 insertions, 76 deletions
diff --git a/src/classes/share/javax/media/j3d/JoglContext.java b/src/classes/share/javax/media/j3d/JoglContext.java
index 9083fa9..f9bd82e 100644
--- a/src/classes/share/javax/media/j3d/JoglContext.java
+++ b/src/classes/share/javax/media/j3d/JoglContext.java
@@ -48,51 +48,6 @@ class JoglContext implements Context {
// Needed for vertex attribute implementation
private JoglShaderObject shaderProgram;
- // Implementation of vertex attribute methods
- static interface VertexAttributeImpl {
- public void vertexAttrPointer(GL gl,
- int index, int size, int type, int stride, Buffer pointer);
- public void enableVertexAttrArray(GL gl, int index);
- public void disableVertexAttrArray(GL gl, int index);
- public void vertexAttr1fv(GL gl, int index, FloatBuffer buf);
- public void vertexAttr2fv(GL gl, int index, FloatBuffer buf);
- public void vertexAttr3fv(GL gl, int index, FloatBuffer buf);
- public void vertexAttr4fv(GL gl, int index, FloatBuffer buf);
- }
- private VertexAttributeImpl vertexAttrImpl;
-
- class GLSLVertexAttributeImpl implements VertexAttributeImpl {
- public void vertexAttrPointer(GL gl,
- int index, int size, int type, int stride, Buffer pointer) {
- gl.getGL2().glVertexAttribPointerARB(index + glslVertexAttrOffset,
- size, type, false, stride, pointer);
- }
-
- public void enableVertexAttrArray(GL gl, int index) {
- gl.getGL2().glEnableVertexAttribArrayARB(index + glslVertexAttrOffset);
- }
-
- public void disableVertexAttrArray(GL gl, int index) {
- gl.getGL2().glDisableVertexAttribArrayARB(index + glslVertexAttrOffset);
- }
-
- public void vertexAttr1fv(GL gl, int index, FloatBuffer buf) {
- gl.getGL2().glVertexAttrib1fvARB(index + glslVertexAttrOffset, buf);
- }
-
- public void vertexAttr2fv(GL gl, int index, FloatBuffer buf) {
- gl.getGL2().glVertexAttrib2fvARB(index + glslVertexAttrOffset, buf);
- }
-
- public void vertexAttr3fv(GL gl, int index, FloatBuffer buf) {
- gl.getGL2().glVertexAttrib3fvARB(index + glslVertexAttrOffset, buf);
- }
-
- public void vertexAttr4fv(GL gl, int index, FloatBuffer buf) {
- gl.getGL2().glVertexAttrib4fvARB(index + glslVertexAttrOffset, buf);
- }
- }
-
// Only used when GLSL shader library is active
private int glslVertexAttrOffset;
@@ -115,41 +70,34 @@ class JoglContext implements Context {
boolean getHasMultisample() { return hasMultisample; }
void setHasMultisample(boolean val){ hasMultisample = val; }
- void initGLSLVertexAttributeImpl() {
- if (vertexAttrImpl != null) {
- throw new RuntimeException("Should not initialize the vertex attribute implementation twice");
- }
- vertexAttrImpl = new GLSLVertexAttributeImpl();
- }
-
- void vertexAttrPointer(GL gl,
- int index, int size, int type, int stride, Buffer pointer) {
- vertexAttrImpl.vertexAttrPointer(gl, index, size, type, stride, pointer);
- }
+void vertexAttrPointer(GL gl, int index, int size, int type, int stride, Buffer pointer) {
+ gl.getGL2().glVertexAttribPointerARB(index + glslVertexAttrOffset, size,
+ type, false, stride, pointer);
+}
- void enableVertexAttrArray(GL gl, int index) {
- vertexAttrImpl.enableVertexAttrArray(gl, index);
- }
+void enableVertexAttrArray(GL gl, int index) {
+ gl.getGL2().glEnableVertexAttribArrayARB(index + glslVertexAttrOffset);
+}
- void disableVertexAttrArray(GL gl, int index) {
- vertexAttrImpl.disableVertexAttrArray(gl, index);
- }
+void disableVertexAttrArray(GL gl, int index) {
+ gl.getGL2().glDisableVertexAttribArrayARB(index + glslVertexAttrOffset);
+}
- void vertexAttr1fv(GL gl, int index, FloatBuffer buf) {
- vertexAttrImpl.vertexAttr1fv(gl, index, buf);
- }
+void vertexAttr1fv(GL gl, int index, FloatBuffer buf) {
+ gl.getGL2().glVertexAttrib1fvARB(index + glslVertexAttrOffset, buf);
+}
- void vertexAttr2fv(GL gl, int index, FloatBuffer buf) {
- vertexAttrImpl.vertexAttr2fv(gl, index, buf);
- }
+void vertexAttr2fv(GL gl, int index, FloatBuffer buf) {
+ gl.getGL2().glVertexAttrib2fvARB(index + glslVertexAttrOffset, buf);
+}
- void vertexAttr3fv(GL gl, int index, FloatBuffer buf) {
- vertexAttrImpl.vertexAttr3fv(gl, index, buf);
- }
+void vertexAttr3fv(GL gl, int index, FloatBuffer buf) {
+ gl.getGL2().glVertexAttrib3fvARB(index + glslVertexAttrOffset, buf);
+}
- void vertexAttr4fv(GL gl, int index, FloatBuffer buf) {
- vertexAttrImpl.vertexAttr4fv(gl, index, buf);
- }
+void vertexAttr4fv(GL gl, int index, FloatBuffer buf) {
+ gl.getGL2().glVertexAttrib4fvARB(index + glslVertexAttrOffset, buf);
+}
// Used in vertex attribute implementation
JoglShaderObject getShaderProgram() { return shaderProgram; }
diff --git a/src/classes/share/javax/media/j3d/JoglPipeline.java b/src/classes/share/javax/media/j3d/JoglPipeline.java
index 2df5c52..325b688 100644
--- a/src/classes/share/javax/media/j3d/JoglPipeline.java
+++ b/src/classes/share/javax/media/j3d/JoglPipeline.java
@@ -7582,8 +7582,6 @@ class JoglPipeline extends Pipeline {
if (gl.isExtensionAvailable("GL_ARB_shader_objects") &&
gl.isExtensionAvailable("GL_ARB_shading_language_100")) {
- // Initialize shader vertex attribute function pointers
- ctx.initGLSLVertexAttributeImpl();
// FIXME: this isn't complete and would need to set up the
// JoglContext for dispatch of various routines such as those