Switching windowed/fullscreen and fonts

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
rubixcuber
Posts: 7
Joined: Fri Feb 19, 2010 6:01 pm

Switching windowed/fullscreen and fonts

Post by rubixcuber »

I've got a project I'm working on, where I included the option to switch between fullscreen and windowed at runtime.

I have it set up so it reloads all of the textures under the new device and everything works great, except that all of the fonts stop working.

Trying to call getFont again doesn't seem to make any sort of difference.

Right now my code looks something like this:

Code: Select all

font = guienv->getFont("GFX/Font/console.xml");
 
...
 
if(font)guienv->removeFont(font); // added this after finding it in the forums, but sounds like this isn't functional at the moment?
 
device->closeDevice();
 
device = createDevice( EDT_OPENGL, dimension2d<u32>(MAXX, MAXY), 32, false, false, false, events);
    if (!device) return;
 
guienv = device->getGUIEnvironment();
 
font = guienv->getFont("GFX/Font/console.xml");
 
statictext->setOverrideFont(font);
 
But I haven't had any luck so far. Is there a way to get around this?
thanhle
Posts: 325
Joined: Wed Jun 12, 2013 8:09 am

Re: Switching windowed/fullscreen and fonts

Post by thanhle »

Hi,
Can we go to full screen mode without closing the previous device?
Its not too hard using windows API to hide the title bar and border. But is there a universal method?

Thanks
Thanh
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: Switching windowed/fullscreen and fonts

Post by Granyte »

I don't know how or why it's not included in irrlicht but considering how easy it's to do it using windows I don't get why irrlicht cannot do it is it so hard to do with OGL?
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Switching windowed/fullscreen and fonts

Post by hendu »

No, there is no cross-platform method for window control. The only portable way to get fullscreen is to request it at device creation.
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: Switching windowed/fullscreen and fonts

Post by Granyte »

there is no cross platform way to deal with the window creation anyway so the question was more can it be done in Linux/ osx and idden inside a irrlicht command just like the creation process is
Post Reply