diff --git a/src/OpenGl/OpenGl_AVIWriter.cxx b/src/OpenGl/OpenGl_AVIWriter.cxx index 7906d7e3fd..8b8452e68b 100755 --- a/src/OpenGl/OpenGl_AVIWriter.cxx +++ b/src/OpenGl/OpenGl_AVIWriter.cxx @@ -17,10 +17,13 @@ // purpose or non-infringement. Please see the License for the specific terms // and conditions governing the rights and limitations under the License. - #include -#ifdef WNT +#if (defined(_WIN32) || defined(__WIN32__)) && defined(HAVE_VIDEOCAPTURE) + #ifdef _MSC_VER + #pragma comment (lib, "vfw32.lib") + #endif + OpenGl_AVIWriter* OpenGl_AVIWriter::MyAVIWriterInstance = 0L; OpenGl_AVIWriter * OpenGl_AVIWriter::GetInstance() @@ -479,4 +482,4 @@ Standard_Boolean OpenGl_AVIWriter_AllowWriting(void * hWin) return aResult; } -#endif //WNT +#endif diff --git a/src/OpenGl/OpenGl_Workspace_4.cxx b/src/OpenGl/OpenGl_Workspace_4.cxx index 0eecbccd9f..15534d33d7 100644 --- a/src/OpenGl/OpenGl_Workspace_4.cxx +++ b/src/OpenGl/OpenGl_Workspace_4.cxx @@ -17,10 +17,9 @@ // purpose or non-infringement. Please see the License for the specific terms // and conditions governing the rights and limitations under the License. - #include -#if (defined(_WIN32) || defined(__WIN32__)) +#if (defined(_WIN32) || defined(__WIN32__)) && defined(HAVE_VIDEOCAPTURE) #include #endif @@ -68,7 +67,7 @@ void OpenGl_Workspace::Redraw (const Graphic3d_CView& theCView, glViewport (aViewPortBack[0], aViewPortBack[1], aViewPortBack[2], aViewPortBack[3]); } -#if (defined(_WIN32) || defined(__WIN32__)) +#if (defined(_WIN32) || defined(__WIN32__)) && defined(HAVE_VIDEOCAPTURE) if (OpenGl_AVIWriter_AllowWriting (theCView.DefWindow.XWindow)) { GLint params[4]; diff --git a/src/TKOpenGl/EXTERNLIB b/src/TKOpenGl/EXTERNLIB index a7d53f77ee..8b6922e94f 100755 --- a/src/TKOpenGl/EXTERNLIB +++ b/src/TKOpenGl/EXTERNLIB @@ -7,3 +7,4 @@ CSF_FTGL CSF_GL2PS CSF_user32 CSF_gdi32 +CSF_AviLibs diff --git a/src/ViewerTest/ViewerTest_AviCommands.cxx b/src/ViewerTest/ViewerTest_AviCommands.cxx index 5897495988..cf9892bb52 100755 --- a/src/ViewerTest/ViewerTest_AviCommands.cxx +++ b/src/ViewerTest/ViewerTest_AviCommands.cxx @@ -17,27 +17,26 @@ // purpose or non-infringement. Please see the License for the specific terms // and conditions governing the rights and limitations under the License. - - -#ifdef WNT -#include +#if (defined(_WIN32) || defined(__WIN32__)) && defined(HAVE_VIDEOCAPTURE) + #include + #include #endif #include #include -#include static Standard_Integer avi_record(Draw_Interpretor& di, Standard_Integer argc, const char** argv) { - Standard_Integer aResult(1); - if (argc < 2) { + if (argc < 2) + { cout << "Syntax: " << argv[0] << " file | start | stop | save" << endl; - } else { + return 1; + } -#ifndef WNT - cout << "AVI writer is implemented only in Windows version" << endl; -#else + Standard_Integer aResult = 1; +#if (defined(_WIN32) || defined(__WIN32__)) + #ifdef HAVE_VIDEOCAPTURE static OpenGl_AVIWriter * pAviWriter = 0L; if (strncmp(argv[1], "file", 5) == 0) { @@ -71,8 +70,12 @@ static Standard_Integer avi_record(Draw_Interpretor& di, cout << pAviWriter->GetLastErrorMessage() << endl; aResult = 0; } + #else + cout << "AVI writer capability was disabled\n"; + #endif +#else + cout << "AVI writer is implemented only in Windows version\n"; #endif - } return aResult; } @@ -96,6 +99,3 @@ void ViewerTest::AviCommands(Draw_Interpretor& theCommands) __FILE__, &avi_record, group); //Draft_Modification } - - -