namedWindow OpenGL exception in Windows 10

asked 2019-02-03 05:52:26 -0600

I try to output from webcam to OpenGL window. I built OpenCV with WITH_OPENGL flag. In cvconfig.h and in CMakeVars.txt HAVE_OPENGL presents. But every time I have exception. In debug I see error in system.cpp here:

#ifndef HAVE_OPENGL
     if (flags & CV_WINDOW_OPENGL) CV_ERROR( CV_OpenGlNotSupported, "Library was built without OpenGL support" );
#else

This is my code:

cv::namedWindow("raw", CV_WINDOW_OPENGL | CV_WINDOW_AUTOSIZE);
edit retag flag offensive close merge delete

Comments

can it be ,you're using the old (prebuild) opencv_world.lib (which has no opengl support), not your self-built libs ?

try a : cout << cv::getBuildInformation() << endl to find out, what you are actually using

berak gravatar imageberak ( 2019-02-03 07:39:38 -0600 )edit

Thanks for your answer. I built OpenCV from source (git master) so I hope it doesn't contains old libraries

VTatischev gravatar imageVTatischev ( 2019-02-03 14:17:52 -0600 )edit

no, but maybe, by accident, you linked the old prebuilt ones, not your own

berak gravatar imageberak ( 2019-02-03 15:01:32 -0600 )edit

I checked a few times. And I built it with different parameters (with QT, with MediaSDK, etc)

VTatischev gravatar imageVTatischev ( 2019-02-03 16:26:23 -0600 )edit

I added output of getBuildInformation but it is moderated

VTatischev gravatar imageVTatischev ( 2019-02-03 16:27:07 -0600 )edit

Does this help?

namedWindow("raw", CV_WINDOW_OPENGL | CV_WINDOW_AUTOSIZE);
setOpenGlDrawCallback("windowName", glCallback);
supra56 gravatar imagesupra56 ( 2019-02-03 21:53:52 -0600 )edit

Thanks for your answer but I cannot do that because the exception happens on

namedWindow("raw", CV_WINDOW_OPENGL | CV_WINDOW_AUTOSIZE);
VTatischev gravatar imageVTatischev ( 2019-02-04 01:57:11 -0600 )edit