You might be interested in some improvements I made in the nimgl/vulkan 
bindings (<https://github.com/planetis-m/vulkan>) These include enum values 
that are more readable:
    
    
    VkImageAspectFlagBits* {.size: sizeof(int32).} = enum
        None
        ColorBit
        DepthBit
        StencilBit = 4
        MetadataBit = 8
        Plane0Bit = 16
        Plane1Bit = 32
        Plane2Bit = 64
        MemoryPlane0BitExt = 128
        MemoryPlane1BitExt = 256
        MemoryPlane2BitExt = 512
        MemoryPlane3BitExt = 1024
    
    
    Run

And improved constructors, which imo are super helpful to prevent misusing the 
API, they now use openarrays, which makes your code much simpler:
    
    
    proc newVkPresentInfoKHR*(sType: VkStructureType = 
VkStructureType.PresentInfoKHR, pNext: pointer = nil, waitSemaphores: 
openarray[VkSemaphore], swapchains: openarray[VkSwapchainKHR], imageIndices: 
openarray[uint32], results: openarray[VkResult]): VkPresentInfoKHR =
      result = VkPresentInfoKHR(
        sType: sType,
        pNext: pNext,
        waitSemaphoreCount: len(waitSemaphores).uint32,
        pWaitSemaphores: if len(waitSemaphores) == 0: nil else: cast[ptr 
VkSemaphore](waitSemaphores),
        swapchainCount: len(swapchains).uint32,
        pSwapchains: if len(swapchains) == 0: nil else: cast[ptr 
VkSwapchainKHR](swapchains),
        pImageIndices: if len(imageIndices) == 0: nil else: cast[ptr 
uint32](imageIndices),
        pResults: if len(results) == 0: nil else: cast[ptr VkResult](results),
      )
    
    
    Run

Reply via email to