- bugfix on windows for autoscreenshots in g3d viewer

This commit is contained in:
Mark Vejvoda 2012-01-04 21:43:34 +00:00
parent 43c9d44bd6
commit 7b69d3040f
3 changed files with 9 additions and 6 deletions

View File

@ -616,8 +616,7 @@ void MainWindow::onPaint(wxPaintEvent &event) {
}
renderer->renderParticleManager();
glCanvas->SwapBuffers();
bool haveLoadedParticles = (particleProjectilePathList.empty() == false || particleSplashPathList.empty() == false);
if(autoScreenShotAndExit == true) {
@ -629,7 +628,10 @@ void MainWindow::onPaint(wxPaintEvent &event) {
Close();
return;
}
else if((modelPathList.empty() == false) && resetAnimation && haveLoadedParticles) {
glCanvas->SwapBuffers();
if((modelPathList.empty() == false) && resetAnimation && haveLoadedParticles) {
if(anim >= resetAnim && resetAnim > 0) {
printf("RESETTING EVERYTHING [%f][%f]...\n",anim,resetAnim);
fflush(stdout);

View File

@ -485,11 +485,12 @@ void Renderer::setAlphaColor(float alpha) {
void Renderer::saveScreen(const string &path) {
Pixmap2D *pixmapScreenShot = new Pixmap2D(width, height, 4);
glFinish();
//glFinish();
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadPixels(0, 0, pixmapScreenShot->getW(), pixmapScreenShot->getH(),GL_RGBA, GL_UNSIGNED_BYTE, pixmapScreenShot->getPixels());
glReadPixels(0, 0, pixmapScreenShot->getW(), pixmapScreenShot->getH(),
GL_RGBA, GL_UNSIGNED_BYTE, pixmapScreenShot->getPixels());
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

View File

@ -6395,7 +6395,7 @@ void Renderer::saveScreen(const string &path) {
Pixmap2D *pixmapScreenShot = new Pixmap2D(sm.getScreenW(), sm.getScreenH(), 3);
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
glFinish();
//glFinish();
glPixelStorei(GL_PACK_ALIGNMENT, 1);