MCPcopy Create free account
hub / github.com/Card-Forge/forge / takeScreenshot

Method takeScreenshot

forge-gui-mobile/src/forge/Forge.java:831–845  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() : "";

Callers 12

afterDbLoadedMethod · 0.95
switchToClassicMethod · 0.95
storeScreenMethod · 0.95
startRoundMethod · 0.95
exitDuelSceneMethod · 0.95
startRoundMethod · 0.95
createPreviewMethod · 0.95
runMethod · 0.95
beginDuelMethod · 0.95
onActingMethod · 0.95
LoadingOverlayMethod · 0.95

Calls 5

invokeInEdtNowOrLaterMethod · 0.95
disposeMethod · 0.65
getWidthMethod · 0.65
getHeightMethod · 0.65
getTextureMethod · 0.45

Tested by

no test coverage detected