[Interest] QOpenGLContext::currentContext() returning nullptr (in some cases)

Andy asmaloney at gmail.com
Sat Dec 31 15:42:18 CET 2016


On Sat, Dec 31, 2016 at 7:48 AM, Giuseppe D'Angelo <
giuseppe.dangelo at kdab.com> wrote:

> Il 21/12/2016 16:00, Andy ha scritto:
> > In what situations should I expect QOpenGLContext::currentContext() to
> > return a nullptr? I thought with the fallback/ANGLE stuff I could always
> > expect at least the ANGLE stuff to kick in - as in the second example.
>
> Well, the situation is far more complex, and there's no "ANGLE
> fallback". Read the docs on Windows and its "dynamic GL" support to
> better understand the role of ANGLE in all of this.


Thanks Giuseppe.

I've read and re-read the docs but am not any clearer on an answer.

https://doc.qt.io/qt-5/windows-requirements.html#dynamically-loading-graphics-drivers
says:

"When a given environment fails to provide a proper OpenGL 2.0
implementation, it will fall back automatically to ANGLE. This fallback
will be completely transparent to the application, and will allow Qt Quick
or other OpenGL code to function by translating to Direct3D. Such a
fallback could, for example, take place on a Windows 7 PC with no
additional graphics drivers installed. On other machines, where there is
sufficient OpenGL support, the normal desktop OpenGL drivers will be used."


> Besides, ANGLE only
> provides OpenGL ES 2 (3?), so it cannot possibly provide a (Desktop)
> OpenGL 3.3 context.
>

That's fine. The way I read the docs, I should ask for what I want, and it
should return what it can handle so I know what I have to work with. If
there are no OpenGL drivers installed, it should fall back to ANGLE and
return that.

I think that's what I'm seeing "in the wild" except that sometimes it
doesn't return a context at all. That's what I'm asking about. When can
this happen?

Thank you for your time.


>
> HTH,
> --
> Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
> KDAB (UK) Ltd., a KDAB Group company | Tel: UK +44-1625-809908
> KDAB - Qt, C++ and OpenGL Experts
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
---
Andy Maloney  //  https://asmaloney.com
twitter ~ @asmaloney <https://twitter.com/asmaloney>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20161231/23bdaa87/attachment.html>


More information about the Interest mailing list