コード例 #1
0
ファイル: OpenGlDevice.cs プロジェクト: unitycoder/Drawing3D
        /// <summary>
        /// refreshes the back ground for <see cref="ForeGroundDraw"/>.
        /// </summary>
        public void RefreshBackGround()
        {
            Texture  Savet = texture;
            GLShader S     = Shader;

            BackBuffer.BackGround = BackColor;
            if (BackBuffer.FboHandle <= 0)
            {
                BackBuffer.Init((int)ViewPort.Width, (int)ViewPort.Height);
            }

            RenderKind K = RenderKind;

            RenderKind = RenderKind.Render;
            Matrix P = ProjectionMatrix;

            ProjectionMatrix = Matrix.scale(new xyz(1, -1, 1)) * P;

            //--------- Draw scene to Backbuffer
            BackBuffer.EnableWriting();

            OnPaint();

            BackBuffer.DisableWriting();
            texture          = Savet;
            ProjectionMatrix = P;
            RenderKind       = K;
            Shader           = S;
        }