فهرست منبع

Fix: Added initial context.sync value to correct Flip() behaviour

Ronny Otto 6 سال پیش
والد
کامیت
daf483a69d
1فایلهای تغییر یافته به همراه7 افزوده شده و 2 حذف شده
  1. 7 2
      sdlgraphics.mod/sdlgraphics.bmx

+ 7 - 2
sdlgraphics.mod/sdlgraphics.bmx

@@ -207,9 +207,9 @@ Type TSDLGraphicsDriver Extends TGraphicsDriver
 
 		context.window = TSDLWindow.Create(AppTitle, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, windowFlags)
 		If glFlags Then
-			SDL_GL_SetSwapInterval(-1)
-
 			context.context = context.window.GLCreateContext()
+			SDL_GL_SetSwapInterval(-1)
+			context.sync = -1
 		End If
 
 		context.width = width
@@ -235,6 +235,11 @@ Type TSDLGraphicsDriver Extends TGraphicsDriver
 	End Method
 
 	Method Flip( sync:Int )
+		'BRL  SDL
+		'-1   -1   sdl: adaptive vsync, brl: "use graphics object's refresh rate"
+		' 1    1   vsync
+		' 0    0   sdl: immediate, brl: "as soon as possible"
+
 		'bbSDLGraphicsFlip sync
 		If Not _currentContext Then
 			Return