Provide proper return status when screen grabbing.
Allow tasks to remove themselves (return task entries to the queue _before_
executig them)
}
-// dump the screen buffer to a png file
+// dump the screen buffer to a png file, returns true on success
bool sg_glDumpWindow(const char *filename, int win_width, int win_height) {
osg::ref_ptr<osg::Image> img(new osg::Image);
img->readPixels(0,0, win_width, win_height, GL_RGB, GL_UNSIGNED_BYTE);
- osgDB::writeImageFile(*img, filename);
- return true;
+ return osgDB::writeImageFile(*img, filename);
}
#if defined(SGATOMIC_USE_GCC4_BUILTINS) && defined (__i386__)
-// Usually the apropriate functions are inlined by gcc.
-// But if gcc is called with something aequivalent to -march=i386,
+// Usually the appropriate functions are inlined by gcc.
+// But if gcc is called with something equivalent to -march=i386,
// it will not assume that there is a lock instruction and instead
// calls this pair of functions. We will provide them here in this case.
// Note that this assembler code will not work on a i386 chip anymore.
-// But I hardly believe that we can assume to run at least on a i486 ...
+// But I firmly believe that we can assume to run at least on a i486 ...
extern "C" {
_now += deltaSecs;
while(_numEntries && nextTime() <= _now) {
SGTimer* t = remove();
- t->run();
- if(t->repeat) {
+ if(t->repeat)
insert(t, t->interval);
- } else {
+ t->run();
+ if (!t->repeat)
delete t;
- }
}
}
* level of accuracy).
*
* The SGTimeStamp is useful for tracking the elapsed time of various
- * events in your program. You can also use it to keep constistant
+ * events in your program. You can also use it to keep consistent
* motion across varying frame rates.
*
* Note SGTimestamp does not deliver the time of day. The content of this