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!
In order to create an appealing, reactive and portable interface I was thinking of using OpenGL.
In my mind there is something like 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:
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.
nUI: it seems really cool and portable, but... Its forum is a desert, and it's really hard to find a tutorial!
ceGUI, FLTK, GLUI: so flat and gray ;-) and any aren't still maintained.
Do you know other toolkit? As you understand I'm looking for a portable library (in C++), fast and supported.
The other possibility is developing from scratch my custom toolkit using SDL or Freeglut, in this case which could be the best solution?
P.S.:
Reading other threads about this topic I noticed that many devs suggest using Qt... Could Qt relies on OpenGL for rendering? Or it could only host OpenGL canvas? Anyway do you think is possible (with good performance) creating something like this in Qt:
Reaktor GUI example 1
Reaktor GUI example 2
Blender Compositing example
There isn't really a good openGL toolkit, they tend to get invented for a particular app and then sort of abandoned.
Yes Qt works very well with openGL, there is an openGL QGlWidget with full hardware acceleration (and optional links to openCL). You can have as many QGLwidgets as you like in a Qt app - each with their own openGL commands inside them.
You can also mix Qt and openGL in the same 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.
edit: To clarify -the entire app are still normal Qt but drawn with openGL commands 'under the hood'
I like Clutter and MX.
See http://www.clutter-project.org/ and https://github.com/clutter-project/mx
Qt 5.7 and up offers QtQuick Controls 2.0 in QML, which are implemented in OpenGL.
http://doc.qt.io/qt-5/qtquickcontrols2-index.html
Their API is very stable and works on Android, iOS, macOS, Windows, GNU/Linux, etc.
Here is a small hello world in a great book about QML. 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.
import QtQuick 2.5
Rectangle {
width: 360
height: 360
Text {
anchors.centerIn: parent
text: "Hello World"
}
MouseArea {
anchors.fill: parent
onClicked: {
Qt.quit();
}
}
}
Related
I am building a c++ maze project for school and want to create a 2d graphics window in c++ that will let me render something like this http://www.dreamincode.net/forums/uploads/monthly_07_2011/post-114496-13104660729008.png.
Can anyone suggest a 2d graphics library to use? I have looked into openGL but am worried that the geometry necessary is too complicated for what I need. Of course I may be overlooking some things.
I am working in Xcode on OS X and if the library is not multiplatform that is okay. Can anyone suggest me something?
The Qt framework is a cross-platform solution for building applications.
There is a basic drawing example that shows how to use basic graphic primitives:
The core of the technique consists in reimplementing a widget's paintEvent() method to control how it is displayed (painted) on the screen. The QPainter class provides many drawing methods to suit your needs.
Since cross-platform is not a problem, just use Quartz or SpriteKit. Quartz is general 2D drawing, SpriteKit is specifically for games. All the docs you can access directly in Xcode through the documentation window, and Apple provides a bunch of sample code too.
I need a cross-platform GUI toolkit with OpenGL support. I also need to be able to draw on a canvas or panel from an image buffer. The candidates I've chosen so far are FLTK (it can do OpenGL windows -- I don't know about canvases), Qt, and wxWidgets.
Any idea which would be the best?
Thanks!
I would say Qt. But that might be argumentative question...
Hey Deep, XVT support openGL. It's a GUI cross-platform toolkit for C and C++ www.xvt.com
For simple things I would suggest GLUT or something similar. But for anything above a simple window into which you render some OpenGL, I strongly recommend Qt. But as tibur said, its probably a matter of taste.
Checkout the Ecere SDK. It's a feature rich cross-platform GUI toolkit, and it supports a variety of graphics driver (e.g. GDI, X11, OpenGL, Direct3D). It has a built-in 3D engine, but you can mix it with your own OpenGL code as well, there are samples showing you how to do just that. It was originally designed as a GUI system for in-game menus, so it supports full screen mdoe as well as windowed mode, but is now a general purpose SDK.
Besides Qt, GTK, wxWidgets... What are the recommendations for a cross platform, open source GUI framework library that works with OpenGL?
Its not quite a GUI framework. But GLFW is good for an OpenGL window with some extra features like keyboard and joystick handling.
I found the other framework I was looking for. It is SFML. I only used it briefly but I do remember liking it very much. It does contain a lot of nice extras going a step further than GLFW. If I recall correctly the documentation was stellar.
For a full featured cross-platform GUI framework I think you would be hard pressed to beat QT, GTK, or wx.
I'm not sure, but at a guess, the other framework mfperzel was trying to think of might have been fltk (the "fast light tool kit"). Where glfw is mostly an OpenGL window with some ability to read the mouse and keyboard, fltk is a GUI framework that supports OpenGL (but as the name implies it's still quite a bit smaller and faster than most GUI frameworks). I haven't tried it yet, but there's a new GUI builder program for it (FLUID) that looks fairly promising as well. One warning though: FLTK uses its own widgets, which tend to look at least a little foreign to most users.
So, I'm going to develop a Pac-Man clone with Qt. The problem is that I do not really know where to start.
I quickly take a look at the documentation and some demo. I also downloaded some game sources on qt-apps.org. And it seems that there is a lot of ways to develop a game with Qt!
In your experience, which part of Qt should I consider to develop a Pac-Mac clone ?
The Animation Framework
The Graphics View Framework
The Paint System
Qt Declarative
Any help would be appreciated.
I think that QGraphicsView framework is the best way. Create a QGraphicsScene, some QGraphicsItems for the elements of the game. You have collision detection for free.
Most of KDE games are based on the QGraphicsView framework. It is a good fit for simple game development.
I'm currently working on a project providing gaming-specific Qt Quick Components for cross-platform game development, might be of interest: http://v-play.net :)
At the very minimum you will want to look at QGLWidget. You can get an OpenGL program up in a few minutes by deriving from QGLWidget, it will create the window, context, handle mouse and keyboard input, etc. Create a QTimer to trigger updateGL() every 10-15 ms or so and your good to go. I think there is a demo somewhere for setting this up, but it has been awhile since I saw it.
If you want to embed widgets into the window, I would look at QGraphicsView. There is a demo of this called boxes. Just beware the demo is a tad hard to learn from as several classes are thrown into the same file and it might take a few moments of tracing to figure out where the flow is.
Since you are doing a 2d game, you might want to look at using QPainter on top of OpenGL. This allows you to draw primitives easily instead of doing them with OpenGL calls. I never could get this to stop flickering in fullscreen though.
There's a book about game development in Qt here, it's a bit old, but it might give you some ideas. But IMHO, Qt is widget based and is a bit slow for a game, you might consider using SDL or OpenGL.
I'm developing a simulation of rigid bodies with Qt and OpenGL using the PhysX API from Nvidia. If you want to see this approach, look at my project at github: http://github.com/lucassimao/Simulacao-Estereologica
Well, one place to look could be the Gluon game development framework, which is currently under development. It depends on what you're really aiming for with your PacMan clone, but Gluon may well be what you're after: https://github.com/KDE/gluon
If anyone else is interested in learning how to make GAMES using C++ and Qt, have a look at my YouTube tutorial series. It explains the graphics view framework through a series of videos which build upon a single game that we start in tutorial 1.
C++ Qt Game Tutorial 8 - Adding Graphics
If you are not comfortable with Qt yet, then I REALLY loved VoidRealm's Qt tutorial series, also on youtube (C++ Qt 1 - Introduction to QT programming).
A good start would be:
Qt Examples And Tutorials
Perhaps if you need to cheat you may want to look here
xpacman.tar.gz
I'm searching for a OpenGL User Interface Library like WxWidgets but not OS dependent.
It would have to provide callbacks for user input since this is OS dependent.
If something like this doesn't yet exist (which I doubt because most games have most of the Basic UI Elements) is there a OpenGL HTML/CSS renderer?
FLTK, GTK+, and QT support OpenGL widgets in a portable way. QT in particular can render all of its widgets in an OpenGL viewport. I know there's been some work on getting GTK to do the same thing, but I haven't heard on the progress of it.
OTK comes up on a quick Google search as an OpenGL-backed widget library.
It's also worth pointing out that Cairo has an OpenGL backend, and there are a number of toolkits that depend on it, including GTK+.