Beispiel #1
0
        public GlCallResult GlCall(Action action, bool recursive = false)
        {
            var glAction = new GlAction(action, this, false, recursive);

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