Ask Your Question
0

Cannot create an OpenGL window

asked 2013-12-26 08:02:47 -0500

Elador gravatar image

The following simple code fails with a

OpenCV Error: OpenGL API call (Can't load OpenGL extension [glGenerateMipmap]) i n IntGetProcAddress, file C:\opencv\2.4.7.2_prebuilt\opencv\sources\modules\core \src\gl_core_3_1.cpp, line 141

I built opencv with 2.4.7.2 with OpenGL enabled. The code below fails on Debug and Release mode, 64bit. I'm on Windows 7 - 64. I updated the graphics drivers (Intel GM45)... What is going wrong?

#include <string>

#include "opencv2/core/core.hpp"

#include "opencv2/highgui/highgui.hpp"

int main(int argc, char* argv[]) {

cv::Mat img = cv::Mat::zeros(640, 480, CV_8UC1);

cv::namedWindow("oglWin", cv::WINDOW_OPENGL);

cv::imshow("oglWin", img); // crash here

return 0;

}

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-01-02 07:48:39 -0500

Nghia gravatar image

Your graphics card most likely does not support glGenerateMipmap, which was introduced in OpenGL 3.0 and above. I'm going to guess your card only supports up to OpenGL 2.x.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-12-26 08:02:47 -0500

Seen: 350 times

Last updated: Jan 02 '14