Skip to content

Automatically resize / recreate depth buffer #107

@marcdownie

Description

@marcdownie

The with swap_chain as current_texture_view: trick causes swap_chain to recreate its native swap chain if the canvas it was produced from has been resized since the last __enter__. This makes resizing the canvas magically work --- so well you have to go looking for the resizing code.

All is well. But then you want to have a depth texture view associated with your canvas which needs to be resized at the same time or panic. Any additional sugar to be poured on this? An argument should_resize to draw_frame ? Should we have a swap_chain.size_has_changed() ? Something else that's already there that I'm missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions