Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 639691e

Browse files
committed
made sure glfw uses egl so that we get angle
1 parent ae4c1f0 commit 639691e

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

impeller/playground/backend/gles/playground_impl_gles.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ PlaygroundImplGLES::PlaygroundImplGLES(PlaygroundSwitches switches)
6262
handle_(nullptr, &DestroyWindowHandle),
6363
worker_(std::shared_ptr<ReactorWorker>(new ReactorWorker())),
6464
use_angle_(switches.use_angle) {
65-
6665
if (use_angle_) {
6766
angle_glesv2_ = dlopen("libGLESv2.dylib", RTLD_LAZY);
6867
FML_CHECK(angle_glesv2_ != nullptr);
@@ -71,8 +70,14 @@ PlaygroundImplGLES::PlaygroundImplGLES(PlaygroundSwitches switches)
7170
::glfwDefaultWindowHints();
7271

7372
#if FML_OS_MACOSX
74-
// ES Profiles are not supported on Mac.
75-
::glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API);
73+
if (use_angle_) {
74+
::glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API);
75+
::glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
76+
::glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
77+
::glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
78+
} else {
79+
::glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API);
80+
}
7681
#else // FML_OS_MACOSX
7782
::glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
7883
::glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);

0 commit comments

Comments
 (0)