Macbook Pro's Touch Bar + Love2D... how do I start?

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.
Post Reply
Ivan.Dionízio
Prole
Posts: 11
Joined: Sat Jul 31, 2021 12:46 am

Macbook Pro's Touch Bar + Love2D... how do I start?

Post by Ivan.Dionízio »

Hi, i'd like to know how do I access macbook's touch bar to work with love2d? Is it possible? I think we could make a good use of it on our games.

I've researched a lot about how to use it on games and there are some options such as:
- Apple's Spritekit on XCode;
- MonoGame or FNA + Xamarin: https://github.com/xamarin/mac-samples/ ... BarExample
- QT + QT Touch Bar: https://github.com/KDAB/KDMacTouchBar
- Electron + Electron TouchBar (doesn't require XCode): https://github.com/pahund/electron-touch-bar
- SDL: https://github.com/joncampbell123/dosbox-x/issues/967

Regarding the SDL way, joncampbell123 user said "There is no need, and no API, for your app to know whether or not there is a Touch Bar available. Whether your app is running on a machine that supports the Touch Bar or not, your app’s onscreen user interface (UI) appears and behaves the same way. That's nice, so instead of creating a touch bar object only if one is present, applications have to create one and set it (and waste memory on systems that don't have one!) at all times.", then, "I am only able to add touch bar support to SDL1 builds because adding touch bar support requires modifying the NSApplication and NSWindow objects inside the SDL1 library. I do not modify the SDL2 library because the goal is to keep DOSBox-X compatible with the actively developed main SDL2 project. SDL1 builds have touch bar support, SDL2 builds do not."

Plus I found this: https://www.rderewianko.com/detecting-a-touchbar-mac/

So, there are lots of info, but what I really wanna know is, can anyone help me or at least give me a clue on how to start making a working touchbar library for love2d? For Mac users who wanna help, you can use a Touch Bar Simulator, it doesn't require XCode and works in any Mac: https://github.com/sindresorhus/touch-bar-simulator.

I really appreciate your help, if possible :) Thank you!
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: Macbook Pro's Touch Bar + Love2D... how do I start?

Post by ReFreezed »

You probably have to access this kind of system functionality through the FFI library, i.e. by calling C functions, unless you wanna/need to dive into LÖVE's C++ code to make the desired changes and compile everything from scratch.
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
Ivan.Dionízio
Prole
Posts: 11
Joined: Sat Jul 31, 2021 12:46 am

Re: Macbook Pro's Touch Bar + Love2D... how do I start?

Post by Ivan.Dionízio »

Hmm.. this FFI library can give me at least a chance to make the touchbar work with löve through C functions. Neat. I will try that from now on. From all the options I mentioned above, the electron way was the easiest. But I think dealing with javascript would be very hard, so I think I'll stick with C for now. Thanks
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Macbook Pro's Touch Bar + Love2D... how do I start?

Post by Jasoco »

The TouchBar is sadly (or not sadly) being phased out so I wouldn't put too much effort into it. New high-end MBPs don't have them anymore and the lower ones that do will definitely lose them with the next revision.
Ivan.Dionízio
Prole
Posts: 11
Joined: Sat Jul 31, 2021 12:46 am

Re: Macbook Pro's Touch Bar + Love2D... how do I start?

Post by Ivan.Dionízio »

Jasoco wrote: Fri May 06, 2022 5:47 pm The TouchBar is sadly (or not sadly) being phased out so I wouldn't put too much effort into it. New high-end MBPs don't have them anymore and the lower ones that do will definitely lose them with the next revision.
Funny thing is I found out about that just one day after creating this topic :ultrahappy: (crying inside). It had a lot of potential, though. I was having fun with some open-source little games projects on github. Guess it's time to move on. Thank you all! :vamp:
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Macbook Pro's Touch Bar + Love2D... how do I start?

Post by Jasoco »

Ivan.Dionízio wrote: Sat May 14, 2022 11:18 am Funny thing is I found out about that just one day after creating this topic :ultrahappy: (crying inside). It had a lot of potential, though. I was having fun with some open-source little games projects on github. Guess it's time to move on. Thank you all! :vamp:
Well, I mean people still develop for old consoles. The technology exists now even if it's on its way out. So feel free to try. Just remember it's not going to be something a lot of people can use anymore. It'd be like developing for the gyroscope tilt sensors Apple used to put in pre-Retina MacBooks that they used to park the HDD heads to save from damage. It was a cool technology to play with for a while, but it was gone before you could really use its full potential because there was no reason to keep it around once they switched to all flash storage.
Ivan.Dionízio
Prole
Posts: 11
Joined: Sat Jul 31, 2021 12:46 am

Re: Macbook Pro's Touch Bar + Love2D... how do I start?

Post by Ivan.Dionízio »

Jasoco wrote: Wed May 18, 2022 6:36 pm
Ivan.Dionízio wrote: Sat May 14, 2022 11:18 am Funny thing is I found out about that just one day after creating this topic :ultrahappy: (crying inside). It had a lot of potential, though. I was having fun with some open-source little games projects on github. Guess it's time to move on. Thank you all! :vamp:
Well, I mean people still develop for old consoles. The technology exists now even if it's on its way out. So feel free to try. Just remember it's not going to be something a lot of people can use anymore. It'd be like developing for the gyroscope tilt sensors Apple used to put in pre-Retina MacBooks that they used to park the HDD heads to save from damage. It was a cool technology to play with for a while, but it was gone before you could really use its full potential because there was no reason to keep it around once they switched to all flash storage.
Hmmm...Well, the Touch Bar is back :awesome:, but only on 13' M2 Macbook Pro :( . I wonder what Apple is thinking on making it even more niche :huh:... Maybe it's going to be removed for good on next year revisions?
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Macbook Pro's Touch Bar + Love2D... how do I start?

Post by Jasoco »

Ivan.Dionízio wrote: Tue Jun 14, 2022 1:25 am
Jasoco wrote: Wed May 18, 2022 6:36 pm
Ivan.Dionízio wrote: Sat May 14, 2022 11:18 am Funny thing is I found out about that just one day after creating this topic :ultrahappy: (crying inside). It had a lot of potential, though. I was having fun with some open-source little games projects on github. Guess it's time to move on. Thank you all! :vamp:
Well, I mean people still develop for old consoles. The technology exists now even if it's on its way out. So feel free to try. Just remember it's not going to be something a lot of people can use anymore. It'd be like developing for the gyroscope tilt sensors Apple used to put in pre-Retina MacBooks that they used to park the HDD heads to save from damage. It was a cool technology to play with for a while, but it was gone before you could really use its full potential because there was no reason to keep it around once they switched to all flash storage.
Hmmm...Well, the Touch Bar is back :awesome:, but only on 13' M2 Macbook Pro :( . I wonder what Apple is thinking on making it even more niche :huh:... Maybe it's going to be removed for good on next year revisions?
I wouldn't count on the 13" sticking around though. It's only "back" because they didn't redesign it or anything. No one knows why it's still being kept around when not only does the 14" exist and is much better but the new 13" Air is also really really good. The 13" Pro is just some weird leftover they haven't killed yet. The TouchBar will only live as long as that machine does. And it wont be very long. Sad to say. It's just another one of those cool features Apple released but didn't catch on like 3D Touch on the iPhone.

My money's on there not being a 13" M3. By then they will definitely drop it. Whether it's next year or in two years. (The M1 13" was around for 2 years. Just like the M1 Air.) Once they get into a smooth release schedule it'll definitely be dropped since it doesn't offer anything new. It's still a conundrum that they put the M2 in it. Probably because it was too early for the 14" and 16" to get M2 (Released last fall) and they didn't want just the Air to have M2.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 53 guests