简体   繁体   English

OpenGL中的GUI工具包

[英]GUI Toolkit in OpenGL

I'd like to develop an application (in C++) similar to Pure Data , but with a cool GUI and a better documentation... Yes, something like Max/MSP or Reaktor , but free and open! 我想开发一个类似于Pure Data的应用程序(用C ++编写),但是有一个很酷的GUI和更好的文档...是的,像Max / MSPReaktor ,但是免费且开放!

In order to create an appealing, reactive and portable interface I was thinking of using OpenGL. 为了创建一个吸引人的,反应性的和可移植的界面,我正在考虑使用OpenGL。 In my mind there is something like Blender GUI . 在我看来,有一些像Blender GUI

Before starting to develop my custom GUI toolkit I googled around in order to understand if there exist something that I could use, and I found: 在开始开发我的自定义GUI工具包之前,我用Google搜索,以了解是否存在我可以使用的东西,并且我发现:

  • Juce : it seems quite supported, but I didn't understand if you can only embed OpenGL canvas in your interface or it is possible to render all the widgets using OpenGL. Juce :看起来很受支持,但我不明白你是否只能在界面中嵌入OpenGL画布,或者可以使用OpenGL渲染所有小部件。
  • nUI : it seems really cool and portable, but... Its forum is a desert, and it's really hard to find a tutorial! nUI :它看起来非常酷且便携,但是...它的论坛是一片沙漠,很难找到一个教程!
  • ceGUI, FLTK, GLUI: so flat and gray ;-) and any aren't still maintained. ceGUI,FLTK,GLUI:如此扁平和灰色;-)并且任何都不会被维护。

Do you know other toolkit? 你知道其他工具包吗? As you understand I'm looking for a portable library (in C++), fast and supported. 如您所知,我正在寻找一个可移植的库(在C ++中),快速且受支持。

The other possibility is developing from scratch my custom toolkit using SDL or Freeglut, in this case which could be the best solution? 另一种可能性是从头开始使用SDL或Freeglut我的自定义工具包,在这种情况下,这可能是最好的解决方案?

PS: Reading other threads about this topic I noticed that many devs suggest using Qt... Could Qt relies on OpenGL for rendering? PS:阅读关于这个主题的其他主题我注意到许多开发人员建议使用Qt ... Qt可以依赖OpenGL进行渲染吗? Or it could only host OpenGL canvas? 或者它只能托管OpenGL画布? Anyway do you think is possible (with good performance) creating something like this in Qt: 无论如何你认为在Qt中创建这样的东西是可能的(有良好的性能):

Qt 5.7 and up offers QtQuick Controls 2.0 in QML, which are implemented in OpenGL. Qt 5.7及以上版本提供QML中的QtQuick Controls 2.0,它们在OpenGL中实现。

http://doc.qt.io/qt-5/qtquickcontrols2-index.html http://doc.qt.io/qt-5/qtquickcontrols2-index.html

Their API is very stable and works on Android, iOS, macOS, Windows, GNU/Linux, etc. 他们的API非常稳定,适用于Android,iOS,macOS,Windows,GNU / Linux等。

Here is a small hello world in a great book about QML. 这是一本关于QML的好书中的小世界。 https://qmlbook.github.io/en/ch02/index.html#hello-world https://qmlbook.github.io/en/ch02/index.html#hello-world

You write JavaScript in QML and the QMake build system turns it into C++ object code. 您在QML中编写JavaScript,而QMake构建系统将其转换为C ++目标代码。

import QtQuick 2.5

Rectangle {
    width: 360
    height: 360
    Text {
        anchors.centerIn: parent
        text: "Hello World"
    }
    MouseArea {
        anchors.fill: parent
        onClicked: {
            Qt.quit();
        }
    }
}

There isn't really a good openGL toolkit, they tend to get invented for a particular app and then sort of abandoned. 实际上没有一个好的openGL工具包,它们往往是针对特定应用程序而发明的,然后被抛弃。

Yes Qt works very well with openGL, there is an openGL QGlWidget with full hardware acceleration (and optional links to openCL). 是的Qt与openGL配合得很好,有一个带有全硬件加速的openGL QGlWidget (以及openCL的可选链接)。 You can have as many QGLwidgets as you like in a Qt app - each with their own openGL commands inside them. 你可以在Qt应用程序中拥有任意数量的QGLwidgets - 每个都有自己的openGL命令。

You can also mix Qt and openGL in the same QGlWidget (http://doc.qt.nokia.com/qq/qq26-openglcanvas.html) 您也可以将Qt和openGL混合在同一个QGlWidget中(http://doc.qt.nokia.com/qq/qq26-openglcanvas.html)

Slightly off topic: You can also select Qt to use openGL for all it's rendering - this is still a bit experimental but means that 2d Qt can be much faster on some embedded platforms like phones. 稍微偏离主题:你也可以选择Qt来使用openGL进行所有渲染 - 这仍然有点实验性,但这意味着2d Qt在某些嵌入式平台上可以快得多,比如手机。
edit: To clarify -the entire app are still normal Qt but drawn with openGL commands 'under the hood' 编辑:澄清 - 整个应用程序仍然是正常Qt,但使用openGL命令'引擎盖下'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM