Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
36
Task/Image-noise/PureBasic/image-noise.basic
Normal file
36
Task/Image-noise/PureBasic/image-noise.basic
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#filter=0.2 ; Filter parameter for the FPS-calculation
|
||||
#UpdateFreq=100 ; How often to update the FPS-display
|
||||
|
||||
OpenWindow(0,400,300,320,240,"PureBasic")
|
||||
Define w=WindowWidth(0), h=WindowHeight(0)
|
||||
Define x, y, T, TOld, FloatingMedium.f, cnt
|
||||
InitSprite()
|
||||
OpenWindowedScreen(WindowID(0),0,0,w,h,1,0,0,#PB_Screen_NoSynchronization)
|
||||
Repeat
|
||||
StartDrawing(ScreenOutput())
|
||||
For y=0 To h-1
|
||||
For x=0 To w-1
|
||||
If Random(1)
|
||||
Plot(x,y,#Black)
|
||||
Else
|
||||
Plot(x,y,#White)
|
||||
EndIf
|
||||
Next
|
||||
Next
|
||||
StopDrawing()
|
||||
FlipBuffers()
|
||||
cnt+1
|
||||
If cnt>=#UpdateFreq
|
||||
cnt =0
|
||||
TOld=T
|
||||
T =ElapsedMilliseconds()
|
||||
FloatingMedium*(1-#filter)+1000*#filter/(T-TOld)
|
||||
SetWindowTitle(0,"PureBasic: "+StrF(#UpdateFreq*FloatingMedium,2)+" FPS")
|
||||
Repeat ; Handle all events
|
||||
Event=WindowEvent()
|
||||
If Event=#PB_Event_CloseWindow
|
||||
End
|
||||
EndIf
|
||||
Until Not Event
|
||||
EndIf
|
||||
ForEver
|
||||
Loading…
Add table
Add a link
Reference in a new issue