@@ -629,9 +629,9 @@ public void dispose() { // PGraphics
629
629
pgl .swapBuffers ();
630
630
}
631
631
632
- deletePolyBuffers ();
633
- deleteLineBuffers ();
634
- deletePointBuffers ();
632
+ finalizePolyBuffers ();
633
+ finalizeLineBuffers ();
634
+ finalizePointBuffers ();
635
635
636
636
deleteSurfaceTextures ();
637
637
if (primarySurface ) {
@@ -1378,76 +1378,53 @@ protected boolean polyBuffersContextIsOutdated() {
1378
1378
}
1379
1379
1380
1380
1381
- protected void deletePolyBuffers () {
1382
- if (polyBuffersCreated ) {
1383
- deleteVertexBufferObject (glPolyVertex , polyBuffersContext , pgl );
1384
- glPolyVertex = 0 ;
1385
-
1386
- deleteVertexBufferObject (glPolyColor , polyBuffersContext , pgl );
1387
- glPolyColor = 0 ;
1388
-
1389
- deleteVertexBufferObject (glPolyNormal , polyBuffersContext , pgl );
1390
- glPolyNormal = 0 ;
1391
-
1392
- deleteVertexBufferObject (glPolyTexcoord , polyBuffersContext , pgl );
1393
- glPolyTexcoord = 0 ;
1394
-
1395
- deleteVertexBufferObject (glPolyAmbient , polyBuffersContext , pgl );
1396
- glPolyAmbient = 0 ;
1397
-
1398
- deleteVertexBufferObject (glPolySpecular , polyBuffersContext , pgl );
1399
- glPolySpecular = 0 ;
1400
-
1401
- deleteVertexBufferObject (glPolyEmissive , polyBuffersContext , pgl );
1402
- glPolyEmissive = 0 ;
1403
-
1404
- deleteVertexBufferObject (glPolyShininess , polyBuffersContext , pgl );
1405
- glPolyShininess = 0 ;
1406
-
1407
- deleteVertexBufferObject (glPolyIndex , polyBuffersContext , pgl );
1408
- glPolyIndex = 0 ;
1409
-
1410
- polyBuffersCreated = false ;
1411
- }
1412
- }
1413
-
1414
-
1415
1381
protected void finalizePolyBuffers () {
1416
1382
if (glPolyVertex != 0 ) {
1417
1383
PGraphicsOpenGL .finalizeVertexBufferObject (glPolyVertex , polyBuffersContext );
1384
+ glPolyVertex = 0 ;
1418
1385
}
1419
1386
1420
1387
if (glPolyColor != 0 ) {
1421
1388
PGraphicsOpenGL .finalizeVertexBufferObject (glPolyColor , polyBuffersContext );
1389
+ glPolyColor = 0 ;
1422
1390
}
1423
1391
1424
1392
if (glPolyNormal != 0 ) {
1425
1393
PGraphicsOpenGL .finalizeVertexBufferObject (glPolyNormal , polyBuffersContext );
1394
+ glPolyNormal = 0 ;
1426
1395
}
1427
1396
1428
1397
if (glPolyTexcoord != 0 ) {
1429
1398
PGraphicsOpenGL .finalizeVertexBufferObject (glPolyTexcoord , polyBuffersContext );
1399
+ glPolyTexcoord = 0 ;
1430
1400
}
1431
1401
1432
1402
if (glPolyAmbient != 0 ) {
1433
1403
PGraphicsOpenGL .finalizeVertexBufferObject (glPolyAmbient , polyBuffersContext );
1404
+ glPolyAmbient = 0 ;
1434
1405
}
1435
1406
1436
1407
if (glPolySpecular != 0 ) {
1437
1408
PGraphicsOpenGL .finalizeVertexBufferObject (glPolySpecular , polyBuffersContext );
1409
+ glPolySpecular = 0 ;
1438
1410
}
1439
1411
1440
1412
if (glPolyEmissive != 0 ) {
1441
1413
PGraphicsOpenGL .finalizeVertexBufferObject (glPolyEmissive , polyBuffersContext );
1414
+ glPolyEmissive = 0 ;
1442
1415
}
1443
1416
1444
1417
if (glPolyShininess != 0 ) {
1445
1418
PGraphicsOpenGL .finalizeVertexBufferObject (glPolyShininess , polyBuffersContext );
1419
+ glPolyShininess = 0 ;
1446
1420
}
1447
1421
1448
1422
if (glPolyIndex != 0 ) {
1449
1423
PGraphicsOpenGL .finalizeVertexBufferObject (glPolyIndex , polyBuffersContext );
1424
+ glPolyIndex = 0 ;
1450
1425
}
1426
+
1427
+ polyBuffersCreated = false ;
1451
1428
}
1452
1429
1453
1430
@@ -1526,41 +1503,28 @@ protected boolean lineBufferContextIsOutdated() {
1526
1503
}
1527
1504
1528
1505
1529
- protected void deleteLineBuffers () {
1530
- if (lineBuffersCreated ) {
1531
- deleteVertexBufferObject (glLineVertex , lineBuffersContext , pgl );
1532
- glLineVertex = 0 ;
1533
-
1534
- deleteVertexBufferObject (glLineColor , lineBuffersContext , pgl );
1535
- glLineColor = 0 ;
1536
-
1537
- deleteVertexBufferObject (glLineAttrib , lineBuffersContext , pgl );
1538
- glLineAttrib = 0 ;
1539
-
1540
- deleteVertexBufferObject (glLineIndex , lineBuffersContext , pgl );
1541
- glLineIndex = 0 ;
1542
-
1543
- lineBuffersCreated = false ;
1544
- }
1545
- }
1546
-
1547
-
1548
1506
protected void finalizeLineBuffers () {
1549
1507
if (glLineVertex != 0 ) {
1550
1508
PGraphicsOpenGL .finalizeVertexBufferObject (glLineVertex , lineBuffersContext );
1509
+ glLineVertex = 0 ;
1551
1510
}
1552
1511
1553
1512
if (glLineColor != 0 ) {
1554
1513
PGraphicsOpenGL .finalizeVertexBufferObject (glLineColor , lineBuffersContext );
1514
+ glLineColor = 0 ;
1555
1515
}
1556
1516
1557
1517
if (glLineAttrib != 0 ) {
1558
1518
PGraphicsOpenGL .finalizeVertexBufferObject (glLineAttrib , lineBuffersContext );
1519
+ glLineAttrib = 0 ;
1559
1520
}
1560
1521
1561
1522
if (glLineIndex != 0 ) {
1562
1523
PGraphicsOpenGL .finalizeVertexBufferObject (glLineIndex , lineBuffersContext );
1524
+ glLineIndex = 0 ;
1563
1525
}
1526
+
1527
+ lineBuffersCreated = false ;
1564
1528
}
1565
1529
1566
1530
@@ -1638,41 +1602,28 @@ protected boolean pointBuffersContextIsOutdated() {
1638
1602
}
1639
1603
1640
1604
1641
- protected void deletePointBuffers () {
1642
- if (pointBuffersCreated ) {
1643
- deleteVertexBufferObject (glPointVertex , pointBuffersContext , pgl );
1644
- glPointVertex = 0 ;
1645
-
1646
- deleteVertexBufferObject (glPointColor , pointBuffersContext , pgl );
1647
- glPointColor = 0 ;
1648
-
1649
- deleteVertexBufferObject (glPointAttrib , pointBuffersContext , pgl );
1650
- glPointAttrib = 0 ;
1651
-
1652
- deleteVertexBufferObject (glPointIndex , pointBuffersContext , pgl );
1653
- glPointIndex = 0 ;
1654
-
1655
- pointBuffersCreated = false ;
1656
- }
1657
- }
1658
-
1659
-
1660
1605
protected void finalizePointBuffers () {
1661
1606
if (glPointVertex != 0 ) {
1662
1607
PGraphicsOpenGL .finalizeVertexBufferObject (glPointVertex , pointBuffersContext );
1608
+ glPointVertex = 0 ;
1663
1609
}
1664
1610
1665
1611
if (glPointColor != 0 ) {
1666
1612
PGraphicsOpenGL .finalizeVertexBufferObject (glPointColor , pointBuffersContext );
1613
+ glPointColor = 0 ;
1667
1614
}
1668
1615
1669
1616
if (glPointAttrib != 0 ) {
1670
1617
PGraphicsOpenGL .finalizeVertexBufferObject (glPointAttrib , pointBuffersContext );
1618
+ glPointAttrib = 0 ;
1671
1619
}
1672
1620
1673
1621
if (glPointIndex != 0 ) {
1674
1622
PGraphicsOpenGL .finalizeVertexBufferObject (glPointIndex , pointBuffersContext );
1623
+ glPointIndex = 0 ;
1675
1624
}
1625
+
1626
+ pointBuffersCreated = false ;
1676
1627
}
1677
1628
1678
1629
0 commit comments