From 0cd850fbb47c7d271bd4a4ae2002d4c706acd589 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 6 Jan 2019 15:31:16 -0700 Subject: [PATCH] vision: Allow including from OpenCV's videoio, for 3.x+ This commit doesn't add buildsystem support yet. --- panda/src/vision/openCVTexture.cxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/panda/src/vision/openCVTexture.cxx b/panda/src/vision/openCVTexture.cxx index 58c233232a..be85aa6866 100644 --- a/panda/src/vision/openCVTexture.cxx +++ b/panda/src/vision/openCVTexture.cxx @@ -22,20 +22,26 @@ #include "bamCacheRecord.h" // This symbol is predefined by the Panda3D build system to select whether we -// are using the OpenCV 2.3 or later interface, or if it is not defined, we -// are using the original interface. -#ifdef OPENCV_VER_23 +// are using the OpenCV 3.x or later interface. +#if defined(OPENCV_VER_3) + +#include +#include + +// This checks for 2.3 or later. +#elif defined(OPENCV_VER_23) #include -// #include #include +// If neither of those are predefined, assume 1.x. #else + #include #include #include -#endif // OPENCV_VER_23 +#endif // OPENCV_VER_3 TypeHandle OpenCVTexture::_type_handle;