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?
QWindow *win = new QWindow();
win->setSurfaceType(QSurface::SurfaceType::OpenGLSurface);
QOpenGLContext* ctx = new QOpenGLContext;
QSurfaceFormat* fmt = new QSurfaceFormat;
fmt->setRenderableType(QSurfaceFormat::OpenGLES);
fmt->setMajorVersion(2);
fmt->setMinorVersion(0);
fmt->setRedBufferSize(5);
fmt->setGreenBufferSize(6);
fmt->setBlueBufferSize(5);
fmt->setAlphaBufferSize(0);
fmt->setDepthBufferSize(0);
ctx->setFormat(*fmt);
ctx->create();
QWindow *win = new QWindow();
win->setSurfaceType(QSurface::SurfaceType::OpenGLSurface);
QOpenGLContext* ctx = new QOpenGLContext;
QSurfaceFormat* fmt = new QSurfaceFormat;
fmt->setRenderableType(QSurfaceFormat::OpenGLES);
fmt->setMajorVersion(2);
fmt->setMinorVersion(0);
fmt->setRedBufferSize(5);
fmt->setGreenBufferSize(6);
fmt->setBlueBufferSize(5);
fmt->setAlphaBufferSize(0);
fmt->setDepthBufferSize(0);
ctx->setFormat(*fmt);
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
Gal
Bookmarks