<div dir="ltr"><div><div><div><div>Hello forum/list!<br><br></div>We're using a 3rd party library that requires an active OpenGL context for the initialization. Not too much aware of what we were doing, we put the initialization code in a draw call of a drawable. (On first draw, the 3rd party initialization code is called because there is an active OpenGL context at that moment.)<br><br></div>This worked, but some requirements in how our stuff is initialized changed so we had to move the initialization code earlier.<br><br></div>So we used a GraphicsOperation callback to be called during the viewer :: realize call. (We were not aware of that before.)<br><br></div>This works, and from what I read, this is the preferred way in this context.<br><div><br></div><div>Now, upon destruction, that 3rd party library would also need access the OpenGL context to be active for cleanup and termination. It's not a HUGE issue: the library has not a valid context so it can't do its things correctly: in debug mode it spams the console (it just hushes them in release). <br></div><div><br></div><div>I read that the usage of GraphicsContext::makeCurrent (and releaseContext) would probably do the job (gc->makeCurrent(); otherLib->terminate(); gc->releaseContext();), but that it's not the preferred way because the graphics thread could be in the middle of something.<br><br></div><div><div><div><div></div><div>What would be the clean way to do this?<br><br></div><div>Thanks!<br><br></div><div>P.S. Sorry if this looks dumb, we're slowly learning how stuff gets done :)<br></div><div><br clear="all"><div><div><div class="gmail_signature"><div dir="ltr">--<br>Alexandre Vaillancourt<br></div></div></div>
</div></div></div></div></div></div>