screensaver on mac?

BlitzMax Forums/BlitzMax Programming/screensaver on mac?

slenkar(Posted 2008) [#1]
does anyone know how to convert a windows screensaver done in blitzmax to apple mac?


Brucey(Posted 2008) [#2]
Yeah... start with not using BlitzMax :-p


slenkar(Posted 2008) [#3]
D'oh!


MGE(Posted 2008) [#4]
You have a stable screensaver shell for Windows in Blitzmax? :)


slenkar(Posted 2008) [#5]
there was some code posted, but after looking at it... it doesnt work!


ImaginaryHuman(Posted 2008) [#6]
Been discussed a few times, it's quite difficult. Basically you have to write the screensaver in XCode and use their `framework` API, write the code in objective c, and then compile it in XCode. We could not really figure out how to get BlitzMax involved even a little bit, otherwise I would've churned out many a screensaver by now. It's nowhere near as easy as renaming an exe on the PC, although that's not all there is to it. It's hard to get the windows preview working properly too.


Yan(Posted 2008) [#7]
It's hard to get the windows preview working properly too.
Nah...

There's a stable Windows screen saver example in the archives.


slenkar(Posted 2008) [#8]
I tried some code I found on this website and the preview worked fine, the actual screensaver just failed to appear on the screen but stayed in memory


jkrankie(Posted 2008) [#9]
If you really want to make Mac screensavers you can use Quartz Composer, whci you can find on your hard disk in /Developer/applications/graphics tools/Quartz composer.app

It's quite fun to play around with anyway.

Cheers
Charlie


ImaginaryHuman(Posted 2008) [#10]
Yah I tried that and made a simple one... but the dream is to use BlitzMax with OpenGL or DX to make your own screensaver... a bit more difficult on the Mac.


ImaginaryHuman(Posted 2010) [#11]
jkrankie, do you know if quartz composer can launch an external executable?


Nate the Great(Posted 2010) [#12]
what if you make an app that runs in the background until there is no input for a certain amount of time, and then brings itself to the front after that amount of time.


Brucey(Posted 2010) [#13]
what if you make an app that runs in the background until there is no input for a certain amount of time, and then brings itself to the front after that amount of time.

Hehehe... :-)


ImaginaryHuman(Posted 2010) [#14]
That's what I asked in Brucey's other thread. It's how it used to be done before there was a centralized screensaver system in osx or windows. Maybe its the only option for integrating Blitz or Unity code into a screensaver on osx. The question is, how do you monitor all system input from a blitz program so that you know when to trigger the saver?


ima747(Posted 2010) [#15]
Just thought I'd mention that a proper screen saver for mac is currently impossible from bmax. Screen savers under 10.6 must be 64bit. BMax only generates 32bit. So fundamentally it's impossible to make a proper screen saver from bmax for the current release of OS X.

Workarounds are the only real option such as a screen saver launcher, i.e. a screen saver that just runs another program, and quits it when the screen saver ends. It's not a clean solution for something distributable, but it might be enough if you you just want something for yourself etc.


ImaginaryHuman(Posted 2010) [#16]
So you're saying all 32-bit screensavers which would've worked on leopard suddenly stop working on snow leopard?

My question again is... does anyone know how to monitor global system input so that you can trigger a screensaver manually?


N(Posted 2010) [#17]
My question again is... does anyone know how to monitor global system input so that you can trigger a screensaver manually?
You do realize this is a really bad idea, don't you?


Nate the Great(Posted 2010) [#18]
You do realize this is a really bad idea, don't you?


my fault for suggesting it :p

why is it a really bad idea though? its not like it would take up any cpu time with a delay 200 in there ;)

then check for any keys hit or mousehits/movement every 200 millisecs...


N(Posted 2010) [#19]
why is it a really bad idea though?
You're bypassing the system in use by Mac OS that allows it to conserve battery use/system resources/what have you. Your proposed solution would use more battery, more resources, and it would do all this regardless of whether or not it was even running. That aside, it's an intuitively bad idea - I shouldn't have to explain that going around the operating system's method for this is bad (nevermind that users who want to have a password to disable the screensaver would be completely unable to use your screensaver thanks to its hack).

There's also the rather obvious issue of whether or not you can trust something that is monitoring all user input regardless of whether or not it's the main/key window.


ima747(Posted 2010) [#20]
re:ImaginaryHuman
yes, if you try to use a 32 bit screen saver in 10.6 it will say it's not compatible and tell you to contact the developer for an updated version.

A bit vague, but official
http://support.apple.com/kb/TS2913

And for lack of a better reference handy see
http://www.macintouch.com/specialreports/snowleopard/slcompat.html
Second paragraph, last sentence.


Nate the Great(Posted 2010) [#21]
@nilium oh I guess that makes sense.. I never really used my screensavers like that because I work on a windows machine and its as easy as renaming it and using some code in the code archives


ImaginaryHuman(Posted 2010) [#22]
You do have some points. I guess Mac screensavers are just going to remain off limits.

The only other idea I had was to use Quartz Composer to create a basic screensaver which uses the `command line` plugin to launch an external executable as the screensaver... only issue then is the preview window isn't going to show the proper screensaver, you still have to create a configuration panel in Interface Builder using probably Objective C code or something, and the Quartz Composer screensaver will probably cause two screens to be open or something.

There just is no easy way of doing it other than using Apple's dedicated system, writing the saver entirely in Objective C using their framework.


Brucey(Posted 2010) [#23]
It's doable in C++/Obj-C ... and therefore should also be possible in bmx2 (I'd imagine)...


ImaginaryHuman(Posted 2010) [#24]
Probably technically there is a way, but it seems so difficult. Also now as someone else said, Snow Leopard requires screensavers to be 64-bit, so Blitz is currently totally out of the picture.


ImaginaryHuman(Posted 2010) [#25]
Apart from some of the obvious drabacks/concerns about a custom external input monitor, isn't there some way to properly use the o/s to handle such monitoring in a safe way?