qt5base-lts/src
Laszlo Agocs 52781f2a7d Make versioned OpenGL functions working with the subclass pattern
QOpenGLFunctions allows both deriving from it and getting an instance
via QOpenGLContext::functions().

Unsurprisingly a large number of users attempt to use the versioned
function wrappers in the same way. Unfortunately this approach was
not that well supported.

Besides some potential base class exporting issues the real blocker for
QOpenGLWidget - or any versionfunction subclass whose associated context
changes during its lifetime - is that the functions instances could
only be initialized once. Unlike instances retrieved via
QOpenGLContext::versionFunctions(), instances created "manually" were not
deinitialized upon the destruction of the associated context because
context did not know about them.

A pattern like

  initializeOpenGLFunctions();
  delete context;
  create new context and make it current
  initializeOpenGLFunctions();

is working fine in QOpenGLFunctions-derived classes but not with the
versioned ones.

To overcome this, start registering such instances to the context too.
QOpenGLContext::destroy() can then reset the internal state so a
subsequent initializeOpenGLFunctions() will reinitialize properly instead
of bailing out mistakenly thinking that everything is ready to use.

Task-number: QTBUG-45199
Change-Id: Ia1420bcccb33c51508698b7a1b036c7544a66e74
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2015-03-27 16:36:34 +00:00
..
3rdparty Update bundled HarfBuzz to 0.9.40 2015-03-23 07:12:53 +00:00
android Android: update android gradle plugin version 2015-03-23 07:38:48 +00:00
angle make the installed meta files play nicely with sysroots 2015-02-05 14:26:44 +00:00
concurrent Doc: fixed links on index page QtConcurrent 2015-03-05 09:40:16 +00:00
corelib Add Qt::WindowFlag to signal that maximizing should cover full screen geometry 2015-03-27 10:24:17 +00:00
dbus Skip non-exported slots early when creating a XML interface description. 2015-03-25 10:11:51 +00:00
gui Make versioned OpenGL functions working with the subclass pattern 2015-03-27 16:36:34 +00:00
network winrt: Fix UDP socket writeDatagram 2015-03-27 13:18:27 +00:00
opengl QtOpenGL: Fix const correctness in old style casts 2015-03-26 06:11:11 +00:00
openglextensions Updated BSD licensed file headers 2015-02-15 07:41:17 +00:00
platformheaders Updated BSD licensed file headers 2015-02-15 07:41:17 +00:00
platformsupport libinput: Reorganize touch frame handler 2015-03-25 10:53:22 +00:00
plugins xcb: Do not crash with VNC 2015-03-27 16:36:16 +00:00
printsupport Fixed compilation on Mac OS X (qt namespace and preprocessor issues)) 2015-03-20 07:05:03 +00:00
sql MySQL: Keep the precision of the field when formatting the value 2015-03-20 13:51:29 +00:00
testlib Testlib: Fix cleanupTestCase not called when last test blacklisted 2015-03-12 09:43:30 +00:00
tools qdoc: No internal qmlabstract types in the "inherited by" list 2015-03-27 13:55:56 +00:00
widgets Windows: Support virtual folders as initial directory for file dialog. 2015-03-27 14:24:03 +00:00
winmain Updated BSD licensed file headers 2015-02-15 07:41:17 +00:00
xml QtXml: Fix const correctness in old style casts 2015-03-11 01:50:23 +00:00
src.pro Build bundled PCRE copy as qt_helper_lib 2015-03-20 18:12:09 +00:00