Results 1 to 2 of 2

Thread: Qt over openGL ES 2.0 in Mac OS

  1. #1
    Join Date
    Aug 2015
    Qt products
    MacOS X

    Default Qt over openGL ES 2.0 in Mac OS

    I have a cross platform mobile application that uses openGL ES 2.0.
    I want to write a Qt platform that will run on Mac OS. In order to use openGL ES 2.0 on mac (instead of openGL), I'm using powerVR drivers. Now I'm not sure what to do with Qt.
    Is it possible to use QOpenGLWidget or QOpenGLContext with QWinodw to create the context and then let the underlying cross platform software run openGL ES 2.0 commands? I tried this in several ways but it didn't seem to work.
    Maybe instead I can use native EGL to create the context, and then somehow bind it to a Qt display widget?

    I'm new to Qt and openGL and I searched and read in the forum and internet about this but I'm confused. Can someone advise on which direction I should go?
    Thank you very much!

  2. #2
    Join Date
    Aug 2015
    Qt products
    MacOS X

    Default Re: Qt over openGL ES 2.0 in Mac OS

    If I try the following code on MAC OS X, the QOpenGLContext::create() returns false. Is it because openGL ES is not compatible with mac os?
    Is there a way to use native EGL to create openGL ES context on mac os (using powerVR) and then bind it with a Qt display widget?

    Qt Code:
    1. QWindow *win = new QWindow();
    2. win->setSurfaceType(QSurface::SurfaceType::OpenGLSurface);
    3. QOpenGLContext* ctx = new QOpenGLContext;
    4. QSurfaceFormat* fmt = new QSurfaceFormat;
    5. fmt->setRenderableType(QSurfaceFormat::OpenGLES);
    6. fmt->setMajorVersion(2);
    7. fmt->setMinorVersion(0);
    8. fmt->setRedBufferSize(5);
    9. fmt->setGreenBufferSize(6);
    10. fmt->setBlueBufferSize(5);
    11. fmt->setAlphaBufferSize(0);
    12. fmt->setDepthBufferSize(0);
    13. ctx->setFormat(*fmt);
    14. ctx->create();
    To copy to clipboard, switch view to plain text mode 

    ***UPDATE: I read about QEGLNativeContext, which could be good to me since I know how to create context with EGL, Can anyone point me to how I can include this platform specific class in my program?

    ***UPDATE 2: I tried using QEGLNativeContext but I only get the message: QCocoaGLContext: Requires a QCocoaNativeContext

    If anyone has a clue on how I can continue, it would be much appreciated.

    Thanks again
    Last edited by gal; 3rd August 2015 at 12:23.

Similar Threads

  1. Replies: 2
    Last Post: 5th July 2017, 13:28
  2. Conversion from opengl to opengl es2 (Shapefile rendering)?
    By swapan_gh in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 5th December 2013, 06:59
  3. converting GLUT/OpenGL to Qt/OpenGL - displaying issue
    By yoti13 in forum Qt Programming
    Replies: 1
    Last Post: 25th November 2012, 00:45
  4. Replies: 0
    Last Post: 6th December 2009, 00: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, 10:10

Tags for this Thread


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.