public unsafe SoundWAVInstance(SoundWAV sound, bool looped) : base(sound) { State = SoundStates.Stopped; Looped = looped; Volume = 1; uint instanceTEMP = 0; AL.GenSources(1, &instanceTEMP); instance = instanceTEMP; if (instance == 0) { Debug.ThrowError("SoundWAVInstance", "Failed to create instance"); } AL.Sourcei(instance, AL.BUFFER, (int)sound.buffer); AL.Sourcef(instance, AL.PITCH, 1); AL.Sourcef(instance, AL.GAIN, 1); AL.Source3f(instance, AL.POSITION, 0, 0, 0); AL.Source3f(instance, AL.VELOCITY, 0, 0, 0); AL.Sourcei(instance, AL.LOOPING, looped ? AL.TRUE : AL.FALSE); }
public unsafe SoundWAVInstance(SoundWAV sound, bool looped) : base(sound) { State = SoundStates.Stopped; Looped = looped; Volume = 1; uint instanceTEMP = 0; AL.GenSources(1, &instanceTEMP); instance = instanceTEMP; if (instance == 0) Debug.ThrowError("SoundWAVInstance", "Failed to create instance"); AL.Sourcei(instance, AL.BUFFER, (int)sound.buffer); AL.Sourcef(instance, AL.PITCH, 1); AL.Sourcef(instance, AL.GAIN, 1); AL.Source3f(instance, AL.POSITION, 0, 0, 0); AL.Source3f(instance, AL.VELOCITY, 0, 0, 0); AL.Sourcei(instance, AL.LOOPING, looped ? AL.TRUE : AL.FALSE); }