Multi-Window Rendering with Vulkan

Since I wrote this post, I have scrapped the Helium 2D engine and decided to write a new engine called Silicon. Silicon will still support Multiwindow rendering with Vulkan. More details on that in the future.
When I first wrote Helium 2D, the API was designed for windows to be instanced and allowed for multiple windows to be open simultaneously. However, our current renderer was incomplete and opening multiple windows led to all sorts of errors. Attempting to refactor would be a long and tedious process. In fact it would be easier to rewrite the renderer from scratch with multi-window rendering in mind, and so I did. The idea was simple, first determine what can be shared and reused across windows, static variables, and what must be instanced per window. The static items such as the vk::Instance and vk::Device, were stored inside an anonymous namespace in a source file. Whereas instanced items such as vk::SurfaceKHR and vk::SwapChainKHR, were isolated in separate classes. After setting up the rest of the pipeline, command buffers, and render passes. I was finally able to achieve multi-window rendering!

Screenshot demonstrating two desktop windows with colored triangles

Now that we have a solid architecture for rendering triangles to as many windows as we want, it is now time to move onto real graphics: 2D Sprites. Aside from the renderer, not much else has changed. The event system was updated to be more robust and supports more event types such as WindowCloseEvent and WindowResizeEvent. Expect the source code to be make public soon as Helium 2D slowly becomes a real game engine and I’ll try to post more frequently here. For more frequent updates, see my Twitter.

Copyright © 2022 Matthew McCall

Multi-Window Rendering with Vulkan

Since I wrote this post, I have scrapped the Helium 2D engine and decided to write a new engine called Silicon. Silicon will still support Multiwindow rendering with Vulkan. More details on that in the future.
When I first wrote Helium 2D, the API was designed for windows to be instanced and allowed for multiple windows to be open simultaneously. However, our current renderer was incomplete and opening multiple windows led to all sorts of errors. Attempting to refactor would be a long and tedious process. In fact it would be easier to rewrite the renderer from scratch with multi-window rendering in mind, and so I did. The idea was simple, first determine what can be shared and reused across windows, static variables, and what must be instanced per window. The static items such as the vk::Instance and vk::Device, were stored inside an anonymous namespace in a source file. Whereas instanced items such as vk::SurfaceKHR and vk::SwapChainKHR, were isolated in separate classes. After setting up the rest of the pipeline, command buffers, and render passes. I was finally able to achieve multi-window rendering!

Screenshot demonstrating two desktop windows with colored triangles

Now that we have a solid architecture for rendering triangles to as many windows as we want, it is now time to move onto real graphics: 2D Sprites. Aside from the renderer, not much else has changed. The event system was updated to be more robust and supports more event types such as WindowCloseEvent and WindowResizeEvent. Expect the source code to be make public soon as Helium 2D slowly becomes a real game engine and I’ll try to post more frequently here. For more frequent updates, see my Twitter.