You need to create a shared context for the second thread.  There have been
some issues with this and I have been working with Andreia from Xamarin on
getting this working for MonoGame.  We don't have a nice solution yet, but
it's getting there.

Sly

On 3 March 2012 23:37, johnHolmes <[email protected]> wrote:

> Hi,
>
> I'm currently trying to reload textyre asynchronously when the game is
> restored from background. To do this I'm reloading texures in the OnLoad
> method creating a new thread. Unfortunatelly, when in the new thread I call
> MakeCurrent an exception is thrown.
>
> protected override OnLoad(EventArgs e)
> {
>   MakeCurrent();
>
>   if(_mustReloadTextures)
>   {
>       ThreadPool.QueueUserWorkItem(state =>
>       {
>           MakeCurrent(); // <== EXCEPTION!
>           ReloadTextures();
>       }, null);
>   }
>
>   Run();
> }
>
> Any hint?
>
>
> --
> View this message in context:
> http://mono-for-android.1047100.n5.nabble.com/Can-t-detach-AndroidGraphicsContext-from-current-thead-and-attach-to-another-tp5520013p5533670.html
> Sent from the Mono for Android mailing list archive at Nabble.com.
> _______________________________________________
> Monodroid mailing list
> [email protected]
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>
>
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to