From 0969a98f2007d76e38f8819eedfead5b840f6364 Mon Sep 17 00:00:00 2001 From: Travis Bryson Date: Fri, 24 Jun 2005 20:28:37 +0000 Subject: This putback adds array offsets to the public JOGL API. The offsets are respected and used properly in all of the public and private functions. The changes are in gluegen, so that the code is generated properly. And also throughout the parts of the jogl code that are not gluegen-generated. For the internally generated implementation methods, a "1" is added to the method names. So as to not overload the public API. This is similar to what is already done with Buffer APIs, which have a "0" added internally. I used a "1" instead of a "0" to avoid any collisions of the signatures, which could happen if a null object was sent down for the Array (e.g., the wrong method would get called). This should be a suitable foundation for the implementation to add the ability to wrap arrays in Buffers, which we plan to add to the implementation soon. These changes will cause all existing JOGL programs to break, although adapting them is pretty easy. We will later be putting back changed examples and utilities that incorporate these new APIs. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JSR-231@313 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/net/java/games/jogl/GLJPanel.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/net/java/games/jogl/GLJPanel.java') diff --git a/src/net/java/games/jogl/GLJPanel.java b/src/net/java/games/jogl/GLJPanel.java index 229cc3446..9fe7ffa6c 100644 --- a/src/net/java/games/jogl/GLJPanel.java +++ b/src/net/java/games/jogl/GLJPanel.java @@ -494,11 +494,11 @@ public final class GLJPanel extends JPanel implements GLDrawable { if (offscreenImage != null) { GL gl = getGL(); // Save current modes - gl.glGetIntegerv(GL.GL_PACK_SWAP_BYTES, swapbytes); - gl.glGetIntegerv(GL.GL_PACK_ROW_LENGTH, rowlength); - gl.glGetIntegerv(GL.GL_PACK_SKIP_ROWS, skiprows); - gl.glGetIntegerv(GL.GL_PACK_SKIP_PIXELS, skippixels); - gl.glGetIntegerv(GL.GL_PACK_ALIGNMENT, alignment); + gl.glGetIntegerv(GL.GL_PACK_SWAP_BYTES, swapbytes, 0); + gl.glGetIntegerv(GL.GL_PACK_ROW_LENGTH, rowlength, 0); + gl.glGetIntegerv(GL.GL_PACK_SKIP_ROWS, skiprows, 0); + gl.glGetIntegerv(GL.GL_PACK_SKIP_PIXELS, skippixels, 0); + gl.glGetIntegerv(GL.GL_PACK_ALIGNMENT, alignment, 0); gl.glPixelStorei(GL.GL_PACK_SWAP_BYTES, GL.GL_FALSE); gl.glPixelStorei(GL.GL_PACK_ROW_LENGTH, offscreenImage.getWidth()); @@ -509,9 +509,9 @@ public final class GLJPanel extends JPanel implements GLDrawable { // Actually read the pixels. gl.glReadBuffer(GL.GL_FRONT); if (dbByte != null) { - gl.glReadPixels(0, 0, offscreenImage.getWidth(), offscreenImage.getHeight(), glFormat, glType, dbByte.getData()); + gl.glReadPixels(0, 0, offscreenImage.getWidth(), offscreenImage.getHeight(), glFormat, glType, dbByte.getData(), 0); } else if (dbInt != null) { - gl.glReadPixels(0, 0, offscreenImage.getWidth(), offscreenImage.getHeight(), glFormat, glType, dbInt.getData()); + gl.glReadPixels(0, 0, offscreenImage.getWidth(), offscreenImage.getHeight(), glFormat, glType, dbInt.getData(), 0); } // Restore saved modes. -- cgit v1.2.3