mono/MonoGame — pull request #749 by tomspilman (2012-09-09 05:07:49+00:00)
Title: Fix For "Failed to make context current."

This is a fix for the OpenTK GraphicsContextException "Failed to make context current. Error: 170" that has been happening lately.

Seems like it was added because of this issue...

https://github.com/mono/MonoGame/issues/596

So the change to call...

```Threading.BackgroundContext.MakeCurrent( Threading.WindowInfo );```

... on all platforms broke threaded content loading on Windows.

The explanation from the OpenTK site is that you cannot make the context current on two different threads...

http://www.opentk.com/node/1714

... by making it current on the foreground thread that makes it unable to be made current on the background thread. There is really no reason to make it current in the foreground thread... Sly even mentioned that...

"It would appear that at the time the first SpriteBatch is created, the main
thread does not have the main context set as current. Elisee's work-around
is not really the correct way to do it as this is making the secondary
context current on the UI thread."

In my commit here I've removed the line.

I suggest we find the real bug with Linux not having the main GL context active.