Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In the version 2.7 everything was pretty simple:

glfwOpenWindow(Width, Height, 8, 8, 8, 8, 24, 0, isFullscr ? GLFW_FULLSCREEN : GLFW_WINDOW);

But in version 3.x there is no place where i can specify how my my window should be and by default its windowed:

glfwCreateWindow(width, height, m_windowName.c_str(), nullptr, nullptr);

How can i change my window to fullscreen mode?

share|improve this question
Wow. I was thinking "surely this must be clearly defined in the documentation" ... but it isn't. Serious oversight on their part. I think maybe you just have to set the monitor parameter in glfwCreateWindow ? – Sean Middleditch Jul 3 '13 at 19:33
up vote 4 down vote accepted

In 3.x, you specify which monitor you want to use for fullscreen instead of the flag in 2.x.

You can use glfwGetPrimaryMonitor() to get a monitor handle and pass it into glfwCreateWindow() as follows:

glfwCreateWindow(width, height, m_windowName.c_str(), glfwGetPrimaryMonitor(), nullptr);

As long as monitor param is not null, it will create full screen window on the monitor specified. This was done to support multiple monitors.

As for various attributes for the window, you need to use window hints by calling glfwWindowHint with appropriate parameters and then make theglfwCreateWindow call.

Read the docs, its very clear.

share|improve this answer
Wow, i didn't notice that, thanks for answering. – MDumitru Jul 4 '13 at 14:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.