()
| 35 | } |
| 36 | |
| 37 | public void updateScene() { |
| 38 | fadeup = fading++ < 50 && Main.os!=Main.OS.mac; |
| 39 | |
| 40 | if (GraphicsContext.isResizing) { |
| 41 | for (Layer l : layers.values()) { |
| 42 | if (l.fbo.specification.width * l.res != window.getWidth()*window.getRetinaScaleFactor() || l.fbo.specification.height * l.res != window.getHeight()*window.getRetinaScaleFactor()) { |
| 43 | l.fbo.finalize(); |
| 44 | Scene sceneWas = l.fbo.scene; |
| 45 | l.fbo = newFBO(l.fbo.specification.unit, l.res); |
| 46 | l.fbo.setScene(sceneWas); |
| 47 | resizing = true; |
| 48 | Log.log("graphics.debug", () -> " scene was :" + sceneWas); |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | for (Layer l : layers.values()) { |
| 54 | l.needsRedrawing = Math.max(-1, l.needsRedrawing - 1); |
| 55 | if (resizing) |
| 56 | { |
| 57 | System.out.println(" drawing (resizing) :"+l); |
| 58 | l.fbo.draw(); |
| 59 | } |
| 60 | else if (l.needsRedrawing > -1 || fadeup) { |
| 61 | Log.log("drawing", () -> " drawing dependancies of " + l); |
| 62 | l.drawDependancies(); |
| 63 | Log.log("drawing", () -> " drawing because dirty " + l); |
| 64 | // System.out.println(" redrawing layer "+l.name+" because "+l.needsRedrawing); |
| 65 | l.fbo.draw(); |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | if (fadeup) { |
| 70 | window.requestRepaint(); |
| 71 | } |
| 72 | resizing = false; |
| 73 | } |
| 74 | |
| 75 | private FBO newFBO() { |
| 76 | return newFBO(0); |
nothing calls this directly
no test coverage detected