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

Update windowing chapter #17

Closed
wants to merge 7 commits into from

Conversation

Nekomansa
Copy link
Contributor

Resolves #10. I made the mentioned changes as well as more updates to the example code in the chapter. Let me know if anything needs adjustment.

Copy link
Contributor

@marc0246 marc0246 left a comment

Choose a reason for hiding this comment

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

Just in case you're unaware, you can apply a suggestion block directly from GitHub. You don't have to of course, feel free to discuss the changes, just letting you know that you can save time that way in case you do decide to follow the suggestions.

Comment on lines +58 to +64

let window = surface
.object()
.unwrap()
.clone()
.downcast::<Window>()
.unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

This is duplicated since it also appears below. I like that put a separate version of this together with the explanation, so I think it's best if you stick only with the below one and remove this one.

Suggested change
let window = surface
.object()
.unwrap()
.clone()
.downcast::<Window>()
.unwrap();

for rendering. As for the window itself, it can be retrieved by calling `surface.window()`, which
for rendering. As for the window itself, it can be retrieved this way:

```rust
Copy link
Contributor

Choose a reason for hiding this comment

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

Window is not in scope.

Suggested change
```rust
```rust
use winit::window::Window;

Comment on lines +74 to +78
.object()
.unwrap()
.clone()
.downcast::<Window>()
.unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

fmt

Suggested change
.object()
.unwrap()
.clone()
.downcast::<Window>()
.unwrap();
.object()
.unwrap()
.clone()
.downcast::<Window>()
.unwrap();

Comment on lines +80 to 82

which
you can use to manipulate and change its default properties.
Copy link
Contributor

Choose a reason for hiding this comment

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

This continues a sentence from above the code block, which is generally a no-no as it can be a bit hard to read.

More importantly however, ideally users wouldn't use this procedure every time they need to access the window. This is something users seem to be doing and so I would like to make this distinction clearer. I'm not sure what the best phrasing is myself (feel free to comment).

All in all, maybe it's best to remove this entirely.

Suggested change
which
you can use to manipulate and change its default properties.

Copy link
Contributor

@marc0246 marc0246 May 12, 2023

Choose a reason for hiding this comment

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

Update: the issue has just been resolved upstream. Therefore there is no further clarification needed, as this way of creating the surface is going to be deprecated in the next release.

Comment on lines +163 to +164
.then_execute(queue.clone(),
command_buffers[image_i as usize].clone())
Copy link
Contributor

Choose a reason for hiding this comment

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

fmt

Suggested change
.then_execute(queue.clone(),
command_buffers[image_i as usize].clone())
.then_execute(queue.clone(), command_buffers[image_i as usize].clone())

@@ -206,7 +205,7 @@ also have multiple framebuffers, we will have multiple command buffers as well,
framebuffer. Let's put everything nicely into a function:

```rust
use vulkano::buffer::TypedBufferAccess;
use vulkano::buffer::subbuffer::Subbuffer;
Copy link
Contributor

Choose a reason for hiding this comment

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

I would personally prefer importing the re-exported one from the buffer module as that's more succinct. Also, the StandardCommandBufferAllcoator used below is not in scope.

Suggested change
use vulkano::buffer::subbuffer::Subbuffer;
use vulkano::buffer::Subbuffer;
use vulkano::command_buffer::allocator::StandardCommandBufferAllocator;

@marc0246
Copy link
Contributor

There seems to be one use of the old Surface type parameter left here:
/~https://github.com/vulkano-rs/vulkano-book/pull/17/files#diff-031c45075465e6884b80b940c10b4fcebc50d92a52b08f25b7d58af0ed72f0bcR112
Also this import is no longer needed:
/~https://github.com/vulkano-rs/vulkano-book/pull/17/files#diff-031c45075465e6884b80b940c10b4fcebc50d92a52b08f25b7d58af0ed72f0bcR108
Would you be so kind as to address these as well?

@marc0246
Copy link
Contributor

marc0246 commented May 5, 2023

Hi! If you need anything please let me know. No rush at all though. :)

@Nekomansa
Copy link
Contributor Author

Thanks! Sorry, I've just been busy. I should be able to go through this stuff soon!

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.

Outdated example in Windowing - Swapchain Creation chapter
2 participants