+
+ ; get a handle to the predefined STDOUT log stream and attach
+ ; it to the logging system. It remains active for all further
+ ; calls to aiImportFile(Ex) and aiApplyPostProcessing.
+ (ai-attach-predefined-log-stream (ai-default-log-stream stdout))
+
+ ; ... same procedure, but this stream now writes the
+ ; log messages to assimp_log.txt
+ (ai-attach-predefined-log-stream (ai-default-log-stream file) "assimp_log.txt")
+
+ ; the model name can be specified on the command line. If none
+ ; is specified, we try to locate one of the more expressive test
+ ; models from the repository (/models-nonbsd may be missing in
+ ; some distributions so we need a fallback from /models!).
+ (load-asset (cadr args))
+
+ (set-gl-clear-color 0.1 0.1 0.1 1.0)
+
+ (gl-enable (enable-cap lighting))
+ (gl-enable (enable-cap light0)) ; Uses default lighting parameters
+
+ (gl-enable (enable-cap depth-test))
+
+ (glLightModeli (light-model-parameter light-model-two-side) (boolean true))
+ (gl-enable (enable-cap normalize))
+
+ ; XXX docs say all polygons are emitted CCW, but tests show that some aren't.
+ (cond ((getenv "MODEL_IS_BROKEN")
+ (glFrontFace (front-face-direction cw))))
+
+ (glColorMaterial (material-face front-and-back) (material-parameter diffuse))
+
+ (glutGet (glut-state elapsed-time))
+ (glut-main-loop)
+
+ ; cleanup - calling 'aiReleaseImport' is important, as the library
+ ; keeps internal resources until the scene is freed again. Not
+ ; doing so can cause severe resource leaking.
+ (ai-release-import scene)
+
+ ; We added a log stream to the library, it's our job to disable it
+ ; again. This will definitely release the last resources allocated
+ ; by Assimp.
+ (ai-detach-all-log-streams)))