コード例 #1
0
        public override void Initialize()
        {
            currentFormWindowState = Form.WindowState;
            Form.Resize           += (o, args) =>
            {
                if (Form.WindowState != currentFormWindowState)
                {
                    if (togglingFullScreen == false)
                    {
                        HandleResize(o, args);
                    }
                }

                currentFormWindowState = Form.WindowState;
            };

            Form.ResizeBegin += (o, args) => { formIsResizing = true; };
            Form.ResizeEnd   += (o, args) =>
            {
                formIsResizing = false;
                HandleResize(o, args);
            };

            Form.Closed += (o, args) => { isFormClosed = true; };


            Width            = 1024;
            Height           = 768;
            FullScreenWidth  = Screen.PrimaryScreen.Bounds.Width;
            FullScreenHeight = Screen.PrimaryScreen.Bounds.Height;
            NearPlane        = 1.0f;
            FarPlane         = 200f;
            Ambient          = Color.Gray.ToArgb();

            OnInitializeDevice();

            ActiveMaterial         = new Material();
            ActiveMaterial.Diffuse = Color.Orange;
            ActiveMaterial.Ambient = new Color4(Ambient);

            PassiveMaterial         = new Material();
            PassiveMaterial.Diffuse = Color.Red;
            PassiveMaterial.Ambient = new Color4(Ambient);

            GroundMaterial         = new Material();
            GroundMaterial.Diffuse = Color.Green;
            GroundMaterial.Ambient = new Color4(Ambient);

            SoftBodyMaterial         = new Material();
            SoftBodyMaterial.Diffuse = Color.White;
            SoftBodyMaterial.Ambient = new Color4(Ambient);

            light              = new Light();
            light.Type         = LightType.Point;
            light.Range        = 70;
            light.Position     = new Vector3(10, 25, 10);
            light.Diffuse      = Color.LemonChiffon;
            light.Attenuation0 = 1.0f;

            Info         = new InfoText(Device);
            _meshFactory = new MeshFactory(this);
            MeshFactory  = _meshFactory;
        }
コード例 #2
0
        public override void Initialize()
        {
            currentFormWindowState = Form.WindowState;
            Form.Resize += (o, args) =>
            {
                if (Form.WindowState != currentFormWindowState)
                {
                    if (togglingFullScreen == false)
                        HandleResize(o, args);
                }

                currentFormWindowState = Form.WindowState;
            };

            Form.ResizeBegin += (o, args) => { formIsResizing = true; };
            Form.ResizeEnd += (o, args) =>
            {
                formIsResizing = false;
                HandleResize(o, args);
            };

            Form.Closed += (o, args) => { isFormClosed = true; };


            Width = 1024;
            Height = 768;
            FullScreenWidth = Screen.PrimaryScreen.Bounds.Width;
            FullScreenHeight = Screen.PrimaryScreen.Bounds.Height;
            NearPlane = 1.0f;
            FarPlane = 200f;
            Ambient = Color.Gray.ToArgb();

            OnInitializeDevice();

            ActiveMaterial = new Material();
            ActiveMaterial.Diffuse = Color.Orange;
            ActiveMaterial.Ambient = new Color4(Ambient);

            PassiveMaterial = new Material();
            PassiveMaterial.Diffuse = Color.Red;
            PassiveMaterial.Ambient = new Color4(Ambient);

            GroundMaterial = new Material();
            GroundMaterial.Diffuse = Color.Green;
            GroundMaterial.Ambient = new Color4(Ambient);

            SoftBodyMaterial = new Material();
            SoftBodyMaterial.Diffuse = Color.White;
            SoftBodyMaterial.Ambient = new Color4(Ambient);

            light = new Light();
            light.Type = LightType.Point;
            light.Range = 70;
            light.Position = new Vector3(10, 25, 10);
            light.Diffuse = Color.LemonChiffon;
            light.Attenuation0 = 1.0f;

            Info = new InfoText(Device);
            _meshFactory = new MeshFactory(this);
            MeshFactory = _meshFactory;
        }