Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. setting core profile gets a blank background
QtWS: Super Early Bird Tickets Available!

setting core profile gets a blank background

Scheduled Pinned Locked Moved Unsolved General and Desktop
openglubuntucross platform
1 Posts 1 Posters 700 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • MicPianoM Offline
    MicPianoM Offline
    MicPiano
    wrote on last edited by MicPiano
    #1

    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;
        format.setDepthBufferSize(24);
        format.setVersion(3,3);
        format.setRenderableType(QSurfaceFormat::OpenGL);
        format.setProfile(QSurfaceFormat::CoreProfile);
        QSurfaceFormat::setDefaultFormat(format);
    
        app.setApplicationName("textured cube");
        app.setApplicationVersion("0.1.0");
    #ifndef QT_NO_OPENGL
        Dialog w;
        w.show();
    #else
        QLabel note("OpenGL Support required");
        note.show();
    #endif
        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?

    1 Reply Last reply
    0

  • Login

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved