예제 #1
0
        public MainForm()
        {
            InitializeComponent();
            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true);
            InitializeGraphics ig;
            bool fullScreen = false;

            fullScreen = (MessageBox.Show("Will you to display FullScreen by DirectX?\n\r"+
                "آیا می خواهید پنجره نمایش به حالت تمام صفحه باز شود؟",
                "DirectX Windowsed", MessageBoxButtons.YesNo,
                MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes);

            ig = new InitializeGraphics(!fullScreen);

            ge = new GraphicEngine(ig.getDevice(this), fullScreen);
        }
예제 #2
0
        //
        public InputToolBox(GraphicEngine GE, bool checkHeight)
        {
            GE_object = GE;
            _checkHeight = checkHeight;
            try
            {
                KeyBoardDevice = new Microsoft.DirectX.DirectInput.Device(SystemGuid.Keyboard);
                KeyBoardDevice.SetDataFormat(DeviceDataFormat.Keyboard);
                KeyBoardDevice.Acquire();

                MouseDevice = new Device(SystemGuid.Mouse);
                MouseDevice.SetDataFormat(DeviceDataFormat.Mouse);
                MouseDevice.Acquire();
            }
            catch (DirectXException ex)
            {
                MessageBox.Show(ex.Message, ex.Source);
            }
        }