qt - Deallocating OpenGL context created by QGLWidget -
qt - Deallocating OpenGL context created by QGLWidget -
if create qglwidget, , allocate own textures using glgentextures, gltex2dimage, etc, texture info cleaned when delete widget? (also, have shared widgets deleted too).
i looked @ source destructor , looks deleting context, assume clean textures generated context
https://qt.gitorious.org/qt/qt/source/ca5b49a2ec0ee9d7030b8d03b561717addd3441f:src/opengl/qgl.cpp#l3409
just want create sure incase missing something
no, texture storage released when object uses not bound in any of contexts share it. moreover, not implicitly released because 1 context destroyed. share same object name space between of shared contexts, there no way allowed happen (all contexts in share grouping have destroyed).
each context maintains own set of bound textures, if bind texture 1 in context a , b, delete context a texture cannot freed until delete (or unbind from) context b. behavior applies calling gldeletetextures (...)
well.
that function implicitly unbind texture(s) pass current (calling) context, until unbound in other context memory not allowed freed. thing happen texture name re-usable , may returned subsequent phone call glgentextures (...)
.
long story short, in case memory freed (you claim going destroy all of contexts). not freed when destroy first context - other conditions described above have met first.
qt opengl qglwidget openglcontext
Comments
Post a Comment