Add EGL-based backend for wxGLCanvas

Among other things, this enables wxGLCanvas to be used natively on
Wayland.

Closes https://github.com/wxWidgets/wxWidgets/pull/2038

Closes #17702.
This commit is contained in:
Scott Talbert
2020-08-28 11:59:27 -04:00
committed by Vadim Zeitlin
parent ed4b9e5f97
commit 7cd12a2bd6
23 changed files with 1101 additions and 31 deletions

View File

@@ -3191,10 +3191,12 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
<if cond="TOOLKIT=='OSX_IPHONE'">src/osx/iphone/glcanvas.mm src/osx/glcanvas_osx.cpp</if>
<if cond="TOOLKIT=='COCOA'">src/cocoa/glcanvas.mm</if>
<if cond="TOOLKIT=='GTK' and TOOLKIT_VERSION=='4' and PLATFORM_WIN32=='0'">
src/unix/glegl.cpp
src/unix/glx11.cpp
src/gtk/glcanvas.cpp
</if>
<if cond="TOOLKIT=='GTK' and TOOLKIT_VERSION=='3' and PLATFORM_WIN32=='0'">
src/unix/glegl.cpp
src/unix/glx11.cpp
src/gtk/glcanvas.cpp
</if>
@@ -3222,10 +3224,12 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
<if cond="TOOLKIT=='COCOA'">wx/cocoa/glcanvas.h</if>
<if cond="TOOLKIT=='GTK' and TOOLKIT_VERSION=='4'">
wx/gtk/glcanvas.h
wx/unix/glegl.h
wx/unix/glx11.h
</if>
<if cond="TOOLKIT=='GTK' and TOOLKIT_VERSION=='3'">
wx/gtk/glcanvas.h
wx/unix/glegl.h
wx/unix/glx11.h
</if>
<if cond="TOOLKIT=='GTK' and TOOLKIT_VERSION=='2'">

View File

@@ -3036,11 +3036,13 @@ set(OPENGL_MSW_HDR
set(OPENGL_GTK_SRC
src/gtk/glcanvas.cpp
src/unix/glx11.cpp
src/unix/glegl.cpp
)
set(OPENGL_GTK_HDR
wx/gtk/glcanvas.h
wx/unix/glx11.h
wx/unix/glegl.h
)
set(OPENGL_OSX_COCOA_SRC

View File

@@ -385,6 +385,9 @@ if(wxUSE_GUI)
set(OPENGL_LIBRARIES "-framework OpenGLES" "-framework QuartzCore")
else()
find_package(OpenGL)
if(WXGTK3 AND OpenGL_EGL_FOUND)
set(wxUSE_GLCANVAS_EGL ON)
endif()
endif()
if(NOT OPENGL_FOUND)
message(WARNING "opengl not found, wxGLCanvas won't be available")

View File

@@ -549,6 +549,8 @@
#cmakedefine01 wxUSE_GLCANVAS
#cmakedefine01 wxUSE_GLCANVAS_EGL
#cmakedefine01 wxUSE_RICHTEXT

View File

@@ -2973,10 +2973,12 @@ OPENGL_MSW_SRC =
OPENGL_GTK_HDR =
wx/gtk/glcanvas.h
wx/unix/glegl.h
wx/unix/glx11.h
OPENGL_GTK_SRC =
src/gtk/glcanvas.cpp
src/unix/glegl.cpp
src/unix/glx11.cpp
OPENGL_MSW_HDR =