Skip to content

Conversation

@yonzebu
Copy link

@yonzebu yonzebu commented Nov 1, 2025

Using a raw u32 for window flags works, but it's not nearly as nice for discoverability or usability as a dedicated bitflags type (right now using window flags requires using the relevant consts in sdl3_sys). Also, it's not forward compatible if SDL3 adds too many new window flags since SDL3's window flags are u64.

Changes

  • added WindowFlags bitflags wrapper around SDL_WindowFlags
  • use WindowFlags internally for WindowBuilder/PopupWindowBuilder
  • added flags/set_flags methods to WindowBuilder/PopupWindowBuilder, which use WindowFlags instead of u32 (changing window_flags/set_window_flags would be a semver breaking change, I can open a second PR to do that if it would be desirable)

@yonzebu yonzebu changed the title Added bitflags type (WindowFlags) for SDL_WindowFlags Add bitflags type (WindowFlags) for SDL_WindowFlags Nov 1, 2025
@yonzebu yonzebu changed the title Add bitflags type (WindowFlags) for SDL_WindowFlags feat: Add bitflags type (WindowFlags) for SDL_WindowFlags Nov 1, 2025
@yonzebu yonzebu force-pushed the window-flags-bitflags branch from a71a255 to c38eba4 Compare November 2, 2025 00:05
@yonzebu yonzebu force-pushed the window-flags-bitflags branch from c38eba4 to 308c78f Compare November 2, 2025 00:06
@yonzebu
Copy link
Author

yonzebu commented Nov 2, 2025

Sorry about those renames/force pushes, I am not particularly familiar with opening PRs.

@revmischa
Copy link
Member

Sorry about those renames/force pushes, I am not particularly familiar with opening PRs.

No worries, thanks for your contribution! Would you mind terribly running cargo fmt

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 this pull request may close these issues.

2 participants