I have been running my game at 800*500 in a window, so recently I tried full screen mode.
Now my laptop monitor is 1600*900 so I set my full screen to this and the resolution looks excellent.
My question is this. Is it possible to get the monitor resolution so full screen will work on any size monitor?
Can you change the size of resolution with some kind of menu from within the game?
What are the best practices for going full screen on a monitor you have no idea of the size?
How to get monitor width and height
Re: How to get monitor width and height
You can create a null device (video::EDT_NULL) first (which doesn't create a Window but allows you to call some stuff). And from that you can get the info, like that:
You can't change fullscreen resolution without creating a new device. But you can always create the size of the desktop. And then render any resolution you want to a render-target texture (RTT). Then in next step you put that rendertargettexture on node which has fullscreen size. (check XEffects - it should have that kind of node - if not ask again - there was some node like that on forum in code-snippets from Hendu I think - but I'd have to search myself first as I don't rember name right now).
Actually this way will also be useful in the long run if you decide to add any kind of fullscreen effects (like bloom or similar stuff).
Code: Select all
IrrlichtDevice *dummyDevice = 0;
dummyDevice = createDevice(video::EDT_NULL,core::dimension2d<u32>(100,100),false,false);
if ( dummyDevice )
{
video::IVideoModeList *videoModes = dummyDevice->getVideoModeList();
core::dimension2d<u32> desktopRes = videoModes->getDesktopResolution();
s32 desktopDepth = videoModes->getDesktopDepth();
dummyDevice->closeDevice();
dummyDevice->clearSystemMessages();
dummyDevice->drop();
dummyDevice = 0;
}
Actually this way will also be useful in the long run if you decide to add any kind of fullscreen effects (like bloom or similar stuff).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm