Code: Select all
CompilerIf Not Subsystem("OpenGL")
Debug "Use OpenGL!"
End
CompilerEndIf
InitSprite()
OpenWindow(0, 0, 0, 800, 600, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, WindowWidth(0), WindowHeight(0), #False, 0, 0, #PB_Screen_NoSynchronization)
Repeat
Repeat
WinEvent = WindowEvent()
If WinEvent = #PB_Event_CloseWindow
Break 2
EndIf
Until WinEvent = 0
TimeCurrent = ElapsedMilliseconds()
If TimeCurrent - TimeLast < 1000
FPSCurrent + 1
Else
FPSLast = FPSCurrent
FPSCurrent = 0
TimeLast = TimeCurrent
EndIf
ClearScreen(RGB(0, 0, 0))
If StartDrawing(ScreenOutput())
DrawText(10, 10, "FPS: "+Str(FPSLast), RGB(255, 255, 255), RGB(0, 0, 0))
StopDrawing()
EndIf
FlipBuffers()
ForEver
c ya,
nco2k