OpenGL ES 3.0 with Qt Quick on Android
-
Hi,
Is it possible to use OpenGL ES 3.0 on Android using Qt Quick? I am running the "OpenGL under QML" example application [1] on an android device, and would like to extend the example using GLES30 functionality. However, the project pro/makefile generates an android manifest that asks the device for a 2.0 context, and I don't seem to find a way to change that. The makefile re-generates the manifest on every build, so editing the manifest does not seem to be the proper way to change the opengl context version. The manifest also targets an api level lower than 18, which is the minimum required for 3.0, so I should also change that as well.
Is OpenGL ES 3.0 even supported using Qt Quick on Android? Is there any documentation explaining how to set up such an environment?
Thanks.
[1] http://doc.qt.io/qt-5/qtquick-scenegraph-openglunderqml-example.html
-
It is possible to use OpenGL ES up to version 3.1 along with functions from the AEP. I don't believe there is much official documentation, but I asked a similar question on the interest mailing list here. You may find my little sample project on GitHub to be of some help. It is incomplete, but you may get somewhere with it. Another interesting resource is this GitHub project.
-
Thanks for the links and the fast reply.
What I don't see is how you access GLES3 functions. The header file <GLES3/gl31.h> does not exist on my end, even though I have Qt 5.5 and latest android sdk/ndk. In your code I see you include <QtGui/QOpenGLFunctions>, but inspection of that file and the files it includes reveals there is no 3.x logic as of Qt 5.5. The other project by TReed has a bunch of header files where they seem to declare the functions manually, but I don't see how it defines the enums or if all of this is even necessary. How exactly are you accessing 3.x functions and enums?
Thanks.
-
@Jeanne-Kamikaze It seems my project is more incomplete than I originally thought. At one point I had everything building on Android by including the gl31.h header file. That code has been lost somehow, so I'm not sure how to accomplish it anymore. You can try downloading the Khronos GLES3 header files from here and then including them manually. Then the problem is linking, which unfortunately I'm not sure how to solve.
-
I see. I'll see if I can use those header files. The problem I have with Qt is that apparently it makes me inherit from QOpenGLFunctions to be able to call opengl. I don't even know who thought that would be a remotely good idea, but it basically forces me to either put all the rendering code in one class, or to put it into multiple classes all inheriting from QOpenGLFunctions, both solutions of which make my code absolutely ugly and no longer portable.
-
Well good news: It appears GLES 3.1 will have some main stream support in Qt 5.6.