Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Multisampling: QSurfaceformat::samples() always returns -1

Multisampling: QSurfaceformat::samples() always returns -1

Scheduled Pinned Locked Moved Unsolved Game Development
1 Posts 1 Posters 696 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.
  • S Offline
    S Offline
    sylorr
    wrote on last edited by sylorr
    #1

    Hi all,

    I am using QOpenGLWidget to render 3D scene and I want to turn on MSAA even before my App is running.

    This is what I do now:

    SurfaceFormat format;
    format.setRenderableType(QSurfaceFormat::OpenGL);
    format.setVersion(3, 3);
    format.setProfile(QSurfaceFormat::CoreProfile);
    format.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
    int samples = format.setSamples(8)
    // int samples = format.samples()
    

    However, either samples() or setSamples(int) returns -1. I wonder if I need to turn on something from OpenGL side. Therefore I did this before setting up format:

    initializeOpenGLFunctions();
    glEnable(GL_MULTISAMPLE);
    

    As you may guess, setSamples(8) still returns -1. I begin to doubt if my system doesn't support MSAA at all. But I don't know how to check it. Could you please help me out? Either checking if my system could support multisampling or the correct way to use multisampling. Thanks

    Note: Platform: Qt5.6 + Ubuntu16.04 + C++14

    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