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

binding for SDL_FlashWindow added #1204

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fayccal
Copy link

@fayccal fayccal commented Feb 7, 2022

Hi, I added bindings for SDL_FlashWindow answering to issue #1174 .
A review would be very appreciated since it is my first contribution :).

@fayccal fayccal mentioned this pull request Feb 7, 2022
@@ -1768,6 +1768,17 @@ impl Window {
Ok(opacity)
}
}

#[doc(alias = "SDL_FlashWindow")]
pub fn flash_window(&mut self, operation: sys::SDL_FlashOperation) -> Result<(), String> {

Choose a reason for hiding this comment

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

probably should just be called pub fn flash(…)

Copy link
Author

Choose a reason for hiding this comment

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

okay i will change that.

Copy link
Member

@Cobrand Cobrand left a comment

Choose a reason for hiding this comment

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

How did you generate sdl-bindings.rs? Using bindgen? This file is automatically generated, you cannot edit it manually.

You should create another enum FlashOperation in SDL2 which translates to sdl2_sys::SDL_FlashOperation . There are many examples of this in this repo, for instance MouseButton.

Use cargo fmt --check to make sure your code is fmt compliant. From one look I can tell that the else being on a separate line than its } will error the fmt check.

@fayccal
Copy link
Author

fayccal commented Feb 7, 2022

Okay thanks you, I will change that according to what you said .

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.

3 participants