Browse Source

testing sound

main
cosmonaut 4 months ago
parent
commit
0c97df6e25
5 changed files with 23 additions and 1 deletions
  1. BIN
      Content/title_screen.ogg
  2. +8
    -0
      Properties/launchSettings.json
  3. +1
    -1
      lib/MoonWorks
  4. +1
    -0
      src/Program.cs
  5. +13
    -0
      src/TestGame.cs

BIN
Content/title_screen.ogg View File


+ 8
- 0
Properties/launchSettings.json View File

@ -0,0 +1,8 @@
{
"profiles": {
"MoonWorksTest": {
"commandName": "Project",
"nativeDebugging": true
}
}
}

+ 1
- 1
lib/MoonWorks

@ -1 +1 @@
Subproject commit 408e438efcf8a19992c3b0ecd74bfd11b65441e6
Subproject commit ec28d17a755e267bafd4354d615c3f6ddb1f0cc2

+ 1
- 0
src/Program.cs View File

@ -8,6 +8,7 @@ namespace MoonWorksTest
{
WindowCreateInfo windowCreateInfo = new WindowCreateInfo
{
WindowTitle = "MoonWorksTest",
WindowWidth = 1280,
WindowHeight = 720,
ScreenMode = ScreenMode.Windowed


+ 13
- 0
src/TestGame.cs View File

@ -1,6 +1,8 @@
using MoonWorks;
using MoonWorks.Audio;
using MoonWorks.Graphics;
using RefreshCS;
using System.IO;
using System.Threading;
namespace MoonWorksTest
@ -34,6 +36,9 @@ namespace MoonWorksTest
uint screenShotBufferSize;
Thread screenshotThread;
StaticSound music;
StaticSoundInstance musicInstance;
public TestGame(WindowCreateInfo windowCreateInfo, PresentMode presentMode, int targetTimestep = 60, bool debugMode = false) : base(windowCreateInfo, presentMode, targetTimestep, debugMode)
{
var windowWidth = windowCreateInfo.WindowWidth;
@ -249,6 +254,14 @@ namespace MoonWorksTest
screenshotPixels = new byte[screenShotBufferSize];
screenshotBuffer = new Buffer(GraphicsDevice, 0, screenShotBufferSize);
screenshotThread = new Thread(new ThreadStart(SaveScreenshot));
music = StaticSound.LoadOgg(AudioDevice, new FileInfo(Path.Combine("Content", "title_screen.ogg")));
musicInstance = music.CreateInstance();
musicInstance.Play();
//music = new DynamicSound(AudioDevice, new FileInfo(Path.Combine("Content", "title_screen.ogg")));
//musicInstance = music.CreateInstance();
//musicInstance.Play();
}
protected override void Update(double dt)


Loading…
Cancel
Save