EgtExecutor :

- migliorie nella funzione ExeGetImageEx per gestione errori e per modalità driver OpenGL 1.
This commit is contained in:
Dario Sassi
2025-12-11 12:10:14 +01:00
parent 57d01e7f4c
commit b68dd72cf6
+9 -4
View File
@@ -1008,7 +1008,7 @@ CALLBACK SceneBoxProc( HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
case WM_INITDIALOG :
{
// imposto dimensione box e picture
const int WIN_MAX_DIM = 1024 ;
const int WIN_MAX_DIM = ( s_nDriver == 1 ? 512 : 1024) ;
int nWinW = ( s_nWidth >= s_nHeight ? WIN_MAX_DIM : ( WIN_MAX_DIM * s_nWidth) / s_nHeight) ;
int nWinH = ( s_nHeight >= s_nWidth ? WIN_MAX_DIM : ( WIN_MAX_DIM * s_nHeight) / s_nWidth) ;
HWND hPic = GetDlgItem( hwndDlg, IDC_PICTURE1) ;
@@ -1023,10 +1023,15 @@ CALLBACK SceneBoxProc( HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
s_nContext = nContext ;
pGseCtx->m_pScene->SetCamera( s_nCameraDir) ;
pGseCtx->m_pScene->ZoomAll() ;
pGseCtx->m_pScene->GetImage( s_nShowMode, s_colBackTop, s_colBackBottom, s_nWidth, s_nHeight, s_sImageFile) ;
if ( ! pGseCtx->m_pScene->GetImage( s_nShowMode, s_colBackTop, s_colBackBottom, s_nWidth, s_nHeight, s_sImageFile))
s_nContext = -s_nContext ;
MyResetGroupObjGraphics( pGseCtx->m_pGeomDB, GDB_ID_ROOT) ;
EndDialog( hwndDlg, wParam) ;
}
else {
s_nContext = 0 ;
EndDialog( hwndDlg, wParam) ;
}
}
else
s_nContext = 0 ;
@@ -1063,9 +1068,9 @@ ExeGetImageEx( int nDriver, bool b2Buff, int nColorBits, int nDepthBits,
// lancio dialogo
HWND hTopWnd = ExeGetMainWindowHandle() ;
DialogBox( GetModuleIstance(), MAKEINTRESOURCE( IDD_LUASCENE), hTopWnd, (DLGPROC)SceneBoxProc) ;
bool bOk = ( s_nContext != 0) ;
bool bOk = ( s_nContext > 0) ;
// elimino la scena dal contesto
GseContext* pGseCtx = GetGseContext( s_nContext) ;
GseContext* pGseCtx = GetGseContext( abs( s_nContext)) ;
if ( pGseCtx != nullptr) {
delete pGseCtx->m_pScene ;
pGseCtx->m_pScene = nullptr ;