Browse Source

Fixed background in fullscreen mode...

hutattedonmyarm 12 years ago
parent
commit
b0978982ef
1 changed files with 9 additions and 2 deletions
  1. 9
    2
      CubeControl/Led3D.java

+ 9
- 2
CubeControl/Led3D.java View File

@@ -99,6 +99,10 @@ public class Led3D {
99 99
 		beh3.setSchedulingBounds(boundBox);
100 100
 		transGroup.addChild(beh3);
101 101
 
102
+		
103
+		group.setCapability(BranchGroup.ALLOW_CHILDREN_READ);
104
+		group.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);
105
+		group.setCapability(BranchGroup.ALLOW_DETACH);
102 106
 		background = createBackground();
103 107
 		fullscreenBackground = createFullscreenBackground();
104 108
 		group.addChild(background);
@@ -251,7 +255,7 @@ public class Led3D {
251 255
 	
252 256
 	//create fullscreen background
253 257
 	private Background createFullscreenBackground() {
254
-		Background bg = new Background();
258
+		Background bg = new Background(0.0f, 0.0f, 1.0f);
255 259
 		int radius = Toolkit.getDefaultToolkit().getScreenSize().width;
256 260
 		bg.setApplicationBounds(new BoundingSphere(new Point3d(0.0, 0.0, 0.0), radius));
257 261
 		return bg;
@@ -259,19 +263,22 @@ public class Led3D {
259 263
 	}
260 264
 	
261 265
 	public void enterFullscreen() {
266
+		group.detach();
262 267
 		if(group.indexOfChild(background) != -1){
263 268
 			group.removeChild(background);
264 269
 		}
265 270
 		group.addChild(fullscreenBackground);
271
+		universe.addBranchGraph(group);
266 272
 		
267 273
 	}
268 274
 	
269 275
 	public void leaveFullscreen() {
276
+		group.detach();
270 277
 		if(group.indexOfChild(fullscreenBackground) != -1) {
271 278
 			group.removeChild(fullscreenBackground);
272 279
 		}
273
-		
274 280
 		group.addChild(background);
281
+		universe.addBranchGraph(group);
275 282
 		
276 283
 	}
277 284
 }

Loading…
Cancel
Save