I want to capture the screen. Libgdx provides some of the functions defined in the ScreenUtils class.
For example final Pixmap pixmap = ScreenUtils.getFrameBufferPixmap(x, y, w, h);
My problem is that it takes about 1-3 seconds to get this information. During this time, the game cycle is blocked, and the user will define it as a delay.
Inside the ScreenUtils class, ScreenUtils used. If I run the ScreenUtils.getFrameBufferPixmap method in the stream, there is no delay, but it captures the screen using the wrong method, which is logical, since the game loop starts and changes the material.
Is it possible to copy a GL context or save it and generate a Pixmap at a later point with Thread? Of course, the copy / save operation should be done instantly, otherwise I can do nothing.
I use ShapeRenderer to display my stuff on the screen.
java android multithreading libgdx
Niklas
source share