Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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
1  
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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.