Skip to content

Commit

Permalink
igl | shell | Press Esc to exit OpenGL shell apps
Browse files Browse the repository at this point in the history
Summary: Use the `Esc` key to exit OpenGL shell apps. Similar to Vulkan apps.

Reviewed By: rokuz

Differential Revision: D62905940

fbshipit-source-id: ae6b3bb57c0a406c02db98f568a6c3181f6aec79
  • Loading branch information
corporateshark authored and facebook-github-bot committed Sep 18, 2024
1 parent ce53324 commit c609289
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions shell/windows/opengl/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ GLFWwindow* initGLWindow(const shell::RenderSessionConfig& config) {

glfwSetKeyCallback(windowHandle,
[](GLFWwindow* window, int key, int scancode, int action, int mods) {
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) {
glfwSetWindowShouldClose(window, GLFW_TRUE);
}
if (key == GLFW_KEY_SPACE && action == GLFW_RELEASE) {
angleBackend = !angleBackend;
IGL_LOG_INFO("%s\n", angleBackend ? "Angle" : "Vulkan");
Expand Down
3 changes: 3 additions & 0 deletions shell/windows/opengles/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ GLFWwindow* initGLESWindow(const shell::RenderSessionConfig& config) {

glfwSetKeyCallback(windowHandle,
[](GLFWwindow* window, int key, int scancode, int action, int mods) {
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) {
glfwSetWindowShouldClose(window, GLFW_TRUE);
}
if (key == GLFW_KEY_SPACE && action == GLFW_RELEASE) {
angleBackend = !angleBackend;
IGL_LOG_INFO("%s\n", angleBackend ? "Angle" : "Vulkan");
Expand Down

0 comments on commit c609289

Please sign in to comment.