Image noise: Difference between revisions
Content added Content deleted
m (→{{header|PureBasic}}: Increased FPS by running without synchronization) |
m (→{{header|PureBasic}}: improved readability) |
||
Line 257: | Line 257: | ||
OpenWindowedScreen(WindowID(0),0,0,w,h,1,0,0,#PB_Screen_NoSynchronization) |
OpenWindowedScreen(WindowID(0),0,0,w,h,1,0,0,#PB_Screen_NoSynchronization) |
||
Repeat |
Repeat |
||
cnt+1 |
|||
StartDrawing(ScreenOutput()) |
StartDrawing(ScreenOutput()) |
||
For y=0 To h-1 |
For y=0 To h-1 |
||
Line 272: | Line 271: | ||
cnt+1 |
cnt+1 |
||
If cnt>=#UpdateFreq |
If cnt>=#UpdateFreq |
||
cnt=0 |
cnt =0 |
||
TOld=T |
|||
T =ElapsedMilliseconds() |
|||
FloatingMedium*(1-#filter)+1000*#filter/(T-TOld) |
FloatingMedium*(1-#filter)+1000*#filter/(T-TOld) |
||
SetWindowTitle(0,"PureBasic: "+StrF(#UpdateFreq*FloatingMedium,2)+" FPS") |
SetWindowTitle(0,"PureBasic: "+StrF(#UpdateFreq*FloatingMedium,2)+" FPS") |
||
Repeat |
Repeat ; Handle all events |
||
Event=WindowEvent() |
Event=WindowEvent() |
||
If Event=#PB_Event_CloseWindow |
If Event=#PB_Event_CloseWindow |