浏览代码

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 年之前
父节点
当前提交
4494e927f7
共有 1 个文件被更改,包括 2 次插入0 次删除
  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;