SpiecsEngine
 
Loading...
Searching...
No Matches

◆ OnResized()

void Spices::RendererResource::OnResized ( uint32_t width,
uint32_t height )

Called On SwapChain Resized. Event received from VulkanRenderBackEnd.

Parameters
[in]widthThe new width of this resource.
[in]heightThe new height of this resource.

Go on if can resize,

Update info's width.

Update info's height.

Recreate the texture with specific info.

Go on if can resize,

Update info's width.

Update info's height.

Recreate the texture with specific info.

Definition at line 42 of file RendererResource.cpp.

43 {
45
49 if (!m_IsResizeable) return;
50
54 m_Info.width = width;
55
59 m_Info.height = height;
60
64 switch (m_Info.type)
65 {
67 m_Texture = std::make_unique<Texture2D>(m_Info);
68 break;
70 m_Texture = std::make_unique<Texture2DArray>(m_Info);
71 break;
73 m_Texture = std::make_unique<Texture2DCube>(m_Info);
74 break;
75 default:
76 SPICES_CORE_ERROR("Not supported Texture Class Type");
77 break;
78 }
79 }
#define SPICES_PROFILE_ZONE
std::unique_ptr< Texture2D > m_Texture
The texture this class Wrapped.
RendererResourceCreateInfo m_Info
The information of this resource.
bool m_IsResizeable
True if this resource can resize.
uint32_t height
Texture' height..
TextureType type
Texture's Class Type.

References m_IsResizeable.