Menu

#625 Fullscreen with multi-monitor?

Linux only
open
nobody
fullscreen (1)
6
2017-01-05
2016-06-13
James
No

Is there any way to do "windowed fullscreen" like TF2?

There seems to be currently no setting to gracefully handle fullscreen on multi-monitor setup.

Discussion

  • Wesley Johnson

    Wesley Johnson - 2016-06-14

    We need developers to handle additional hardware interfaces like this.
    There is a command line switch that selects a view direction so that multi-monitors can be used. The user starts doomlegacy on each monitor, with the appropriate command line flag, joins the netgame, as sets the additional monitors to watch his player view. I do not have multiple monitors so I cannot test this. Would like to hear about how it works. The legacy.htm is a better reference than my memory.

    Depends on what you think is graceful. This would be hard to develop more without the equipment.
    That is why we need developers with the equipment and time to figure out what works.
    Do not know what "TF2" is. I do not do windows games, my work box does not have Windows.

     
  • James

    James - 2016-06-15

    Team Fortress 2. It's a mainstream shooter with decently low system requirements and it runs on Linux :/

    This Quake II engine seems to have the multi-monitor thing down pretty well; is there any code you can borrow from there?

     
  • ryan

    ryan - 2016-08-21

    Have a try at using the SDL environment variable SDL_VIDEO_FULLSCREEN_DISPLAY. setting it can control the display the window appears on in fullscreen. It seems to be SDL1-only, but thats what the legacy_one tree still uses IIRC. I have used SDL_VIDEO_FULLSCREEN_DISPLAY in the past successfully to get nice fullscreen games leaving one monitor open on a desktop with no frame drops or anything odd like that.

     
  • James

    James - 2016-08-23

    Setting SDL_VIDEO_FULLSCREEN_DISPLAY seems to work to set the fullscreen monitor, but not in OpenGL mode.

     
  • ryan

    ryan - 2016-08-24

    ahh of course, i think doomlegacy uses straight glx stuff for opengl on unix platforms rather than sdl to open the opengl context......so it would only work for software mode. I am not sure there is such an option for opengl then, i couldn't turn anything up with my (limited) searching...

     
  • Wesley Johnson

    Wesley Johnson - 2017-01-05

    I do not know what you mean by "Windowed Fullscreen". Is it any different that a large window
    that is only on one monitor.
    DoomLegacy only changes the vid mode to go full screen, the display content is the same.

    DoomLegacy uses SDL to manage the OpenGL windows, so SDL still applies.
    Our code in file sdl/ogl_sdl.c turns on OpenGL fullscreen using
    ( SDL_OPENGL | SDL_DOUBLEBUF | SDL_FULLSCREEN ).

    The SDL header files have defined SDL_FULLSCREEN but not
    SDL_VIDEO_FULLSCREEN_DISPLAY. It is not in the SDL docs I have either.

    From the SDL docs 1.2.15

    /*
     * Now, we want to setup our requested
     * window attributes for our OpenGL window.
     * We want *at least* 5 bits of red, green
     * and blue. We also want at least a 16-bit
     * depth buffer.
     *
     * The last thing we do is request a double
     * buffered window. '1' turns on double
     * buffering, '0' turns it off.
     *
     * Note that we do not use SDL_DOUBLEBUF in
     * the flags to SDL_SetVideoMode. That does
     * not affect the GL attribute state, only
     * the standard 2D blitting setup.
     */
    SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
    SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
    SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
    SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
    SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
    
    /*
     * We want to request that SDL provide us
     * with an OpenGL window, in a fullscreen
     * video mode.
     *
     * EXERCISE:
     * Make starting windowed an option, and
     * handle the resize events properly with
     * glViewport.
     */
    flags = SDL_OPENGL | SDL_FULLSCREEN;
    
    /*
     * Set the video mode
     */
    if( SDL_SetVideoMode( width, height, bpp, flags ) == 0 ) {
        /* 
         * This could happen for a variety of reasons,
         * including DISPLAY not being set, the specified
         * resolution not being available, etc.
         */
        fprintf( stderr, "Video mode set failed: %s\n",
             SDL_GetError( ) );
        quit_tutorial( 1 );
    }
    

    end docs

     

Log in to post a comment.