axmolengine / axmol

Axmol Engine – A Multi-platform Engine for Desktop, XBOX (UWP) and Mobile games. (A fork of Cocos2d-x-4.0)
https://axmol.dev
MIT License
868 stars 195 forks source link

Want use "Angle': Set define AX_USE_COMPAT_GL 1 on windows raised an error (GLFWError #65542 Happen, EGL: Library not found) #1024

Closed aismann closed 1 year ago

aismann commented 1 year ago

build cpp-tests with (use Angle): axmol\core\platform\CCPlatformConfig.h => define AX_USE_COMPAT_GL 1

#ifndef AX_USE_COMPAT_GL
#    define AX_USE_COMPAT_GL 1
#endif

Windows 10

image

---------------------------
Error launch application
---------------------------
Can't create window
More info: 
GLFWError #65542 Happen, EGL: Library not found

---------------------------
OK   
---------------------------
halx99 commented 1 year ago

Does the libEGL.dll, libGLESv2.dll, d3dcompiler_47.dll in exe dir?

DelinWorks commented 1 year ago

I got this same error and to fix it i had to copy the missing dlls that @halx99 mentioned above from the thirdparty angle folder to the bin folder of the project next to the exe.

halx99 commented 1 year ago

build cpp-tests with (use Angle): axmol\core\platform\CCPlatformConfig.h => define AX_USE_COMPAT_GL 1

#ifndef AX_USE_COMPAT_GL
#    define AX_USE_COMPAT_GL 1
#endif

Windows 10

image

---------------------------
Error launch application
---------------------------
Can't create window
More info: 
GLFWError #65542 Happen, EGL: Library not found

---------------------------
OK   
---------------------------

You should tell cmake to auto copy dll to target binary dir, not change defination in CCPlatformConfig.h

halx99 commented 1 year ago

i.e.

cmake -B build -DAX_USE_COMPAT_GL=TRUE
aismann commented 1 year ago

i.e.

cmake -B build -DAX_USE_COMPAT_GL=TRUE

Copying the 3 dll to the "exe" folder works also for me.

Compiling from Visual Studio directly should also be an option. Its nice to build with angle or OpenGL directly. Maybe some more "Solution Configurations" is a good choice?

image Debug Angle Release Angle

halx99 commented 1 year ago

Refer to: https://github.com/axmolengine/axmol/blob/dev/CMakeOptions.md

aismann commented 1 year ago

Should we add a sentence about coping the libEGL.dll, libGLESv2.dll, d3dcompiler_47.dll in exe dir? like: ... libEGL.dll, libGLESv2.dll, d3dcompiler_47.dll will not auytomaticvly in exe dir...

AX_USE_COMPAT_GL: whether use compat gl as renderer backend, default: FALSE
windows: whether use angleproject as GLES2 backend
apple: whether use GLES instead Metal backend
halx99 commented 1 year ago

When you use cmake to config it, they will be automatically copy to exe dir, that the only recommand way for switching render backend to angle