From: san Date: Wed, 15 Oct 2014 14:06:52 +0000 (+0400) Subject: 0025383: Broken vrecord command X-Git-Tag: V6_8_0~95 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=6d17debbe9974d43429269d111752ececc8a1590;p=occt.git 0025383: Broken vrecord command Pass HWND of the current 3D view to OpenGl_AVIWriter::StartRecording() in order to make it work. --- diff --git a/src/ViewerTest/ViewerTest_AviCommands.cxx b/src/ViewerTest/ViewerTest_AviCommands.cxx index 69a2cfb259..5aa4729c19 100644 --- a/src/ViewerTest/ViewerTest_AviCommands.cxx +++ b/src/ViewerTest/ViewerTest_AviCommands.cxx @@ -15,7 +15,9 @@ #if (defined(_WIN32) || defined(__WIN32__)) && defined(HAVE_VIDEOCAPTURE) #include + #include #include + #include #endif #include @@ -33,6 +35,13 @@ static Standard_Integer avi_record(Draw_Interpretor& /*di*/, Standard_Integer aResult = 1; #if (defined(_WIN32) || defined(__WIN32__)) #ifdef HAVE_VIDEOCAPTURE + Handle(V3d_View) aView = ViewerTest::CurrentView (); + if (aView.IsNull()) + { + std::cout << "Call vinit before!\n"; + return 1; + } + static OpenGl_AVIWriter * pAviWriter = 0L; if (strncmp(argv[1], "file", 5) == 0) { @@ -52,7 +61,7 @@ static Standard_Integer avi_record(Draw_Interpretor& /*di*/, cout << "AVI Writer instance has not been initialized. Use command " << argv[0] << " file ..." << endl; } else if (strncmp(argv[1], "start", 6) == 0) { - pAviWriter->StartRecording(); + pAviWriter->StartRecording (aView->Window()->NativeHandle()); aResult = 0; } else if (strncmp(argv[1], "stop", 5) == 0) { pAviWriter->StopRecording();