public GlFuncResult <T> GlCall <T>(Func <T> func, bool recursive = false) where T : IGlEvent { var glFunc = new GlFunc <T>(func, this, false, recursive); return(_glExecute(glFunc)); }
protected internal void GlEnqueue(GlFunc <IGlEvent> glAction) { if (!_glActionsBufferSignal.IsSet) { _glFuncsBuffer.Enqueue(glAction); } }
public GlFuncResult <T> GlCallSync <T>(Func <T> func, bool recursive = false) where T : IGlEvent { var glFunc = new GlFunc <T>(func, this, true, recursive); if (Thread.CurrentThread.Name == GlMasterRenderHandler.GlContextThreadName) { return(_glExecuteSync(glFunc)); } else { return(_glExecute(glFunc)); } }
protected internal static GlFuncResult <T> _glExecuteSync <T>(GlFunc <T> glFunc) where T : IGlEvent { glFunc._result._value = glFunc.Function(); return(glFunc.Result); }
protected internal static GlFuncResult <T> _glExecute <T>(GlFunc <T> glFunc) where T : IGlEvent { glFunc.Queue(); return(glFunc.Result); }