Skip to content

Examples: less redundancy, improve fullscreen - #2350

Merged
kchibisov merged 2 commits into
rust-windowing:masterfrom
dhardy:softbuffer
Jul 1, 2022
Merged

kchibisov merged 2 commits into
rust-windowing:masterfrom
dhardy:softbuffer

Conversation

@dhardy

@dhardy dhardy commented Jun 29, 2022

Copy link
Copy Markdown
Contributor

Added softbuffer as a dev-dependency, as discussed in #2246. This is only one new example; I'm not sure it has a lot of utility. (It would be nice to see this used in at least examples/transparency, but this didn't work and due to the simple nature of the softbuffer crate I opted not to investigate further.)

Improved input handling of examples/fullscreen (expecting use of the console for input while in fullscreen mode is not user friendly).

Removed three examples which are redundant with others.

  • Tested on all platforms changed
  • Added an entry to CHANGELOG.md if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality
  • Updated feature matrix, if new features were added or implemented

@kchibisov

Copy link
Copy Markdown
Member

I'm in favor of having window example to use softbuffer and print events.

I'm also not sure about the color you've used with softbuffer, I'd suggest to use something more neutral, since it looks like broken graphics(unless you look into it for a while) or something like that most of the time.

Can go with pink or white.

We should probably close Wayland issues related to window not showing given that there's a window now, with e.g. window example.

@dhardy

dhardy commented Jun 29, 2022

Copy link
Copy Markdown
Contributor Author

You don't like the colour? I just copied the code from the softbuffer example:
softbuffer

Sure, I can merge this with what was window.

@kchibisov

Copy link
Copy Markdown
Member

You don't like the colour?

Yeah, I think it's a little bit too much. Just white or black should do it, I guess.

@dhardy

dhardy commented Jun 30, 2022

Copy link
Copy Markdown
Contributor Author

I can fix that, but I believe there's a more pressing issue: all the windows tests have failed due to a softbuffer build issue. I don't think we want winit to suffer due to this, and dev-dependencies cannot be optional. I guess I could use a separate crate for the example, but then it's not just example/window.rs. Or I can just remove softbuffer. Or we can really try to fix softbuffer. Thoughts?

   Compiling softbuffer v0.1.1
     Running `rustc --crate-name softbuffer --edition=2021 'C:\Users\runneradmin\.cargo\registry\src\githubproxy.fjygbaifeng.eu.org-1ecc6299db9ec823\softbuffer-0.1.1\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=f3ec2003a81d19db -C extra-filename=-f3ec2003a81d19db --out-dir 'D:\a\winit\winit\target\x86_64-pc-windows-msvc\debug\deps' --target x86_64-pc-windows-msvc -L 'dependency=D:\a\winit\winit\target\x86_64-pc-windows-msvc\debug\deps' -L 'dependency=D:\a\winit\winit\target\debug\deps' --extern 'raw_window_handle=D:\a\winit\winit\target\x86_64-pc-windows-msvc\debug\deps\libraw_window_handle-372dbe4082903639.rmeta' --extern 'thiserror=D:\a\winit\winit\target\x86_64-pc-windows-msvc\debug\deps\libthiserror-2bea0a258ade75d0.rmeta' --extern 'winapi=D:\a\winit\winit\target\x86_64-pc-windows-msvc\debug\deps\libwinapi-98ef40f9f3dc86ea.rmeta' --cap-lints allow -C debuginfo=0 --deny warnings`
error[E0432]: unresolved import `winapi::um::winuser`
Error:  --> C:\Users\runneradmin\.cargo\registry\src\githubproxy.fjygbaifeng.eu.org-1ecc6299db9ec823\softbuffer-0.1.1\src\win32.rs:6:17
  |
6 | use winapi::um::winuser::{GetDC, ValidateRect};
  |                 ^^^^^^^ could not find `winuser` in `um`
For more information about this error, try `rustc --explain E0432`.
error: could not compile `softbuffer` due to previous error

@kchibisov

Copy link
Copy Markdown
Member

Or we can really try to fix softbuffer. Thoughts?

I think fixing softbuffer is the right way to go? We're not in a rush with adding examples using softbuffer. We do need this example, since it should be more reliable then testing with glutin. So if we should fix softbuffer for that we should go for it.

@dhardy

dhardy commented Jun 30, 2022

Copy link
Copy Markdown
Contributor Author

Since I lack a Windows machine for testing, I'll have to leave the fixing to others.

@dhardy

dhardy commented Jun 30, 2022

Copy link
Copy Markdown
Contributor Author

I rebased: softbuffer is now only used in examples/window

@kchibisov

Copy link
Copy Markdown
Member

I'd suggest to at least bring this issue to softbuffer.

@dhardy

dhardy commented Jun 30, 2022

Copy link
Copy Markdown
Contributor Author

Sure. Would it make more sense to push softbuffer integration to a different PR in that case, and merge the other changes here?

@kchibisov

Copy link
Copy Markdown
Member

Sure. Would it make more sense to push softbuffer integration to a different PR in that case, and merge the other changes here?

Sure.

@dhardy dhardy changed the title Examples: less redundancy, improve fullscreen, add softbuffer Examples: less redundancy, improve fullscreen Jun 30, 2022
@kchibisov
kchibisov merged commit c55d971 into rust-windowing:master Jul 1, 2022
@dhardy dhardy mentioned this pull request Jul 1, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants