Mac Screensaver Module

BlitzMax Forums/Brucey's Modules/Mac Screensaver Module

Brucey(Posted 2009) [#1]
Heh....



very basic example...
SuperStrict

Framework BaH.MacScreenSaver

Import "drawstuff.m"

Extern
	Function drawStuff(width:Float, height:Float)
End Extern

SetScreenSaver(New myScreenSaver)

Type myScreenSaver Extends TMacScreenSaver

	Method DrawRect(width:Float, height:Float)
		drawstuff(width, height)
	End Method
	
End Type

the drawStuff() function is just drawing some arcs and things via Cocoa... since I just wanted to see if the callbacks were working at all.

Good things
* It compiles
* It runs

Bad things
* It doesn't unload properly - although the destructor is called for the view, I think the BlitzMax side of it is still hanging on.
* Can't quit System Preferences after showing the preview - Need to force quit it.
* Need to hard-reset (the computer) if you mistakenly go fullscreen with it ;-)

Otherwise... it's kind of working :-p


... this is about attempt 6... of trying to get it working. (if at first you don't succeed... probably best not to bother!)


DavidDC(Posted 2009) [#2]
Exciting! I've wanted to be able to do this for ages. Those bad things are pretty bad though...


Brucey(Posted 2009) [#3]
Yeah... and I've really no idea where to go on from here :-)


ImaginaryHuman(Posted 2010) [#4]
Hey Brucey, I never saw this post before, sorry to resurrect it, but have you had any more progress with this?


Brucey(Posted 2010) [#5]
BlitzMax in its current form doesn't work well in a "loadable" binary context on the Mac. It runs fine (i.e. the loop runs, you can draw stuff, etc), but when it comes to unloading, it ain't happening.
Also, with 10.6, it seems screensavers need to be 64bit (probably, I haven't checked for sure).

So, one needs to hold out some hope that things will get easier with bmx2, which makes C++ instead of assembler - and in theory will give us more control over how the binary itself is built. And of course, 64bit support :-)


CASO(Posted 2010) [#6]
BMX2?!?!


xlsior(Posted 2010) [#7]
BMX2?!?!


Yes -- there's some other threads about it if you look around.

It's supposedly a stripped down version of Blitzmax that's pretty early in the development process, but sounds very promising.

Main feature is a wide range of new target compilation platforms: windows, Android, flash, html5, ...? (= web games & mobile games)


Brucey(Posted 2010) [#8]
... and Mac and Linux (not so mobile?)


ima747(Posted 2010) [#9]
BMX2 sounds like the answer to my prayers.

As for screen savers in 10.6 everything I've found and tried to hack together requires 64 bit so *tear*


ImaginaryHuman(Posted 2010) [#10]
Yah, it's a pity it's so tricky to implement. On Windows it's not too bad to do a screensaver, although the preview window is always a little tricky.

Let me know if you ever get this working properly, Brucey. I'd actually like to just use Blitz to launch a second executable as the screensaver, made in some other software. It's just that it can't really integrate with the preview window thing, and it seems any custom configuration options on osx have to have one of those GUI sheet things made for it in the interface builder, so it's one example of Apple's `you gotta use our tools` approach. Oh well.

In the old days, like on the Amiga, there was no official screensaver preference thing and so you had programs which managed the functionality of blanking the display etc, monitoring of keyboard input, as a separate application. `After Dark` springs to mind. It would just sit and monitor input and trigger the screensaver after a given time period, which was just a standard application. Maybe going back to `the old days` might be the only decent solution for Blitz on OSX? It would just need some way to monitor all user input in the system, not just within the Blitz app. But is that easily doable?