I have the following Code written by a classmate of mine (we are working a project):
//inside cqtopencvviewergl.cpp
void CQtOpenCVViewerGl::resizeGL(int width, int height)
{
makeCurrent();
glViewport(0, 0, (GLint)(width), (GLint)(height));
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, width, -height, 0, 0, 1);
glMatrixMode(GL_MODELVIEW);
recalculatePosition();
emit imageSizeChanged(mRenderWidth, mRenderHeight);
updateScene();
}
The call of glLoadIdentity()
leads to an Exception at 0x0, code: 0x0000005
according to the Debugger which is C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\cdb.exe
in my case.
I know that the function is deprecated. But I am very confused about all information sources about what I should do about it. So I will work you through the disorientation in hope you can help me...
According to this answer the Exception occurs because the functions used are deprecated. But the question differs because I (or we) include openGL quite differently:
At the top of the cqtopencvviewergl.cpp
we include the following:
#include "include/Gui/cqtopencvviewergl.h"
#include <QOpenGLFunctions>
#include <opencv2/opencv.hpp>
#include <QPalette>
And at the top of the cqtopencvviewergl.h
we include:
#include <QOpenGLWidget>
#include <QOpenGLFunctions_2_0>
#include <opencv2/core/core.hpp>
So we are using Qt classes to call the openGL functions. I took a look at the Code and it seems Qt handles the deprecation itself.
Also according to this answer Qt supports all current Desktop OpenGL versions.
According to this answer of the asker to the question How to replace following (deprecated) OpenGL functions? the Windows offline installers are by default ANGLE based. I used the offline installer...
According to this entry in the qt wiki To compile Qt with ANGLE I have to have a Direct X SDK installed. However I am sceptical whether I really need this if I use QOpenGLFunctions
and QOpenGLFunctions_2_0
...
According to the wiki entry the Direct X SDK
is part of the Windows SDK
so I am also sceptical that I already have ANGLE due to the fact that I already have a few Windows SDKs:
Also according to this article I should use configure -opengl dynamic
ly and because I use Windows I tried to find out where to call configure
and found configure.bat -opengl desktop
in this article. So wanted to run configure.bat -opengl dynamic
but I could not find the configure.bat
anywhere in the C:\Qt\Qt5.9.1
directory...
I use the following Qt Kit:
I am the only one (of 6 people in the project) who has that problem. Normally my questions are more precisely but I am lost here. What should I do ?