1.项目为ffmpeg+SDL2+MFC,之前单纯用SDL2+ffmpeg直接用弹出框是正常出图播放的;
2.现在将创建窗口改如下代码是不出图,无法播放
screen = SDL_CreateWindowFrom((void*)(dlg->GetDlgItem(IDC_SCREEN)->GetSafeHwnd()));
3.最最最奇怪的是:如果我保留之前弹出框的创建函数不关,MFC创建创建也不关,则MFC窗口可以出图播放(如下2行代码),但是上面会多个完全没必要的弹出框,求大佬帮忙看下!谢谢了!!!
//显示在弹出窗口
screen = SDL_CreateWindow("Simplest Video Play SDL2", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,screen_w, screen_h, SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE);
//===========================================
/显示在MFC控件上
screen = SDL_CreateWindowFrom((void*)(dlg->GetDlgItem(IDC_SCREEN)->GetSafeHwnd()));
if (!screen) {
AfxMessageBox(__T("SDL: could not create window - exiting\n"));
return -1;
}
2.现在将创建窗口改如下代码是不出图,无法播放
screen = SDL_CreateWindowFrom((void*)(dlg->GetDlgItem(IDC_SCREEN)->GetSafeHwnd()));
3.最最最奇怪的是:如果我保留之前弹出框的创建函数不关,MFC创建创建也不关,则MFC窗口可以出图播放(如下2行代码),但是上面会多个完全没必要的弹出框,求大佬帮忙看下!谢谢了!!!
//显示在弹出窗口
screen = SDL_CreateWindow("Simplest Video Play SDL2", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,screen_w, screen_h, SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE);
//===========================================
/显示在MFC控件上
screen = SDL_CreateWindowFrom((void*)(dlg->GetDlgItem(IDC_SCREEN)->GetSafeHwnd()));
if (!screen) {
AfxMessageBox(__T("SDL: could not create window - exiting\n"));
return -1;
}