From 6b102c67c303a54f0fcdde10e2b301d1b14d5c23 Mon Sep 17 00:00:00 2001 From: BZLZHH Date: Fri, 4 Apr 2025 09:30:32 +0800 Subject: [PATCH] [Chore] (EGL_EMU.*): Change EGL_EMU.* into VK/EGL_EMU.*. --- CMakeLists.txt | 7 ++----- MG/MG_GL/EGL/{ => VK}/EGL_EMU.cpp | 6 +++++- MG/MG_GL/EGL/{ => VK}/EGL_EMU.h | 12 ++++++++---- 3 files changed, 15 insertions(+), 10 deletions(-) rename MG/MG_GL/EGL/{ => VK}/EGL_EMU.cpp (99%) rename MG/MG_GL/EGL/{ => VK}/EGL_EMU.h (95%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 70547558..d5385e45 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,11 +42,8 @@ add_library(${CMAKE_PROJECT_NAME} SHARED # MG_UTIL/Debug MG/MG_UTIL/Debug/Debug.cpp - # MG_GL/TEMP_MESA - #MG/MG_GL/TEMP_MESA/MesaEmu.cpp - - # MG_GL/EGL_EMU - MG/MG_GL/EGL/EGL_EMU.cpp + # MG_GL/EGL + MG/MG_GL/EGL/VK/EGL_EMU.cpp ) target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ./includes) diff --git a/MG/MG_GL/EGL/EGL_EMU.cpp b/MG/MG_GL/EGL/VK/EGL_EMU.cpp similarity index 99% rename from MG/MG_GL/EGL/EGL_EMU.cpp rename to MG/MG_GL/EGL/VK/EGL_EMU.cpp index ac9d4404..8e3da8b5 100644 --- a/MG/MG_GL/EGL/EGL_EMU.cpp +++ b/MG/MG_GL/EGL/VK/EGL_EMU.cpp @@ -4,6 +4,8 @@ #include "EGL_EMU.h" +#if BACKEND_TYPE == BACKEND_VULKAN + std::atomic g_nextContextId{1}; std::atomic g_nextSurfaceId{1}; EGLenum g_currentAPI = EGL_OPENGL_ES_API; @@ -544,4 +546,6 @@ EGLBoolean eglQuerySurface(EGLDisplay display, EGLSurface surface, EGLint attrib default: return EGL_FALSE; } return EGL_TRUE; -} \ No newline at end of file +} + +#endif \ No newline at end of file diff --git a/MG/MG_GL/EGL/EGL_EMU.h b/MG/MG_GL/EGL/VK/EGL_EMU.h similarity index 95% rename from MG/MG_GL/EGL/EGL_EMU.h rename to MG/MG_GL/EGL/VK/EGL_EMU.h index 003b63cd..e897e49f 100644 --- a/MG/MG_GL/EGL/EGL_EMU.h +++ b/MG/MG_GL/EGL/VK/EGL_EMU.h @@ -2,10 +2,12 @@ // Created by BZLZHH on 2025/3/30. // -#ifndef MOBILEGL_EGL_EMU_H -#define MOBILEGL_EGL_EMU_H +#ifndef MOBILEGL_EGL_VK_EMU_H +#define MOBILEGL_EGL_VK_EMU_H -#include "../../Includes.h" +#include "../../../Includes.h" + +#if BACKEND_TYPE == BACKEND_VULKAN struct EGLInternalConfig { VkFormat format; @@ -96,4 +98,6 @@ extern "C" MG_EXPORT EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval) extern "C" MG_EXPORT EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface draw); extern "C" MG_EXPORT EGLSurface eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); -#endif //MOBILEGL_EGL_EMU_H +#endif + +#endif //MOBILEGL_EGL_VK_EMU_H