[PB 5.42 / 5.50b1] OpenGL vs #PB_Screen_NoSynchronization
Posted: Wed Jun 08, 2016 1:57 pm
#PB_Screen_NoSynchronization is not working with opengl. i only get 60fps, which is my monitors refresh rate:
its probably because i have vsync enabled in the nvidia driver panel. dunno if opengl can override that, like directx can?
c ya,
nco2k
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()
ForEverc ya,
nco2k