Hi,
This is the error.the compiler shows that it's not defined
Thanks,
Hi,
This is the error.the compiler shows that it's not defined
Thanks,
Òscar Llarch i Galán
I mean post the actual compiler output.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Hi,
I mean post the actual compiler output.Qt Code:
Error 1 error C2065: 'GL_BGR' : identificador no declarado c:\QOpenCVCamera\QOpenCVCamera\QOpenGLWidget.cpp 56To copy to clipboard, switch view to plain text mode
I only included the QtOpenGL header that I think that is the header used by Qt.And the GL includes you have in your code.
Thanks,
Òscar Llarch i Galán
based on this:
http://www.gamedev.net/topic/159846-...d-sdl_loadbmp/
it seems that perhaps under windows its not defined.
Try the solution in the last post there. (using GL_BGR_EXT)
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Qt is including it.But GL_BGR is not a Qt define but rather OpenGL one, you need to include proper OpenGL headers to have it.
If you include <QGLWidget> you are implicitly in including the OpenGL headers as well.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Hi,
Following the instructions on GameDev it seems to work.
Searching into my computer I have found that there is a "gl.h" in this folder "C:\Documents and Settings\All Users\Datos de programa\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\shared\inc\GL" that contains the "GL_BGR" definition. This folder was created when I installed Nvidia CUDA SDK as I want to use OpenGL on OpenCV to improve performance.
Maybe changing the libs it will work but I'm a little confused:
- I can make my application to use this header lib
- In the folder "C:\Documents and Settings\All Users\Datos de programa\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\shared\lib\Win32" there are 3 libs "freeglut.lib" "glew32.lib" and "shrUtils32.lib"
- Qt is already linked to OpenGL libs
So, changing the header in my application will work? Or maybe have to recompile Qt pointing to this new OpenGL libs?
Thanks all,
Òscar Llarch i Galán
It will work, if its only a matter of a missing define in a header, but implemented in the lib.So, changing the header in my application will work?
Otherwise it wont.
If your Qt is compiled with its own OGL, don't mix.
What you can do, is rebuilt Qt to use an OGL that you specify, then you can specify what ever other OGL lib you have, which Qt then will use.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Hi,
In this moment the above solution does what I need but I don't discard try this solution in future.What you can do, is rebuilt Qt to use an OGL that you specify, then you can specify what ever other OGL lib you have, which Qt then will use.
Thanks,
Òscar Llarch i Galán
It's just a define, a number. It doesn't matter what it is called, you can even define it in your own sourcecode.
Qt Code:
#ifndef GL_BGR #define GL_BGR 0x80E0 #endifTo copy to clipboard, switch view to plain text mode
Yes, the compile error is not the problem.
The question is, if this define is really used in the implemented lib, or more importantly used with the same meaning.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
One can check the version of OpenGL supported by the available GL library. I don't know if it's enough to be sure BGR is available (but I think it should pretty much always be available, BGR is a standard format).
Yes, I think so too, but better safe than sorry
I mean, I was really surprised that this define was not defined in windows... so who knows...
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
I think it depends on the OpenGL vendor. I don't know who is the GL vendor on Windows, Microsoft? GFX card producer? Anyway, it's not suprising some defines have the _EXT suffix, it's quite natural, so I'd always check for both GL_SOMETHING and GL_SOMETHING_EXT. It should be safe.
Bookmarks