-
Notifications
You must be signed in to change notification settings - Fork 16
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
Conversation
There was a problem hiding this 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.
|
||
let window = surface | ||
.object() | ||
.unwrap() | ||
.clone() | ||
.downcast::<Window>() | ||
.unwrap(); |
There was a problem hiding this comment.
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.
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 |
There was a problem hiding this comment.
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.
```rust | |
```rust | |
use winit::window::Window; | |
.object() | ||
.unwrap() | ||
.clone() | ||
.downcast::<Window>() | ||
.unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt
.object() | |
.unwrap() | |
.clone() | |
.downcast::<Window>() | |
.unwrap(); | |
.object() | |
.unwrap() | |
.clone() | |
.downcast::<Window>() | |
.unwrap(); |
|
||
which | ||
you can use to manipulate and change its default properties. |
There was a problem hiding this comment.
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.
which | |
you can use to manipulate and change its default properties. |
There was a problem hiding this comment.
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.
.then_execute(queue.clone(), | ||
command_buffers[image_i as usize].clone()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt
.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; |
There was a problem hiding this comment.
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.
use vulkano::buffer::subbuffer::Subbuffer; | |
use vulkano::buffer::Subbuffer; | |
use vulkano::command_buffer::allocator::StandardCommandBufferAllocator; |
There seems to be one use of the old |
Hi! If you need anything please let me know. No rush at all though. :) |
Thanks! Sorry, I've just been busy. I should be able to go through this stuff soon! |
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.