New project doesn't work in windowed

edited November 8 in Help request

Hello,

When I create a new project the game is always in fullscreen. When I edit the main ini file i've FullScreen to false, even when I use orxDisplay_SetFullScreen(false); I still have my game in fullscreen.

Did i miss something ?

If I add ScreenWidth & ScreenHeight in my Display section for something like 1280/720 I'm still in fullscreen but borderless. (see screenshot)

Thanks

Tagged:

Comments

  • edited November 8

    @Vick said:
    Hello,

    When I create a new project the game is always in fullscreen. When I edit the main ini file i've FullScreen to false, even when I use orxDisplay_SetFullScreen(false); I still have my game in fullscreen.

    Did i miss something ?

    If I add ScreenWidth & ScreenHeight in my Display section for something like 1280/720 I'm still in fullscreen but borderless. (see screenshot)

    Thanks

    Found the solution by myself. Sorry for the double post but if someone found this thread by searching on google here is the solution :

    To get a windowed mode you need three things: turn fullscreen to false, turn decoration to true (for the title bar), and define the ScreenWidth & ScreenHeight key in your main ini file.

    Example :

    [Display]
    Title           = ufo
    Smoothing       = true
    VSync           = true
    # Important stuff here
    FullScreen      = false
    Decoration      = true
    ScreenWidth     = @Camera.FrustumWidth   # you can use number instead
    ScreenHeight    = @Camera.FrustumHeight # you can use number instead
    

    And you are good to go :)

  • edited November 8

    Hey @Vick and welcome here.

    Well I'm glad you found the solution with the missing Decoration. Just to give a few more details, when you don't set any values for ScreenWidth/ScreenHeight, the desktop resolution will be used.

    Programmatically, you can retrieve any of the supported video modes for your machine as well as the current resolution and the desktop resolution with:

    /** Gets an available video mode
     * @param[in]   _u32Index                             Video mode index, pass _u32Index < orxDisplay_GetVideoModeCount() for an available listed mode, orxU32_UNDEFINED for the the default (desktop) mode and any other value for current mode
     * @param[out]  _pstVideoMode                         Storage for the video mode
     * @return orxDISPLAY_VIDEO_MODE / orxNULL if invalid
     */
    extern orxDLLAPI orxDISPLAY_VIDEO_MODE *orxFASTCALL   orxDisplay_GetVideoMode(orxU32 _u32Index, orxDISPLAY_VIDEO_MODE *_pstVideoMode);
    

    Also don't hesitate to check the wiki, a couple of pages that come to mind are:
    https://wiki.orx-project.org/en/orx/config/settings_main/main#display_module
    https://wiki.orx-project.org/en/tutorials/display/borderless_window_mode

    But I'm sure @sausage will have more recommendations. :)

  • Thanks for the clarification @iarwain.

    To be honnest I simply bindly follow the getting started tutorial to get my head around the engine but both link are usefull.

    I checked the example section but not the tutorial one 😂 .

  • Glad it was of any help. Don't hesitate if you have questions. Our wiki should already have the answer to some of them and @sausage is always happy to improve its content.

Sign In or Register to comment.