From 57e497b873d95f7487716e12271a82c6384012f0 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sat, 14 Mar 2020 01:23:12 +0100 Subject: I don't use that --- minilibx_beta/mlx_image.swift | 48 ------------------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 minilibx_beta/mlx_image.swift (limited to 'minilibx_beta/mlx_image.swift') diff --git a/minilibx_beta/mlx_image.swift b/minilibx_beta/mlx_image.swift deleted file mode 100644 index 7c1fa9b..0000000 --- a/minilibx_beta/mlx_image.swift +++ /dev/null @@ -1,48 +0,0 @@ - - -import Metal - - -public class MlxImg -{ - public var texture: MTLTexture -/// var texture_buff: MTLBuffer - - public var texture_sizeline: Int - public var texture_data: UnsafeMutablePointer - public var texture_width: Int - public var texture_height: Int - - public var onGPU = 0 - - convenience public init(d device:MTLDevice, w width:Int, h height:Int) - { - self.init(d:device, w:width, h:height, t:0) - } - - public init(d device:MTLDevice, w width:Int, h height:Int, t target:Int) - { - texture_width = width - texture_height = height - texture_sizeline = width * 4 - texture_sizeline = 256 * (texture_sizeline / 256 + (texture_sizeline%256 >= 1 ? 1 : 0) ) - - let textureDesc = MTLTextureDescriptor() - textureDesc.width = texture_width - textureDesc.height = texture_height - textureDesc.usage = .shaderRead - if (target == 1) - { - textureDesc.usage = .renderTarget - textureDesc.storageMode = .private - } - textureDesc.pixelFormat = MTLPixelFormat.bgra8Unorm - let texture_buff = device.makeBuffer(length: texture_sizeline * height)! - texture = texture_buff.makeTexture(descriptor:textureDesc, offset:0, bytesPerRow:texture_sizeline)! - - let tmpptr = texture_buff.contents() - texture_data = tmpptr.assumingMemoryBound(to:UInt32.self) - } - - -} \ No newline at end of file -- cgit v1.2.3