Results 1 to 3 of 3

Thread: Force to gles2 (OpenGL ES 2.0)

  1. #1
    Join Date
    Aug 2017
    Posts
    2
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Smile Force to gles2 (OpenGL ES 2.0)

    Hi All


    I'm making an app that should be used with OpenGL ES 2.0. I have taken an example gles2 but modifying it has automatically changed to gles3. I need it to be gles2.
    How do I force it to compile gles2? I use Qt5.7 but originally example is Qt4.8.

    Qt Code:
    1. std::string glVersion = reinterpret_cast<const char*>(glGetString(GL_VERSION));
    2. std::string glslVer = reinterpret_cast<const char*>(glGetString(GL_SHADING_LANGUAGE_VERSION));
    3. qDebug("glVer: %s\nglslVer: %s", glVersion.c_str(), glslVer.c_str());
    To copy to clipboard, switch view to plain text mode 


    glVer: OpenGL ES 3.0 Mesa 12.0.6
    glslVer: OpenGL ES GLSL ES 3.00

    Thank you.

  2. #2
    Join Date
    Aug 2017
    Posts
    2
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Force to gles2 (OpenGL ES 2.0)

    I tested hellogl_es2 example and works! But my app use same include and not works.


    Added after 10 minutes:


    We start from an example of Qt (hellogl_es2) and we added texture to the ground, some billboard icons that rotate and updated the app to Qt5.7. While I only use gles2 functions in a qDebug I see that Qt5.7 is compiling for gles3.

    std::string glVersion = reinterpret_cast<const char*>(glGetString(GL_VERSION));
    std::string glslVer = reinterpret_cast<const char*>(glGetString(GL_SHADING_LANGUAGE_VERSION));
    qDebug("glVer: %s\nglslVer: %s", glVersion.c_str(), glslVer.c_str());

    glVer: OpenGL ES 3.0 Mesa 12.0.6
    glslVer: OpenGL ES GLSL ES 3.00

    hellogl_es2 qt example works fine on both but in my app only black box is seen with nothing.}

    GPU supports Open GL ES 3.1
    Yocto distribution has partial support for GL ES 3.0
    but Qt toolchain for crosscopile supports only GL ES 2.0

    How do I force Qt to compile on gles2?

    I've tried code like the following and it returns "2.0" but compiles to gles3.

    QSurfaceFormat format;
    format.setVersion(2,0);

    int majorVersion = format.majorVersion();
    int minorVersion = format.minorVersion();
    qDebug("Major Version %d", majorVersion);
    qDebug("Minor Version %d", minorVersion);


    I appreciate who can help me.

    Greetings.
    Last edited by fightimbs; 28th August 2017 at 17:06.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Force to gles2 (OpenGL ES 2.0)

    OpenGLES 3.0 is backward compatible with OpenGLES 2.0 so if you only use 2.0 code in your shaders, it should be working. Are you sure the problem is not elsewhere?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 2
    Last Post: 5th July 2017, 14:28
  2. Replies: 0
    Last Post: 17th May 2015, 19:03
  3. converting GLUT/OpenGL to Qt/OpenGL - displaying issue
    By yoti13 in forum Qt Programming
    Replies: 1
    Last Post: 25th November 2012, 01:45
  4. Replies: 0
    Last Post: 6th December 2009, 01:41
  5. Qt with OpenGL ES for ARM9 - All OpenGL ES tests have failed!
    By vinpa in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 3rd December 2009, 11:10

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.