Kerp, you are working on the Vulkan bindings? Great!

For C flags you should strongly consider using Nim's sets! I did that for the 
high level GTK bindings recently. Have code like
    
    
    type
      RegionFlag* {.size: sizeof(cint), pure.} = enum
        even = 1
        odd = 2
        first = 3
        last = 4
        only = 5
        sorted = 6
      
      RegionFlags* {.size: sizeof(cint).} = set[RegionFlag]
    
    

So you can pass procs sets as parameter. The empty set {}, or something like 
{RegionFlags.sorted, RegionFlags.even}. It is not a very compact notation for 
pure Enums unfortunately. I hope this will work fine for GTK, have not yet 
tested. Of course that needs some mangling, flagNone=0 is generally removed, 
first=8 becomes first=3.

Another solution is using distinc ints. Or enums, but than you have to define 
some operations. 

Reply via email to