示例#1
0
 /// <summary>
 /// Adds the wave to the source voices and starts playing it.
 /// </summary>
 /// <param name="wave">The wave.</param>
 public void AddSound(Wave wave)
 {
     SourceVoice source = new SourceVoice(audio, wave.Data.Format);
     source.Start();
     source.SubmitSourceBuffer(wave.Buffer);
     sources.Add(source);
 }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Renderer"/> class.
 /// </summary>
 public Renderer()
 {
     Contract.Ensures(dx != null);
     dx = new D3DHelper(640, 480);
     LoadShaders();
     LoadMeshes();
     Sound.Audio sound = new Sound.Audio();
     Wave wave = new Wave("Sound/Music/M.wav");
     sound.AddSound(wave);
     CreateMatrices();
     fontEngine = new FontEngine(dx.D3DDevice, "font.fnt", "font.png", dx.WindowWidth, dx.WindowHeight);
     input = new Pigment.Engine.Input.Input();
     dx.Context.Flush();
 }