New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple GL Controls #31
Comments
What version of GLControl are you using? |
I'm using 4.0.0-pre.6 with a Windows Forms NET 7 build for Windows. However, I believe I tried this unsuccessfully many years ago with version 3 as well. |
Sorry for the very delayed answer, but have you tried looking at the multi-form example project that exists in this repo? |
Oh no i haven't. The example shows multiple GL controls on multiple forms I'm assuming? Thanks |
Yeah, it does. If you run into any problems feel free to ask any questions here. I've just recently fixed the build system for this repo so I'll be able to do some work on it, so I expect that I'll update the sample projects soon to use more modern OpenGL. There I can look at maybe making the multi-control sample better (if it isn't fine already). |
I've just updated the multi control sample to make use of modern OpenGL and context sharing (#35 ). |
Wow awesome, this is what I've always dreamed of! |
The context sharing part isn't really possible to conveniently achieve without the change I made to A workaround until then would be to make your own subclass protected override void OnHandleCreated(EventArgs e)
{
if (SharedContext != null)
{
if (SharedContext._nativeWindow == null)
{
throw new InvalidOperationException("The GLControl set as the shared context to this GLControl is not yet initialized. Initialization order when sharing contexts is important.");
}
_glControlSettings.SharedContext = SharedContext.Context;
}
base.OnHandleCreated(e);
} |
Okay good to know. I just saw you did a prerelease of the winforms package. Is that what I need? Or the next release of opentk? Thanks |
To get the multi control test working you either need to download the source as it is right now, or wait for the next version of |
I've been unable to get multiple GLControls to work in a single WinForms application. My goal is to have multiple tabs/windows that each show the same 3D scene but from different angles. Ideally they would share context/data, but separate contexts would be okay too. Is this possible? Not sure if this is a bug or intended behavior.
The text was updated successfully, but these errors were encountered: