[Mono-bugs] [Bug 638017] New: Support opengl context sharing across threads

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Sep 8 15:55:10 EDT 2010


https://bugzilla.novell.com/show_bug.cgi?id=638017

https://bugzilla.novell.com/show_bug.cgi?id=638017#c0


           Summary: Support opengl context sharing across threads
    Classification: Mono
           Product: MonoDroid
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Class Libraries
        AssignedTo: mkestner at novell.com
        ReportedBy: jankit at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Split from bug 635565 .

Comment by 'Dominique Louis':

I noticed that AndroidGameView has a context property, but does this actually
map to an EGLContext? 
If it doesn't then some of us will have issues loading textures on a background
thread as we need the ability to store the current OpenGL rendering context and
also its associated ShareGroup, so that it we can switch contexts when on the
Main thread and also a background thread 

Currently on MonoTouch I can do the following, where _view is a pointer to the
currently running iPhoneOSGameView...

_view.MainContext/*local variable*/ = _view.EAGLContext;
_view.ShareGroup/*local variable*/ = _view.MainContext.ShareGroup;
_view.BackgroundContext/*local variable*/ = new
MonoTouch.OpenGLES.EAGLContext(_view.ContextRenderingApi, _view.ShareGroup);

then in the thread where you are loading the textures you need to do something
like this...

// Switch to our shared Context
EAGLContext.SetCurrentContext(_view.BackgroundContext);

// Load your textures here....

// Switch to our main Context
EAGLContext.SetCurrentContext(_view.MainContext);

Anyway worth keeping in mind if adding the MonoTouch compatibility.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list