Fullscreen monitor select


Is there a proper way to select the target monitor for device creation when starting in fullscreen ?


No, and I think it has to be solved at some point.


Wow, I did not know that.
Multi-monitor setups are becoming more and more common among regular users. Being able to select a monitor should be a top priority.

Sounds to me like the best idea currently would be to not let Urho3D, but something else create the window and point Urho to it as an external window.


Would it work for native fullscreen? Probably no.


My application (currently migrating from Ogre3D) must be able to work in fullscreen/borderless fullscreen window on a selected monitor. Kind of a trivial task, but the Graphics subsystem currently does not use any monitor related parameters.

I currently use a utility wrapper over SDL_video functions for display enumeration, something like this:

// Get number of currently present monitors
int GetMonitorCount();

// Get current desktop resolution
Resolution GetDesktopResolution(int monitor);

// Get a list of supported fullscreen resolutions
ResolutionVector GetFullscreenResolutions(int monitor);

// Get closest supported fullscreen resolution
Resolution GetClosestFullscreenResolution(int monitor, Resolution resolution);

It would be nice if the Graphics subsystem can export such methods in Application::Setup() (after SDL video is initialized) so users can choose correct settings.

I guess I can involve in development :slight_smile:


Not sure if SDL knows how to switch to fullscreen properly for the second monitor. I managed to get a borderless window on the second monitor by just positioning it appropriately. PR or development is welcome.


In the graphics subsystem:

bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless, bool resizable, bool highDPI, bool vsync,
    bool tripleBuffer, int multiSample)

IMHO this function should provide at least two more parameters - monitor and refreshrate.
In Application::Setup(), user should be able to call:

Resolution resolution = GetDesktopResolution(1);
parameters["Monitor"] = 1;
parameters["WindowWidth"] = resolution.width;
parameters["WindowHeight"] = resolution.height;
parameters["Refreshrate"] = resolution.refreshrate;
parameters["Fullscreen"] = 1;

Having convenient methods I mentioned in the above post when initializing the application would be a big plus.
Refresh rate (with vsync = on) is also something that I rely on, my application displays video content which does massive tearing when no vsync is present. I imagine that would also help with 144Hz monitors


Currently works on DX9 in both fullscreen and borderless modes.


I’ve done patches for DX11 and OpenGL, tested on my dualmonitor machine, works just fine.
Silly question: at the end of the Graphics::SetMode() there’s a code that sends an E_SCREENMODE event, should I add monitor and refresh rate there ?
Also, imagine a scenario where the engine is initializing, the user could have a dialog with graphics options to choose from, such as supported desktop resolutions, monitors - possibly with monitor names, etc.
Where is the appropriate place to place a couple of static functions (implemented with SDL and requiring SDL_Video to be initialized) for convenience such as GetMonitorCount(), GetDesktopResolution(int monitor), etc ?


Ok, nevermind my silly questions…