Example usage for javax.microedition.khronos.egl EGL10 eglSwapBuffers

List of usage examples for javax.microedition.khronos.egl EGL10 eglSwapBuffers

Introduction

In this page you can find the example usage for javax.microedition.khronos.egl EGL10 eglSwapBuffers.

Prototype

boolean eglSwapBuffers(EGLDisplay display, EGLSurface surface);

Source Link

Usage

From source file:uk.co.armedpineapple.cth.SDLActivity.java

public static void flipEGL() {
    try {// w  ww .j a v a 2s  .c o m
        EGL10 egl = (EGL10) EGLContext.getEGL();

        egl.eglWaitNative(EGL10.EGL_CORE_NATIVE_ENGINE, null);

        // drawing here

        egl.eglWaitGL();

        egl.eglSwapBuffers(SDLActivity.mEGLDisplay, SDLActivity.mEGLSurface);

    } catch (Exception e) {
        Log.v("SDL", "flipEGL(): " + e);
        for (StackTraceElement s : e.getStackTrace()) {
            Log.v("SDL", s.toString());
        }
    }
}