Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
I tried to create a Window with GLFW an then Center it on the Screen with glfwSetWindowPos().
But unfortunately I'm not able to get the current size of my Desktop Screen, to center my window.
Is there a functino for it, or another way to do it?
Thanks for help. :)
You can retrieve the current video mode for your chosen monitor and then figure out where to put the window for it to be centred.
Video mode sizes use screen coordinates, same as window positions and sizes.
Do you mean the glfwGetVideoMode() function? It doesn't seem to work.
GLFWvidmode* mode = glfwGetVideoMode(glfwGetPrimaryMonitor());
causes the following error:
error C2440: 'initialization': 'const GLFWvidmode ' could not be converted into 'GLFWvidmode '
By the way, if it is necessary: I use Windows 7 and C++ Express 2010 :)
Edit: OK, I was a little bit stupid. -.-
When I use reinterpret_cast all works well. Thank you for your great help. :D
I had the same issue.
Change: GLFWvidmode mode = glfwGetVideoMode(glfwGetPrimaryMonitor());
to: const GLFWvidmode mode = glfwGetVideoMode(glfwGetPrimaryMonitor());
Thank you all for your Help. It works fine now.
So I think this is a closed topic now? :D