freebasic.net Forum Index
FreeBASIC's Official Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log inLog in

FreeBASIC Screensaver Kit
Goto page 1, 2, 3, 4  Next
 
Post new topic   Reply to topic    freebasic.net Forum Index -> Projects
View previous topic :: View next topic  
Author Message
jofers
Master
PostPosted: Sep 11, 2005 6:31    Post subject: FreeBASIC Screensaver Kit Reply with quote

OK, there seems to be a lot of interest in screensavers lately, so I made a "helper" kit so people who don't want to learn the WinAPI don't have to use "dirty screensavers" that just sniff out the command line and use GFXLib.

http://www.betterwebber.com/stuff/FB_ScreenSaverKit.zip

Just unzip, and include this at the top of your program:
Code:
#include "FB_ScreenSaverKit.bas"
StartScreenSaver

Pset (x, y), colr
'...
 

Then you can just start using Pset, Line, etc. It sets up a NULL GFXLib driver, and copies that to a window 60 times a second. If the screensaver is in preview mode, it stretches it so it fits in that little box. If you include a dialog resource called "FB_SCRNSAVE_ABOUT" it will display that and close it when the "IDOK" button is pressed, or show a messagebox if a resource isn't included.

Packaged is the kit, and a conversion of Mambazo's "Doodle" demo. Notice how the preview box and settings button work, and how there's no code related to that stuff in the actual program, FB_ScreenSaverKit.bas takes care of it all.

If you want/need a real settings box, then I might make a function where if you include a different dialog name it makes a modal dialog and lets you hook the message loop, and it doesn't save much effort unless I made a mechanism to save registry keys, which I don't feel like doing because I like registry undiddled.
 
Back to top
View user's profile AIM Address MSN Messenger
Plasma

PostPosted: Sep 11, 2005 6:55    Post subject: Reply with quote

Very cool.
 
Back to top
View user's profile Visit poster's website
rdc
Master
PostPosted: Sep 11, 2005 21:54    Post subject: Reply with quote

Wow, that is great. Thanks!
 
Back to top
View user's profile Send e-mail Visit poster's website
jupiter3888

PostPosted: Sep 12, 2005 11:23    Post subject: Reply with quote

wow. hahaha im going to have sooo much fun with this, i just know it!
 
Back to top
View user's profile Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Antoni
Master
PostPosted: Sep 12, 2005 17:10    Post subject: Reply with quote

And it's too the first NULL GFXLIB example I have seen.It seems lillo forgot to write its's own....

Jofers: A feature you forgot to tell us. Startscreensaver copies the present screen to the GFXLIB buffer, so you don't need to do that if the saver "plays" with the present screen. If the screensaver does a diferent thing, just start erasing te buffer...

Great!!

EDITED: The only drawback. Windows API POINT interferes with GFXLIB's POINT, so i can't do a screen melt....
 
Back to top
View user's profile Visit poster's website
jofers
Master
PostPosted: Sep 12, 2005 20:42    Post subject: Reply with quote

Yes, but you can still use the function from the runtime library:

Code:
#define Point2(x, y) fb_GfxPoint(0, Csng(x), Csng(y))
 
Back to top
View user's profile AIM Address MSN Messenger
Pritchard
Guru
PostPosted: Sep 12, 2005 21:05    Post subject: Reply with quote

Thanks! Man this will help a lot! Maybe...I can post one of my screensavers later for you guys?
 
Back to top
View user's profile Send e-mail
Imortis
Master
PostPosted: Sep 13, 2005 14:38    Post subject: Reply with quote

Could Someone host this on FileAnchor? I would love to have it, but at my college most zip downloads are blocked. For some reson, FileAnchor isn't...
 
Back to top
View user's profile Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
dumbledore
Sr. Member
PostPosted: Sep 13, 2005 20:29    Post subject: Reply with quote

why don't you do it yourself? you can "upload" to fileanchor from the net as well as your computer, then download the stuff it just got for you ;)
 
Back to top
View user's profile Visit poster's website
Imortis
Master
PostPosted: Sep 14, 2005 16:01    Post subject: Reply with quote

Thanks for the tip dumbledore! I didn't know you could do that! Fileanchor now rocks even more then I thought it did before.
 
Back to top
View user's profile Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
relsoft
Master
PostPosted: Sep 15, 2005 5:10    Post subject: Reply with quote

Shockingly awesome!
 
Back to top
View user's profile Visit poster's website Yahoo Messenger
mambazo
Sr. Member
PostPosted: Sep 15, 2005 18:03    Post subject: Reply with quote

wow is this the growth of my seed in Tips & Tricks?!?! *grin*

excellant stuff here thanks a million!
 
Back to top
View user's profile Visit poster's website MSN Messenger
relsoft
Master
PostPosted: Sep 19, 2005 6:25    Post subject: Reply with quote

Hey Joe, does it work with SDL + OpenGL?
 
Back to top
View user's profile Visit poster's website Yahoo Messenger
jofers
Master
PostPosted: Sep 19, 2005 12:29    Post subject: Reply with quote

Not really since it uses GDI. Can SDL/OpenGL write to ScreenPtr?

Also, if you wanted to help me with that, be my guest.
 
Back to top
View user's profile AIM Address MSN Messenger
relsoft
Master
PostPosted: Sep 21, 2005 11:04    Post subject: Reply with quote

I don't know about GL writing to a GDI context. But I was thinking of a GL kit or something.
 
Back to top
View user's profile Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    freebasic.net Forum Index -> Projects All times are GMT
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



sf.net phatcode