[Interest] OpenGL: Setting samples on default QSurfaceFormat

Andy asmaloney at gmail.com
Mon Sep 17 18:57:46 CEST 2018


I seem to have a catch-22.

- QSurfaceFormat::setDefaultFormat() needs to be called before application
construction.

- I want multisampling on a 3.3 context by default, so I need to call
QSurfaceFormat::setSamples().

- I can't know how many samples are supported until after application
construction by actually creating a context and asking how many it
supports. (Or can I somehow?)

- If I just setSamples() to the number I want (8) and call
setDefaultFormat, then any card/driver that doesn't support that many
samples fails to be created and I end up with a 2.0 default context.

Any ideas?

---
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/20180917/08a48047/attachment.html>


More information about the Interest mailing list