예제 #1
0
        private void Glview_Load(object sender, EventArgs e)
        {
            ViewContext.VerifyContext(glview);
            ViewContext.Context.MakeCurrent(glview.WindowInfo);

            Log.Info("GL Version: " + OpenTK.Graphics.OpenGL.GL.GetString(OpenTK.Graphics.OpenGL.StringName.Version));
            IGL.Primary.PatchParameter((int)PatchParameterInt.PatchVertices, 3);
            IGL.Primary.Enable((int)EnableCap.DepthTest);
            IGL.Primary.Enable((int)EnableCap.Blend);
            IGL.Primary.DepthFunc((int)DepthFunction.Lequal);
            IGL.Primary.BlendFunc((int)BlendingFactor.SrcAlpha, (int)BlendingFactor.OneMinusSrcAlpha);
            IGL.Primary.Enable((int)EnableCap.CullFace);
            IGL.Primary.CullFace((int)CullFaceMode.Back);

            renderStack = new RenderStack();
            basePass    = new BasePass(null, glview.Width, glview.Height);
            bloomPass   = new BloomPass(glview.Width, glview.Height);
            renderStack.Add(basePass);
            renderStack.Add(bloomPass);

            LoadMeshes();

            Task.Run(async() =>
            {
                //initial hdri load
                await HdriManager.Load();
            });
        }
예제 #2
0
        protected override void performLayout()
        {
            this._hasVisualOverflow = false;

            if (this._onstageChildCount == 0)
            {
                return;
            }

            this._resolve();
            D.assert(this._resolvedAlignment != null);

            // Same BoxConstraints as used by RenderStack for StackFit.expand.
            BoxConstraints nonPositionedConstraints = BoxConstraints.tight(this.constraints.biggest);

            RenderBox child = this._firstOnstageChild;

            while (child != null)
            {
                StackParentData childParentData = child.parentData as StackParentData;

                if (!childParentData.isPositioned)
                {
                    child.layout(nonPositionedConstraints, parentUsesSize: true);
                    childParentData.offset = this._resolvedAlignment.alongOffset(this.size - child.size as Offset);
                }
                else
                {
                    this._hasVisualOverflow =
                        RenderStack.layoutPositionedChild(child, childParentData, this.size, this._resolvedAlignment) ||
                        _hasVisualOverflow;
                }

                D.assert(child.parentData == childParentData);
                child = childParentData.nextSibling;
            }
        }
예제 #3
0
        public void Release()
        {
            if (renderStack != null)
            {
                renderStack.Release();
                renderStack = null;
            }

            if (materialSettings != null)
            {
                materialSettings.Save();
            }

            if (lightMat != null)
            {
                lightMat.Release();
                lightMat = null;
            }

            if (defaultBlack != null)
            {
                defaultBlack.Release();
                defaultBlack = null;
            }

            if (defaultWhite != null)
            {
                defaultWhite.Release();
                defaultWhite = null;
            }

            if (defaultGray != null)
            {
                defaultGray.Release();
                defaultGray = null;
            }

            if (defaultDarkGray != null)
            {
                defaultDarkGray.Release();
                defaultDarkGray = null;
            }

            HdriManager.Release();

            if (tessMat != null)
            {
                tessMat.Release();
                tessMat = null;
            }

            if (mat != null)
            {
                mat.Release();
                mat = null;
            }

            if (sphere != null)
            {
                sphere.Release();
                sphere = null;
            }

            if (cube != null)
            {
                cube.Release();
                cube = null;
            }

            if (cylinder != null)
            {
                cylinder.Release();
                cylinder = null;
            }

            if (cubeRounded != null)
            {
                cubeRounded.Release();
                cubeRounded = null;
            }

            if (plane != null)
            {
                plane.Release();
                plane = null;
            }

            if (custom != null)
            {
                custom.Release();
                custom = null;
            }

            if (lightMesh != null)
            {
                lightMesh.Release();
                lightMesh = null;
            }

            if (glview != null)
            {
                FHost.Child = null;
                glview.Dispose();
                glview = null;
            }
        }
예제 #4
0
 protected internal override float computeMaxIntrinsicHeight(float width)
 {
     return(RenderStack.getIntrinsicDimension(_firstOnstageChild,
                                              (RenderBox child) => child.getMaxIntrinsicHeight(width)));
 }
예제 #5
0
 protected internal override float computeMinIntrinsicWidth(float height)
 {
     return(RenderStack.getIntrinsicDimension(_firstOnstageChild,
                                              (RenderBox child) => child.getMinIntrinsicWidth(height)));
 }
예제 #6
0
 protected override float computeMinIntrinsicHeight(float width)
 {
     return(RenderStack.getIntrinsicDimension(this._firstOnstageChild,
                                              (RenderBox child) => child.getMinIntrinsicHeight(width)));
 }
예제 #7
0
 protected override float computeMaxIntrinsicWidth(float height)
 {
     return(RenderStack.getIntrinsicDimension(this._firstOnstageChild,
                                              (RenderBox child) => child.getMaxIntrinsicWidth(height)));
 }