MCPcopy Create free account
hub / github.com/axmolengine/axmol / onGLFWWindowSizeCallback

Method onGLFWWindowSizeCallback

core/platform/RenderViewImpl.cpp:1307–1323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1305}
1306
1307void RenderViewImpl::onGLFWWindowSizeCallback(GLFWwindow* /*window*/, int w, int h)
1308{
1309 if (w && h && _resolutionPolicy != ResolutionPolicy::UNKNOWN)
1310 {
1311 handleWindowSize(w, h);
1312
1313#if defined(AX_USE_METAL)
1314 // update metal attachment texture size.
1315 int fbWidth, fbHeight;
1316 glfwGetFramebufferSize(_mainWindow, &fbWidth, &fbHeight);
1317 backend::UtilsMTL::resizeDefaultAttachmentTexture(fbWidth, fbHeight);
1318#endif
1319
1320 Size size(w, h);
1321 Director::getInstance()->getEventDispatcher()->dispatchCustomEvent(RenderViewImpl::EVENT_WINDOW_RESIZED, &size);
1322 }
1323}
1324
1325void RenderViewImpl::onGLFWWindowIconifyCallback(GLFWwindow* /*window*/, int iconified)
1326{

Callers 1

Calls 3

glfwGetFramebufferSizeFunction · 0.85
getInstanceFunction · 0.85
dispatchCustomEventMethod · 0.80

Tested by

no test coverage detected