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

SDL2 backend does not build on UWP #8008

Closed
rokups opened this issue Sep 21, 2024 · 4 comments
Closed

SDL2 backend does not build on UWP #8008

rokups opened this issue Sep 21, 2024 · 4 comments
Labels

Comments

@rokups
Copy link
Contributor

rokups commented Sep 21, 2024

Version/Branch of Dear ImGui:

Version 1.91, Branch: docking

Back-ends:

imgui_impl_sdl2.cpp

Compiler, OS:

MSVC

Full config/build information:

No response

Details:

SDL2 backend uses GetWindowLong/SetWindowLong/ShowWindow windows API, which are not allowed with UWP and the build fails. It would make sense to disable code using these APIs on UWP. You can check presence of UWP build like so:

#if defined(WINAPI_FAMILY_PARTITION)
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
// Is UWP
#endif
#endif

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

No response

@ocornut
Copy link
Owner

ocornut commented Sep 21, 2024

Could you provide a PR for it? (if adequate, over docking branch with 1 commit for master 1 commit for docking if needed)
We do test for UWP here and there already so can use same syntax as whatever is already in.

@ocornut ocornut changed the title sdl2 backend does not build on UWP SDL2 backend does not build on UWP Sep 21, 2024
@ocornut
Copy link
Owner

ocornut commented Sep 23, 2024

Pushed a fix d7cedd6

@ocornut ocornut closed this as completed Sep 23, 2024
@rokups
Copy link
Contributor Author

rokups commented Sep 23, 2024

Sorry, i did not manage to get to this in time. Thanks for the fix :)

@ocornut
Copy link
Owner

ocornut commented Sep 23, 2024

Note that I used the same logic as main lib was using: (defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP || WINAPI_FAMILY == WINAPI_FAMILY_GAMES) which differs from your proposed version.
I am not entirely sure what the FAMILY vs FAMILY_PARTITION means at this point.

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

No branches or pull requests

2 participants