This discussion with Solar-Pro-2 lists some platform-specific solutions, but the software is supposed to function portable across all popular platforms (such as Windows or Unix derivatives).
Wish to know how to use portable (SDL2/GLES2) functions to test if the java window is occluded (does not require maximized forefront window, just requires that the whole java window is occluded, which suggests compositors have improved), so that the physics loop is more course (less granular) when the contents are not shown.
What prompted this was: noticed that top shows xwayland + gnome-shell CPU usage drops to ~0% when the java window is occluded, plus java’s CPU usage drops from 22% to 6% when occluded: the goal is that if the contents are not shown, to have 4x less physics steps, but 4x larger physics steps, which should lower java CPU usage down to 2%.
Since Linux does this, guess Windows does too, so wish to know the most portable functions to use.
Source code for the java software is at SusuJava (FLOSS Java sim) now uses Khronos' GLES2 (includes JNI for SDL2) - #2 by SwuduSusuwu , but guess this “occlusion mode” is not java-specific