Android Open Source - OpenGLShadowDemo F P S Counter






From Project

Back to project page OpenGLShadowDemo.

License

The source code is released under:

MIT License

If you think the Android project OpenGLShadowDemo listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.projectI.openglshadowdemo.common;
// w  w w  .  ja v a  2  s .c om
import android.util.Log;

public class FPSCounter {
    long startTime = System.nanoTime();
    int frames = 0;

    public void logFrame() {
        frames++;
        if(System.nanoTime() - startTime >= 1000000000) {
            Log.i("FPSCounter", "fps: " + frames);
            frames = 0;
            startTime = System.nanoTime();
        }
    }
}




Java Source Code List

com.projectI.openglshadowdemo.Cube.java
com.projectI.openglshadowdemo.Plane.java
com.projectI.openglshadowdemo.ShadowsActivity.java
com.projectI.openglshadowdemo.ShadowsGLSurfaceView.java
com.projectI.openglshadowdemo.ShadowsRenderer.java
com.projectI.openglshadowdemo.common.FPSCounter.java
com.projectI.openglshadowdemo.common.RenderConstants.java
com.projectI.openglshadowdemo.common.RenderProgram.java