Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop prefix vk #7

Closed
porky11 opened this issue Jul 17, 2016 · 5 comments
Closed

Drop prefix vk #7

porky11 opened this issue Jul 17, 2016 · 5 comments

Comments

@porky11
Copy link

porky11 commented Jul 17, 2016

All variables starting with vk or VK_ that are already in package vk should be renamed.
vk.SUCCESS instead of vk.VK_SUCCESS and vk.createImage instead of vk.vkCreateImage etc.

@SimonDanisch
Copy link
Member

That's a fair suggestion! There is value in having a 1:1 mapping of the C-API, but since we don't export any functions, it might be nicer to just drop the VK.

@Gnimuc
Copy link
Member

Gnimuc commented Feb 1, 2018

How about remove the vk module(export every thing including functions)?

At the first glance, the vk module somehow looks like the cl module in OpenCL.jl, but OpenCL.jl is not as low-level as VulkanCore.jl, it has some abstractions. I guess that's why it merely exports the cl module, which implies its API is a little bit different than the original OpenCL C-API.

To me, this package serves as an one-to-one correspondence of the Vulkan C-API, I guess there is no harm in exporting everything out: ModernGL.jl exports every gl* function and GL* constant, and it works fine. Any abstraction should go into more high-level packages like Vulkan.jl.

@porky11
Copy link
Author

porky11 commented Feb 1, 2018

If you want no abstractions, you shouldn't use a package for the new functions.
Rusts unsafe opengl lib also uses a package gl, and removes prefix from the functions and constants

@serenity4
Copy link
Member

I agree with @Gnimuc. Personnally, I just use VulkanCore.vk directly, because typing in the vk. each time is annoying (especially for all those enums!). If one wants to keep it that way, then

import VulkanCore
const vk = VulkanCore

seems an acceptable solution to me. As for dropping the vk/Vk/VK_ prefix, I also believe that it would better be done inside Vulkan.jl. The main reason would be, in addition to being a 1:1 correspondence with the Vulkan API, that it is easier to define new symbols that don't have this prefix as a higher abstraction (e.g. to wrap a VkInstance, IMHO Instance would be a fitting name).

@serenity4
Copy link
Member

I think we agree that for such a core/low-level package, keeping the prefixes makes sense, so I'll close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants