MCPcopy Create free account
hub / github.com/comaps/comaps / SetSize

Method SetSize

libs/drape/framebuffer.cpp:23–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23void Framebuffer::DepthStencil::SetSize(ref_ptr<dp::GraphicsContext> context, uint32_t width, uint32_t height)
24{
25 if (m_texture && m_texture->GetWidth() == width && m_texture->GetHeight() == height)
26 return;
27
28 Destroy();
29
30 Texture::Params params;
31 params.m_width = width;
32 params.m_height = height;
33 if (m_depthEnabled && m_stencilEnabled)
34 params.m_format = TextureFormat::DepthStencil;
35 else if (m_depthEnabled)
36 params.m_format = TextureFormat::Depth;
37 else
38 CHECK(false, ("Unsupported depth-stencil combination."));
39 params.m_allocator = GetDefaultAllocator(context);
40 params.m_isRenderTarget = true;
41
42 m_texture = make_unique_dp<FramebufferTexture>();
43 m_texture->Create(context, params);
44}
45
46void Framebuffer::DepthStencil::Destroy()
47{

Callers 3

ApplyFramebufferMethod · 0.80
OnResizeMethod · 0.80
InitFramebufferFunction · 0.80

Calls 9

GetDefaultAllocatorFunction · 0.85
GetDepthAttachmentIdMethod · 0.80
getMethod · 0.65
GetWidthMethod · 0.45
GetHeightMethod · 0.45
CreateMethod · 0.45
GetApiVersionMethod · 0.45
GetIDMethod · 0.45

Tested by

no test coverage detected