From 41a4aa15484c77b96a401e113fcf34d59e605d2c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 2 Aug 2006 19:55:03 +0000 Subject: [PATCH] Added viewer.cleanup_frame() to all examples. --- examples/osganimate/osganimate.cpp | 8 +++++++- examples/osgautotransform/osgautotransform.cpp | 8 +++++++- examples/osgbillboard/osgbillboard.cpp | 8 +++++++- examples/osgblendequation/osgblendequation.cpp | 8 +++++++- examples/osgcallback/osgcallback.cpp | 8 +++++++- examples/osgcatch/osgcatch.cpp | 5 ++++- examples/osgclip/osgclip.cpp | 8 +++++++- examples/osgcluster/osgcluster.cpp | 8 +++++++- examples/osgcopy/osgcopy.cpp | 8 +++++++- examples/osgcubemap/osgcubemap.cpp | 8 +++++++- examples/osgdelaunay/osgdelaunay.cpp | 8 +++++++- examples/osgdepthshadow/osgdepthshadow.cpp | 8 +++++++- examples/osgdistortion/osgdistortion.cpp | 8 +++++++- examples/osgforest/osgforest.cpp | 8 +++++++- examples/osgfxbrowser/osgfxbrowser.cpp | 8 +++++++- examples/osggeodemo/osggeodemo.cpp | 8 +++++++- examples/osggeometry/osggeometry.cpp | 8 +++++++- examples/osghud/osghud.cpp | 8 +++++++- examples/osgimpostor/osgimpostor.cpp | 7 ++++++- examples/osgkeyboard/osgkeyboard.cpp | 8 +++++++- examples/osglauncher/osglauncher.cpp | 8 +++++++- examples/osglight/osglight.cpp | 12 +++++++++--- examples/osglightpoint/osglightpoint.cpp | 8 +++++++- examples/osglogicop/osglogicop.cpp | 8 +++++++- examples/osglogo/osglogo.cpp | 8 +++++++- examples/osgmotionblur/osgmotionblur.cpp | 8 +++++++- examples/osgmovie/osgmovie.cpp | 8 +++++++- examples/osgmultiplecameras/osgmultiplecameras.cpp | 8 +++++++- examples/osgmultitexture/osgmultitexture.cpp | 8 +++++++- examples/osgoccluder/osgoccluder.cpp | 7 +++++++ examples/osgparametric/osgparametric.cpp | 8 +++++++- examples/osgparticle/osgparticle.cpp | 8 +++++++- examples/osgparticleeffects/osgparticleeffects.cpp | 8 +++++++- examples/osgphotoalbum/osgphotoalbum.cpp | 8 +++++++- examples/osgpick/osgpick.cpp | 8 +++++++- examples/osgplanets/osgplanets.cpp | 8 +++++++- examples/osgpoints/osgpoints.cpp | 8 +++++++- examples/osgpointsprite/osgpointsprite.cpp | 9 +++++++++ examples/osgprecipitation/osgprecipitation.cpp | 8 +++++++- examples/osgprerender/osgprerender.cpp | 8 +++++++- examples/osgprerendercubemap/osgprerendercubemap.cpp | 8 +++++++- examples/osgreflect/osgreflect.cpp | 8 +++++++- examples/osgscalarbar/osgscalarbar.cpp | 8 +++++++- examples/osgscribe/osgscribe.cpp | 8 +++++++- examples/osgsequence/osgsequence.cpp | 8 +++++++- examples/osgshaders/osgshaders.cpp | 8 ++++++++ examples/osgshaderterrain/osgshaderterrain.cpp | 8 +++++++- examples/osgshadowtexture/osgshadowtexture.cpp | 8 +++++++- examples/osgshape/osgshape.cpp | 8 +++++++- examples/osgsimplifier/osgsimplifier.cpp | 8 +++++++- examples/osgsimulation/osgsimulation.cpp | 8 +++++++- examples/osgspacewarp/osgspacewarp.cpp | 8 +++++++- examples/osgspheresegment/osgspheresegment.cpp | 8 +++++++- examples/osgspotlight/osgspotlight.cpp | 8 +++++++- examples/osgstereoimage/osgstereoimage.cpp | 8 +++++++- examples/osgteapot/osgteapot.cpp | 8 +++++++- examples/osgtext/osgtext.cpp | 8 +++++++- examples/osgtexture1D/osgtexture1D.cpp | 8 +++++++- examples/osgtexture2D/osgtexture2D.cpp | 8 +++++++- examples/osgtexture3D/osgtexture3D.cpp | 7 ++++++- examples/osgtexturerectangle/osgtexturerectangle.cpp | 8 +++++++- examples/osgvertexprogram/osgvertexprogram.cpp | 8 +++++++- examples/osgvolume/osgvolume.cpp | 7 ++++++- 63 files changed, 440 insertions(+), 62 deletions(-) diff --git a/examples/osganimate/osganimate.cpp b/examples/osganimate/osganimate.cpp index 2af381168..28bc4605b 100644 --- a/examples/osganimate/osganimate.cpp +++ b/examples/osganimate/osganimate.cpp @@ -279,7 +279,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgautotransform/osgautotransform.cpp b/examples/osgautotransform/osgautotransform.cpp index 5e51b0163..210d2c72e 100644 --- a/examples/osgautotransform/osgautotransform.cpp +++ b/examples/osgautotransform/osgautotransform.cpp @@ -214,7 +214,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgbillboard/osgbillboard.cpp b/examples/osgbillboard/osgbillboard.cpp index 829fde950..94f0ac9db 100644 --- a/examples/osgbillboard/osgbillboard.cpp +++ b/examples/osgbillboard/osgbillboard.cpp @@ -221,7 +221,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgblendequation/osgblendequation.cpp b/examples/osgblendequation/osgblendequation.cpp index 862921642..84e3a61a9 100644 --- a/examples/osgblendequation/osgblendequation.cpp +++ b/examples/osgblendequation/osgblendequation.cpp @@ -203,7 +203,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgcallback/osgcallback.cpp b/examples/osgcallback/osgcallback.cpp index 7ee9472ff..e0113deb8 100644 --- a/examples/osgcallback/osgcallback.cpp +++ b/examples/osgcallback/osgcallback.cpp @@ -199,7 +199,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgcatch/osgcatch.cpp b/examples/osgcatch/osgcatch.cpp index df51ef1dd..8e3adf75d 100644 --- a/examples/osgcatch/osgcatch.cpp +++ b/examples/osgcatch/osgcatch.cpp @@ -1478,7 +1478,10 @@ int main( int argc, char **argv ) viewer.frame(); } - + + // wait for all cull and draw threads to complete. + viewer.sync(); + // run a clean up frame to delete all OpenGL objects. viewer.cleanup_frame(); diff --git a/examples/osgclip/osgclip.cpp b/examples/osgclip/osgclip.cpp index 420897e76..f1ed3c3e5 100644 --- a/examples/osgclip/osgclip.cpp +++ b/examples/osgclip/osgclip.cpp @@ -171,7 +171,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgcluster/osgcluster.cpp b/examples/osgcluster/osgcluster.cpp index 1553c3f5c..0f8ea3e3b 100644 --- a/examples/osgcluster/osgcluster.cpp +++ b/examples/osgcluster/osgcluster.cpp @@ -577,7 +577,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); // if we are master clean up by telling all slaves that we're going down. diff --git a/examples/osgcopy/osgcopy.cpp b/examples/osgcopy/osgcopy.cpp index edf9a4a13..9c8bfcbdc 100644 --- a/examples/osgcopy/osgcopy.cpp +++ b/examples/osgcopy/osgcopy.cpp @@ -248,7 +248,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgcubemap/osgcubemap.cpp b/examples/osgcubemap/osgcubemap.cpp index 013115085..1f707fce0 100644 --- a/examples/osgcubemap/osgcubemap.cpp +++ b/examples/osgcubemap/osgcubemap.cpp @@ -160,7 +160,13 @@ int main(int argc, char *argv[]) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgdelaunay/osgdelaunay.cpp b/examples/osgdelaunay/osgdelaunay.cpp index 870403063..db232d55f 100644 --- a/examples/osgdelaunay/osgdelaunay.cpp +++ b/examples/osgdelaunay/osgdelaunay.cpp @@ -1374,7 +1374,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgdepthshadow/osgdepthshadow.cpp b/examples/osgdepthshadow/osgdepthshadow.cpp index 9370c9503..d5a6d1a14 100644 --- a/examples/osgdepthshadow/osgdepthshadow.cpp +++ b/examples/osgdepthshadow/osgdepthshadow.cpp @@ -493,7 +493,13 @@ int main(int argc, char** argv) viewer.frame(); } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgdistortion/osgdistortion.cpp b/examples/osgdistortion/osgdistortion.cpp index 3b701d879..0c446cc7f 100644 --- a/examples/osgdistortion/osgdistortion.cpp +++ b/examples/osgdistortion/osgdistortion.cpp @@ -243,7 +243,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgforest/osgforest.cpp b/examples/osgforest/osgforest.cpp index 7d611c19e..cca327e3d 100644 --- a/examples/osgforest/osgforest.cpp +++ b/examples/osgforest/osgforest.cpp @@ -1132,7 +1132,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgfxbrowser/osgfxbrowser.cpp b/examples/osgfxbrowser/osgfxbrowser.cpp index 3cf939794..8530f5119 100644 --- a/examples/osgfxbrowser/osgfxbrowser.cpp +++ b/examples/osgfxbrowser/osgfxbrowser.cpp @@ -375,7 +375,13 @@ int main(int argc, char *argv[]) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osggeodemo/osggeodemo.cpp b/examples/osggeodemo/osggeodemo.cpp index 420ef45f8..206497769 100644 --- a/examples/osggeodemo/osggeodemo.cpp +++ b/examples/osggeodemo/osggeodemo.cpp @@ -188,7 +188,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osggeometry/osggeometry.cpp b/examples/osggeometry/osggeometry.cpp index 86745e4b1..2bc6f6d17 100644 --- a/examples/osggeometry/osggeometry.cpp +++ b/examples/osggeometry/osggeometry.cpp @@ -706,7 +706,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osghud/osghud.cpp b/examples/osghud/osghud.cpp index 70ce6c4e4..73ec4f9c3 100644 --- a/examples/osghud/osghud.cpp +++ b/examples/osghud/osghud.cpp @@ -236,7 +236,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgimpostor/osgimpostor.cpp b/examples/osgimpostor/osgimpostor.cpp index 9a7bcea0f..6dc406dc1 100644 --- a/examples/osgimpostor/osgimpostor.cpp +++ b/examples/osgimpostor/osgimpostor.cpp @@ -338,7 +338,12 @@ int main( int argc, char **argv ) // wait for all cull and draw threads to complete. viewer.sync(); - + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. + viewer.sync(); return 0; } diff --git a/examples/osgkeyboard/osgkeyboard.cpp b/examples/osgkeyboard/osgkeyboard.cpp index e9e4f9916..3d909437d 100644 --- a/examples/osgkeyboard/osgkeyboard.cpp +++ b/examples/osgkeyboard/osgkeyboard.cpp @@ -442,7 +442,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osglauncher/osglauncher.cpp b/examples/osglauncher/osglauncher.cpp index 3ea5be335..40f89f0a3 100644 --- a/examples/osglauncher/osglauncher.cpp +++ b/examples/osglauncher/osglauncher.cpp @@ -442,7 +442,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osglight/osglight.cpp b/examples/osglight/osglight.cpp index 7e8b0ab7f..02e45f2ec 100644 --- a/examples/osglight/osglight.cpp +++ b/examples/osglight/osglight.cpp @@ -371,11 +371,17 @@ int main( int argc, char **argv ) // fire off the cull and draw traversals of the scene. viewer.frame(); - - // wait for all cull and draw threads to complete before exit. - viewer.sync(); } + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. + viewer.sync(); + return 0; } diff --git a/examples/osglightpoint/osglightpoint.cpp b/examples/osglightpoint/osglightpoint.cpp index 7f8aec75c..fabd0d36f 100644 --- a/examples/osglightpoint/osglightpoint.cpp +++ b/examples/osglightpoint/osglightpoint.cpp @@ -259,7 +259,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osglogicop/osglogicop.cpp b/examples/osglogicop/osglogicop.cpp index da8e25825..2d43fe17a 100644 --- a/examples/osglogicop/osglogicop.cpp +++ b/examples/osglogicop/osglogicop.cpp @@ -213,7 +213,13 @@ int main( int argc, char **argv ) viewer.frame(); } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osglogo/osglogo.cpp b/examples/osglogo/osglogo.cpp index 036e618ff..a38488a44 100644 --- a/examples/osglogo/osglogo.cpp +++ b/examples/osglogo/osglogo.cpp @@ -506,7 +506,13 @@ arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationNam } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgmotionblur/osgmotionblur.cpp b/examples/osgmotionblur/osgmotionblur.cpp index 831a496b2..d3483e580 100644 --- a/examples/osgmotionblur/osgmotionblur.cpp +++ b/examples/osgmotionblur/osgmotionblur.cpp @@ -162,7 +162,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgmovie/osgmovie.cpp b/examples/osgmovie/osgmovie.cpp index ad81b731e..f524a64ee 100644 --- a/examples/osgmovie/osgmovie.cpp +++ b/examples/osgmovie/osgmovie.cpp @@ -484,7 +484,13 @@ int main(int argc, char** argv) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgmultiplecameras/osgmultiplecameras.cpp b/examples/osgmultiplecameras/osgmultiplecameras.cpp index 2bb99df35..75a4ba45a 100644 --- a/examples/osgmultiplecameras/osgmultiplecameras.cpp +++ b/examples/osgmultiplecameras/osgmultiplecameras.cpp @@ -133,7 +133,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgmultitexture/osgmultitexture.cpp b/examples/osgmultitexture/osgmultitexture.cpp index d8272fd20..2e0bfce29 100644 --- a/examples/osgmultitexture/osgmultitexture.cpp +++ b/examples/osgmultitexture/osgmultitexture.cpp @@ -130,7 +130,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgoccluder/osgoccluder.cpp b/examples/osgoccluder/osgoccluder.cpp index 730a56b69..f7d4c4084 100644 --- a/examples/osgoccluder/osgoccluder.cpp +++ b/examples/osgoccluder/osgoccluder.cpp @@ -369,6 +369,13 @@ int main( int argc, char **argv ) } + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgparametric/osgparametric.cpp b/examples/osgparametric/osgparametric.cpp index fd1c1d24b..e91f4d05d 100644 --- a/examples/osgparametric/osgparametric.cpp +++ b/examples/osgparametric/osgparametric.cpp @@ -299,7 +299,13 @@ int main(int argc, char *argv[]) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgparticle/osgparticle.cpp b/examples/osgparticle/osgparticle.cpp index fcf61bf77..449fd2e2c 100644 --- a/examples/osgparticle/osgparticle.cpp +++ b/examples/osgparticle/osgparticle.cpp @@ -402,7 +402,13 @@ int main(int argc, char **argv) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgparticleeffects/osgparticleeffects.cpp b/examples/osgparticleeffects/osgparticleeffects.cpp index 218846646..efa945a90 100644 --- a/examples/osgparticleeffects/osgparticleeffects.cpp +++ b/examples/osgparticleeffects/osgparticleeffects.cpp @@ -495,7 +495,13 @@ int main(int argc, char **argv) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgphotoalbum/osgphotoalbum.cpp b/examples/osgphotoalbum/osgphotoalbum.cpp index 52032a0ff..1cdcd70a9 100644 --- a/examples/osgphotoalbum/osgphotoalbum.cpp +++ b/examples/osgphotoalbum/osgphotoalbum.cpp @@ -797,7 +797,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgpick/osgpick.cpp b/examples/osgpick/osgpick.cpp index 6538070d7..7b099251e 100644 --- a/examples/osgpick/osgpick.cpp +++ b/examples/osgpick/osgpick.cpp @@ -279,7 +279,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgplanets/osgplanets.cpp b/examples/osgplanets/osgplanets.cpp index b2aac80d6..b32cde658 100644 --- a/examples/osgplanets/osgplanets.cpp +++ b/examples/osgplanets/osgplanets.cpp @@ -967,7 +967,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgpoints/osgpoints.cpp b/examples/osgpoints/osgpoints.cpp index a9e913888..b2f7005b5 100644 --- a/examples/osgpoints/osgpoints.cpp +++ b/examples/osgpoints/osgpoints.cpp @@ -255,7 +255,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgpointsprite/osgpointsprite.cpp b/examples/osgpointsprite/osgpointsprite.cpp index e825c31d4..2b2e38bfa 100755 --- a/examples/osgpointsprite/osgpointsprite.cpp +++ b/examples/osgpointsprite/osgpointsprite.cpp @@ -93,6 +93,15 @@ int main(int, char *[]) viewer.frame(); } + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. + viewer.sync(); + return(0); } diff --git a/examples/osgprecipitation/osgprecipitation.cpp b/examples/osgprecipitation/osgprecipitation.cpp index d9f1093b1..268aa8cb1 100644 --- a/examples/osgprecipitation/osgprecipitation.cpp +++ b/examples/osgprecipitation/osgprecipitation.cpp @@ -187,7 +187,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgprerender/osgprerender.cpp b/examples/osgprerender/osgprerender.cpp index 428dc39c1..f3ab1a48b 100644 --- a/examples/osgprerender/osgprerender.cpp +++ b/examples/osgprerender/osgprerender.cpp @@ -477,7 +477,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgprerendercubemap/osgprerendercubemap.cpp b/examples/osgprerendercubemap/osgprerendercubemap.cpp index d92005c26..da1c869b2 100644 --- a/examples/osgprerendercubemap/osgprerendercubemap.cpp +++ b/examples/osgprerendercubemap/osgprerendercubemap.cpp @@ -354,7 +354,13 @@ int main(int argc, char** argv) viewer.frame(); } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgreflect/osgreflect.cpp b/examples/osgreflect/osgreflect.cpp index f1b5d6960..73620dae7 100644 --- a/examples/osgreflect/osgreflect.cpp +++ b/examples/osgreflect/osgreflect.cpp @@ -409,7 +409,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgscalarbar/osgscalarbar.cpp b/examples/osgscalarbar/osgscalarbar.cpp index f776b6c6c..d91caadc0 100644 --- a/examples/osgscalarbar/osgscalarbar.cpp +++ b/examples/osgscalarbar/osgscalarbar.cpp @@ -175,7 +175,13 @@ int main( int argc, char **argv ) viewer.frame(); } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgscribe/osgscribe.cpp b/examples/osgscribe/osgscribe.cpp index 1a1547bb8..fe6981c0b 100644 --- a/examples/osgscribe/osgscribe.cpp +++ b/examples/osgscribe/osgscribe.cpp @@ -144,7 +144,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgsequence/osgsequence.cpp b/examples/osgsequence/osgsequence.cpp index 26e0841b0..d9e2164b9 100644 --- a/examples/osgsequence/osgsequence.cpp +++ b/examples/osgsequence/osgsequence.cpp @@ -285,7 +285,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgshaders/osgshaders.cpp b/examples/osgshaders/osgshaders.cpp index 335000781..91b8b03f3 100644 --- a/examples/osgshaders/osgshaders.cpp +++ b/examples/osgshaders/osgshaders.cpp @@ -108,6 +108,14 @@ int main( int argc, char **argv ) viewer.update(); viewer.frame(); } + + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; } diff --git a/examples/osgshaderterrain/osgshaderterrain.cpp b/examples/osgshaderterrain/osgshaderterrain.cpp index 8cba27467..6ee3b8289 100644 --- a/examples/osgshaderterrain/osgshaderterrain.cpp +++ b/examples/osgshaderterrain/osgshaderterrain.cpp @@ -846,7 +846,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgshadowtexture/osgshadowtexture.cpp b/examples/osgshadowtexture/osgshadowtexture.cpp index 57587be58..c1582eda8 100644 --- a/examples/osgshadowtexture/osgshadowtexture.cpp +++ b/examples/osgshadowtexture/osgshadowtexture.cpp @@ -232,7 +232,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgshape/osgshape.cpp b/examples/osgshape/osgshape.cpp index 8c618d407..ea3d7917a 100644 --- a/examples/osgshape/osgshape.cpp +++ b/examples/osgshape/osgshape.cpp @@ -154,7 +154,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgsimplifier/osgsimplifier.cpp b/examples/osgsimplifier/osgsimplifier.cpp index 71810abeb..32d30de54 100644 --- a/examples/osgsimplifier/osgsimplifier.cpp +++ b/examples/osgsimplifier/osgsimplifier.cpp @@ -183,7 +183,13 @@ int main( int argc, char **argv ) } } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgsimulation/osgsimulation.cpp b/examples/osgsimulation/osgsimulation.cpp index 95b98d4de..f5a06a216 100644 --- a/examples/osgsimulation/osgsimulation.cpp +++ b/examples/osgsimulation/osgsimulation.cpp @@ -410,7 +410,13 @@ int main(int argc, char **argv) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgspacewarp/osgspacewarp.cpp b/examples/osgspacewarp/osgspacewarp.cpp index 16371a07f..27447e6d6 100644 --- a/examples/osgspacewarp/osgspacewarp.cpp +++ b/examples/osgspacewarp/osgspacewarp.cpp @@ -187,7 +187,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgspheresegment/osgspheresegment.cpp b/examples/osgspheresegment/osgspheresegment.cpp index 4522e4317..a34e23f68 100644 --- a/examples/osgspheresegment/osgspheresegment.cpp +++ b/examples/osgspheresegment/osgspheresegment.cpp @@ -672,7 +672,13 @@ int main(int argc, char **argv) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgspotlight/osgspotlight.cpp b/examples/osgspotlight/osgspotlight.cpp index d92569e64..4cef7404b 100644 --- a/examples/osgspotlight/osgspotlight.cpp +++ b/examples/osgspotlight/osgspotlight.cpp @@ -329,7 +329,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgstereoimage/osgstereoimage.cpp b/examples/osgstereoimage/osgstereoimage.cpp index e0164ebeb..00bffdf6b 100644 --- a/examples/osgstereoimage/osgstereoimage.cpp +++ b/examples/osgstereoimage/osgstereoimage.cpp @@ -538,7 +538,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgteapot/osgteapot.cpp b/examples/osgteapot/osgteapot.cpp index 77e5d1726..b9ded5c91 100644 --- a/examples/osgteapot/osgteapot.cpp +++ b/examples/osgteapot/osgteapot.cpp @@ -369,7 +369,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgtext/osgtext.cpp b/examples/osgtext/osgtext.cpp index 4a23a7b44..89814e5da 100644 --- a/examples/osgtext/osgtext.cpp +++ b/examples/osgtext/osgtext.cpp @@ -554,7 +554,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgtexture1D/osgtexture1D.cpp b/examples/osgtexture1D/osgtexture1D.cpp index e2a28e0ec..e43f6dee3 100644 --- a/examples/osgtexture1D/osgtexture1D.cpp +++ b/examples/osgtexture1D/osgtexture1D.cpp @@ -218,7 +218,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); } else diff --git a/examples/osgtexture2D/osgtexture2D.cpp b/examples/osgtexture2D/osgtexture2D.cpp index f805cfc92..e751e7d56 100644 --- a/examples/osgtexture2D/osgtexture2D.cpp +++ b/examples/osgtexture2D/osgtexture2D.cpp @@ -740,7 +740,13 @@ int main( int argc, char **argv ) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); diff --git a/examples/osgtexture3D/osgtexture3D.cpp b/examples/osgtexture3D/osgtexture3D.cpp index 5200d4476..4b975ae10 100644 --- a/examples/osgtexture3D/osgtexture3D.cpp +++ b/examples/osgtexture3D/osgtexture3D.cpp @@ -288,8 +288,13 @@ int main( int argc, char **argv ) } + // wait for all cull and draw threads to complete. + viewer.sync(); - // wait for all cull and draw threads to complete before exit. + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); } diff --git a/examples/osgtexturerectangle/osgtexturerectangle.cpp b/examples/osgtexturerectangle/osgtexturerectangle.cpp index 87e55d6ee..a0b4961ec 100644 --- a/examples/osgtexturerectangle/osgtexturerectangle.cpp +++ b/examples/osgtexturerectangle/osgtexturerectangle.cpp @@ -294,7 +294,13 @@ int main(int argc, char** argv) viewer.frame(); } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgvertexprogram/osgvertexprogram.cpp b/examples/osgvertexprogram/osgvertexprogram.cpp index 35c9c2795..6e8ef2727 100644 --- a/examples/osgvertexprogram/osgvertexprogram.cpp +++ b/examples/osgvertexprogram/osgvertexprogram.cpp @@ -435,7 +435,13 @@ int main(int argc, char *argv[]) } - // wait for all cull and draw threads to complete before exit. + // wait for all cull and draw threads to complete. + viewer.sync(); + + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); return 0; diff --git a/examples/osgvolume/osgvolume.cpp b/examples/osgvolume/osgvolume.cpp index 023f77f24..240817997 100644 --- a/examples/osgvolume/osgvolume.cpp +++ b/examples/osgvolume/osgvolume.cpp @@ -1658,8 +1658,13 @@ int main( int argc, char **argv ) } + // wait for all cull and draw threads to complete. + viewer.sync(); - // wait for all cull and draw threads to complete before exit. + // run a clean up frame to delete all OpenGL objects. + viewer.cleanup_frame(); + + // wait for all the clean up frame to complete. viewer.sync(); }