opengl support issue?

asked 2015-05-08 13:36:10 -0600

zazarb gravatar image

Hello,

I am on windows 7 32bits. I have installed opencv (the latest GIT sources) with opengl support. When I launch a simple test app that displays my webcam images in real-time, everything works fine, my console displays "opengl support available". However, when I create a simple opengl callback with the samples provided in the OpenCV documentation (see end of the email), the simples opengl function glLoadIdentity() returns an error "identifier is undefined".

I suspect that this is an include problem, but it was my understanding that it wasn't necessary to have OpenGL installed on the computer on windows to have OpenGL support with OpenCV. Am I wrong? Are there specific OpenCV include files (or OpenGL include files) that need to be included in addition to highgui to have OpenGL support work ?

Sorry if my question is irrelevant, but I have been looking for help for a while from different sources and could not find an answer. Thanks for any advice you can help with!

setOpenGlDrawCallback("video", onOpenGlDraw, void * userdata = 0); // in my main

void on_opengl(void* param){ // my simplistic callback glLoadIdentity(); }

edit retag flag offensive close merge delete

Comments

1
  • did you compile in opengl support ? (the prebuilt libs probably won't have it) . do a cerr << getBuildInformation() << endl; (and look somewhere at the bottom to find out.)

  • if so, you need a preceeding namedWindow(someTitle, WINDOW_OPENGL); to create an opengl context behind the curtains

berak gravatar imageberak ( 2015-05-08 15:13:21 -0600 )edit

Hello,

Thanks for your help.

I did compile with opengl support : with getBuildInformation() I get OpenGL support : Yes (glu32, opengl32)

I have a window created with opengl context with namedWindow("video", WINDOW_OPENGL). When I compile the above described code, I still get the following compilation error with glLoadIdentity all all gl functions which seem not recongized:

error C3861: 'glLoadIdentity': identifier not foun

Would you have other explanations?

Thanks

zazarb gravatar imagezazarb ( 2015-05-09 02:59:29 -0600 )edit

I suspect that this is an include problem, but it was my understanding that it wasn't necessary to have OpenGL installed on the computer on windows to have OpenGL support with OpenCV. Am I wrong? Not sure and going a bit out of my expertise zone here, but it seems to me that it is impossible to run OpenGL supported software without OpenGL being on the machine itself ...

StevenPuttemans gravatar imageStevenPuttemans ( 2015-05-09 06:28:12 -0600 )edit
1

"but it was my understanding that it wasn't necessary to have OpenGL installed on the computer on windows to have OpenGL support with OpenCV." - well, ofc. you need the opengl headers/libs/dll's on your machine, but they are supplied with your compiler.

berak gravatar imageberak ( 2015-05-09 06:35:35 -0600 )edit
1

yeah ok my bad I just needed to include

include <windows.h>

include <gl gl.h="">

...

zazarb gravatar imagezazarb ( 2015-05-09 06:58:34 -0600 )edit