Ejemplo n.º 1
0
        /// <summary>
        /// 获取一个可渲染此VBO的渲染器。执行此方法后,此对象中的非托管内存即可释放掉,不再占用CPU内存。
        /// Uploads this buffer to GPU memory and gets its pointer.
        /// It's totally OK to free memory of unmanaged array stored in this buffer object after this method invoked.
        /// </summary>
        /// <returns></returns>
        public BufferPtr GetBufferPtr()
        {
            if (bufferPtr == null)
            {
                bufferPtr = Upload2GPU();
            }

            return(bufferPtr);
        }
Ejemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="internalformat"></param>
 /// <param name="bufferPtr"></param>
 /// <param name="autoDispose">Dispose <paramref name="bufferPtr"/> when this filler is disposed.</param>
 public TexBufferImageFiller(uint internalformat, BufferPtr bufferPtr, bool autoDispose)
 {
     this.internalformat = internalformat;
     this.bufferPtr      = bufferPtr;
     this.autoDispose    = autoDispose;
 }