Exemplo n.º 1
0
        public GlCallResult GlCall(Action action, bool recursive = false)
        {
            var glAction = new GlAction(action, this, false, recursive);

            glAction.Queue();
            return(glAction._result);
        }
Exemplo n.º 2
0
 protected internal void GlEnqueue(GlAction glAction)
 {
     if (!_glActionsBufferSignal.IsSet)
     {
         _glActionsBuffer.Enqueue(glAction);
     }
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 protected internal static GlCallResult _glExecuteSync(GlAction glAction)
 {
     glAction.Action();
     glAction._result._signal.Set();
     return(glAction.Result);
 }
Exemplo n.º 6
0
 protected internal static GlCallResult _glExecute(GlAction glAction)
 {
     glAction.Queue();
     return(glAction.Result);
 }