Is it possible to change the default origin in client area?


#1

Hello, GLFW community,
by default, GLFW sets the origin (0,0) of a GLFW window (client area) to the top-left corner. so functions like glfwGetCursorPos() return the y-coordinate relative to the top-left corner of the window. This is customary in many APIs but not the default in OpenGL, and not what one would expect from a mathematical point of view.

I am developing a multimedia API and opted to use a more “natural” origin, set at the bottom-left corner, or at least a coordinate system where the y-coordinate increases upwards, not downwards. Given that GLFW behaves otherwise, I have to modify the output of GLFW functions like glfwGetCursorPos(). However, that means I have to pass the window’s vertical size in any subroutine that needs to call glfwGetCursorPos() - or any other GLFW function that returns window coordinates. I would prefer not to be forced to do that. So my question is, is it possible to change the default origin for the client area in GLFW? I was looking for such an option but couldn’t find any.


#2

This isn’t possible, and since it’s so easy to do in client code I don’t think it’s a good idea to add to glfw.