Пример #1
0
        public void End()
        {
            _line.End();

            AGT_SystemImages.Begin();
            foreach (AGT_Waypoint point in _waypoints)
            {
                AGT_SystemImages.Draw(AGT_SystemImages.Waypoint, point.X, point.Y, point.Z, point.Diffuse);
            }
            AGT_SystemImages.End();
        }
Пример #2
0
        public AGT_GameFramework(DeviceParams parameters)
        {
            if (parameters == DeviceParams.Empty)
            {
                throw new ArgumentException("Empty Device Parameters");
            }
            if (parameters.PresentationParameters == null)
            {
                throw new ArgumentException("Missing PresentationParameters, in DeviceParams");
            }
            if (parameters.TargetControl == null)
            {
                throw new ArgumentException("Missing TargetControl, in DeviceParams");
            }

            _AppIdleHandler = new EventHandler(this.Application_Idle);

            AGT_Scene.QueryPerformanceFrequency(ref _ticks_per_second);
            _DeviceParams_ = parameters;
            BindFormEvents();

            _VIDEO_DEVICE_ = new Microsoft.DirectX.Direct3D.Device(
                Microsoft.DirectX.Direct3D.Manager.Adapters.Default.Adapter,
                Microsoft.DirectX.Direct3D.DeviceType.Hardware,
                parameters.TargetControl,
                parameters.Flags,
                parameters.PresentationParameters);

            _SystemImages = new AGT_SystemImages(_VIDEO_DEVICE_);
            Cursor        = _SystemImages.Cursor_Select;

            _device_lost   = new EventHandler(_DEVICE__DeviceLost);
            _device_reset  = new EventHandler(_DEVICE__DeviceReset);
            _device_resize = new System.ComponentModel.CancelEventHandler(_DEVICE__DeviceResizing);

            _VIDEO_DEVICE_.DeviceLost     += _device_lost;
            _VIDEO_DEVICE_.DeviceReset    += _device_reset;
            _VIDEO_DEVICE_.DeviceResizing += _device_resize;
        }