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

Add HINSTANCE for win32 #2

Closed
msiglreith opened this issue Jul 25, 2019 · 5 comments · Fixed by #30
Closed

Add HINSTANCE for win32 #2

msiglreith opened this issue Jul 25, 2019 · 5 comments · Fixed by #30

Comments

@msiglreith
Copy link
Member

Vulkan requires for surface creation at least a HWND and HINSTANCE handle.

@Osspial
Copy link
Contributor

Osspial commented Jul 25, 2019

Is this necessary? I'm pretty sure you can call GetModuleHandle(ptr::null()) as HINSTANCE to get the HINSTANCE from anywhere in the program.

@msiglreith
Copy link
Member Author

IIRC there is some discrepancy when the hwnd comes from an external library or something like that

@Osspial
Copy link
Contributor

Osspial commented Jul 25, 2019

The only discrepancy I'm aware of is that when you call GetModuleHandle from a DLL, the module handle is from the parent executable, not from the DLL. Since Rust links downstream libraries directly into the executable that shouldn't cause any issues. I'd be surprised if that were an issue even with a Rust library compiled to a DLL, but I'd need to test that to know for sure.

@Ralith
Copy link
Contributor

Ralith commented Oct 3, 2019

Since Rust links downstream libraries directly into the executable that shouldn't cause any issues

Is this really an assumption we want to bake in? It's perfectly reasonable for people to manually dynamically load libraries containing rust code from both rust and foreign processes. If there was really never any case in which being explicit was necessary, I don't think it would be in the Vulkan interface.

@Osspial
Copy link
Contributor

Osspial commented Oct 5, 2019

@Ralith Fair enough. I've submitted a PR to add HINSTANCE in #30.

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

Successfully merging a pull request may close this issue.

3 participants