Skip to content

Frame rate is not accurate if it is set to 60 or higher on Android #16912

Open
@minggo

Description

@minggo

Current implementation of FPS controller codes are

public void onDrawFrame(final GL10 gl) {
        /*
         * No need to use algorithm in default(60 FPS) situation,
         * since onDrawFrame() was called by system 60 times per second by default.
         */
        if (sAnimationInterval <= 1.0 / 60 * Cocos2dxRenderer.NANOSECONDSPERSECOND) {
            // when FPS is set to 60 or higher, not FPS controlling
            Cocos2dxRenderer.nativeRender();
        } else {
            // fps control codes
        }
    }

There is not doc says onDrawFrame is invoked 60 per second. So if onDrawFrame is invoked more than 60 per second and sAnimationInterval < 1.0 / 60 * Cocos2dxRenderer.NANOSECONDSPERSECOND, then there is not FPS controlling, which may make real FPS is more than 60.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions