Query on Qt OpenGL ES 2.0 support



  • Hi,

    I am confused with the OpenGL ES 2.0 support when using Qt. From the documentations, the QOpenGLFunctions class provides cross-platform access to the OpenGL ES 2.0 API. Does that mean i can only use the OpenGL function in OpenGL ES 2.0 API? Below is my example, OpenGL ES 2.0 does not support this GL_DEPTH_COMPONENT enum to get depth value in depth buffer, however, it does actually work on my desktop and able to get the depth Z value of pixels. What's the rationale behind here?

    glReadPixels(posX, posY, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &posZ);
    


  • @dalishi I'm a little confused by the question. Maybe I need another cup of tea!

    Right, so I write OpenGL code in Qt (TBH I use my own libraries much of the time) but the concept is that Qt is a kind of "superset" of the OpenGL system supporting programmable shaders.

    That is, you will find things in there, such as the above, that do not work in ES2. However, they are still "expressible" because they work on other platforms e.g. desktop, and Qt is cross platform.

    The OGL functions work on both desktop and mobile. You are not restricted to using ES2 and Qt does a fair amount of levelling the ground for you (take the tediums with precision in shaders).

    None-the-less it is important that you, the coder, make sure your code uses the correct features on the correct platform.

    Does this help?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.