3

For my game using GLFW for windowing, I want to prohibit the user from closing the game window using the close button. Is there any cross-platform way to do this?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
jmegaffin
  • 1,162
  • 11
  • 22
  • 1
    For the record, I absolutely HATE any program that won't let me close or resize it. Many games do this and it really bothers me when I have to use their mouse to find out where their "close" button is. – Forest Katsch Oct 03 '13 at 22:37

2 Answers2

3

Use glfwSetWindowCloseCallback to set a callback that always returns GL_FALSE.

Simon
  • 31,675
  • 9
  • 80
  • 92
1

You must add glfwWindowHint(GLFW_DECORATED, GLFW_FALSE) before glfwCreateWindow() call, this remove minimize, maximize, close button and borders, the window cannot be resized anymore.

anewb33
  • 81
  • 7