Mac OS X Lion Feature Support

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
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Mac OS X Lion Feature Support

Post by Jasoco »

Some observations about the way Löve currently works in Mac OS X Lion:

In Lion, "fullscreen" apps are first-class citizens now. You put an app in fullscreen, and you don't have to leave it to switch to another app. It gets its own space and can be switched between via a swipe of four fingers on your Magic Trackpad. It's very convenient. I keep iTunes and Mail open at all times in their own spaces and swipe between them like it's nothing.

The problem is Löve, when placed in "Fullscreen" takes over the entire computer. Same thing happens with Minecraft, but that's probably Java's fault. Another problem with this method is if the game freezes, or Löve freezes, or all around stops working, you cannot get out of it. In Lion, Löve grabs the screen and doesn't let go. I can't switch between apps or anything while it's running which kinda sucks. So it would be really neat if OS X Löve could get proper Lion Fullscreen support.

I propose it is set up so Löve would have a love.fullscreen(f) function. And that the user could optionally customize it themselves. By default it could toggle Fullscreen up and down. But if the user so chooses, it could be customized so they could toggle it themselves and add their own code to help it along. The "f" variable would of course be like the focus version where f is true or false based on whether or not the app is being put into or taken out of fullscreen. And if the user just uses an empty function, the button for Fullscreen would be there, but it would do nothing. Whether the button appears or not would be a setting in the config file.

I know nothing about how Löve works, so I don't know how, or why it chooses the "take over the screen" method instead of a more passive "Just another window on top of the others" mode. I know that Fullscreen mode will usually keep the current resolution and change the display's resolution to fit it as long as it's valid. Maybe we could get an alternative mode where if the "haspassivefullscreen" flag is set, it will not use the resolution changing version and will just let you make the window itself as big as the screen and if the content is smaller than the screen, it would just get centered. Otherwise we could have total coding control over how big the content area is.

Just wanted to put that out there. Was hoping to get some input from whichever of you is in charge of the Mac builds. (Sorry, I always forget!)
User avatar
bmelts
Party member
Posts: 380
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin
Contact:

Re: Mac OS X Lion Feature Support

Post by bmelts »

That'd be me in charge of the Mac builds.

The issue is that LÖVE relies on SDL for all its Mac interactions. If they don't add support for this upstream, we're SOL. I believe Lion-related stuff is into SDL 1.3, but who knows when that's coming out? And it's doubtful anything's going to be backported to SDL 1.2 at this point.

The technical details of how fullscreen works on Mac OS X are a little complicated; in short, there's two main ways of making applications fullscreen: The Old Way and The New Way (which was actually introduced back in Mac OS 10.5, I think). SDL uses The Old Way, which grabs the entire screen and shoves an OpenGL context onto it. Apple recommends (and Lion requires, for proper fullscreen support) The New Way, which basically makes a giant window without a title bar that happens to be sized to fill up the entire screen. I think SDL 1.3 uses The New Way, but again, that's irrelevant until it actually gets released, which is unlikely to be anytime soon.

So, tl;dr: unlikely to happen unless SDL releases 1.2.15 with proper Lion support (highly unlikely) or we ditch SDL for a cross-platform toolkit that, to be blunt, doesn't suck so much.
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Mac OS X Lion Feature Support

Post by slime »

It sounds like The New Way isn't ideal for when you want as much framerate as possible, because it sacrifices performance by making it a "full screen window" rather than simply "fullscreen".
User avatar
bmelts
Party member
Posts: 380
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin
Contact:

Re: Mac OS X Lion Feature Support

Post by bmelts »

Honestly there's not a lot of difference. Mac OS X is very smart about what it renders and what it doesn't - when you've got a window in fullscreen The New Way, it stops rendering the stuff behind it and focuses all the GPU's power on the window in front. It's still all hardware-accelerated OpenGL. I haven't done any benchmarking to personally prove it but I would wager that the difference is minimal.
User avatar
BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: Mac OS X Lion Feature Support

Post by BlackBulletIV »

anjo wrote:or we ditch SDL for a cross-platform toolkit that, to be blunt, doesn't suck so much.
How about SFML? Or you could just create your own implementation, like Monocle has (with all the SDL problems we've been having, I'm starting to think that would be a better option).
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Mac OS X Lion Feature Support

Post by slime »

anjo wrote:Honestly there's not a lot of difference. Mac OS X is very smart about what it renders and what it doesn't - when you've got a window in fullscreen The New Way, it stops rendering the stuff behind it and focuses all the GPU's power on the window in front. It's still all hardware-accelerated OpenGL. I haven't done any benchmarking to personally prove it but I would wager that the difference is minimal.
Perhaps, I guess I'm coming from bad experiences with Windows. :P


I would imagine creating a new implementation might come with even more problems than it solves, but I know little of these things.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Mac OS X Lion Feature Support

Post by bartbes »

Wow, talking about dumping SDL as it's something we can do in 15 minutes again.
User avatar
BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: Mac OS X Lion Feature Support

Post by BlackBulletIV »

bartbes wrote:Wow, talking about dumping SDL as it's something we can do in 15 minutes again.
I never said anything about it being able to done quickly; it'd take time, that's for sure. (Unless you weren't referring to me.)
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: Mac OS X Lion Feature Support

Post by T-Bone »

But we're talking about games here. When you play games on your computer, it's very common for them to do fullscreen "the Old Way". If you were to play a "serious" game, say Portal 2, on OSX Lion, would it not use "the Old Way" as well?
User avatar
BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: Mac OS X Lion Feature Support

Post by BlackBulletIV »

Just because many other games do it (and Portal 2 was released before Lion of course) the old way, doesn't mean that the old way is better.
Post Reply

Who is online

Users browsing this forum: No registered users and 171 guests