()
| 829 | splashScreen = null; |
| 830 | } |
| 831 | public static TextureRegion takeScreenshot() { |
| 832 | FThreads.invokeInEdtNowOrLater(() -> { |
| 833 | if (lastScreenTexture != null) |
| 834 | lastScreenTexture.getTexture().dispose(); |
| 835 | //some Android device don't support RGBA on FrameBuffer like Unisoc T618 with Mali G52 MP2 and maybe others... |
| 836 | Texture texture = new Texture(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), Pixmap.Format.RGB888); |
| 837 | Gdx.gl.glEnable(GL20.GL_TEXTURE_2D); |
| 838 | Gdx.gl.glActiveTexture(GL20.GL_TEXTURE0); |
| 839 | texture.bind(); |
| 840 | Gdx.gl.glCopyTexImage2D(GL20.GL_TEXTURE_2D, 0, GL20.GL_RGB, 0, 0,Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), 0); |
| 841 | Gdx.gl.glDisable(GL20.GL_TEXTURE_2D); |
| 842 | lastScreenTexture = new TextureRegion(texture, 0, Gdx.graphics.getHeight(), Gdx.graphics.getWidth(), -Gdx.graphics.getHeight()); |
| 843 | }); |
| 844 | return lastScreenTexture; |
| 845 | } |
| 846 | |
| 847 | private static void setCurrentScreen(FScreen screen0) { |
| 848 | String toNewScreen = screen0 != null ? screen0.toString() : ""; |
no test coverage detected