realitix / vulkan

The ultimate Python binding for Vulkan API
Apache License 2.0
505 stars 46 forks source link

types for enums #89

Open hrbigelow opened 7 months ago

hrbigelow commented 7 months ago

Hi,

I wondered if you'd consider (or is it already available?) providing types for the enums so we can use type annotations, for example:

from typing import NewType

VkFormat = NewType('VkFormat', int)
VK_FORMAT_UNDEFINED = VkFormat(0)
VK_FORMAT_R4G4_UNORM_PACK8 = VkFormat(1)
...

def some_func(format: VkFormat, ...)
ItsCubeTime commented 5 months ago

Yes please! Type annotations would be great 🥳

realitix commented 5 months ago

Indeed it's a good idea, if you can do a PR for it I will merge it.