home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
MM1
/
GRAPHICS
/
kwsaver.lzh
/
kwsaver.programmers.notes
< prev
next >
Wrap
Text File
|
1994-05-05
|
4KB
|
86 lines
KWSaver Programmers' Notes
==========================
This file contains information on writing your own screen-savers for use
with KWSaver. No information contained in this file is guaranteed for future
versions (although it probably will still be valid). The version used when
writing this file was Version 1.0. As always, use this program (and all
related files) at your own risk.
Also, it is assumed you have read the "Technical Notes" section in the
kwsaver.readme file, which contains some important information not mentioned
here.
Two Types of Screen-Savers:
===========================
There are two types (ways of writing) screen-savers for KWSaver. Type 1
screen-savers are the simplest. What makes the type 1? The fact that they
require no signal handler function. I.E. they die when a signal (any signal)
is sent to them. So, type 2 screen-savers obviously require a signal
handler to prevent their death at the hands of a signal.
When is a signal sent to a screen-saver? When KWSaver wants the
screen-saver to go away due to the user returning to his mouse/keyboard.
KWSaver will send the signal 4444 (decimal) when this occurs. For Type 1
savers, this means instant death. But why would Type 2 savers want to prevent
this death anyway?
Type 2 savers "stare death in the eye" because they need to do some
cleanup processing before dying (exiting). Usually, this cleanup work is
killing some K-Windows graphics buffers the saver used for animation while it
was running. If there was no signal handler, the saver would die instantly,
but any K-Windows buffers it may have used would remain, needlessly hogging up
memory. So, when the saver receives a signal, it should deallocate (kill) any
K-Windows buffers it has been using, and then exit.
RULES FOR WRITING SCREEN-SAVERS THAT WORK:
==========================================
1) Thou shalt use the current screen, and none other. Do not allocate any
other screen, and do not attempt to Select() another screen.
2) Thou shalt NOT deallocate (DWEnd) the current screen. (KWSaver will take
care of this for you upon exit.)
3) Thou shalt NOT change palettes. (Actually, you can if you want, but since
savers do not run on the currently selected screen, the palette changes will
have absolutely no visual effect.)
4) Thou shalt die when a signal is sent. (Specifically for Type 2 savers...
Be sure to make your saver responsive enough to a received signal. When the
user comes back, s/he does not want to wait a half-hour for the screen-saver
to die because the programmer wanted to list the credits, company logo, etc.)
5) Thou shalt NOT require any command-line arguments... since there's no
command-line!
Included Sample Files:
======================
Well, that's pretty much all the information you really need to get
started. If you follow the rules, things should work out pretty nicely.
There are a few sample files with source code included in this archive to help
you out. 'kwsaver_lines.c' is a simple Type 1 saver. If you are a novice
OS-9 C programmer, you may want to check this out. If you are familiar with
signal handlers, and feel you're ready to tackle Type 2, check out
'kwsaver_mm1s.c' to see how a graphical logo is moved around the screen.
(The last program also requires a header file, 'kwsaver_mm1s.h' to compile.)
Anyone who develops a screen-saver, please send me a copy. I'd love to
see it!
Finally, this program has taken up a decent amount of time to write
(mainly trying to find ways to side-step K-Windows bugs). No, I'm not asking
for any money; rather I'm stating that I'm not receiving money for this
program. Therefore, I hearby decree, no one may sell (for profit, excluding
minimal copying, shipping, and media charges) screen-savers where the intended
audience is KWSaver users. Nor can KWSaver be sold. In other words, no one
may take the work I've done for free and use it to profit themselves or
others. You may upload your screen-savers whereever you like for others to
enjoy -- that is strongly encouraged.