]> OCCT Git - occt.git/commitdiff
0025383: Broken vrecord command
authorsan <san@opencascade.com>
Wed, 15 Oct 2014 14:06:52 +0000 (18:06 +0400)
committerbugmaster <bugmaster@opencascade.com>
Thu, 16 Oct 2014 11:46:36 +0000 (15:46 +0400)
Pass HWND of the current 3D view to OpenGl_AVIWriter::StartRecording()
in order to make it work.

src/ViewerTest/ViewerTest_AviCommands.cxx

index 69a2cfb25945aaf5d75716a9fd5c94f8efe49bb0..5aa4729c199bdc2f51e7ba38e63833b1c3331d5f 100644 (file)
@@ -15,7 +15,9 @@
 
 #if (defined(_WIN32) || defined(__WIN32__)) && defined(HAVE_VIDEOCAPTURE)
   #include <windows.h>
+  #include <Aspect_Window.hxx>
   #include <OpenGl_AVIWriter.hxx>
+  #include <V3d_View.hxx>
 #endif
 
 #include <ViewerTest.hxx>
@@ -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();