Browse Source

libobs-opengl: Disable v-sync on mac

Sets the swap interval to 0 to prevent v-sync from affecting any of the
preview panes on mac.
jp9000 8 năm trước cách đây
mục cha
commit
4494e927f7
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      libobs-opengl/gl-cocoa.m

+ 2 - 0
libobs-opengl/gl-cocoa.m

@@ -73,12 +73,14 @@ static NSOpenGLContext *gl_context_create(void)
 struct gl_platform *gl_platform_create(gs_device_t *device, uint32_t adapter)
 {
 	struct gl_platform *plat = bzalloc(sizeof(struct gl_platform));
+	GLint interval = 0;
 
 	plat->context = gl_context_create();
 	if (!plat->context)
 		goto fail;
 
 	[plat->context makeCurrentContext];
+	[plat->context setValues:&interval forParameter:NSOpenGLCPSwapInterval];
 
 	if (!gladLoadGL())
 		goto fail;