
FreeBASIC's Official Forums
|
| View previous topic :: View next topic |
| Author |
Message |
|
|
Posted: Sep 11, 2005 6:31 Post subject: FreeBASIC Screensaver Kit |
|
|
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 |
|
 |
|
|
Posted: Sep 11, 2005 6:55 Post subject: |
|
|
| Very cool. |
| |
|
| Back to top |
|
 |
|
|
Posted: Sep 11, 2005 21:54 Post subject: |
|
|
| Wow, that is great. Thanks! |
| |
|
| Back to top |
|
 |
|
|
Posted: Sep 12, 2005 11:23 Post subject: |
|
|
| wow. hahaha im going to have sooo much fun with this, i just know it! |
| |
|
| Back to top |
|
 |
|
|
Posted: Sep 12, 2005 17:10 Post subject: |
|
|
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 |
|
 |
|
|
Posted: Sep 12, 2005 20:42 Post subject: |
|
|
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 |
|
 |
|
|
Posted: Sep 12, 2005 21:05 Post subject: |
|
|
| Thanks! Man this will help a lot! Maybe...I can post one of my screensavers later for you guys? |
| |
|
| Back to top |
|
 |
|
|
Posted: Sep 13, 2005 14:38 Post subject: |
|
|
| 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 |
|
 |
|
|
Posted: Sep 13, 2005 20:29 Post subject: |
|
|
| 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 |
|
 |
|
|
Posted: Sep 14, 2005 16:01 Post subject: |
|
|
| 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 |
|
 |
|
|
Posted: Sep 15, 2005 5:10 Post subject: |
|
|
| Shockingly awesome! |
| |
|
| Back to top |
|
 |
|
|
Posted: Sep 15, 2005 18:03 Post subject: |
|
|
wow is this the growth of my seed in Tips & Tricks?!?! *grin*
excellant stuff here thanks a million! |
| |
|
| Back to top |
|
 |
|
|
Posted: Sep 19, 2005 6:25 Post subject: |
|
|
| Hey Joe, does it work with SDL + OpenGL? |
| |
|
| Back to top |
|
 |
|
|
Posted: Sep 19, 2005 12:29 Post subject: |
|
|
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 |
|
 |
|
|
Posted: Sep 21, 2005 11:04 Post subject: |
|
|
| I don't know about GL writing to a GDI context. But I was thinking of a GL kit or something. |
| |
|
| Back to top |
|
 |
|
|
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
|
|