Winit: Add WindowExt::get_hinstance() for win32 windows

Created on 25 Oct 2018  路  7Comments  路  Source: rust-windowing/winit

I'm trying to create a Vulkan Surface for drawing to a winit window using Surface::from_hwnd() from the vulkano crate.

Is there a better/preferred way to do this?

As a sidenote: I see that docs.rs only shows the unix submodule under os, presumably because the docs are built on a unix-like machine?

Windows question

All 7 comments

To create vulkan surfaces, there is the vulkano-win crate that bridges vulkano and winit, and it apparently works without needing this addition. (I know nothing about vulkan or vulkano though.)

Regarding docs.rs, the top bar has a drop-down menu for changing the platform, it just displays the linux one by default.

I'll take a look! Thanks for both answers 馃憤

I'm closing this issue. Feel free to reopen if needed.

@vberger I want to use ash myself and want to allow window creation on windows - should I use win32 then or might this still be added?

Better ask @Osspial, I know pretty much nothing about win32.

@nifker I suppose there wouldn't be much harm to adding this, but it's already possible to do this externally to Winit via GetWindowLong(hwnd, GWL_HINSTANCE), so I don't think it's strictly necessary for us to expose. I'd accept a PR implementing it, but I don't want to write such a PR myself.

@Osspial Ive also seen using this function to get HINSTANCE: https://docs.rs/winapi/0.3.8/winapi/um/libloaderapi/fn.GetModuleHandleW.html

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rukai picture rukai  路  4Comments

hobogenized picture hobogenized  路  3Comments

e00E picture e00E  路  5Comments

alexheretic picture alexheretic  路  4Comments

Osspial picture Osspial  路  5Comments