Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielBRDeveloper committed Dec 21, 2024
1 parent 3787358 commit a252447
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import android.content.Context;
import android.opengl.GLSurfaceView;
import android.os.Build;
import android.os.Debug;
import android.view.Surface;
import android.view.SurfaceHolder;

import androidx.annotation.NonNull;
import com.panda3ds.pandroid.math.Vector2;
Expand All @@ -25,6 +28,16 @@ public PandaGlSurfaceView(Context context, String romPath) {
setRenderer(renderer);
}

@Override
public void surfaceCreated(SurfaceHolder holder) {
super.surfaceCreated(holder);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
holder.getSurface().setFrameRate(120.0f, Surface.FRAME_RATE_COMPATIBILITY_FIXED_SOURCE, Surface.CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS);
} else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.R) {
holder.getSurface().setFrameRate(120.0f, Surface.FRAME_RATE_COMPATIBILITY_FIXED_SOURCE);
}
}

public ConsoleRenderer getRenderer() { return renderer; }

@Override
Expand Down

0 comments on commit a252447

Please sign in to comment.