- looks like windows cannot reliably paint in wxwidgets when iconized (but Linux works perfectly) so g3dviewer must take focus duing autoscreenshots in windows OS

This commit is contained in:
Mark Vejvoda
2011-05-25 07:21:22 +00:00
parent 44e25c1e62
commit 7387a469c4

View File

@@ -498,12 +498,25 @@ void MainWindow::onPaint(wxPaintEvent &event) {
// the latter doesn't return correct results for the minimized windows // the latter doesn't return correct results for the minimized windows
// (at least not under Windows) // (at least not under Windows)
#if defined(WIN32) #if defined(WIN32)
/*
//Seems like windows cannot handle this consistently
if(autoScreenShotAndExit == true) { if(autoScreenShotAndExit == true) {
renderer->reset(GetSize().x, GetSize().y, playerColor); printf("\n\n$$$ GetSize() x = %d y = %d, Renderer::windowW = %d H = %d\n",GetSize().x,GetSize().y,Renderer::windowW,Renderer::windowH);
//renderer->reset(GetSize().x, GetSize().y-10, playerColor);
//renderer->reset(Renderer::windowW, Renderer::windowH-20, playerColor);
//this->Iconize(false);
//this->Refresh();
//renderer->reset(GetClientSize().x, GetClientSize().y, playerColor);
renderer->reset(Renderer::windowW, Renderer::windowH-20, playerColor);
} }
else { else {
printf("\n\n### GetClientSize() x = %d y = %d\n",GetClientSize().x,GetClientSize().y);
renderer->reset(GetClientSize().x, GetClientSize().y, playerColor); renderer->reset(GetClientSize().x, GetClientSize().y, playerColor);
} }
*/
renderer->reset(GetClientSize().x, GetClientSize().y, playerColor);
#else #else
renderer->reset(GetClientSize().x, GetClientSize().y, playerColor); renderer->reset(GetClientSize().x, GetClientSize().y, playerColor);
#endif #endif
@@ -2279,7 +2292,9 @@ bool App::OnInit() {
newYRotValue, newYRotValue,
appPath); appPath);
if(autoScreenShotAndExit == true) { if(autoScreenShotAndExit == true) {
#if !defined(WIN32)
mainWindow->Iconize(true); mainWindow->Iconize(true);
#endif
} }
mainWindow->Show(); mainWindow->Show();
mainWindow->init(); mainWindow->init();