Skip to content

Conversation

Susko3
Copy link
Contributor

@Susko3 Susko3 commented Aug 28, 2025

Description

SDL_FlipMode is used internally in SDL rendering code as flags. Just grep for SDL_FLIP_HORIZONTAL and see all the & and |=. This assert just adds a check so that this won't break in the future.

Existing Issue(s)

This property is used internally in SDL rendering code.
SDL_FLIP_HORIZONTAL_AND_VERTICAL, /**< flip horizontally and vertically (not a diagonal flip) */
} SDL_FlipMode;

SDL_COMPILE_TIME_ASSERT(SDL_FlipMode_is_flags, (SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL) == SDL_FLIP_HORIZONTAL_AND_VERTICAL);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe instead of adding a compile time assert, we just define it that way?

@slouken slouken closed this in 5d9b170 Aug 28, 2025
@Susko3 Susko3 deleted the assert-SDL_FlipMode-usage branch August 28, 2025 11:32
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