public GlCallResult GlCall(Action action, bool recursive = false) { var glAction = new GlAction(action, this, false, recursive); glAction.Queue(); return(glAction._result); }
protected internal void GlEnqueue(GlAction glAction) { if (!_glActionsBufferSignal.IsSet) { _glActionsBuffer.Enqueue(glAction); } }
protected internal void AddUnitGlObject(GlObject glObject, GlAction glAction) { #if DEBUG if (glObject is null) { throw new ArgumentNullException(nameof(glObject), "Argument can not be null."); } if (glAction is null) { throw new ArgumentNullException(nameof(glAction), "Argument can not be null."); } #endif UninitGlObjects.Add(glObject, glAction); }
public GlCallResult GlCallSync(Action action, bool recursive = false) { GlAction glAction = new GlAction(action, this, true, recursive); if (Thread.CurrentThread.Name == GlMasterRenderHandler.GlContextThreadName) { glAction.Action(); } else { glAction.Queue(); glAction._result._signal.Wait(); } return(glAction._result); }
protected internal static GlCallResult _glExecuteSync(GlAction glAction) { glAction.Action(); glAction._result._signal.Set(); return(glAction.Result); }
protected internal static GlCallResult _glExecute(GlAction glAction) { glAction.Queue(); return(glAction.Result); }