Hey guys,
I was wondering if it was possible to make a Blitz3D program to run as a screen saver for your computer.
I was wondering if it was possible to make a Blitz3D program to run as a screen saver for your computer.
;************************************************* ;**** First Attempt At (Crap) Screen Saver ;**** YAN May 2001 ;************************************************* ; ;Rename the executable from ????.exe To ????.scr ; AppTitle "Blitz Screen Saver Config" in$=Upper(CommandLine$()) Global screenx=640 ; Global screeny=480 ;Probably read these from a config file Global screendepth=16 ; If Instr(in$,"S") Then StartSaver() ;Test/Preview/Timeout Call If in$="" Or Instr(in$,"C") Then ConfigSaver(in$) ;Configure/Settings Call End Function StartSaver() ;Run the screensaver code Graphics screenx,screeny,screendepth SetBuffer BackBuffer() FlushKeys FlushMouse x=MouseX() y=MouseY() SeedRnd MilliSecs() Color Rnd(255),Rnd(255),Rnd(255) cs=(screenx Shr 5) cx=(screenx Shr 1) cy=(screeny Shr 1) sx=Rnd(1,4):sy=Rnd(1,4) Repeat Cls Oval cx,cy,cs,cs,1 Flip cy=cy+sy:cx=cx+sx If cx<=0 Or cx>=(screenx-cs) Then sx=-sx If cy<=0 Or cy>=(screeny-cs) Then sy=-sy Until GetMouse() Or GetKey() Or y<>MouseY() Or x<>MouseX() End Function Function ConfigSaver(cl$) ;Set up saver properties and Graphics 300,300,0,2 ;probably save to a config file SetBuffer FrontBuffer() Text 0, 0, cl$ Text 100,100,"Configure Me" Repeat If RectsOverlap(120, 210, 60, 30, MouseX(), MouseY(), 1, 1);MouseX()>120 And MouseX()<180 And MouseY()>210 And MouseY()<240 Color 0,0,200 Rect 120,210,60,30,1 Color $ff,$ff,$ff Text 133,218,"EXIT" If MouseDown(1) Then click=True Else Color 100,0,200 Rect 120,210,60,30,1 Color $ff,$ff,$ff Text 133,218,"EXIT" click=False EndIf Until click End Function
Graphics3D 1440, 900, 0, 1 SetBuffer BackBuffer() cube = CreateCube() cam = CreateCamera() PositionEntity cam, 0, 0, -20 While Not KeyHit(1) TurnEntity cube, Rnd(0.0, 10.0), Rnd(0.0, 10.0), Rnd(0.0, 10.0) RenderWorld Flip Wend End