diff options
author | Julien Gouesse <[email protected]> | 2013-11-04 20:39:05 +0100 |
---|---|---|
committer | Julien Gouesse <[email protected]> | 2013-11-04 20:39:05 +0100 |
commit | e857ca2719b458140a67d2bc87cf935f05172cc5 (patch) | |
tree | cb86b73f6fcd34f5465019b9d53c468db56d38eb /ardor3d-jogl/src | |
parent | 4c694e497da9d0e7f402babdd0b8cc9aa5d03860 (diff) |
Modifies the JOGL renderer in order to support the changes introduced in the public APIs of JOGL 2.1.x
Diffstat (limited to 'ardor3d-jogl/src')
-rw-r--r-- | ardor3d-jogl/src/main/java/com/ardor3d/renderer/jogl/JoglRenderer.java | 30 | ||||
-rw-r--r-- | ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/shader/JoglShaderUtil.java | 12 |
2 files changed, 20 insertions, 22 deletions
diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/renderer/jogl/JoglRenderer.java b/ardor3d-jogl/src/main/java/com/ardor3d/renderer/jogl/JoglRenderer.java index 9dcdde4..a1e20bd 100644 --- a/ardor3d-jogl/src/main/java/com/ardor3d/renderer/jogl/JoglRenderer.java +++ b/ardor3d-jogl/src/main/java/com/ardor3d/renderer/jogl/JoglRenderer.java @@ -892,11 +892,11 @@ public class JoglRenderer extends AbstractRenderer { indices.position(0); - if (primcount < 0) { - gl.glDrawElements(glIndexMode, indices.getBufferLimit(), type, indices.getBuffer()); - } else { - if (gl.isGL2GL3()) { - gl.getGL2GL3().glDrawElementsInstanced(glIndexMode, indices.getBufferLimit(), type, + if (gl.isGL2()) { + if (primcount < 0) { + gl.getGL2().glDrawElements(glIndexMode, indices.getBufferLimit(), type, indices.getBuffer()); + } else { + gl.getGL2().glDrawElementsInstanced(glIndexMode, indices.getBufferLimit(), type, indices.getBuffer(), primcount); } } @@ -915,12 +915,11 @@ public class JoglRenderer extends AbstractRenderer { indices.getBuffer().position(offset); indices.getBuffer().limit(offset + count); - if (primcount < 0) { - gl.glDrawElements(glIndexMode, count, type, indices.getBuffer()); - } else { - if (gl.isGL2GL3()) { - gl.getGL2GL3() - .glDrawElementsInstanced(glIndexMode, count, type, indices.getBuffer(), primcount); + if (gl.isGL2()) { + if (primcount < 0) { + gl.getGL2().glDrawElements(glIndexMode, count, type, indices.getBuffer()); + } else { + gl.getGL2().glDrawElementsInstanced(glIndexMode, count, type, indices.getBuffer(), primcount); } } @@ -1419,8 +1418,8 @@ public class JoglRenderer extends AbstractRenderer { if (primcount < 0) { gl.glDrawElements(glIndexMode, indices.getBufferLimit(), type, 0); } else { - if (gl.isGL2GL3()) { - gl.getGL2GL3().glDrawElementsInstanced(glIndexMode, indices.getBufferLimit(), type, + if (gl.isGL2()) { + gl.getGL2().glDrawElementsInstanced(glIndexMode, indices.getBufferLimit(), type, indices.getBuffer(), primcount); } } @@ -1446,9 +1445,8 @@ public class JoglRenderer extends AbstractRenderer { } else { final int previousPos = indices.getBuffer().position(); indices.getBuffer().position(offset * byteSize); - if (gl.isGL2GL3()) { - gl.getGL2GL3() - .glDrawElementsInstanced(glIndexMode, count, type, indices.getBuffer(), primcount); + if (gl.isGL2()) { + gl.getGL2().glDrawElementsInstanced(glIndexMode, count, type, indices.getBuffer(), primcount); } indices.getBuffer().position(previousPos); } diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/shader/JoglShaderUtil.java b/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/shader/JoglShaderUtil.java index 4748cd3..3931796 100644 --- a/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/shader/JoglShaderUtil.java +++ b/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/shader/JoglShaderUtil.java @@ -363,7 +363,7 @@ public abstract class JoglShaderUtil { variable.data.getBuffer().rewind(); GLContext .getCurrentGL() - .getGL2ES2() + .getGL2() .glVertexAttribPointer(variable.variableID, variable.size, GL.GL_FLOAT, variable.normalized, variable.stride, variable.data.getBuffer()); } @@ -387,8 +387,8 @@ public abstract class JoglShaderUtil { } else { variable.data.getBuffer().limit(pos + length - 1); variable.data.getBuffer().position(pos); - gl.getGL2ES2().glVertexAttribPointer(variable.variableID + i, size, GL.GL_FLOAT, variable.normalized, - 0, variable.data.getBuffer()); + gl.getGL2().glVertexAttribPointer(variable.variableID + i, size, GL.GL_FLOAT, variable.normalized, 0, + variable.data.getBuffer()); } } } @@ -410,7 +410,7 @@ public abstract class JoglShaderUtil { variable.data.getBuffer().rewind(); GLContext .getCurrentGL() - .getGL2ES2() + .getGL2() .glVertexAttribPointer(variable.variableID, variable.size, variable.unsigned ? GL.GL_UNSIGNED_BYTE : GL.GL_BYTE, variable.normalized, variable.stride, variable.data.getBuffer()); @@ -434,7 +434,7 @@ public abstract class JoglShaderUtil { variable.data.getBuffer().rewind(); GLContext .getCurrentGL() - .getGL2ES2() + .getGL2() .glVertexAttribPointer(variable.variableID, variable.size, variable.unsigned ? GL.GL_UNSIGNED_INT : GL2ES2.GL_INT, variable.normalized, variable.stride, variable.data.getBuffer()); @@ -458,7 +458,7 @@ public abstract class JoglShaderUtil { variable.data.getBuffer().rewind(); GLContext .getCurrentGL() - .getGL2ES2() + .getGL2() .glVertexAttribPointer(variable.variableID, variable.size, variable.unsigned ? GL.GL_UNSIGNED_SHORT : GL.GL_SHORT, variable.normalized, variable.stride, variable.data.getBuffer()); |