MCPcopy Create free account
hub / github.com/cocos/cocos-engine / getWindowHandle

Method getWindowHandle

native/cocos/platform/SDLHelper.cpp:404–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

402#endif
403
404uintptr_t SDLHelper::getWindowHandle(SDL_Window *window) {
405 SDL_SysWMinfo wmInfo;
406 SDL_VERSION(&wmInfo.version);
407 SDL_GetWindowWMInfo(window, &wmInfo);
408
409#if CC_PLATFORM == CC_PLATFORM_WINDOWS
410 return reinterpret_cast<uintptr_t>(wmInfo.info.win.window);
411#elif (CC_PLATFORM == CC_PLATFORM_LINUX)
412 return reinterpret_cast<uintptr_t>(wmInfo.info.x11.window);
413#elif (CC_PLATFORM == CC_PLATFORM_MACOS)
414 return reinterpret_cast<uintptr_t>(wmInfo.info.cocoa.window);
415#endif
416 CC_ABORT();
417 return 0;
418}
419
420Vec2 SDLHelper::getWindowPosition(SDL_Window *window) {
421 int x = 0;

Callers 8

onHelpAboutFunction · 0.45
shutDownAppFunction · 0.45
runMethod · 0.45
onNativeWindowResumeMethod · 0.45
checkSwapchainStatusMethod · 0.45
setCanvasCallbackFunction · 0.45
getCurrentWindowHwndFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected