9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Sam <sah@softcardsystems.com>
To: <9fans@cse.psu.edu>
Subject: Re: [9fans] xscreensaver hacks
Date: Sat, 22 Jun 2002 16:39:36 -0400	[thread overview]
Message-ID: <Pine.LNX.4.30.0206221636020.10475-100000@athena> (raw)
In-Reply-To: <f3cac23edf30973a52237b5e31229d82@acl.lanl.gov>

I'm cleaning up galaxy to find the bug as well as in hopes of
giving it colour.  I don't know who wrote this, but I want
to drag him/her out back and beat them about the head and
shoulders with a copy of _The Practice of Programming_.  :-X

The things we do for eye candy ...

Sam

On Fri, 21 Jun 2002, andrey mirtchovski wrote:

> this morning I found out that there's not much for me to do today, so
> I decided to take a look at the XScreenSaver hacks (the X11 stuff, not
> the OpenGL ones) to see if it'd be easy to port them to Plan9...
>
> I was familiar with galaxy.c from an old project I did at usask.ca, so
> that was my first choice..
>
> I found out that it's amazingly easy to port (this one specifically)
> since there's not much to it -- it calculates pixels and draws them on
> the screen.  nothing complex...
>
> so, here it is -- compile and run in a window to see how fast it'll go...
>
> what's missing:
> 	colors, number of stars was reduced to 1000 (from 3000) to
> 	display faster, the whole galaxy thingie was rotating around
> 	the viewpoint.  it was puke-inducing so i removed it
>
> 	license -- some parts of xscreensaver think they're under the
> 	GPL (like the autoconf scripts and some hacks), others do
> 	not...  no autoconf was used, so no GPL :)
>
> what's added:
> 	menu (right mouse button exits)
> 	increased pixel size by 1, it seems to look better on my
> 	screen
> 	fps calculation -- the fps will be given upon exit, note that
> 	it's cpu-bound, rather than graphics-bound
>
> originally galaxy.c kept track of old pixels and filled them in with
> black, then drawing the new ones.  this seems to be slower for plan9,
> since P9 doesn't have something resembling XDrawPixels() with which to
> draw an array of Points (i.e.  each pixel is currently a call to
> draw() with a 2x2 rectangle argument).  in this case it's better to
> redraw the screen with black at the beginning of each iteration and
> then just fill in the white spots one by one...
>
> I'll do more when I have some more time (likely soon :) -- there's
> plenty where this one came from :)
>
> andrey
>
> ps: some data, if anyone's interested:
> 	(all done in a brand new window started with the 'window'
> 	command)
>
> 	GeForce3 video card, athlon 800mhz, 32bpp, gives 20+fps with 3
> 	galaxies, 26+ with 2
>



  parent reply	other threads:[~2002-06-22 20:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <andrey@lanl.gov>
2002-06-21 18:43 ` andrey mirtchovski
2002-06-21 18:55   ` Scott Schwartz
2002-06-22 20:39   ` Sam [this message]
2002-06-21 19:20 Andrey S. Kukhar
2002-06-21 19:53 Andrey S. Kukhar
2002-06-21 20:20 andrey mirtchovski
2002-06-21 19:33 ` Sam
2002-06-21 20:21 Andrey S. Kukhar
2002-06-21 21:17 andrey mirtchovski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.30.0206221636020.10475-100000@athena \
    --to=sah@softcardsystems.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).