Refresh Rate : Are we Drawing this Frame?

see my producer consumer pattern. Why do you have to fix your timestep instead of having a SetFPS function? - #4 by Jack-Ji

you can get your 8000 fps and just draaw the last good frame, and smooth the frameraete… i use 300fps… for windows… on android i do rull throttle… i dont use locks i cant. android will stutter… if its skiips framess thats fine… its you are running physics or ai, touch is faster thant seeintg… 60 fps is tgood enoug… thad or if you touch your screen it might go to 120 or more…

chapt gpt wil tell you all this… using System;
using System.Collections.Generic;
using System.Threading;

struct FrameData
{
public List Vertices;
public Color Color;
public Vector2D Position;
// Other data as needed
}

class LocklessProducerConsumerRenderer
{
private FrameData frameBuffer;
private int bufferSize;
private volatile int writeIndex = 0;
private volatile int readIndex = 0;

public LocklessProducerConsumerRenderer(int bufferSize)
{
    this.bufferSize = bufferSize;
    frameBuffer = new FrameData[bufferSize];
}

public void UpdateFrame(FrameData newFrame)
{
    int nextWriteIndex = (writeIndex + 1) % bufferSize;

    // Check if the buffer is full
    if (nextWriteIndex != readIndex)
    {
        frameBuffer[writeIndex] = newFrame;
        writeIndex = nextWriteIndex;
    }
    else
    {
        // Handle buffer full situation (e.g., drop frames or wait)
    }
}

public void RenderFrames()
{
    while (true)
    {
        if (readIndex != writeIndex)
        {
            FrameData frameToRender = frameBuffer[readIndex];
            readIndex = (readIndex + 1) % bufferSize;

            // Render the frame using frameToRender data
            // ...
        }
        else
        {
            // Handle no frames to render (e.g., wait or continue)
        }
    }
}

}