[PB 5.42 / 5.50b1] OpenGL vs #PB_Screen_NoSynchronization

Windows specific forum
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

[PB 5.42 / 5.50b1] OpenGL vs #PB_Screen_NoSynchronization

Post by nco2k »

#PB_Screen_NoSynchronization is not working with opengl. i only get 60fps, which is my monitors refresh rate:

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
its probably because i have vsync enabled in the nvidia driver panel. dunno if opengl can override that, like directx can?

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
DontTalkToMe
Enthusiast
Enthusiast
Posts: 334
Joined: Mon Feb 04, 2013 5:28 pm

Re: [PB 5.42 / 5.50b1] OpenGL vs #PB_Screen_NoSynchronizatio

Post by DontTalkToMe »

nco2k wrote:its probably because i have vsync enabled in the nvidia driver panel. dunno if opengl can override that, like directx can?
In that case it's not a bug.

That settings cannot be overridden. If you want to be able to change it through software, you have to select "let the application decide" or something like that.
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Re: [PB 5.42 / 5.50b1] OpenGL vs #PB_Screen_NoSynchronizatio

Post by nco2k »

there is no such setting. you can only choose between on, off, adaptive and adaptive (half). you can override it with directx, so maybe the same can be done with opengl. im just hoping for some consistency here.

maybe a new mode schould be introduced (#PB_Screen_DefaultSynchronization), which respects the users driver setting and doesnt override anything.

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
DontTalkToMe
Enthusiast
Enthusiast
Posts: 334
Joined: Mon Feb 04, 2013 5:28 pm

Re: [PB 5.42 / 5.50b1] OpenGL vs #PB_Screen_NoSynchronizatio

Post by DontTalkToMe »

nco2k wrote:there is no such setting.
Strange.

Try to Google for "let the 3d application decide" to see what I mean, I wrote some simple OpenGL stuff and this setting was present under different names on both AMD and nVidia drivers for as long as I can remember and across different ranges of cards.

When this is locked, the OpenGL extensions used to enable/disable vsync have no effect.
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Re: [PB 5.42 / 5.50b1] OpenGL vs #PB_Screen_NoSynchronizatio

Post by nco2k »

i remember that setting and when i reset the driver, i can choose that option again. so weird. must have been a glitch in the driver panel. good opportunity to update my outdated driver however. :)

so yea, this is technically not a bug, but it would be great to have some consistency between the subsystems if possible.

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Post Reply