Exemple #1
0
        public static Buffer2D <T> Allocate2D <T>(this MemoryAllocator memoryAllocator, int width, int height, bool clear)
            where T : struct
        {
            IBuffer <T> buffer = memoryAllocator.Allocate <T>(width * height, clear);

            return(new Buffer2D <T>(buffer, width, height));
        }
        public static Buffer2D <T> Allocate2D <T>(this MemoryAllocator memoryAllocator, int width, int height, AllocationOptions options = AllocationOptions.None)
            where T : struct
        {
            IBuffer <T> buffer = memoryAllocator.Allocate <T>(width * height, options);

            return(new Buffer2D <T>(buffer, width, height));
        }
Exemple #3
0
 public static IBuffer <T> AllocateClean <T>(this MemoryAllocator memoryAllocator, int length)
     where T : struct
 {
     return(memoryAllocator.Allocate <T>(length, true));
 }