qt5base-lts/examples/opengl/hellowindow/main.cpp
Samuel Rødal 4a189c188c QWindowContext / QWindowFormat refactor.
To enable having a single GL context used for multiple drawables we need
to de-couple the context class a bit more from the window class in the
plugin API. Now contexts are created stand-alone based on a GL format
and a share context, and when calling makeCurrent() a desired surface
is specified. This maps well to GLX, EGL, Cocoa, AGL, and WGL, which all
support this use case.

QWindowContext is renamed to QGuiGLContext, and QWindowFormat is renamed
to QGuiGLFormat. We have the ability to introduce a pbuffer or similar
other offscreen GL drawable abstraction in the future.
2011-06-10 09:24:56 +02:00

19 lines
309 B
C++

#include <QGuiApplication>
#include "hellowindow.h"
int main(int argc, char **argv)
{
QGuiApplication app(argc, argv);
Renderer renderer;
HelloWindow windowA(&renderer);
windowA.setVisible(true);
HelloWindow windowB(&renderer);
windowB.setVisible(true);
return app.exec();
}