Important: Please read the Qt Code of Conduct -

setting core profile gets a blank background

  • I was following the cube tutorial the other day, and was trying to get it work with OpenGL 3.3 core profile. I have set my QSurfaceFormat in main correctly as you can see in the following code:

    int main(int argc, char *argv[])
        QApplication app(argc, argv);
        QSurfaceFormat format;
        app.setApplicationName("textured cube");
    #ifndef QT_NO_OPENGL
        Dialog w;;
        QLabel note("OpenGL Support required");;
        return app.exec();

    I did also added #version 330 in both my vertex and fragment shader
    here is my result
    What did I do wrong?

    another question:
    My application is tend to be cross desktop platforms in the future, should I choose OpenGL 2.0 ES over OpenGL 3.3 Core?