private static void Render(GLControl control, GUIRenderEventArgs arg)
        {
            if (control != null)
            {
                var        renderable = control as IGUIRenderable;
                ThreeFlags flags      = (renderable != null) ? renderable.EnableGUIRendering : ThreeFlags.None;
                bool       before     = (renderable != null) && ((flags & ThreeFlags.BeforeChildren) == ThreeFlags.BeforeChildren);
                bool       children   = (renderable == null) || ((flags & ThreeFlags.Children) == ThreeFlags.Children);
                bool       after      = (renderable != null) && ((flags & ThreeFlags.AfterChildren) == ThreeFlags.AfterChildren);

                if (before)
                {
                    renderable.RenderGUIBeforeChildren(arg);
                }

                if (children)
                {
                    foreach (var item in control.Children)
                    {
                        GUIRenderAction.Render(item, arg);
                    }
                }

                if (after)
                {
                    renderable.RenderGUIAfterChildren(arg);
                }
            }
        }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        public override void Act()
        {
            var scissor  = new int[4];
            var viewport = new int[4];

            GL.Instance.GetIntegerv((uint)GetTarget.ScissorBox, scissor);
            GL.Instance.GetIntegerv((uint)GetTarget.Viewport, viewport);

            GUIRenderAction.Render(this.Scene.RootControl);

            GL.Instance.Scissor(scissor[0], scissor[1], scissor[2], scissor[3]);
            GL.Instance.Viewport(viewport[0], viewport[1], viewport[2], viewport[3]);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="param"></param>
        public override void Act(ActionParams param)
        {
            //    var scissor = new int[4];
            //    var viewport = new int[4];
            //    GL.Instance.GetIntegerv((uint)GetTarget.ScissorBox, scissor);
            //    GL.Instance.GetIntegerv((uint)GetTarget.Viewport, viewport);

            var arg = new GUIRenderEventArgs(this.Scene, this.Scene.Camera);

            GUIRenderAction.Render(this.Scene.RootControl, arg);

            int width = param.Viewport.width, height = param.Viewport.height;

            GL.Instance.Scissor(0, 0, width, height);
            GL.Instance.Viewport(0, 0, width, height);
        }
Beispiel #4
0
        private static void Render(GLControl control)
        {
            if (control != null)
            {
                GLControlRendererBase renderer = control.Renderer;
                if (renderer != null)
                {
                    renderer.Render(control);
                }

                foreach (var item in control.Children)
                {
                    GUIRenderAction.Render(item);
                }
            }
        }