• Laszlo Agocs's avatar
    Modernize the OpenGL examples · 611558d8
    Laszlo Agocs authored
    Change them to use QOpenGLWidget and QOpenGLTexture.
    Advocate also the usage of VBOs.
    
    Hopeless examples, that rely on the fixed pipeline and will
    not compile or work in ES and dynamic builds, are moved to
    a "legacy" directory. The documentation pages for these are
    removed. This long due change avoids the confusion newcomers
    experience when trying to get started with Qt 5 and OpenGL.
    
    hellowindow's behavior is changed to open a single window only
    by default. The old default behavior, that opened three windows
    on platforms that supported both MultipleWindows & ThreadedOpenGL,
    can be requested by passing --multiple. --single is removed since it
    is the default now. This plays much nicer with drivers that have
    issues with threading.
    
    In addition, say hello to hellogl2.
    
    This is the old hellogl example updated to use QOpenGLWidget and
    OpenGL 2. It also has a mainwindow with multiple (un)dockable widgets
    containing the OpenGL widgets. This helps testing the behavior when
    the top-le...
    611558d8
pbuffers.pro 467 B
HEADERS += glwidget.h \
    cube.h
SOURCES += glwidget.cpp \
    main.cpp \
    cube.cpp
RESOURCES += pbuffers.qrc
QT += opengl widgets
# install
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers
INSTALLS += target
contains(QT_CONFIG, opengles.) {
    contains(QT_CONFIG, angle): \
        warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c")
    error("This example requires Qt to be configured with -opengl desktop")