Switching between fullscreen and windowed mode

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
VideroBoy
Party member
Posts: 102
Joined: Wed Mar 31, 2010 6:12 pm
Location: Canada

Switching between fullscreen and windowed mode

Post by VideroBoy »

Using love.graphics.toggleFullscreen() can get me from windowed to fullscreen mode, but not the other way around. When I'm in fullscreen, I'm stuck in fullscreen. Is it possible to make a fullscreen game switch back to windowed mode?
User avatar
nevon
Commander of the Circuloids
Posts: 938
Joined: Thu Feb 14, 2008 8:25 pm
Location: Stockholm, Sweden
Contact:

Re: Switching between fullscreen and windowed mode

Post by nevon »

Yup, same here.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Switching between fullscreen and windowed mode

Post by Robin »

toggleFullscreen should* work, but if it really doesn't you can always do it the hard-core way:

Code: Select all

--love.graphics.setMode( width, height, fullscreen, vsync, fsaa )
love.graphics.setMode(love.graphics.getWidth(), love.graphics.getHeight(), false )
* In theory.
Help us help you: attach a .love.
User avatar
VideroBoy
Party member
Posts: 102
Joined: Wed Mar 31, 2010 6:12 pm
Location: Canada

Re: Switching between fullscreen and windowed mode

Post by VideroBoy »

[quote="Robin"]but if it really doesn't you can always do it the hard-core way:

Code: Select all

--love.graphics.setMode( width, height, fullscreen, vsync, fsaa )
love.graphics.setMode(love.graphics.getWidth(), love.graphics.getHeight(), false )
This is how I ended up doing it.

A bug report is in order, perhaps?
User avatar
bmelts
Party member
Posts: 380
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin
Contact:

Re: Switching between fullscreen and windowed mode

Post by bmelts »

Interesting. It should be noted that love.graphics.toggleFullscreen() returns a boolean - true if LÖVE thinks it succeeded, false if it doesn't. I'm assuming that in this situation it returns false?
User avatar
VideroBoy
Party member
Posts: 102
Joined: Wed Mar 31, 2010 6:12 pm
Location: Canada

Re: Switching between fullscreen and windowed mode

Post by VideroBoy »

I didn't actually check the return value. I should probably do that sometime. :ehem:

I assume love.graphics.toggleFullscreen() switches in and out of fullscreen mode properly for most other people then?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Switching between fullscreen and windowed mode

Post by Robin »

AFAIK, yes.
Help us help you: attach a .love.
User avatar
Jasoco
Inner party member
Posts: 3727
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Switching between fullscreen and windowed mode

Post by Jasoco »

I also have this problem. Glad to see it's not just me.
User avatar
VideroBoy
Party member
Posts: 102
Joined: Wed Mar 31, 2010 6:12 pm
Location: Canada

Re: Switching between fullscreen and windowed mode

Post by VideroBoy »

I guess, if it helps, I'll mention I'm running Mac OS X 10.6.3 with an ATI Radeon HD 4850 graphics card.

Setting the mode directly like Robin suggested works perfectly as I said, so what is toggleFullscreen doing differently exactly?
Xoria
Citizen
Posts: 61
Joined: Sun Jan 31, 2010 1:24 am

Re: Switching between fullscreen and windowed mode

Post by Xoria »

Happens with me to. lol
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests