gtk2/build/win32/README_EGL_MSVC.txt
Chun-wei Fan af66faf604 Add a EGL renderer (via ANGLE) for Windows
This is for adding a EGL-based renderer which is done via the ANGLE
project, which translate EGL calls to Direct3D 9/11.  This is done as a
possible solution to issue #105, especially for cases where the needed
full GL extensions to map OpenGL to Direc3D is unavailable or
unreliable, or when the OpenGL implementation from the graphics drivers
are problematic.

To enable this, do the following:
-Build ANGLE and ensure the ANGLE libEGL.dll and libGLESv2.dll are
 available.  A sufficiently-recent ANGLE is needed for things to
 work correctly--note that the copy of ANGLE that is included in
 qtbase-5.10.1 is sufficient.  ANGLE is licensed under a BSD 3-clause
 license.  Note also that Visual Studio 2013 or later is required to
 build ANGLE from QT-5.10.1, but the 2013-built ANGLE DLLs can work
 without without problems for GTK+ that is built with Visual Studio
 2008 or later.
-Build libepoxy on Windows with EGL support enabled.
-Define GDK_WIN32_ENABLE_EGL when building gdk-win32.lib when building
 with Visual Studio, or pass in --enable-win32-gles during configure
 when building with MinGW/mingw-w64.
-Prior to running GTK+ programs, the GDK_GL envvar needs to contain
 gles.

Known issues:
-Only OpenGL ES 3 is supported, ANGLE's ES 2 does not support the needed
 extensions, notably GL_OES_vertex_array_object, but its ES 3 support is
 sufficient.
-There is no autodetection or fallback mechanism to enable using
 EGL/Angle automatically yet.  There is no plans to do this in this
 commit.

Thanks to LRN for pointing out that we should #include
"win32/gdkwin32.h" instead of #include "gdkwin32.h" for gdkgl.c.  LRN
also did the autotools portion of this patch.

Further notes about the autotools --enable-win32-gles option, fom LRN:

This adds --enable-win32-gles option, which enables the
code for GLES renderer.  This commit also adds tests for WGL and
EGL in epoxy.  The absence of WGL is highly unlikely (it's enabled
by default), but checking for EGL when GLES is enabled is necessary,
as EGL is disabled in Windows builds of epoxy by default.
2018-06-28 15:33:42 +08:00

30 lines
1.8 KiB
Plaintext

Notes on enabling EGL (ANGLE/D3D support) for Windows/Visual Studio builds
==========================================================================
There is now support in the GL context creation code for Windows in GDK for
creating and using EGL (OpenGL ES 3) contexts, which can be used instead of
the existing OpenGL (Desktop) support, especially when the graphics drivers
do not support OpenGL adequately.
This support is not enabled by default in the project files. In order to do
so, please do the following:
-Obtain or compile a build of recent version of ANGLE. The one that comes
with QT 5.10.x is sufficiently recent, but not the one that comes with QT-
5.6.x. Note that Visual Studio 2013 or later is required for building
ANGLE from QT-5.10.x, but the Visual Studio 2013-built ANGLE DLLs does work
without problems with GTK+ built with Visual Studio 2008~2013. You may
need to obtain D3Dcompiler_[47|43|42].dll if it does not come with the
system (which is part of the DirectX runtimes). Its headers and .lib
needs to be set to be found by the compiler and linker respectively before
building libepoxy.
-Build libepoxy with EGL support, which has to be enabled explicitly on
Windows builds. Pass in -Degl=yes when building libepoxy using Meson.
Build and install, making sure the headers and .lib can be located by the
compiler and linker respectively.
-Open the vsX/gtk+.sln, and open the project properties in the "gdk3-win32"
project. Under "C/C++", add GDK_WIN32_ENABLE_EGL in the "Preprocessor
Definitions" to the existing definitions in there for the configuration
that is being built. Then build the solution.
-To force the use of the EGL code, set the envvar GDK_GL=(...,)gles , where (...,)
are the other GDK_GL options desired.