favreau / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

Better leaveMainLoop support in demos #544

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Bullet has partial support for glutLeaveMainLoop() via BT_USE_FREEGLUT, but 
this is also available on OS X, although with slightly different syntax 
(glutCheckLoop()).  This patch unifies the two approaches for better 
portability, using an exception fallback if neither is available.

This is an improved version of that presented in issue 540, I've tested it 
under Linux with and without BT_USE_FREEGLUT, and everything is happy now. 
(sorry, there was a build issue under non-freeglut in the old patch)

This is useful for detecting memory leaks and generally testing proper object 
destruction under OS X (previously only available with freeglut enabled), as 
well as providing an easy way to algorithmically re-run demos.

The introduction of DemoApplication::main(int,char**) is necessary as it 
replaces the 'hardcoded' glutMainLoop() call from GlutStuff.cpp, but it 
provides a convenient way for demos to get access to command line parameters 
after freeglut has removed any glut specific arguments, and after the demo has 
been constructed/initialized.

Original issue reported on code.google.com by ejtt...@gmail.com on 14 Sep 2011 at 5:02

Attachments:

GoogleCodeExporter commented 9 years ago
See https://github.com/bulletphysics/bullet3/issues/136

Original comment by erwin.coumans on 30 Mar 2014 at 7:41