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

SurfaceApi usage is unclear #2337

Closed
Stargateur opened this issue Sep 21, 2023 · 2 comments · Fixed by #2340
Closed

SurfaceApi usage is unclear #2337

Stargateur opened this issue Sep 21, 2023 · 2 comments · Fixed by #2340

Comments

@Stargateur
Copy link

Surface::from_handle now take a SurfaceApi but it's unclear how to dynamicly determine this information, specially there is no "Unknown" or "Generic" variant. The documentation is currently empty about SurfaceApi. Is this important ? Can I fill a dummy value ?

@Rua
Copy link
Contributor

Rua commented Sep 21, 2023

You need to pass the windowing API that was used to create the surface handle. Each of them corresponds to one of the constructor functions of Surface. For example, if the handle was created by calling vkCreateWin32SurfaceKHR or Vulkano's equivalent Surface::from_win32, then you pass SurfaceApi::Win32.

@marc0246
Copy link
Contributor

marc0246 commented Sep 21, 2023

The example they have is in fact undefined behavior. You should use this. I wanted to fix their example once we release, but you will only be able to use this function after sdl2 releases. They are still stuck on an ancient version of raw-window-handle.

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

Successfully merging a pull request may close this issue.

3 participants