Page 1 of 2
Another screensaver
Posted: Sun Mar 04, 2007 12:12 am
by Psychophanta
Today i've learned how to do an screensaver for windows,
thanks to Kale, netmaestro, Danilo, and others
Here
BTW, it works with smooth movements if at 60Hz refresh rate and modern PCs.
Posted: Sun Mar 04, 2007 12:18 am
by netmaestro
Link doesn't work

Posted: Sun Mar 04, 2007 12:24 am
by Psychophanta
netmaestro wrote:Link doesn't work

now !
Posted: Sun Mar 04, 2007 12:33 am
by netmaestro
Looks good! Excellent start, I'd recommend antialias for the ball edges and you don't have the scale right for the preview screen. For that to be correct you need to make your windowed screen the same size as your big main screen, just set autostretch to 1 and when you make it a child of the preview windowhandle it'll be scaled perfect.
Posted: Sun Mar 04, 2007 12:37 am
by Psychophanta
netmaestro wrote:Looks good! Excellent start, I'd recommend antialias for the ball edges and you don't have the scale right for the preview screen. For that to be correct you need to make your windowed screen the same size as your big main screen, just set autostretch to 1 and when you make it a child of the preview windowhandle it'll be scaled perfect.
Thank you, tomorrow i will do your recommendations, because i don't like the big size in the windowed screen.
About antialias i know how to do it too

Posted: Sun Mar 04, 2007 12:43 am
by netmaestro
Tiny demo: (resize/maximize the window and see result)
Code: Select all
InitSprite()
w=GetSystemMetrics_(#SM_CXSCREEN) ; w = FullScreen width
h=GetSystemMetrics_(#SM_CYSCREEN) ; h = FullScreen height
OpenWindow(0,0,0,152,112,"",$CF0001) ; Host Window is opened preview-window size
OpenWindowedScreen(WindowID(0),0,0,w,h,1,0,0) ; WindowedScreen size = FullScreen size ** important **
CreateSprite(0,128,128) ; It will scale itself to fit host window
StartDrawing(SpriteOutput(0)) ; Your display routine for preview is identical to
Circle(64,64,64,#Red) ; fullscreen version, all scaling is managed by DX
StopDrawing()
fwd=1:x=0
Repeat
ClearScreen(0)
If fwd:x+5:If x>=w-128:fwd=0:EndIf:Else:x-5:If x<1:fwd=1:EndIf:EndIf
DisplaySprite(0,x,h/2-64)
FlipBuffers()
ev=WaitWindowEvent(1)
Until ev = #WM_CLOSE
Posted: Sun Mar 04, 2007 12:44 am
by rsts
Very nice. Thanks.
Posted: Sun Mar 04, 2007 3:47 pm
by Psychophanta
It is done.
I've been testing something with antialias, but finally i will not do it because i decided it is uses too much CPU for an almost useless thing.

Posted: Sun Mar 04, 2007 10:18 pm
by netmaestro
How much CPU would it use? Currently it's very near 0 here, I can't believe using alphablended images would raise it that much. And if a screensaver uses a bit of CPU, say 10% or so, that shouldn't be a problem as the machine isn't being used at the time and if a job is running it's got 90% of the CPU available to it. To me, the advantage of having lovely alphablended images is worth it.
Posted: Mon Mar 05, 2007 12:10 am
by GeoTrail
Looks good. I made an even more useless screen saver some time ago. Just displayed some static text hehehe. But, I got your screen saver installed on my laptop now. Runs smoothly, but it would be nice if you made it with anti alizing

Posted: Mon Mar 05, 2007 12:34 am
by Joakim Christiansen
You doesn't need real antialiasing or aplhablending at all, just make the edges more "soft" and do this on a black bakground and I think it would look quite nice. Great physics btw!

Posted: Mon Mar 05, 2007 4:08 pm
by Psychophanta
Joakim Christiansen wrote:You doesn't need real antialiasing or aplhablending at all, just make the edges more "soft" and do this on a black bakground and I think it would look quite nice. Great physics btw!

Exactly
It is what i was thinking about.
I don't use Sprite3D there, so then this one is what i will do just now.
Posted: Mon Mar 05, 2007 5:08 pm
by r_hyde
Thanks for the screensaver. I keep watching it just to see what the balls will do next!
Posted: Mon Mar 05, 2007 8:54 pm
by Num3
Doesn't work...
Just get a black screen...
Posted: Mon Mar 05, 2007 9:33 pm
by Psychophanta
Num3 wrote:Doesn't work...
Just get a black screen...
Ooops,
get now
