
Problem with OpenTK and DevExpress Document and Dock Managers
Posted Friday, 2 September, 2011 - 12:49 by nlraley inI am trying to provide support for dockable panels and content for my application that was running OpenTK using your GLControl.
The first render is rendering everything fine. I pre-load all of my textures before displaying anything and the entire scene, background and all is rendered just fine. However, when the panel that contains the GLControl has its docked parent changed, none of the pre-loaded textures are able to be drawn for the background. The primitives are rendered just fine, OpenGL just does not load any of my textures at that point. Changing the docked parent back to the original does not work as well.
I was wandering if someone would have any ideas as to what may be going on that would cause the primitives to render fine but the textures to not render?


Comments
Re: Problem with OpenTK and DevExpress Document and Dock ...
It might be the case that the GLControl handle is destroyed and recreated when the docked parent is changed. In this case, the GLControl has no other choice but to recreate its GraphicsContext, deleting your textures in the process.
You can verify whether this happens by hooking the HandleDestroyed event. If this is indeed the case, you should be able to fix the issue by detaching the GLControl from the Panel temporarily when changing its docked parent.
Re: Problem with OpenTK and DevExpress Document and Dock ...
Thanks, that worked.
For anyone needing to know how to do this, on the form which hosts your control you simply need to perform the following:
Where glControl1 is the name of your OpenGL GLControl.
Thanks