Windows Maximizing/Fullscreening

I'm getting started with raylib for visualization purposes. I'm able to make a display window on windows OS (not my normal OS), but maximized it still has the little windows menu bar at the top. If I "fullscreen" it works perfectly, but it always seems to fullscreen to display 1, and I'll need it fullscreened on a second display (the first one is utilized as a debugging display). I know this seems extremely pedantic, but it's one of those little details that will keep me from utilizing it in my line of work, so I was trying to figure out if I'm doing something extremely silly.

Comments

  • Hi box!

    By default raylib is configured to work with the primary monitor in fullscreen but internally it uses GLFW3 library for display and inputs management on Windows, Linux and OSX.

    Related code line in raylib source:
    https://github.com/raysan5/raylib/blob/develop/src/core.c#L553

    You can change that function just adding a couple of lines:

    int monitorCount;
    GLFWmonitor** monitors = glfwGetMonitors(&monitorCount);
    if (fullscreen) glfwSetWindowMonitor(window, monitor[1], 0, 0, screenWidth, screenHeight, GLFW_DONT_CARE);

    But it requires recompiling the library... just executing raylib_source_compile_gl33 script on Notepad++ (all setup automatically).

    Another option is enabling a resizable window (but graphic elements on the canvas will not scale with the window). To do that, just call this function before InitWindow():

    SetConfigFlags(FLAG_RESIZABLE_WINDOW);

    In any case, I take note of this issue for further improvement: https://github.com/raysan5/raylib/issues/227
  • If you're looking for further improvement, I don't know what's possible with the underlying GLFW layer, but one of the common use cases (for me, at least) is to manually position a window at launch at a specific position, with a specific size and without any UI or system chromes of any sort (I generally do this in electron, since a lot of the stuff I do is in webGL). That way if I have to bridge several displays without fullscreening, like on a mac, since macs can't fullscreen across displays, I can set that all up in a config file and press the trigger. I guess it's like setting games to windowed fullscreen to avoid the actual fullscreen anomalies. Again, just if you're looking for improvement ideas. Your lib is my new favorite. =)
  • Hey box! Mostly everything related to window management is possible with GLFW3, actually, when a raylib window is initialized it's automatically centered in the monitor. I can expose that funcion: SetWindowPosition()

    Also, it's possible to avoid windows decoration (frame and window buttons), I'll expose that functionality too, that would be useful for windowed fullscreen modes...

    About fullscreen anomalies, in raylib I tried hard to reduce that kind of issues... :)
Sign In or Register to comment.