Refactor triangle and texture examples to use better practices #356
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #190
It's a huge commit but almost all of it is just moving around already existing code rather than newly written code. The reason it's so big is because I decided to refactor the ExampleBase so it matches https://vulkan-tutorial.com/ more closely which has the creation of everything broken down into small functions so I decided to do the same with the
ExampleBase:: new(..)
so that's pretty much where all the changed lines have come from.As well as that I fixed the order of
destroy_buffer
,free_memory
etc so when you close the window it doesn't error saying the device hasn't been destroyed.And I created the
render_triangle
andrender_texture
functions just to keep the event_loop a bit smaller and less convoluted