Skip to content

Commit

Permalink
returned floats to timing variables and removed unsigned int in Shade…
Browse files Browse the repository at this point in the history
…r.java
  • Loading branch information
bmabsout authored Feb 8, 2024
1 parent f5da3f7 commit 3381240
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/src/main/java/com/OxGames/OxShell/Wallpaper/Shader.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class Shader {

private int targetFPS = 30;
private long startTime;
private unsigned int frame;
private int frame;
private long prevTime;

private FloatBuffer quadVertices;
Expand Down Expand Up @@ -325,9 +325,9 @@ protected void draw() {

frame++;
long currentTime = System.currentTimeMillis() - startTime;
double secondsElapsed = (currentTime) / 1000.0; // will be input into shader as iTime
double deltaTime = (currentTime - prevTime) / 1000.0;
double fps = 1 / deltaTime;
float secondsElapsed = (currentTime) / 1000.0; // will be input into shader as iTime
float deltaTime = (currentTime - prevTime) / 1000.0;
float fps = 1 / deltaTime;
prevTime = currentTime;
if (secondsElapsed > 60 * 60 * 24 || Double.isNaN(fps) || Double.isNan(deltaTime)) {
frame = 0;
Expand Down

0 comments on commit 3381240

Please sign in to comment.