Эх сурвалжийг харах

[Android]implemented scr_Flush

git-svn-id: http://zengl.googlecode.com/svn/branches/0.3.x@1938 6573c10b-8653-0410-9706-d32479e959fb
dr.andru 13 жил өмнө
parent
commit
13a2d6d0da

+ 18 - 1
demos/Android/01 - Initialization/src/zengl/android/ZenGL.java

@@ -23,6 +23,10 @@
 */
 package zengl.android;
 
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
 import javax.microedition.khronos.egl.EGLConfig;
 import javax.microedition.khronos.opengles.GL10;
 
@@ -171,6 +175,19 @@ public class ZenGL extends GLSurfaceView
 		((Activity)getContext()).finish();
 		System.exit( 0 );
 	}
+	
+	public void SwapBuffers()
+	{
+	    EGL10 currEGL = (EGL10)EGLContext.getEGL();
+
+	    EGLDisplay currDisplay = currEGL.eglGetCurrentDisplay();
+	    if ( currDisplay == EGL10.EGL_NO_DISPLAY ) return;    
+
+	    EGLSurface currSurface = currEGL.eglGetCurrentSurface( EGL10.EGL_DRAW );
+	    if ( currSurface == EGL10.EGL_NO_SURFACE ) return;
+
+	    currEGL.eglSwapBuffers( currDisplay, currSurface);
+	}
 
 	public void ShowKeyboard()
 	{
@@ -253,4 +270,4 @@ public class ZenGL extends GLSurfaceView
 			return true;
 		}
 	}
-}
+}

+ 18 - 1
demos/Android/02 - Resources/src/zengl/android/ZenGL.java

@@ -23,6 +23,10 @@
 */
 package zengl.android;
 
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
 import javax.microedition.khronos.egl.EGLConfig;
 import javax.microedition.khronos.opengles.GL10;
 
@@ -171,6 +175,19 @@ public class ZenGL extends GLSurfaceView
 		((Activity)getContext()).finish();
 		System.exit( 0 );
 	}
+	
+	public void SwapBuffers()
+	{
+	    EGL10 currEGL = (EGL10)EGLContext.getEGL();
+
+	    EGLDisplay currDisplay = currEGL.eglGetCurrentDisplay();
+	    if ( currDisplay == EGL10.EGL_NO_DISPLAY ) return;    
+
+	    EGLSurface currSurface = currEGL.eglGetCurrentSurface( EGL10.EGL_DRAW );
+	    if ( currSurface == EGL10.EGL_NO_SURFACE ) return;
+
+	    currEGL.eglSwapBuffers( currDisplay, currSurface);
+	}
 
 	public void ShowKeyboard()
 	{
@@ -253,4 +270,4 @@ public class ZenGL extends GLSurfaceView
 			return true;
 		}
 	}
-}
+}

+ 18 - 1
demos/Android/03 - Input/src/zengl/android/ZenGL.java

@@ -23,6 +23,10 @@
 */
 package zengl.android;
 
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
 import javax.microedition.khronos.egl.EGLConfig;
 import javax.microedition.khronos.opengles.GL10;
 
@@ -171,6 +175,19 @@ public class ZenGL extends GLSurfaceView
 		((Activity)getContext()).finish();
 		System.exit( 0 );
 	}
+	
+	public void SwapBuffers()
+	{
+	    EGL10 currEGL = (EGL10)EGLContext.getEGL();
+
+	    EGLDisplay currDisplay = currEGL.eglGetCurrentDisplay();
+	    if ( currDisplay == EGL10.EGL_NO_DISPLAY ) return;    
+
+	    EGLSurface currSurface = currEGL.eglGetCurrentSurface( EGL10.EGL_DRAW );
+	    if ( currSurface == EGL10.EGL_NO_SURFACE ) return;
+
+	    currEGL.eglSwapBuffers( currDisplay, currSurface);
+	}
 
 	public void ShowKeyboard()
 	{
@@ -253,4 +270,4 @@ public class ZenGL extends GLSurfaceView
 			return true;
 		}
 	}
-}
+}

+ 18 - 1
demos/Android/04 - Screen Settings/src/zengl/android/ZenGL.java

@@ -23,6 +23,10 @@
 */
 package zengl.android;
 
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
 import javax.microedition.khronos.egl.EGLConfig;
 import javax.microedition.khronos.opengles.GL10;
 
@@ -171,6 +175,19 @@ public class ZenGL extends GLSurfaceView
 		((Activity)getContext()).finish();
 		System.exit( 0 );
 	}
+	
+	public void SwapBuffers()
+	{
+	    EGL10 currEGL = (EGL10)EGLContext.getEGL();
+
+	    EGLDisplay currDisplay = currEGL.eglGetCurrentDisplay();
+	    if ( currDisplay == EGL10.EGL_NO_DISPLAY ) return;    
+
+	    EGLSurface currSurface = currEGL.eglGetCurrentSurface( EGL10.EGL_DRAW );
+	    if ( currSurface == EGL10.EGL_NO_SURFACE ) return;
+
+	    currEGL.eglSwapBuffers( currDisplay, currSurface);
+	}
 
 	public void ShowKeyboard()
 	{
@@ -253,4 +270,4 @@ public class ZenGL extends GLSurfaceView
 			return true;
 		}
 	}
-}
+}

+ 18 - 1
demos/Android/05 - Primitives/src/zengl/android/ZenGL.java

@@ -23,6 +23,10 @@
 */
 package zengl.android;
 
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
 import javax.microedition.khronos.egl.EGLConfig;
 import javax.microedition.khronos.opengles.GL10;
 
@@ -171,6 +175,19 @@ public class ZenGL extends GLSurfaceView
 		((Activity)getContext()).finish();
 		System.exit( 0 );
 	}
+	
+	public void SwapBuffers()
+	{
+	    EGL10 currEGL = (EGL10)EGLContext.getEGL();
+
+	    EGLDisplay currDisplay = currEGL.eglGetCurrentDisplay();
+	    if ( currDisplay == EGL10.EGL_NO_DISPLAY ) return;    
+
+	    EGLSurface currSurface = currEGL.eglGetCurrentSurface( EGL10.EGL_DRAW );
+	    if ( currSurface == EGL10.EGL_NO_SURFACE ) return;
+
+	    currEGL.eglSwapBuffers( currDisplay, currSurface);
+	}
 
 	public void ShowKeyboard()
 	{
@@ -253,4 +270,4 @@ public class ZenGL extends GLSurfaceView
 			return true;
 		}
 	}
-}
+}

+ 18 - 1
demos/Android/06 - Text/src/zengl/android/ZenGL.java

@@ -23,6 +23,10 @@
 */
 package zengl.android;
 
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
 import javax.microedition.khronos.egl.EGLConfig;
 import javax.microedition.khronos.opengles.GL10;
 
@@ -171,6 +175,19 @@ public class ZenGL extends GLSurfaceView
 		((Activity)getContext()).finish();
 		System.exit( 0 );
 	}
+	
+	public void SwapBuffers()
+	{
+	    EGL10 currEGL = (EGL10)EGLContext.getEGL();
+
+	    EGLDisplay currDisplay = currEGL.eglGetCurrentDisplay();
+	    if ( currDisplay == EGL10.EGL_NO_DISPLAY ) return;    
+
+	    EGLSurface currSurface = currEGL.eglGetCurrentSurface( EGL10.EGL_DRAW );
+	    if ( currSurface == EGL10.EGL_NO_SURFACE ) return;
+
+	    currEGL.eglSwapBuffers( currDisplay, currSurface);
+	}
 
 	public void ShowKeyboard()
 	{
@@ -253,4 +270,4 @@ public class ZenGL extends GLSurfaceView
 			return true;
 		}
 	}
-}
+}

+ 18 - 1
demos/Android/07 - Sprites/src/zengl/android/ZenGL.java

@@ -23,6 +23,10 @@
 */
 package zengl.android;
 
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
 import javax.microedition.khronos.egl.EGLConfig;
 import javax.microedition.khronos.opengles.GL10;
 
@@ -171,6 +175,19 @@ public class ZenGL extends GLSurfaceView
 		((Activity)getContext()).finish();
 		System.exit( 0 );
 	}
+	
+	public void SwapBuffers()
+	{
+	    EGL10 currEGL = (EGL10)EGLContext.getEGL();
+
+	    EGLDisplay currDisplay = currEGL.eglGetCurrentDisplay();
+	    if ( currDisplay == EGL10.EGL_NO_DISPLAY ) return;    
+
+	    EGLSurface currSurface = currEGL.eglGetCurrentSurface( EGL10.EGL_DRAW );
+	    if ( currSurface == EGL10.EGL_NO_SURFACE ) return;
+
+	    currEGL.eglSwapBuffers( currDisplay, currSurface);
+	}
 
 	public void ShowKeyboard()
 	{
@@ -253,4 +270,4 @@ public class ZenGL extends GLSurfaceView
 			return true;
 		}
 	}
-}
+}

+ 18 - 1
demos/Android/08 - Sprite Engine/src/zengl/android/ZenGL.java

@@ -23,6 +23,10 @@
 */
 package zengl.android;
 
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
 import javax.microedition.khronos.egl.EGLConfig;
 import javax.microedition.khronos.opengles.GL10;
 
@@ -171,6 +175,19 @@ public class ZenGL extends GLSurfaceView
 		((Activity)getContext()).finish();
 		System.exit( 0 );
 	}
+	
+	public void SwapBuffers()
+	{
+	    EGL10 currEGL = (EGL10)EGLContext.getEGL();
+
+	    EGLDisplay currDisplay = currEGL.eglGetCurrentDisplay();
+	    if ( currDisplay == EGL10.EGL_NO_DISPLAY ) return;    
+
+	    EGLSurface currSurface = currEGL.eglGetCurrentSurface( EGL10.EGL_DRAW );
+	    if ( currSurface == EGL10.EGL_NO_SURFACE ) return;
+
+	    currEGL.eglSwapBuffers( currDisplay, currSurface);
+	}
 
 	public void ShowKeyboard()
 	{
@@ -253,4 +270,4 @@ public class ZenGL extends GLSurfaceView
 			return true;
 		}
 	}
-}
+}

+ 18 - 1
demos/Android/09 - Sprite Engine(Classes)/src/zengl/android/ZenGL.java

@@ -23,6 +23,10 @@
 */
 package zengl.android;
 
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
 import javax.microedition.khronos.egl.EGLConfig;
 import javax.microedition.khronos.opengles.GL10;
 
@@ -171,6 +175,19 @@ public class ZenGL extends GLSurfaceView
 		((Activity)getContext()).finish();
 		System.exit( 0 );
 	}
+	
+	public void SwapBuffers()
+	{
+	    EGL10 currEGL = (EGL10)EGLContext.getEGL();
+
+	    EGLDisplay currDisplay = currEGL.eglGetCurrentDisplay();
+	    if ( currDisplay == EGL10.EGL_NO_DISPLAY ) return;    
+
+	    EGLSurface currSurface = currEGL.eglGetCurrentSurface( EGL10.EGL_DRAW );
+	    if ( currSurface == EGL10.EGL_NO_SURFACE ) return;
+
+	    currEGL.eglSwapBuffers( currDisplay, currSurface);
+	}
 
 	public void ShowKeyboard()
 	{
@@ -253,4 +270,4 @@ public class ZenGL extends GLSurfaceView
 			return true;
 		}
 	}
-}
+}

+ 18 - 1
demos/Android/10 - Tiles/src/zengl/android/ZenGL.java

@@ -23,6 +23,10 @@
 */
 package zengl.android;
 
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
 import javax.microedition.khronos.egl.EGLConfig;
 import javax.microedition.khronos.opengles.GL10;
 
@@ -171,6 +175,19 @@ public class ZenGL extends GLSurfaceView
 		((Activity)getContext()).finish();
 		System.exit( 0 );
 	}
+	
+	public void SwapBuffers()
+	{
+	    EGL10 currEGL = (EGL10)EGLContext.getEGL();
+
+	    EGLDisplay currDisplay = currEGL.eglGetCurrentDisplay();
+	    if ( currDisplay == EGL10.EGL_NO_DISPLAY ) return;    
+
+	    EGLSurface currSurface = currEGL.eglGetCurrentSurface( EGL10.EGL_DRAW );
+	    if ( currSurface == EGL10.EGL_NO_SURFACE ) return;
+
+	    currEGL.eglSwapBuffers( currDisplay, currSurface);
+	}
 
 	public void ShowKeyboard()
 	{
@@ -253,4 +270,4 @@ public class ZenGL extends GLSurfaceView
 			return true;
 		}
 	}
-}
+}

+ 18 - 1
demos/Android/11 - Grid/src/zengl/android/ZenGL.java

@@ -23,6 +23,10 @@
 */
 package zengl.android;
 
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
 import javax.microedition.khronos.egl.EGLConfig;
 import javax.microedition.khronos.opengles.GL10;
 
@@ -171,6 +175,19 @@ public class ZenGL extends GLSurfaceView
 		((Activity)getContext()).finish();
 		System.exit( 0 );
 	}
+	
+	public void SwapBuffers()
+	{
+	    EGL10 currEGL = (EGL10)EGLContext.getEGL();
+
+	    EGLDisplay currDisplay = currEGL.eglGetCurrentDisplay();
+	    if ( currDisplay == EGL10.EGL_NO_DISPLAY ) return;    
+
+	    EGLSurface currSurface = currEGL.eglGetCurrentSurface( EGL10.EGL_DRAW );
+	    if ( currSurface == EGL10.EGL_NO_SURFACE ) return;
+
+	    currEGL.eglSwapBuffers( currDisplay, currSurface);
+	}
 
 	public void ShowKeyboard()
 	{
@@ -253,4 +270,4 @@ public class ZenGL extends GLSurfaceView
 			return true;
 		}
 	}
-}
+}

+ 18 - 1
demos/Android/12 - Render into Texture/src/zengl/android/ZenGL.java

@@ -23,6 +23,10 @@
 */
 package zengl.android;
 
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
 import javax.microedition.khronos.egl.EGLConfig;
 import javax.microedition.khronos.opengles.GL10;
 
@@ -171,6 +175,19 @@ public class ZenGL extends GLSurfaceView
 		((Activity)getContext()).finish();
 		System.exit( 0 );
 	}
+	
+	public void SwapBuffers()
+	{
+	    EGL10 currEGL = (EGL10)EGLContext.getEGL();
+
+	    EGLDisplay currDisplay = currEGL.eglGetCurrentDisplay();
+	    if ( currDisplay == EGL10.EGL_NO_DISPLAY ) return;    
+
+	    EGLSurface currSurface = currEGL.eglGetCurrentSurface( EGL10.EGL_DRAW );
+	    if ( currSurface == EGL10.EGL_NO_SURFACE ) return;
+
+	    currEGL.eglSwapBuffers( currDisplay, currSurface);
+	}
 
 	public void ShowKeyboard()
 	{
@@ -253,4 +270,4 @@ public class ZenGL extends GLSurfaceView
 			return true;
 		}
 	}
-}
+}

+ 18 - 1
demos/Android/13 - Particles/src/zengl/android/ZenGL.java

@@ -23,6 +23,10 @@
 */
 package zengl.android;
 
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
 import javax.microedition.khronos.egl.EGLConfig;
 import javax.microedition.khronos.opengles.GL10;
 
@@ -171,6 +175,19 @@ public class ZenGL extends GLSurfaceView
 		((Activity)getContext()).finish();
 		System.exit( 0 );
 	}
+	
+	public void SwapBuffers()
+	{
+	    EGL10 currEGL = (EGL10)EGLContext.getEGL();
+
+	    EGLDisplay currDisplay = currEGL.eglGetCurrentDisplay();
+	    if ( currDisplay == EGL10.EGL_NO_DISPLAY ) return;    
+
+	    EGLSurface currSurface = currEGL.eglGetCurrentSurface( EGL10.EGL_DRAW );
+	    if ( currSurface == EGL10.EGL_NO_SURFACE ) return;
+
+	    currEGL.eglSwapBuffers( currDisplay, currSurface);
+	}
 
 	public void ShowKeyboard()
 	{
@@ -253,4 +270,4 @@ public class ZenGL extends GLSurfaceView
 			return true;
 		}
 	}
-}
+}

+ 18 - 1
demos/Android/14 - Sound/src/zengl/android/ZenGL.java

@@ -23,6 +23,10 @@
 */
 package zengl.android;
 
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
 import javax.microedition.khronos.egl.EGLConfig;
 import javax.microedition.khronos.opengles.GL10;
 
@@ -171,6 +175,19 @@ public class ZenGL extends GLSurfaceView
 		((Activity)getContext()).finish();
 		System.exit( 0 );
 	}
+	
+	public void SwapBuffers()
+	{
+	    EGL10 currEGL = (EGL10)EGLContext.getEGL();
+
+	    EGLDisplay currDisplay = currEGL.eglGetCurrentDisplay();
+	    if ( currDisplay == EGL10.EGL_NO_DISPLAY ) return;    
+
+	    EGLSurface currSurface = currEGL.eglGetCurrentSurface( EGL10.EGL_DRAW );
+	    if ( currSurface == EGL10.EGL_NO_SURFACE ) return;
+
+	    currEGL.eglSwapBuffers( currDisplay, currSurface);
+	}
 
 	public void ShowKeyboard()
 	{
@@ -253,4 +270,4 @@ public class ZenGL extends GLSurfaceView
 			return true;
 		}
 	}
-}
+}

+ 18 - 1
demos/Android/15 - Video/src/zengl/android/ZenGL.java

@@ -23,6 +23,10 @@
 */
 package zengl.android;
 
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
 import javax.microedition.khronos.egl.EGLConfig;
 import javax.microedition.khronos.opengles.GL10;
 
@@ -171,6 +175,19 @@ public class ZenGL extends GLSurfaceView
 		((Activity)getContext()).finish();
 		System.exit( 0 );
 	}
+	
+	public void SwapBuffers()
+	{
+	    EGL10 currEGL = (EGL10)EGLContext.getEGL();
+
+	    EGLDisplay currDisplay = currEGL.eglGetCurrentDisplay();
+	    if ( currDisplay == EGL10.EGL_NO_DISPLAY ) return;    
+
+	    EGLSurface currSurface = currEGL.eglGetCurrentSurface( EGL10.EGL_DRAW );
+	    if ( currSurface == EGL10.EGL_NO_SURFACE ) return;
+
+	    currEGL.eglSwapBuffers( currDisplay, currSurface);
+	}
 
 	public void ShowKeyboard()
 	{
@@ -253,4 +270,4 @@ public class ZenGL extends GLSurfaceView
 			return true;
 		}
 	}
-}
+}

+ 18 - 1
demos/Android/16 - Physics/src/zengl/android/ZenGL.java

@@ -23,6 +23,10 @@
 */
 package zengl.android;
 
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
 import javax.microedition.khronos.egl.EGLConfig;
 import javax.microedition.khronos.opengles.GL10;
 
@@ -171,6 +175,19 @@ public class ZenGL extends GLSurfaceView
 		((Activity)getContext()).finish();
 		System.exit( 0 );
 	}
+	
+	public void SwapBuffers()
+	{
+	    EGL10 currEGL = (EGL10)EGLContext.getEGL();
+
+	    EGLDisplay currDisplay = currEGL.eglGetCurrentDisplay();
+	    if ( currDisplay == EGL10.EGL_NO_DISPLAY ) return;    
+
+	    EGLSurface currSurface = currEGL.eglGetCurrentSurface( EGL10.EGL_DRAW );
+	    if ( currSurface == EGL10.EGL_NO_SURFACE ) return;
+
+	    currEGL.eglSwapBuffers( currDisplay, currSurface);
+	}
 
 	public void ShowKeyboard()
 	{
@@ -253,4 +270,4 @@ public class ZenGL extends GLSurfaceView
 			return true;
 		}
 	}
-}
+}

+ 18 - 1
headers/android/zengl/android/ZenGL.java

@@ -23,6 +23,10 @@
 */
 package zengl.android;
 
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
 import javax.microedition.khronos.egl.EGLConfig;
 import javax.microedition.khronos.opengles.GL10;
 
@@ -171,6 +175,19 @@ public class ZenGL extends GLSurfaceView
 		((Activity)getContext()).finish();
 		System.exit( 0 );
 	}
+	
+	public void SwapBuffers()
+	{
+	    EGL10 currEGL = (EGL10)EGLContext.getEGL();
+
+	    EGLDisplay currDisplay = currEGL.eglGetCurrentDisplay();
+	    if ( currDisplay == EGL10.EGL_NO_DISPLAY ) return;    
+
+	    EGLSurface currSurface = currEGL.eglGetCurrentSurface( EGL10.EGL_DRAW );
+	    if ( currSurface == EGL10.EGL_NO_SURFACE ) return;
+
+	    currEGL.eglSwapBuffers( currDisplay, currSurface);
+	}
 
 	public void ShowKeyboard()
 	{
@@ -253,4 +270,4 @@ public class ZenGL extends GLSurfaceView
 			return true;
 		}
 	}
-}
+}

+ 4 - 2
src/zgl_application.pas

@@ -175,6 +175,7 @@ var
   appClass        : JClass;
   appObject       : JObject;
   appFinish       : JMethodID;
+  appSwapBuffers  : JMethodID;
   appShowKeyboard : JMethodID;
   appHideKeyboard : JMethodID;
   appLock         : zglTCriticalSection;
@@ -1591,6 +1592,7 @@ begin
   appClass := appEnv^.FindClass( appEnv, 'zengl/android/ZenGL' );
 
   appFinish       := appEnv^.GetMethodID( appEnv, appClass, 'Finish', '()V' );
+  appSwapBuffers  := appEnv^.GetMethodID( appEnv, appClass, 'SwapBuffers', '()V' );
   appShowKeyboard := appEnv^.GetMethodID( appEnv, appClass, 'ShowKeyboard', '()V' );
   appHideKeyboard := appEnv^.GetMethodID( appEnv, appClass, 'HideKeyboard', '()V' );
 
@@ -1627,8 +1629,8 @@ procedure Java_zengl_android_ZenGL_zglNativeSurfaceCreated( env : PJNIEnv; thiz
 begin
   thread_CSEnter( appLock );
 
-  appEnv        := env;
-  appObject     := thiz;
+  appEnv    := env;
+  appObject := thiz;
 
   if appInitialized Then
     begin

+ 1 - 1
src/zgl_main.pas

@@ -49,7 +49,7 @@ uses
 
 const
   cs_ZenGL    = 'ZenGL 0.3.6';
-  cs_Date     = '2012.11.08';
+  cs_Date     = '2012.11.13';
   cv_major    = 0;
   cv_minor    = 3;
   cv_revision = 6;

+ 3 - 0
src/zgl_screen.pas

@@ -528,6 +528,9 @@ begin
   {$IFDEF iOS}
   eglContext.presentRenderbuffer( GL_RENDERBUFFER );
   {$ENDIF}
+  {$IFDEF ANDROID}
+  appEnv^.CallVoidMethod( appEnv, appObject, appSwapBuffers );
+  {$ENDIF}
 {$ENDIF}
 end;