SimpleOpenGlControl Fullscreen

Hello, I am here graciously seeking some insight into getting my SimpleOpenGlControl to render in fullscreen mode. I have been scouring the internet for a while on this topic and have come up broke.

I've been able to hack a pseudo-fullscreen mode where i simply set the form's location to (0, 0) and its size to the size of the screen, but this is not a true fullscreen mode in my mind.

Is there a way to give my control an exclusive access to the screen to enable a true fullscreen mode?

Thank you!

Is there a way to give my

Is there a way to give my control an exclusive access to the screen to enable a true fullscreen mode?

Set the WindowState of the containing form to maximized, and call RecreateHandle() for SimpleOpenGlControl (this is a protected property, so you'll have to inherit your own control from SimpleOpenGlControl).

------
OpenTK

Hmm this isn't doing quite

Hmm this isn't doing quite what I need. If I call RecreateHandle() without first calling DestroyContexts(), the call to wglMakeCurrent() fails and my application exits.

Even after the call to RecreateHandle() (or a second call to InitializeContexts(), since it in turn calls RecreateHandle()), nothing changes - my SimpleOpenGlControl is still merely "maximized", but not in full screen.

After digging a bit more, it looks like the only answer might be to manually call ChangeDisplaySettings()? If this is the case, might this functionality be added to the SimpleOpenGlControl in a future release?

Thanks for your time -

Indeed, you have to destroy

Indeed, you have to destroy the context as soon as the window handle is destroyed. I thought SimpleOpenGlControl did this automatically, but it seems I was wrong. In this case, just hook the HandleDestroyed and HandleCreated events, and call DestroyContexts() and InitializeContexts() respectively.

That issue aside, you'll have to give some more information on what you wish to achieve.

The method I outlined above *does* create a fullscreen window (and not merely a maximized window) - but it does not change the resolution of the screen.

To make things clear, there are three concepts here:

- Maximize the window. Self-explainable.
- Recreate the window handle: this turns the maximized window into a fullscreen window, which has some performance advantages on Windows.
- Change the screen resolution. This is orthogonal to the above two: you can have a fullscreen window without changing the resolution, or change the resolution without a fullscreen window.

I am opposed to linking the two operations in SimpleOpenGlControl - many people (me included) appreciate the fact that you can set a fullscreen mode without changing the resolution. It's both faster and less visually jarring, not to mention that it avoids potential problems with multiple monitors (this is non-trivial code, and I don't think SimpleOpenGlControl is the correct place for this).

------
OpenTK

Thank you for the rigorous

Thank you for the rigorous reply.

I have experimented with many different variations of all this but finally decided on a solution that does not involve calling RecreateHandle() - it seemed quickest just to remove the border from my form (FormBorderStyle = FormBorderStyle.None - this was the key I was missing) and then maximize it. No resolution change, very quick, and instantly maximizes your real estate.

Thank you again, keep up the quality controls!

Theme by La Boite a site | Powered by Drupal