Added missing null checks for gl_manager in MacOS and Windows display servers

This commit is contained in:
David Snopek 2022-11-13 07:06:26 -06:00
parent c17f17eb98
commit 4c8409c0fe
2 changed files with 12 additions and 3 deletions

View File

@ -2945,8 +2945,11 @@ int64_t DisplayServerMacOS::window_get_native_handle(HandleType p_handle_type, W
}
#ifdef GLES3_ENABLED
case OPENGL_CONTEXT: {
if (gl_manager) {
return (int64_t)gl_manager->get_context(p_window);
}
return 0;
}
#endif
default: {
return 0;

View File

@ -743,11 +743,17 @@ int64_t DisplayServerWindows::window_get_native_handle(HandleType p_handle_type,
}
#if defined(GLES3_ENABLED)
case WINDOW_VIEW: {
if (gl_manager) {
return (int64_t)gl_manager->get_hdc(p_window);
}
return 0;
}
case OPENGL_CONTEXT: {
if (gl_manager) {
return (int64_t)gl_manager->get_hglrc(p_window);
}
return 0;
}
#endif
default: {
return 0;