mirror of https://github.com/mpv-player/mpv
Sync swap with VBL.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15611 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
1adaa6b62f
commit
994a2b2479
|
@ -298,6 +298,7 @@ static uint32_t control(uint32_t request, void *data, ...)
|
||||||
@implementation CustomOpenGLView
|
@implementation CustomOpenGLView
|
||||||
- (void) initOpenGLView
|
- (void) initOpenGLView
|
||||||
{
|
{
|
||||||
|
long swapInterval = 1;
|
||||||
NSRect frame = [self frame];
|
NSRect frame = [self frame];
|
||||||
CVReturn error = kCVReturnSuccess;
|
CVReturn error = kCVReturnSuccess;
|
||||||
|
|
||||||
|
@ -323,6 +324,7 @@ static uint32_t control(uint32_t request, void *data, ...)
|
||||||
[window makeKeyAndOrderFront:self];
|
[window makeKeyAndOrderFront:self];
|
||||||
|
|
||||||
[self setOpenGLContext:glContext];
|
[self setOpenGLContext:glContext];
|
||||||
|
[[self openGLContext] setValues:&swapInterval forParameter:NSOpenGLCPSwapInterval];
|
||||||
[glContext setView:self];
|
[glContext setView:self];
|
||||||
[glContext makeCurrentContext];
|
[glContext makeCurrentContext];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue