At the moment I’m using SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 0); and glFlush(); to get low latency frames, unless I measured wrong it seems to be 2 frames faster. I haven’t tried running the code on mac or windows, but I imagine it would work since those OS support gl? What are the benefits of sdl_gpu if I don’t need shaders? I only plan to support linux, mac and windows, but maybe I’ll support an android tablet
I don’t think it’ll matter but all I do is clear the screen, fill rectangles, render textures and sometimes flip textures. Nothing complicated
With SDL_GPU you have the option of using mailbox presentation mode on operating systems and drivers that support it. macOS currently doesn’t.
You can also directly control how many frames are “in flight”. In other words, how many frames ahead of the currently displayed frame the application can get. Set it to 2 and you have triple buffering, set it to 1 for regular ol’ double buffering.
Is frame latency an actual issue you’re running into? Also, be aware that if you’re running in a window (or in borderless window “fullscreen” mode on some OSes) the window compositor itself can introduce an unavoidable frame of latency.
Is frame latency an actual issue you’re running into?
Yes. That was my initial motivation. I was testing something and used obs-studio to record my screen. For fun I put in code that wrote to stderr every keypress and I noticed I’d see the result in my app 2 frames later (recorded at 60fps). After doing what I mentioned in the other thread, the results show up the same frame as I saw the stderr text. This is using a window. I don’t plan on changing resolution and having exclusive access like those old DOS/win98 games, but I am considering removing window borders so I can customize the top