예제 #1
0
        /// <inheritdoc cref="GetStringList(Device*, GetEnumerateAllContextStringList)" />
        public IEnumerable <string> GetStringList(GetEnumerateAllContextStringList param)
        {
            unsafe {
                var result = GetStringList(null, param);
                if (result == (char *)0)
                {
                    return(new List <string>());
                }

                var strings = new List <string>();

                var currentPos = result;
                while (true)
                {
                    var currentString = Marshal.PtrToStringAnsi(new IntPtr(currentPos));
                    if (currentString is null)
                    {
                        break;
                    }

                    strings.Add(currentString);
                    currentPos += currentString.Length + 1;
                }

                return(strings);
            }
        }
예제 #2
0
 /// <inheritdoc cref="GetStringList(ALDevice, GetEnumerateAllContextStringList)"/>
 public static IEnumerable <string> GetStringList(GetEnumerateAllContextStringList param)
 {
     unsafe
     {
         byte *result = GetStringList(ALDevice.Null, param);
         return(ALC.ALStringListToList(result));
     }
 }
예제 #3
0
 /// <inheritdoc />
 public abstract unsafe char *GetStringList(Device *device, GetEnumerateAllContextStringList param);
예제 #4
0
 /// <inheritdoc />
 public unsafe partial byte *GetStringList(Device *device, GetEnumerateAllContextStringList param);
예제 #5
0
 /// <summary>
 /// Gets a named property on the context.
 /// </summary>
 /// <param name="device">The device for the context.</param>
 /// <param name="param">The named property.</param>
 /// <returns>The value.</returns>
 [DllImport(ALC.Lib, EntryPoint = "alcGetString", ExactSpelling = true, CallingConvention = ALC.AlcCallingConv)] public static extern unsafe byte *GetStringList(ALDevice device, GetEnumerateAllContextStringList param);
예제 #6
0
 public static extern unsafe byte *GetStringList(ALDevice device, GetEnumerateAllContextStringList param);