Esempio n. 1
0
        public override void Init()
        {
            Content.ContentPath = "Data";

            SetStyle(System.Windows.Forms.ControlStyles.UserPaint, true);


            RootScene = new Graphics.Interface.InterfaceScene(this);

            RootScene.Add(windowsCursor);
            RootScene.Add(rawInputCursor);
            RootScene.Add(new Graphics.Interface.TextBox
            {
                Position   = new Vector2(10, 10),
                Text       = "Windows",
                Size       = new Vector2(100, 20),
                Background = null,
                TextAnchor = Orientation.Right
            });
            RootScene.Add(windowsKeyboard);
            RootScene.Add(new Graphics.Interface.TextBox
            {
                Position   = new Vector2(10, 30),
                Text       = "Raw",
                Size       = new Vector2(100, 20),
                Background = null,
                TextAnchor = Orientation.Right
            });
            RootScene.Add(rawInputKeyboard);
            RootScene.Add(rawInputKeyboardTextbox);
            RootScene.Add(windowsKeyboardTextbox);

            InterfaceRenderer = new Graphics.Interface.InterfaceRenderer9(Device9)
            {
                Scene        = (Graphics.Interface.InterfaceScene)RootScene,
                StateManager = new Device9StateManager(Device9)
            };
            InterfaceRenderer.Initialize(this);

            rawInputDevice = new Graphics.RawInput();
            rawInputDevice.RegisterKeyboard(Application.MainWindow.Handle, false);
            rawInputDevice.RegisterMouse(Application.MainWindow.Handle);
            rawInputDevice.KeyDown      += new System.Windows.Forms.KeyEventHandler(rawInputDevice_KeyDown);
            rawInputDevice.KeyUp        += new System.Windows.Forms.KeyEventHandler(rawInputDevice_KeyUp);
            rawInputDevice.MouseMove    += new System.Windows.Forms.MouseEventHandler(rawInputDevice_MouseMove);
            rawInputDevice.MousePosition = LocalMousePosition;
            stopwatch.Start();
        }
        public override void Init()
        {
            Content.ContentPath = "Data";

            SetStyle(System.Windows.Forms.ControlStyles.UserPaint, true);

            RootScene = new Graphics.Interface.InterfaceScene(this);

            RootScene.Add(windowsCursor);
            RootScene.Add(rawInputCursor);
            RootScene.Add(new Graphics.Interface.TextBox
            {
                Position = new Vector2(10, 10),
                Text = "Windows",
                Size = new Vector2(100, 20),
                Background = null,
                TextAnchor = Orientation.Right
            });
            RootScene.Add(windowsKeyboard);
            RootScene.Add(new Graphics.Interface.TextBox
            {
                Position = new Vector2(10, 30),
                Text = "Raw",
                Size = new Vector2(100, 20),
                Background = null,
                TextAnchor = Orientation.Right
            });
            RootScene.Add(rawInputKeyboard);
            RootScene.Add(rawInputKeyboardTextbox);
            RootScene.Add(windowsKeyboardTextbox);

            InterfaceRenderer = new Graphics.Interface.InterfaceRenderer9(Device9)
            {
                Scene = (Graphics.Interface.InterfaceScene)RootScene,
                StateManager = new Device9StateManager(Device9)
            };
            InterfaceRenderer.Initialize(this);

            rawInputDevice = new Graphics.RawInput();
            rawInputDevice.RegisterKeyboard(Application.MainWindow.Handle, false);
            rawInputDevice.RegisterMouse(Application.MainWindow.Handle);
            rawInputDevice.KeyDown += new System.Windows.Forms.KeyEventHandler(rawInputDevice_KeyDown);
            rawInputDevice.KeyUp += new System.Windows.Forms.KeyEventHandler(rawInputDevice_KeyUp);
            rawInputDevice.MouseMove += new System.Windows.Forms.MouseEventHandler(rawInputDevice_MouseMove);
            rawInputDevice.MousePosition = LocalMousePosition;
            stopwatch.Start();
        }