diff options
Diffstat (limited to 'src/demos/readbuffer')
-rwxr-xr-x | src/demos/readbuffer/Main.java | 6 | ||||
-rwxr-xr-x | src/demos/readbuffer/ReadBuffer2Screen.java | 14 | ||||
-rwxr-xr-x | src/demos/readbuffer/ReadBufferBase.java | 2 | ||||
-rwxr-xr-x | src/demos/readbuffer/ReadBufferUtil.java | 8 | ||||
-rwxr-xr-x | src/demos/readbuffer/Surface2File.java | 4 |
5 files changed, 17 insertions, 17 deletions
diff --git a/src/demos/readbuffer/Main.java b/src/demos/readbuffer/Main.java index 426bdd7..d0ce55b 100755 --- a/src/demos/readbuffer/Main.java +++ b/src/demos/readbuffer/Main.java @@ -68,7 +68,7 @@ public class Main implements WindowListener, MouseListener, SurfaceUpdatedListen Window nWindow = NewtFactory.createWindow(nScreen, capsOffscreen); GLWindow windowOffscreen = GLWindow.create(nWindow); - windowOffscreen.enablePerfLog(true); + windowOffscreen.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, System.err); windowOffscreen.setSize(w, h); windowOffscreen.setVisible(true); return windowOffscreen; @@ -139,11 +139,11 @@ public class Main implements WindowListener, MouseListener, SurfaceUpdatedListen // System.out.println("..............................."); windowOffscreen.display(); if ( TEST_READBUFFER2SCREEN == typeTest ) { - if ( windowOffscreen.getDuration() >= 10000) { + if ( windowOffscreen.getTotalFPSDuration() >= 10000) { break; } } else { - if ( windowOffscreen.getTotalFrames() >= 10) { + if ( windowOffscreen.getTotalFPSFrames() >= 10) { break; } } diff --git a/src/demos/readbuffer/ReadBuffer2Screen.java b/src/demos/readbuffer/ReadBuffer2Screen.java index 13e6508..cc120f2 100755 --- a/src/demos/readbuffer/ReadBuffer2Screen.java +++ b/src/demos/readbuffer/ReadBuffer2Screen.java @@ -66,10 +66,10 @@ public class ReadBuffer2Screen extends ReadBufferBase { if(null==readTextureVertices) { //readTextureVertices = GLArrayDataClient.createFixed(gl, GLPointerFunc.GL_VERTEX_ARRAY, "mgl_Vertex", // 2, GL.GL_FLOAT, true, 4); - readTextureVertices = GLArrayDataServer.createFixed(gl, GLPointerFunc.GL_VERTEX_ARRAY, "mgl_Vertex", + readTextureVertices = GLArrayDataServer.createFixed(GLPointerFunc.GL_VERTEX_ARRAY, "mgl_Vertex", 2, GL.GL_FLOAT, true, 4, GL.GL_STATIC_DRAW); readTextureVertices.setEnableAlways(enableBufferAlways); - readTextureVertices.setVBOUsage(enableBufferVBO); + readTextureVertices.setVBOEnabled(enableBufferVBO); { FloatBuffer vb = (FloatBuffer)readTextureVertices.getBuffer(); vb.put(-f_edge); vb.put(-f_edge); @@ -130,8 +130,8 @@ public class ReadBuffer2Screen extends ReadBufferBase { if(!readBufferUtil.isValid()) return; // Now draw one quad with the texture - readBufferUtil.getTexture().enable(); - readBufferUtil.getTexture().bind(); + readBufferUtil.getTexture().enable(gl); + readBufferUtil.getTexture().bind(gl); if(gl.isGL2ES1()) { // gl.getGL2ES1().glTexEnvi(GL2ES1.GL_TEXTURE_ENV, GL2ES1.GL_TEXTURE_ENV_MODE, GL2ES1.GL_REPLACE); @@ -151,15 +151,15 @@ public class ReadBuffer2Screen extends ReadBufferBase { } readTextureVertices.enableBuffer(gl, false); */ - readBufferUtil.getTexture().disable(); + readBufferUtil.getTexture().disable(gl); } void updateTextureCoords(GL gl, boolean force) { if(force || null==readTextureCoords) { - readTextureCoords = GLArrayDataServer.createFixed(gl, GLPointerFunc.GL_TEXTURE_COORD_ARRAY, "mgl_MultiTexCoord0", + readTextureCoords = GLArrayDataServer.createFixed(GLPointerFunc.GL_TEXTURE_COORD_ARRAY, "mgl_MultiTexCoord0", 2, GL.GL_FLOAT, true, 4, GL.GL_STATIC_DRAW); readTextureCoords.setEnableAlways(enableBufferAlways); - readTextureCoords.setVBOUsage(enableBufferVBO); + readTextureCoords.setVBOEnabled(enableBufferVBO); { TextureCoords coords = readBufferUtil.getTexture().getImageTexCoords(); FloatBuffer cb = (FloatBuffer)readTextureCoords.getBuffer(); diff --git a/src/demos/readbuffer/ReadBufferBase.java b/src/demos/readbuffer/ReadBufferBase.java index 6922f02..d392d1c 100755 --- a/src/demos/readbuffer/ReadBufferBase.java +++ b/src/demos/readbuffer/ReadBufferBase.java @@ -80,7 +80,7 @@ public class ReadBufferBase implements GLEventListener { } public void dispose(GLAutoDrawable drawable) { - readBufferUtil.dispose(); + readBufferUtil.dispose(drawable.getGL()); } public void display(GLAutoDrawable drawable) { diff --git a/src/demos/readbuffer/ReadBufferUtil.java b/src/demos/readbuffer/ReadBufferUtil.java index 85680c7..e271767 100755 --- a/src/demos/readbuffer/ReadBufferUtil.java +++ b/src/demos/readbuffer/ReadBufferUtil.java @@ -88,9 +88,9 @@ public class ReadBufferUtil { gl.glReadPixels(0, 0, drawable.getWidth(), drawable.getHeight(), GL.GL_RGB, GL.GL_UNSIGNED_BYTE, readPixelBuffer); readPixelBuffer.rewind(); if(newData) { - readTexture.updateImage(readTextureData); + readTexture.updateImage(gl, readTextureData); } else { - readTexture.updateSubImage(readTextureData, 0, + readTexture.updateSubImage(gl, readTextureData, 0, 0, 0, // src offset 0, 0, // dst offset drawable.getWidth(), drawable.getHeight()); @@ -99,8 +99,8 @@ public class ReadBufferUtil { } } - public void dispose() { - readTexture.dispose(); + public void dispose(GL gl) { + readTexture.destroy(gl); readTextureData = null; readPixelBuffer.clear(); readPixelBuffer = null; diff --git a/src/demos/readbuffer/Surface2File.java b/src/demos/readbuffer/Surface2File.java index 2303a1c..051094c 100755 --- a/src/demos/readbuffer/Surface2File.java +++ b/src/demos/readbuffer/Surface2File.java @@ -47,8 +47,8 @@ public class Surface2File implements SurfaceUpdatedListener { ReadBufferUtil readBufferUtil = new ReadBufferUtil(); int shotNum=0; - public void dispose() { - readBufferUtil.dispose(); + public void dispose(GL gl) { + readBufferUtil.dispose(gl); } public void surfaceUpdated(Object updater, NativeSurface surface, long when) { |