fix(surface): not checking if surface component has initialized x11 native data
This commit is contained in:
parent
84d0026051
commit
a77abe312b
1 changed files with 5 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
|||
#include <lt_debug/assertions.hpp>
|
||||
#include <renderer/vk/context/surface.hpp>
|
||||
#include <surface/components.hpp>
|
||||
|
||||
|
@ -7,6 +8,9 @@ Surface::Surface(const ecs::Entity &surface_entity)
|
|||
{
|
||||
const auto &component = surface_entity.get<surface::SurfaceComponent>();
|
||||
|
||||
esnure(component.get_native_data().display, "Failed to initialize usrface: null x-display");
|
||||
esnure(component.get_native_data().window, "Failed to initialize usrface: null x-window");
|
||||
|
||||
auto create_info = VkXlibSurfaceCreateInfoKHR {
|
||||
.sType = VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR,
|
||||
.dpy = component.get_native_data().display,
|
||||
|
@ -14,7 +18,7 @@ Surface::Surface(const ecs::Entity &surface_entity)
|
|||
};
|
||||
|
||||
auto *instance = Instance::get();
|
||||
vkc(vk_create_xlib_surface_khr(instance, &create_info, nullptr, &m_surface));
|
||||
auto result = vk_create_xlib_surface_khr(instance, &create_info, nullptr, &m_surface);
|
||||
|
||||
const auto &[width, height] = component.get_resolution();
|
||||
m_framebuffer_size = {
|
||||
|
|
Loading…
Add table
Reference in a new issue