Interface MDLMeshBuffer

  • All Superinterfaces:
    NSCopying
    All Known Implementing Classes:
    GLKMeshBuffer, MDLMeshBufferData, MTKMeshBuffer

    public interface MDLMeshBuffer
    extends NSCopying
    [@protocol] MDLMeshBuffer Used by ModelIO to represent a buffer to be filled with vertex and index data Supports deep copy of data by conforming to the NSCopying protocol
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      MDLMeshBufferAllocator allocator()
      [@property] allocator Allocator object used to create this buffer.
      void fillDataOffset​(NSData data, long offset)
      fillData:offset: Fills buffer with data at offset Fills data.length bytes of data.
      long length()
      [@property] length Size in bytes of the buffer allocation
      MDLMeshBufferMap map()
      map CPU access to buffer's memory The buffer will remain mapped as long as the returned MDLMeshBufferMap object exists.
      long type()
      [@property] type the intended type of the buffer
      MDLMeshBufferZone zone()
      [@property] zone Zone from which this buffer was created This zone will be used for copy and relayout operations (such as when a new vertex descriptor is applied to a vertex buffer).
    • Method Detail

      • allocator

        MDLMeshBufferAllocator allocator()
        [@property] allocator Allocator object used to create this buffer. This allcoator used for copy and relayout operations (such as when a new vertex descriptor is applied to a vertex buffer)
      • fillDataOffset

        void fillDataOffset​(NSData data,
                            long offset)
        fillData:offset: Fills buffer with data at offset Fills data.length bytes of data. Will not write beyond length of this buffer.
        Parameters:
        data - Data to fill buffer with
        offset - Byte offset in buffer to begin filling data
      • length

        long length()
        [@property] length Size in bytes of the buffer allocation
      • map

        MDLMeshBufferMap map()
        map CPU access to buffer's memory The buffer will remain mapped as long as the returned MDLMeshBufferMap object exists. Mapping a buffer may impose restrictions on a system. For instance, if the implementing class maps an OpenGL buffer, that buffer may be unavailable for rendering while mapped, and cause a draw failure. Precautions must be taken in such cases.
        Returns:
        An MDLMeshBufferMap object to read or modify a buffer's memory
      • type

        long type()
        [@property] type the intended type of the buffer
      • zone

        MDLMeshBufferZone zone()
        [@property] zone Zone from which this buffer was created This zone will be used for copy and relayout operations (such as when a new vertex descriptor is applied to a vertex buffer). If the default zone is used this will be nil.