Render QtQuick into a texture of an external OpenGL application - c++

We have an application that loads OpenGL functions via GLEW and WGL.
We aim to use QML created UI on top of it within the same window.
We had a look into the QQuickRenderControl but we are not sure how to link the OpenGL context to Qt and if the loaded OpenGL function pointers are compatible with the one used by Qt.
We have already looked into the RenderControl example but the difference here is that the OpenGL context and loading are managed by Qt. We want to manage it on our own without Qt dependencies.
We use Qt 5.11.
edit: Both our OpenGL and Qt are in the same process. Just to not confuse you.

Related

Connecting GLFW to QOpenGLWidget

I'm trying to connect GLFW application to Qt QOpenGLWidget, but I can't figure out is it possible and if it's possible, how to do this?
Maybe it's a bit late for an answer, anyway:
GLFW is a library provides an API for creating windows, contexts and surfaces, receiving input and events. Qt already does it for you. (with additional GL functions)
So it is not possible to use Qt with GLFW. Almost everything that GLFW provides could be found inside Qt libraries. For example: to specify major/minor version you can use QSurfaceFormat, etc.
I think it's worth to mention that Qt works with other OpenGL bindings.
I use PyOpenGL with Qt with no problems instead built-in Qt functions. Works perfectly.

Is there a built-in OpenGL GUI windowing library in XCode 6 (OS X 10.10)?

I am trying to develop a C++ application that uses OpenGL. I set up everything in XCode 6.4 (running on OS X 10.10.5) and I was able to get the OpenGL framework working. However, I can't figure out how to draw the graphics to a GUI window.
I know that GLUT is available, but it is deprecated and I'd rather avoid using it. Instead, is there a way of using some of Apple's native windowing systems (I assume there should be something available in the Cocoa API)?
I would rather avoid downloading additional libraries like SDL or Qt since I do not have root access on this machine and maintaining third-party libraries those may be challenging.

Qt C++ Library for Windows and OpenGL

I am trying to experiment with the Qt library on Windows. On their downloads page, I notice that the binaries built using VS2012 are available in two forms, with and without OpenGL. What exactly is the difference between the two? In the OpenGL version, do they have some special API implemented using OpenGL or does all of Qt rendering depend on OpenGL? Also, is there a version of Qt that uses DirectX?
#Raman: The opengl variant is using the desktop opengl version just like with Qt4.
The non-opengl variant is using angle, and you need to have that installed alongside the DirectX SDK to get it working. Angle is an adapter between the directx and the opengles API. Only the latter is support directly by Qt, but unfortunately directx drivers tend to work better on Windows than the opengl(es) ones. There are no plans to support a directx backend inside Qt, so we leave with Google's Angle work in that regard.
As for providing some extra bit, there was a discussion about it recently on the mailing list, that this decision should not be build time, but more like run time. However, no one has stood up just yet to make that work. Hopefully, that will change soon. It is causing confusion for the end users just like, so do not feel alone. ;-)
Hope this explanation helps.
DirectX is supported via the ANGLE based library.
Note that this has changed and as of Qt 5.5 the prebuilt binaries you can download from the Qt website are configured with the -opengl dynamic option. This is what #lpapp above was talking about. Qt defaults to choosing either native OpenGL drivers or ANGLE at run time now.
Qt internally uses OpenGL to render unless you specify otherwise now. You can also render custom OpenGL content using Qt's QOpenGLxxx functions and classes.
For a simple introduction to Qt and OpenGL that covers this and more click here.

Qt 4.x/5.x and OpenGL for Desktop Gui application: What module to choose?

I am starting a new GUI application project using Qt and OpenGL for Linux/Windows desktops. My assumptions so far: use Qt GUI (C++ ... not QML/QtQuick 2) with OpenGL 4.1 or higher (requirement). After some reading, I am completely lost about what path to choose. What path will keep my application future-proof in term of support and libraries.
Qt 4.x or Qt 5.x?
Standard OpenGL or QGL or QOpenGL or QtOpenGL wrappers?
QWidget/QGLWidget (Qt 4.x) or QWindow (Qt 5.x)?
The application is intended to run in desktop environment and will do a lot of file (geometry) opening/saving, instanced 3D painting and some imaging. Could someone point me out to the best combination to choose with some explanation if possible?
Sean Harmer presentation on Qt 5 and OpenGL did answer some parts of my questions but I was a bit lost when he started using QML and QtQuick 2. I felt like QOpenGL was a lightweighted version to be used with QtQuick 2. Correct me If I am wrong on that please.
Qt 5.0 is still in beta, therefore if your project is serious, you should go with qt 4.8, because that is the latest stable release. However, if you must have some Qt 5.0 features, then you have no other choice but to go with 5.0.
Since you chosen Qt, you should stick to it. That means using QtOpenGL. That doesn't mean you are not going to use standard OpenGL. QtOpenGL provides you API to simplify some OpenGL calls, and make them more object oriented. After all, OpenGL is set of C functions, not set of c++ classes.

OpenNi Ogre3D integration using OpenGL

I just started to use OpenNI and Ogre3D for an animation application. I found the below sample for this integration: OpenNI Ogre Integration Sample. But I noticed that it is developed using DirectX which I am not familiar with. Are there other samples which are using OpenGL?
Ogre actually abstracts away all the rendering code - it can use both DirectX and OpenGL (I've used it with both OpenGL and OpenGLES in the past). You usually have a dialog on start-up that lets you choose between OpenGL and DirectX on windows, and if there's no log file, there usually is some config file which specifies which renderer to use.
Also, all the other samples provided with OpenNI with draw to the screen use OpenGL with GLUT.
This is the linux version of OpenNI Sinbad: https://github.com/ttair/TuxSinbad