From c4328e2de85a83573dc17d18c66e6397f804a772 Mon Sep 17 00:00:00 2001 From: Ichiro Date: Mon, 30 Sep 2024 01:17:34 +0900 Subject: [PATCH] GLSupport: Android - add currentEGLSurface misc param (#3236) --- OgreMain/include/OgreRenderSystem.h | 1 + .../GLSupport/src/EGL/Android/OgreAndroidEGLWindow.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/OgreMain/include/OgreRenderSystem.h b/OgreMain/include/OgreRenderSystem.h index 87bedd9697c..6488b1b046d 100644 --- a/OgreMain/include/OgreRenderSystem.h +++ b/OgreMain/include/OgreRenderSystem.h @@ -393,6 +393,7 @@ namespace Ogre | externalWlDisplay | wl_display address as an integer | 0 (none) | Wayland display connection | Linux | | externalWlSurface | wl_surface address as an integer | 0 (none) | Wayland onscreen surface | Linux | | currentGLContext | true, false | false | Use an externally created GL context. (Must be current) | OpenGL | + | currentEGLSurface | true, false | false | Use an externally created EGL surface. | Android | | minColourBufferSize | Positive integer (usually 16, 32) | 16 | Min total colour buffer size. See EGL_BUFFER_SIZE | OpenGL | | windowProc | WNDPROC | DefWindowProc | function that processes window messages | Win 32 | | colourDepth | 16, 32 | Desktop depth | Colour depth of the resulting rendering window; only applies if fullScreen | Win32 | diff --git a/RenderSystems/GLSupport/src/EGL/Android/OgreAndroidEGLWindow.cpp b/RenderSystems/GLSupport/src/EGL/Android/OgreAndroidEGLWindow.cpp index 353497efb66..bd15c6ebbe8 100644 --- a/RenderSystems/GLSupport/src/EGL/Android/OgreAndroidEGLWindow.cpp +++ b/RenderSystems/GLSupport/src/EGL/Android/OgreAndroidEGLWindow.cpp @@ -120,6 +120,12 @@ namespace Ogre { "EGLWindow::create"); } + if((opt = miscParams->find("currentEGLSurface")) != end && + StringConverter::parseBool(opt->second)) + { + mEglSurface = eglGetCurrentSurface(EGL_DRAW); + } + mEglDisplay = eglGetCurrentDisplay(); }