Get Metal drawing context in Qt 6 - c++

When using the Qt OpenGL back-end then it is possible to render custom OpenGL code during Qml scenegraph rendering using the QQuickWindow::beforeRenderPassRecording signal, as described in the Qt documentation: https://doc.qt.io/qt-5/qtquick-scenegraph-openglunderqml-example.html
Is a similar functionality available for the Apple Metal back-end? How can I use native Metal code in the scene graph?

Related

Use Unity3D as GUI to a Win32 c++ with OpenGL app

I have a Win32 app written in C++ that uses a lot of OpenGL code.
Right now we render all the GUI using OpenGL code, but I think using Unity3D as an interface layer would really simple things for us:
Is it possible to use our own c++ classes with OpenGL under a Unity3D app (in Windows?)
You should consider an alternative UI library that is capable of rendering directly to an OpenGL texture without imposing the burden of integrating with the entire Unity system.
I've played with QML, CEGUI, or libRocket.
QML is the most well designed of these three, although it's support for rendering directly to OpenGL textures is relatively recent, so there are some minor gotchas, but in general it's easy to use and the limitations can be worked around.

Integrate 3rd party 3d renderer in Qt

I have been looking for ways to render a 3d scene using Qt QML controls. I saw there is a framebuffer example which uses Canvas3D control to get OpenGL 3d scene rendered. However this example uses JavaScript for the rendering logic.
I was looking for a way to do the same but via a C++ class. Is there any way to do so? Or any example available?
Ideally, I would like to use 3rd party renderer to create a scene. Any ideas?

QML OpenGL game redraw loop

I am making a 3D game with OpenGL ES 2.0 and want to use QML as an overlay for the user interfaces.
I know that I can embed my OpenGL code inside a QGLWidget but how can I force QML to redraw the view as often as possible?
Additionally will I get performance issues because I am embedding the OpenGL view?
If you want to render your game with OpenGL and use QML for the UI, consider using the Qt Quick Scene Graph:
Mixing Scene Graph and OpenGL
Scene Graph - OpenGL Under QML

Embedding a GLFW window inside windows forms

I'm making an editor for 3d worlds in opengl using the windows forms UI. I'm developing on visual studio 2012 express and i would like to embed a GLFW window/context inside a windows form. just like done in this tutorial http://www.codeproject.com/Articles/16051/Creating-an-OpenGL-view-on-a-Windows-Form except working. And with GLFW for opengl context.
Is this possible? should i use Qt instead? and how would i got about doing this? I'm not bound to using windows forms i just need a simple good-looking functional UI for my project.
That are three different frameworks (Windows Forms, GLFW, Qt) which can all do the same thing, i.e. creating a window and an OpenGL context in it.
See here for an easy example how to create a window with OpenGL context with GLFW.
Or see here for the Qt example.
So, you have to choose between one of them. GLFW and Qt have the advantages that your code will also work on MacOSX and on Linux; with some work even on iPhone.
If you want to do the window creation and event handling and other stuff with GLFW but the GUI still with Qt, there is some way to do offline drawing (some ref here or here or here) the Qt widgets and then draw it onto some OpenGL texture. Or you might also be able to directly draw them via OpenGL (not exactly sure).

Is there anyway to use the OpenGl API directly in Qt 5?

We're using Qt 5.01. We're supposed to use OpenGl to write a visualizer. Even a simple function to draw a triangle returns the error: glBegin() not found, glVertex2f() not found/defined or something.
I learned this is because Qt 5 doesn't come with the regular OpenGl API but it has its own QOpenGl framework.
Is there anyway to eschew the QOpenGl framework and work with OpenGl directly?
I'm on a Windows system using MinGW if that's relevant.