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.
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.
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
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
Last edited by netmaestro on Sun Mar 04, 2007 6:06 am, edited 3 times in total.
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.
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.
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
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
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!
I like logic, hence I dislike humans but love computers.
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.