(target)
| 1304 | } |
| 1305 | |
| 1306 | function testDepthGetsCleared(target) { |
| 1307 | target.pixelDensity(1); |
| 1308 | target.noStroke(); |
| 1309 | target.fill(255, 0, 0); |
| 1310 | target.plane(target.width, target.height); |
| 1311 | assertAllPixelsAreColor(target, 255, 0, 0, 255); |
| 1312 | |
| 1313 | target.background(255); |
| 1314 | target.push(); |
| 1315 | target.translate(0, 0, -10); // Move farther away |
| 1316 | target.fill(0, 0, 255); |
| 1317 | // expanded to fill the screen |
| 1318 | target.plane(target.width * 4, target.height * 4); |
| 1319 | target.pop(); |
| 1320 | // The farther-away plane should not be occluded because we cleared |
| 1321 | // the screen with background() |
| 1322 | assertAllPixelsAreColor(target, 0, 0, 255, 255); |
| 1323 | } |
| 1324 | |
| 1325 | test('background() resets the depth buffer of the main canvas', function() { |
| 1326 | myp5.createCanvas(10, 10, myp5.WEBGL); |
no test coverage detected