Changeset View
Changeset View
Standalone View
Standalone View
intern/ghost/intern/GHOST_WindowWayland.cpp
| /* SPDX-License-Identifier: GPL-2.0-or-later */ | /* SPDX-License-Identifier: GPL-2.0-or-later */ | ||||
| /** \file | /** \file | ||||
| * \ingroup GHOST | * \ingroup GHOST | ||||
| */ | */ | ||||
| #include "GHOST_WindowWayland.h" | #include "GHOST_WindowWayland.h" | ||||
| #include "GHOST_SystemWayland.h" | #include "GHOST_SystemWayland.h" | ||||
| #include "GHOST_WaylandUtils.h" | #include "GHOST_WaylandUtils.h" | ||||
| #include "GHOST_WindowManager.h" | #include "GHOST_WindowManager.h" | ||||
| #include "GHOST_utildefines.h" | #include "GHOST_utildefines.h" | ||||
| #include "GHOST_Event.h" | #include "GHOST_Event.h" | ||||
| #include "GHOST_ContextEGL.h" | #include "GHOST_ContextEGL.h" | ||||
| #include "GHOST_ContextNone.h" | #include "GHOST_ContextNone.h" | ||||
| #ifdef WITH_VULKAN_BACKEND | |||||
| # include "GHOST_ContextVK.h" | |||||
| #endif | |||||
| #include <wayland-client-protocol.h> | #include <wayland-client-protocol.h> | ||||
| #ifdef WITH_GHOST_WAYLAND_DYNLOAD | #ifdef WITH_GHOST_WAYLAND_DYNLOAD | ||||
| # include <wayland_dynload_egl.h> | # include <wayland_dynload_egl.h> | ||||
| #endif | #endif | ||||
| #include <wayland-egl.h> | #include <wayland-egl.h> | ||||
| ▲ Show 20 Lines • Show All 1,181 Lines • ▼ Show 20 Lines | |||||
| */ | */ | ||||
| GHOST_Context *GHOST_WindowWayland::newDrawingContext(GHOST_TDrawingContextType type) | GHOST_Context *GHOST_WindowWayland::newDrawingContext(GHOST_TDrawingContextType type) | ||||
| { | { | ||||
| GHOST_Context *context; | GHOST_Context *context; | ||||
| switch (type) { | switch (type) { | ||||
| case GHOST_kDrawingContextTypeNone: | case GHOST_kDrawingContextTypeNone: | ||||
| context = new GHOST_ContextNone(m_wantStereoVisual); | context = new GHOST_ContextNone(m_wantStereoVisual); | ||||
| break; | break; | ||||
| #ifdef WITH_VULKAN_BACKEND | |||||
| case GHOST_kDrawingContextTypeVulkan: | |||||
| context = new GHOST_ContextVK(m_wantStereoVisual, | |||||
| GHOST_kVulkanPlatformWayland, | |||||
| 0, | |||||
| NULL, | |||||
| window_->wl_surface, | |||||
| system_->wl_display(), | |||||
| 1, | |||||
| 0, | |||||
| true); | |||||
| break; | |||||
| #endif | |||||
| case GHOST_kDrawingContextTypeOpenGL: | case GHOST_kDrawingContextTypeOpenGL: | ||||
| for (int minor = 6; minor >= 0; --minor) { | for (int minor = 6; minor >= 0; --minor) { | ||||
| context = new GHOST_ContextEGL(system_, | context = new GHOST_ContextEGL(system_, | ||||
| m_wantStereoVisual, | m_wantStereoVisual, | ||||
| EGLNativeWindowType(window_->egl_window), | EGLNativeWindowType(window_->egl_window), | ||||
| EGLNativeDisplayType(system_->wl_display()), | EGLNativeDisplayType(system_->wl_display()), | ||||
| EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT, | EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT, | ||||
| 4, | 4, | ||||
| ▲ Show 20 Lines • Show All 228 Lines • Show Last 20 Lines | |||||