MCPcopy Create free account
hub / github.com/defold/defold / NullSetWindowSize

Function NullSetWindowSize

engine/graphics/src/null/graphics_null.cpp:274–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272 }
273
274 static void NullSetWindowSize(HContext _context, uint32_t width, uint32_t height)
275 {
276 assert(_context);
277 NullContext* context = (NullContext*) _context;
278 if (dmPlatform::GetWindowStateParam(context->m_BaseContext.m_Window, WINDOW_STATE_OPENED))
279 {
280 FrameBuffer& main = context->m_MainFrameBuffer;
281 delete [] (char*)main.m_ColorBuffer[0];
282 delete [] (char*)main.m_DepthBuffer;
283 delete [] (char*)main.m_StencilBuffer;
284 context->m_BaseContext.m_Width = width;
285 context->m_BaseContext.m_Height = height;
286 uint32_t buffer_size = 4 * width * height;
287 main.m_ColorBuffer[0] = new char[buffer_size];
288 main.m_ColorBufferSize[0] = buffer_size;
289 main.m_DepthBuffer = new char[buffer_size];
290 main.m_DepthBufferSize = buffer_size;
291 main.m_StencilBuffer = new char[buffer_size];
292 main.m_StencilBufferSize = buffer_size;
293
294 dmPlatform::SetWindowSize(context->m_BaseContext.m_Window, width, height);
295 }
296 }
297
298 static void NullResizeWindow(HContext _context, uint32_t width, uint32_t height)
299 {

Callers

nothing calls this directly

Calls 3

assertFunction · 0.50
GetWindowStateParamFunction · 0.50
SetWindowSizeFunction · 0.50

Tested by

no test coverage detected