SasisaDev / BetelEngine

An engine for creating pixel-perfect games and more.
MIT License
1 stars 1 forks source link

Swapchain Recreation #1

Closed SasisaDev closed 2 months ago

SasisaDev commented 2 months ago

Currently invalidated swapchain will just freeze whole application, which should be fixed. Currently swapchain's validity is checked, but we never recreate swapchains.

This feature requires minimal Window Event System to be introduced & interfaced with Render Compositions to recreate outdated swapchains.

Currently Swapchain Composition provides following recreation API:

bool IRenderComposition::Recreate(IRenderCompositionInitializer* initializer);

And following delegate dispatches crucial events:

/*
 * Window Event handler
 * Handles resize, minmax, repos scenarios
 * 
 * Window*  window
 * uint8_t  eventType
 * void*    eventData
 */
MulticastDelegate<Window*, uint8_t, void*> OnWindowEvent;

For successful Swapchain Recreation, we need to update Swapchain Images, ImageViews & Framebuffers, contained within Composition object. No other classess have to be updated afaik.

SasisaDev commented 2 months ago

Swapchain recreation seems to be working. Closing this issue until any bugs come out, if any.