Skip to content

Commit

Permalink
Only hint at EGL if we're using it.
Browse files Browse the repository at this point in the history
Summary: Fixes a latent bug. "EGL" hints to glfw should only be done if we're using EGL.

Reviewed By: aparrapo

Differential Revision: D20323563

fbshipit-source-id: 87d5845a31f46fc40d949a0363758f92e6e2b98d
  • Loading branch information
bkcabral authored and facebook-github-bot committed Mar 9, 2020
1 parent 05371c2 commit 2ec9e65
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions source/gpu/GlfwUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,11 @@ class GlWindow {
glfwWindowHint(GLFW_GREEN_BITS, outputBPP);
glfwWindowHint(GLFW_BLUE_BITS, outputBPP);

#ifdef __linux__
glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API);
#ifdef USE_EGL_
// Only use EGL for offscreen rendering.
if (screenState & OFF_SCREEN) {
glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API);
}
#endif

window = glfwCreateWindow(width, height, name.c_str(), NULL, NULL);
Expand Down

0 comments on commit 2ec9e65

Please sign in to comment.