Exemplo n.º 1
0
        public MappingBuffer(BufferTarget bufferTarget, uint bufferObject, MapBufferAccess access)
        {
            // TODO: Complete member initialization
            this.bufferTarget = bufferTarget;
            this.bufferObject = bufferObject;

            GL.BindBuffer(bufferTarget, bufferObject);

            this.BufferPointer = GL.MapBuffer(bufferTarget, access);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Start to read/write buffer.
        /// </summary>
        /// <param name="access"></param>
        /// <param name="bind"></param>
        /// <returns></returns>
        public virtual IntPtr MapBuffer(MapBufferAccess access, bool bind = true)
        {
            if (bind)
            {
                glBindBuffer((uint)this.Target, this.BufferId);
            }

            IntPtr pointer = glMapBuffer((uint)this.Target, (uint)access);

            return(pointer);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Start to read/write buffer.
        /// </summary>
        /// <param name="access"></param>
        /// <param name="bind"></param>
        /// <returns></returns>
        public virtual IntPtr MapBuffer(MapBufferAccess access, bool bind = true)
        {
            if (bind)
            {
                if (glBindBuffer == null)
                {
                    glBindBuffer = OpenGL.GetDelegateFor <OpenGL.glBindBuffer>();
                }
                glBindBuffer((uint)this.Target, this.BufferId);
            }

            if (glMapBuffer == null)
            {
                glMapBuffer = OpenGL.GetDelegateFor <OpenGL.glMapBuffer>();
            }
            IntPtr pointer = glMapBuffer((uint)this.Target, (uint)access);

            return(pointer);
        }
Exemplo n.º 4
0
 /// <summary>
 /// 把服务端(GPU)上的当前Buffer Object映射到客户端(CPU)的内存上。
 /// </summary>
 /// <param name="target"></param>
 /// <param name="access"></param>
 /// <returns></returns>
 public static IntPtr MapBuffer(BufferTarget target, MapBufferAccess access)
 {
     return GetDelegateFor<glMapBuffer>()((uint)target, (uint)access);
 }
Exemplo n.º 5
0
 /// <summary>
 /// The contents of a texture may be made available for shaders to read and write by binding the texture to one of a collection of image units.
 /// If the texture identified by texture does not have multiple layers or faces, the entire texture level is bound, regardless of the values specified for layered and layer
 /// </summary>
 /// <param name="unit">identifies the image unit [0, MAX_IMAGE_UNITS]</param>
 /// <param name="TextureID">texture is the name of the texture.If texture is zero, any texture currently bound to image unit unit is unbound.</param>
 /// <param name="level">selects a single level of the texture.</param>
 /// <param name="layered"> If layered is TRUE, the entire level is bound. If layered is FALSE, only the single layer identified by layer will be bound</param>
 /// <param name="layer"></param>
 /// <param name="access">access specifies whether the texture bound to the image will be treated as READ_ONLY, WRITE_ONLY, or READ_WRITE.</param>
 /// <param name="format">format specifies the format that the elements of the image will be treated as when doing formatted stores</param>
 public static void BindImageTexture(uint unit, uint TextureID, int level, MapBufferAccess access, SizedInternalFormat format, bool layered = false, int layer = 0)
 {
     Delegates.glBindImageTexture(unit, TextureID, level, layered, layer, access, format);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Maps a buffer into client space.
 /// </summary>
 /// <param name="target"></param>
 /// <param name="access"></param>
 /// <returns></returns>
 public static IntPtr MapBuffer(BufferTarget target, MapBufferAccess access)
 {
     return(Delegates.glMapBuffer(target, access));
 }
Exemplo n.º 7
0
 /// <summary>
 /// Start to read/write buffer.
 /// <para>This will returns IntPtr.Zero as this buffer allocates no data in memory.</para>
 /// </summary>
 /// <param name="access"></param>
 /// <param name="bind"></param>
 /// <returns></returns>
 public override IntPtr MapBuffer(MapBufferAccess access, bool bind = true)
 {
     return(IntPtr.Zero);
 }
Exemplo n.º 8
0
 /// <summary>
 /// 把服务端(GPU)上的当前Buffer Object映射到客户端(CPU)的内存上。
 /// </summary>
 /// <param name="target"></param>
 /// <param name="access"></param>
 /// <returns></returns>
 public static IntPtr MapBuffer(BufferTarget target, MapBufferAccess access)
 {
     return(GetDelegateFor <glMapBuffer>()((uint)target, (uint)access));
 }
Exemplo n.º 9
0
 /// <summary>
 /// Start to read/write buffer.
 /// <para>This will returns IntPtr.Zero as this buffer allocates no data in memory.</para>
 /// </summary>
 /// <param name="access"></param>
 /// <param name="bind"></param>
 /// <returns></returns>
 public override IntPtr MapBuffer(MapBufferAccess access, bool bind = true)
 {
     return IntPtr.Zero;
 }
Exemplo n.º 10
0
 public static IntPtr MapNamedBufferEXT(uint BufferID, MapBufferAccess access)
 {
     return Delegates.glMapNamedBufferEXT(BufferID, access);
 }
Exemplo n.º 11
0
 /// <summary>
 /// Maps a buffer into client space.
 /// </summary>
 /// <param name="target"></param>
 /// <param name="access"></param>
 /// <returns></returns>
 public static IntPtr MapBuffer(BufferTarget target, MapBufferAccess access)
 {
     return Delegates.glMapBuffer(target, access);
 }
Exemplo n.º 12
0
        /// <summary>
        /// Start to read/write buffer.
        /// </summary>
        /// <param name="access"></param>
        /// <param name="bind"></param>
        /// <returns></returns>
        public virtual IntPtr MapBuffer(MapBufferAccess access, bool bind = true)
        {
            if (bind)
            {
                if (glBindBuffer == null) { glBindBuffer = OpenGL.GetDelegateFor<OpenGL.glBindBuffer>(); }
                glBindBuffer((uint)this.Target, this.BufferId);
            }

            if (glMapBuffer == null) { glMapBuffer = OpenGL.GetDelegateFor<OpenGL.glMapBuffer>(); }
            IntPtr pointer = glMapBuffer((uint)this.Target, (uint)access);
            return pointer;
        }
Exemplo n.º 13
0
 /// <summary>
 /// The contents of a texture may be made available for shaders to read and write by binding the texture to one of a collection of image units.
 /// If the texture identified by texture does not have multiple layers or faces, the entire texture level is bound, regardless of the values specified for layered and layer
 /// </summary>
 /// <param name="unit">identifies the image unit [0, MAX_IMAGE_UNITS]</param>
 /// <param name="TextureID">texture is the name of the texture.If texture is zero, any texture currently bound to image unit unit is unbound.</param>
 /// <param name="level">selects a single level of the texture.</param>
 /// <param name="layered"> If layered is TRUE, the entire level is bound. If layered is FALSE, only the single layer identified by layer will be bound</param>
 /// <param name="layer"></param>
 /// <param name="access">access specifies whether the texture bound to the image will be treated as READ_ONLY, WRITE_ONLY, or READ_WRITE.</param>
 /// <param name="format">format specifies the format that the elements of the image will be treated as when doing formatted stores</param>
 public static void BindImageTexture(uint unit, uint TextureID, int level, MapBufferAccess access, SizedInternalFormat format, bool layered = false, int layer = 0)
 {
     Delegates.glBindImageTexture(unit, TextureID, level, layered, layer, access, format);
 }
Exemplo n.º 14
0
 public static IntPtr MapNamedBufferEXT(uint BufferID, MapBufferAccess access)
 {
     return(Delegates.glMapNamedBufferEXT(BufferID, access));
 }