SpinIt Screensaver

Community Forums/Showcase/SpinIt Screensaver

TomToad(Posted 2006) [#1]
I have just finished a new screensaver calle SpinIt. The program is free to anyone who wants to give it a try.
Windows platform only. Tested on WinXP Pro, 2.0Ghz Athalon XP2400+, GeForce FX5200.

Thanks to KevinTheKaleidoscopicKoala for his screensaver framework.

Edit: Made SpinIt spin over the desktop

Web Site
Download

Some Screenshots





Boiled Sweets(Posted 2006) [#2]
HELL! The room is spinning now!!!

That is crazy.

Nice one...


Booticus(Posted 2006) [#3]
Its pretty neat! If you stare at it and then look away, stuff starts spinning. Its like being slightly buzzed!


TomToad(Posted 2006) [#4]
Just made a nice update to my SpinIt screensaver. :)


Boiled Sweets(Posted 2006) [#5]
COOL! Are you prepared to share the code how to grab and display the desktop image?

Go on you know it makes sense!


TomToad(Posted 2006) [#6]
Are you out of your mind? I'm planning on charging $80 for the code. You want to buy? Just kidding. Check out the Code Archives :)


Boiled Sweets(Posted 2006) [#7]
How are you drawing the grabbed image?

I use this

DrawPixmap( desktopPixMap, 0, 0 )


and my screen saver runs jerkily now :-(

Is there a faster way?


TomToad(Posted 2006) [#8]
Yes,
Local DesktopImage:TImage = LoadImage(desktopPixMap)
...
DrawImage DeskTopImage, 0 ,0

But it will still be slower anyway since you'll be drawing a huge bitmap to the screen. One way to solve this would be to divide the bitmap into sections and draw individually.
Local DesktopImage:TImage = LoadAnimImage(desktopPixMap,64,64,0,CellWidth*CellHeight)
For y = 0 to CellWidth - 1
  For x = 0 to CellHeight - 1
    DrawImage DeskTopImage,x*64,y*64,y*CellWidth+x
  Next
Next

This would be better because some cards can't handle a TImage as big as the desktop. Only problem is that you don't know ahead of time what the resolution of the desktop will be, and the only divisor I can find that works with all resolutions is 8, which makes for many tiny tiles.
You could either run the program at a specific resolution regardless of desktop resolution (requiring you to scale the desktop image to fit) or you could set the number of cells to a constant and divide the resoltion by the number of cells to get the tile's width and height (but create non power-of-two size tiles) or you can keep a table of tile sizes based on the most common resolutions and fall back to one of the other methods on a non-standard resoltion.
Or maybe there's an even more elegant solution. Once you have the desktop in a pixmap, you're pretty much free to process it how you want.


Boiled Sweets(Posted 2006) [#9]
So Drawimage is Faster then DrawPixMap?


Boiled Sweets(Posted 2006) [#10]
Using method one is still jerky...

Method 2 looks faster but the desktop is not drawn correctly. Are you sure that loop code is right :-)

Have I got my stupid hat on today, I do this to get the cellwidth/height

cellwidth = screenWidth / 8
cellheight = screenHeight / 8
DesktopImage = LoadAnimImage desktopPixMap,64,64,0,cellwidth*cellheight)


Looking at desktopimage it appears to be null but the desktoppixmap isn't - uh?


TomToad(Posted 2006) [#11]
The way you're doing it, you'd need to enter
cellwidth = screenWidth / 8
cellHeight = screenHeight / 8
DesktopImage = LoadAnimImage(desktopPixmap,8,8,0,cellwidth*cellheight)

I might be confusing you with the terms I'm using, basically what I mean by cellWidth and CellHeight, is how many tiles across and down you are breaking up the image into. So when you divide by 8, you are saying you want the tiles 8 pixels by 8 pixels. If your resolution is 800x600 that'll give you 100 tiles across and 75 tiles down.
So in the LoadAnimImage command, you'd be telling it that your tiles are going to be 8 pixels by 8 pixels, and there will be a total of 7500 tiles.
It might've been better if I had typed it as
const TileWidth = 64
Const TileHeight = 64
Const TilesAcross = screenWidth/64
Const TilesDown = screenHeight/64
Local DesktopImage:TImage = LoadAnimImage(desktopPixMap,TileWidth,TileHeight,0,TilesAcross*TilesDown)
For y = 0 to TilesDown - 1
  For x = 0 to TilesAcross - 1
    DrawImage DeskTopImage,x*TileWidth,y*TileHeight,y*TilesAcross+x
  Next
Next

Where TileWidth and TileHeight is the width and height of each tile in pixels, and TilesAcross and TilesDown is the number of tiles across and down.