screen shot fixes (issue #127 related)

Provide proper return status when screen grabbing.
Allow tasks to remove themselves (return task entries to the queue _before_
executig them)
This commit is contained in:
ThorstenB 2011-05-28 23:09:06 +02:00
parent c828961327
commit c033979130
4 changed files with 9 additions and 11 deletions

View File

@ -75,11 +75,10 @@ bool sg_glWritePPMFile(const char *filename, GLubyte *buffer, int win_width, int
}
// 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);
}

View File

@ -22,12 +22,12 @@
#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" {

View File

@ -94,12 +94,11 @@ void SGTimerQueue::update(double deltaSecs)
_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;
}
}
}

View File

@ -44,7 +44,7 @@
* 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