当前位置: 首页>>代码示例>>C#>>正文


C# IInput.Create方法代码示例

本文整理汇总了C#中IInput.Create方法的典型用法代码示例。如果您正苦于以下问题:C# IInput.Create方法的具体用法?C# IInput.Create怎么用?C# IInput.Create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IInput的用法示例。


在下文中一共展示了IInput.Create方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PollKey

 public PollKey(EmuKeys oldKey, string message, string inputMode)
 {
     InitializeComponent();
     switch (inputMode)
     {
         default:
         case "Win":
             input = new WinInput(this, this);
             break;
     #if !NO_DX
         case "DX":
             input = new DXInput(this);
             break;
         case "XIn":
             input = new XInInput();
             break;
     #endif
         case "Null":
             input = new NullInput();
             break;
     }
     lblMessage.Text = message;
     input.Create();
     input.InputEvent += new InputHandler(input_InputEvent);
     input.InputScalerEvent += new InputScalerHandler(input_InputScalerEvent);
     this.oldKey = this.newKey = oldKey;
     tmrPoll.Enabled = true;
 }
开发者ID:nickmass,项目名称:Emu-o-Tron,代码行数:28,代码来源:PollKey.cs

示例2: StartEmu


//.........这里部分代码省略.........
                this.state = SystemState.SystemPause;
                DipDialog DipDiag = new DipDialog();
                DipDiag.FormClosing += new FormClosingEventHandler(DipDiag_FormClosing);
                DipDiag.ShowDialog();
            }
            if (debugger != null)
                debugger.Close();
            debugger = new Debugger(cpu.debug);
            debugger.UpdateDebug();
            ejectDiskToolStripMenuItem.DropDownItems.Clear();
            ejectDiskToolStripMenuItem.Text = "Eject Disk";
            ejectDiskToolStripMenuItem.Visible = (cpu.GetSideCount() != 0);
            cpu.SetControllers((ControllerType)Enum.Parse(typeof(ControllerType), config["portOne"]), (ControllerType)Enum.Parse(typeof(ControllerType), config["portTwo"]), (ControllerType)Enum.Parse(typeof(ControllerType), config["expansion"]), config["fourScore"] == "1", config["filterIllegalInput"] == "1");

            if (cpu.nsfPlayer)
                nsfScreen = new NSFScreen(cpu);

            switch (config["renderer"])
            {
            #if NO_DX

                default:
                case "GDI":
                    config["renderer"] = "GDI";
                    renderer = new GDIRenderer(surfaceControl, imageScaler, cpu.PPU.screen, smoothOutputToolStripMenuItem.Checked);
                    break;
            #else
                case "GDI":
                    renderer = new GDIRenderer(surfaceControl, imageScaler, cpu.PPU.screen, smoothOutputToolStripMenuItem.Checked);
                    break;
                default:
                case "DX9":
                    config["renderer"] = "DX9";
                    renderer = new DX9Renderer(surfaceControl, imageScaler, cpu.PPU.screen, smoothOutputToolStripMenuItem.Checked);
                    break;
                case "DX10":
                    renderer = new DX10Renderer(surfaceControl, imageScaler, cpu.PPU.screen, smoothOutputToolStripMenuItem.Checked);
                    break;
            #endif
                case "OGL":
                    renderer = new OpenGLRenderer(surfaceControl, imageScaler, cpu.PPU.screen, smoothOutputToolStripMenuItem.Checked);
                    break;
                case "Null":
                    renderer = new NullRenderer();
                    break;
            }
            renderer.DrawMessageEvent += new EventHandler(renderer_DrawMessageEvent);
            renderer.Create();

            switch (config["audio"])
            {
                case "OAL":
                    audio = new OpenALAudio(cpu.APU.sampleRate, cpu.APU.output, Convert.ToInt32(config["volume"]) / 100f);
                    break;

            #if NO_DX
                default:
                case "Null":
                    config["audio"] = "Null";
                    audio = new NullAudio(cpu.APU.sampleRate);
                    break;
            #else
                default:
                case "XA2":
                    config["audio"] = "XA2";
                    audio = new XA2Audio(cpu.APU.sampleRate, cpu.APU.output, Convert.ToInt32(config["volume"]) / 100f);
                    break;
                case "DXS":
                    audio = new DXSAudio(cpu.APU.sampleRate, cpu.APU.output, Convert.ToInt32(config["volume"]) / 100f, this.Handle);
                    break;
                case "Null":
                    audio = new NullAudio(cpu.APU.sampleRate);
                    break;
            #endif
            }
            audio.Create();

            switch (config["input"])
            {
                default:
                case "Win":
                    config["input"] = "Win";
                    input = new WinInput(this, surfaceControl);
                    break;
            #if !NO_DX
                case "DX":
                    input = new DXInput(this);
                    break;
                case "XIn":
                    input = new XInInput();
                    break;
            #endif
                case "Null":
                    input = new NullInput();
                    break;
            }
            input.Create();
            input.InputEvent += new InputHandler(input_InputEvent);
            input.InputScalerEvent += new InputScalerHandler(input_InputScalerEvent);
        }
开发者ID:nickmass,项目名称:Emu-o-Tron,代码行数:101,代码来源:Program.cs


注:本文中的IInput.Create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。