PDA

View Full Version : Qt Creator Using alternate openGL library/header files in QT Creator



Willybood
22nd May 2011, 18:31
I currently have an openGL modelviewer, made using creator and the openGL widget, which works under windows.

However, for the purposes of porting it to test it on a mobile platform I have been trying to get an openGL ES 2.0 emulator running using it, which would require me to run it using an alternate header reference and set of library files.

Is there anyway of forcing QT creator to use an alternate openGL library/header reference when building the application? A forum search doesn't turn up anything, but it seems like it should be possible.

Thanks in advance! Any help is appreciated!

Added after 1 55 minutes:

It took some slightly more abstract google searching, but it looks like the issue can be solved by changing the QMAKE_INCDIR_OPENGL and QMAKE_LIBDIR_OPENGL variables in the config.

Hope this helps someone else!

wysota
22nd May 2011, 21:08
#ifdef Q_OS_WINCE
#include <gles.h>
#else
#include <gl.h>
#endif

As for libs it should be enough to use Qt's OpenGL module and the appropriate library for the platform will be linked. If you'd like to override that, you'd have to rebuild Qt to use GLES instead of GL for your desktop platform.

Willybood
24th May 2011, 09:06
I was hoping to not have to rebuild QT from scratch, but it looks like that might be necessary here.

Thanks for your help, fingers crossed this will work!