示例#1
0
文件: Source.cs 项目: bonomali/Ibasa
        public Buffer Unqueue()
        {
            AlHelper.ThrowNullException(Id);

            unsafe
            {
                uint bid;
                Al.SourceUnqueueBuffers(Id, 1, &bid);
                return(new OpenAL.Buffer(bid));
            }
        }
示例#2
0
文件: Source.cs 项目: bonomali/Ibasa
        public                        Buffer[] Unqueue(int count)
        {
            AlHelper.ThrowNullException(Id);
            if (count <= 0)
            {
                throw new ArgumentException("count is less than or equal to 0.", "count");
            }

            unsafe
            {
                uint *bids = stackalloc uint[count];
                Al.SourceUnqueueBuffers(Id, count, bids);

                Buffer[] buffers = new Buffer[count];
                for (int i = 0; i < count; ++i)
                {
                    buffers[i] = new Buffer(bids[i]);
                }
                return(buffers);
            }
        }