Screensaver mod

BlitzMax Forums/BlitzMax Programming/Screensaver mod

StuC(Posted 2005) [#1]
Will write it in c for necessary reasons. It will be OpenGL based.

Just starting this, initially for win32, but will extend it for MacOS and Linux at a later date.

Any thoughts or ideas?

Cheers,

Stu


Sakamoto(Posted 2005) [#2]
Would be ever so usefull.


Dreamora(Posted 2005) [#3]
hmm and where is its use, at least on Windows were a screensaver is just a renamed exe? Or did I missunderstand your post ...


Picklesworth(Posted 2005) [#4]
Nah, screensavers have a quite a bit more to them.
The preview window thingy needs to be coded into the screensaver's exe, and you need a bit of command line stuff.


N(Posted 2005) [#5]
I think he's talking about allowing drawing in the little area of the window and such.

If not, there's a thought/idea.


Perturbatio(Posted 2005) [#6]
hmm and where is its use, at least on Windows were a screensaver is just a renamed exe?

a windows screensaver must accept 3 switches:
/p - preview
/c - configuration
/s - start normally.

It must also prevent multiple instances of itself from launching.

In preview mode, it is passed the handle of the preview window upon which the screensaver is expected to draw a small example.

Whilst it's true that you can just rename an exe, there's a little more to it.


Grisu(Posted 2005) [#7]
Would be nice to have. Especially if it could do a nice preview window. AND work on MAC + Linux. :)

A small and very old tutorial of mine:
http://www.blitzcoder.com/cgi-bin/articles/show_article.pl?f=grisu02052004150048.html


N(Posted 2005) [#8]
Linux


Thaaat wouldn't work too well, I think.


StuC(Posted 2005) [#9]
The other posts are correct, Dream. Whilst you can get away with renaming, there is more to creating a screen saver. I plan on supporting (transparently) the preview in Windows and any other platform specific stuff for OSX and Linux (if indeed Linux has any specific requirements for a screen saver).

I have created my own C module to handle the creation of the window for you (code derived from the bglCreateContext), that will automagically be a child of the HWND passed in, when in preview mode or full screen when in run mode.

You will "simply" (hard part is the actual screen saver!):

1. Derive your screen saver from my TScreenSaver class.

1.1 Implement the abstract 'RenderFrame' method. You will draw one frame of the screen saver per call to this method. You should check the width and height properties, which will automatically be updated when in preview mode, so you can scale and draw your frames appropriately.

1.2 Optionally override the CreateParams method, to specify your own resolution and bit depth for Run mode. This will always be full screen.

1.3 Optionally override the Config method, if you wish to provide a configuration UI. Default is no config UI.

2. Create an instance of your derived screen saver class
3. Execute the Go() method.
When calling Go(), the TScreenSaver class will run the appropriate UI and set up the window appropriately, depending on the mode (run, config or preview). You just have to call Go().

That's it. All the tech stuff is handled by the TScreenSaver class for you.

I don't have a Mac yet - but will purchase a powerbook in the coming week. Linux I will do some research and seek the help of others.

Cheers,

Stu


Filax(Posted 2005) [#10]
Good news ! if a screensaver module coming soon :)


RmB303(Posted 2005) [#11]
This would be beautiful if it truly is cross-platform!
Thanks a lot guys. I asked for advice about writing a saver for the Mac months ago and had no replies - and now this!
Can't wait. Just need to be abe to code better now.


ImaginaryHuman(Posted 2005) [#12]
Sounds good to me. I like making graphics routines so it'd be nice to convert some into a screensaver especially if it has a cross-platform audience and works equally well on all of them. I agree, screensavers have to be integrated such that they can update a preview window and also provide configuration options. I'm not quite sure though how you'd go about allowing a configuration option because usually this means setting up a real o/s GUI with controls.
??????


TLM(Posted 2005) [#13]
Any updates on this? I would love to make a cross platform screensaver using BlitzMax


Dubious Drewski(Posted 2005) [#14]
a screensaver is just a renamed exe

I found this out a few weeks ago, so I renamed calc.exe to
calc.scr

Now if I leave my machine alone for 20 minutes,
Windows calculator opens, hehe.


TLM(Posted 2005) [#15]
Yea, but the cool preview and settings is the key.


ImaginaryHuman(Posted 2005) [#16]
On the Mac the screensavers are selected within the preferences window and each should possibly have an `options` pane which shows up, which might included several tabs or whatever gui elements, and also a preview window which shows the effect running in a scaled-down size. I also know that you can use a hack to make any screensaver run as desktop background texture which updates in realtime behind the rest of the desktop features, so it should be compatible with that too.


ImaginaryHuman(Posted 2006) [#17]
Any update on this cross-platform/mac-compatible screensaver module?