Menu

Set window focus

Using GLFW
2014-02-16
2015-01-02
  • afalkenhahn

    afalkenhahn - 2014-02-16

    Hi,

    is it possible to programmatically activate a GLFW window? Suppose I have four different GLFW windows and now I'd like to make one of them the active window... is that possible somehow? I can listen to focus changes but I don't seem to be able to set focus programmatically. Maybe we'd need something like glfwSetWindowFocus()...

     
  • XDread

    XDread - 2014-03-06

    I think you can use glfw3native and then one of these functions to obtain a window handle to set focus:

    http://www.glfw.org/docs/latest/glfw3native_8h.html

    Just define two macros like described in this document before including the header file:

    http://www.glfw.org/docs/latest/group__native.html

    EDIT: It is worth mentioning that this is platform specific, so you need to make the platform independence yourself in this case.

     

    Last edit: XDread 2014-03-06
  • divxdede

    divxdede - 2015-01-02

    It would be nice to have a glfwFocusWindow like we have with glfwIconifyWindow
    I can't use native since i use a wrapper that don't expose it to me...