Screen saver - %sv

In this section:

By using %sv (Screen Saver) it is possible to create a screen saver. A format window that includes %sv will close as soon as it receives mouse or keyboard input. The executable should be renamed to a <filename>.SCR file, placed in the Windows directory and then selected as the current screen saver from the Control Panel. Apart from its obvious use, a screen saver can be used to perform a lengthy calculation. To ensure the calculation is continued from where it was interrupted, the %cc (Control Closure) (window closure format) should be used to trap the closure and perform file I/O.

For example:

        WINAPP
        INCLUDE <windows.ins>
        INTEGER xres,yres,g_handle,r,g,b,i
        COMMON  xres,yres,g_handle,r,g,b
        EXTERNAL redraw_screen
        DOUBLE PRECISION secds
        secds=1.0
        r=20
        g=64
        b=11
        xres=clearwin_info@('screen_width')
        yres=clearwin_info@('screen_depth')
c ---   %bg background colour
        i=winio@('%sv%bg[black]&')
c ---   Define a window that takes the Whole display area
        i=winio@('%ww[no_caption,no_maxminbox,no_sysmenu,'
     +   // 'no_frame,no_border,topmost]&')
        i=winio@('%`gr[rgb_colours,black]&',xres,yres,g_handle)
c ---   Use a periodic delayed callback to initiate updates
        i=winio@('%dl',secds,redraw_screen)
        END
c ---------------------------------------------------------
        INTEGER FUNCTION redraw_screen()
        INCLUDE <windows.ins>
        INTEGER xres,yres,g_handle,r,g,b,loop
        COMMON  xres,yres,g_handle,r,g,b
        CALL select_graphics_object@(g_handle)
        DO loop=1,yres
          CALL draw_line_between@(0,loop,xres,loop,RGB@(r,g,b))
          r=r+1
          g=g+3
          b=b+5
          IF(r.GT.255) r=0
          IF(g.GT.255) g=g-255
          IF(b.GT.255) b=b-255
        ENDDO
        redraw_screen=1
        END

 

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited