December 03, 2020, 08:50:02 PM

Author Topic: [bb] Windows Screen Saver by Kalle [ 1+ years ago ]  (Read 850 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] Windows Screen Saver by Kalle [ 1+ years ago ]
« on: June 29, 2017, 12:28:43 AM »
Title : Windows Screen Saver
Author : Kalle
Posted : 1+ years ago

Description : Program your own (3D) Windows Screensaver.
I tested it with Win98 SE, but it should also work with any other 32Bit Windows...


Code :
Code: BlitzBasic
  1. ;*******************************************************************************
  2. ;*                                                                             *
  3. ;* Windows Screensaver                                                         *
  4. ;* (Tested with Win98, but should also work with any other 32 Bit Windows)     *
  5. ;*                                                                             *
  6. ;* Code by Kalle (Pascal Gwosdek) (2002)                                       *
  7. ;*                                                                             *
  8. ;* Just insert your code instead of the comments below.                        *
  9. ;* When finished, create an executable and change the filename into <Name>.scr *
  10. ;* Now, you can handle it as a "real" screensaver...                           *
  11. ;* The preview in the installation screen is not supported. Another bug is     *
  12. ;* that the Blitz Text window appears at every use, ignore it.                 *
  13. ;*                                                                             *
  14. ;* Have fun :-)                                                                *
  15. ;*                                                                             *
  16. ;*******************************************************************************
  17.  
  18. ;Declarations
  19.  
  20. AppTitle "ScreenSaver"
  21. ChangeDir SystemProperty$("appdir") ;This line is important when running as a Screensaver in Windows.
  22. ;Disable it while testing in Blitz (because the "appdir" of Blitz is "in"...)
  23. If CommandLine$() = "" Or Left$(CommandLine$(),2) = "/C" Or Left$(CommandLine$(),2) = "/c" Then ConfigScreensaver
  24. If CommandLine$() = "/S" Or CommandLine$() = "/s" Then ExecuteScreensaver
  25. End
  26.  
  27. ;---------------------------------------
  28.  
  29. Function ConfigScreensaver()
  30. ;Code for config screen... If you want to, launch an external application (written in Delphi or
  31. ;Visual Basic). You can save your data in an additional file.
  32.  
  33. End
  34. End Function
  35.  
  36. ;---------------------------------------
  37.  
  38. Function ExecuteScreensaver()
  39. ;Graphics mode (fullscreen), double buffering command(s) and loading of images, meshes, sounds...
  40. FlushKeys
  41. FlushMouse
  42. MoveMouse 0,0
  43. Repeat
  44.         ;Code for running screensaver...
  45.        
  46. Until MouseX() <> 0 Or MouseY() <> 0 Or GetKey() <> 0 Or GetMouse() <> 0
  47. End
  48. End Function


Comments :


Baystep Productions(Posted 1+ years ago)

 THATS A GREAT PIECE OF CODE!But personaly I would add in the middle of the main loop a function call to Update or sumtin.


 

SimplePortal 2.3.6 © 2008-2014, SimplePortal