mirror of
https://github.com/ZuneDev/Xune.git
synced 2026-07-27 13:13:10 -07:00
Format RenderApi code
This commit is contained in:
@@ -11,43 +11,43 @@ using System;
|
||||
|
||||
namespace Microsoft.Iris.Render.Extensions
|
||||
{
|
||||
public static class SoundLoader
|
||||
{
|
||||
public static void FromResource(
|
||||
string moduleName,
|
||||
string resourceId,
|
||||
out ExtensionsApi.HSpSound soundDataHandle,
|
||||
out ExtensionsApi.SoundInformation soundDataInfo)
|
||||
public static class SoundLoader
|
||||
{
|
||||
Win32Api.HINSTANCE hInstance = ModuleManager.Instance.LoadModule(moduleName);
|
||||
Debug2.Validate(hInstance != Win32Api.HINSTANCE.NULL, typeof (ArgumentException), nameof (moduleName));
|
||||
IntPtr resourceData;
|
||||
int resourceSize;
|
||||
ModuleManager.Instance.LoadResource(hInstance, resourceId, out resourceData, out resourceSize);
|
||||
SoundLoader.FromMemory(resourceData, resourceSize, out soundDataHandle, out soundDataInfo);
|
||||
}
|
||||
public static void FromResource(
|
||||
string moduleName,
|
||||
string resourceId,
|
||||
out ExtensionsApi.HSpSound soundDataHandle,
|
||||
out ExtensionsApi.SoundInformation soundDataInfo)
|
||||
{
|
||||
Win32Api.HINSTANCE hInstance = ModuleManager.Instance.LoadModule(moduleName);
|
||||
Debug2.Validate(hInstance != Win32Api.HINSTANCE.NULL, typeof(ArgumentException), nameof(moduleName));
|
||||
IntPtr resourceData;
|
||||
int resourceSize;
|
||||
ModuleManager.Instance.LoadResource(hInstance, resourceId, out resourceData, out resourceSize);
|
||||
SoundLoader.FromMemory(resourceData, resourceSize, out soundDataHandle, out soundDataInfo);
|
||||
}
|
||||
|
||||
public static void FromMemory(
|
||||
IntPtr rawSoundData,
|
||||
int rawSoundDataSize,
|
||||
out ExtensionsApi.HSpSound soundDataHandle,
|
||||
out ExtensionsApi.SoundInformation soundDataInfo)
|
||||
{
|
||||
Debug2.Validate(rawSoundData != IntPtr.Zero, typeof (ArgumentNullException), nameof (rawSoundData));
|
||||
Debug2.Validate(rawSoundDataSize > 0, typeof (ArgumentException), "Invalid sound data size");
|
||||
ExtensionsApi.SoundOptions options = ExtensionsApi.SoundOptions.Decode;
|
||||
ExtensionsApi.SoundInformation info = new ExtensionsApi.SoundInformation();
|
||||
ExtensionsApi.HSpSound hSound;
|
||||
EngineApi.IFC(ExtensionsApi.SpSoundLoadBuffer(rawSoundData, rawSoundDataSize, options, out hSound, out info));
|
||||
soundDataHandle = hSound;
|
||||
soundDataInfo = info;
|
||||
}
|
||||
public static void FromMemory(
|
||||
IntPtr rawSoundData,
|
||||
int rawSoundDataSize,
|
||||
out ExtensionsApi.HSpSound soundDataHandle,
|
||||
out ExtensionsApi.SoundInformation soundDataInfo)
|
||||
{
|
||||
Debug2.Validate(rawSoundData != IntPtr.Zero, typeof(ArgumentNullException), nameof(rawSoundData));
|
||||
Debug2.Validate(rawSoundDataSize > 0, typeof(ArgumentException), "Invalid sound data size");
|
||||
ExtensionsApi.SoundOptions options = ExtensionsApi.SoundOptions.Decode;
|
||||
ExtensionsApi.SoundInformation info = new ExtensionsApi.SoundInformation();
|
||||
ExtensionsApi.HSpSound hSound;
|
||||
EngineApi.IFC(ExtensionsApi.SpSoundLoadBuffer(rawSoundData, rawSoundDataSize, options, out hSound, out info));
|
||||
soundDataHandle = hSound;
|
||||
soundDataInfo = info;
|
||||
}
|
||||
|
||||
public static void DisposeData(
|
||||
ExtensionsApi.HSpSound soundDataHandle,
|
||||
ExtensionsApi.SoundInformation soundDataInfo)
|
||||
{
|
||||
EngineApi.IFC(ExtensionsApi.SpSoundDispose(soundDataHandle, soundDataInfo));
|
||||
public static void DisposeData(
|
||||
ExtensionsApi.HSpSound soundDataHandle,
|
||||
ExtensionsApi.SoundInformation soundDataInfo)
|
||||
{
|
||||
EngineApi.IFC(ExtensionsApi.SpSoundDispose(soundDataHandle, soundDataInfo));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user