Add vsync for OS X.
This commit is contained in:
@@ -45,6 +45,10 @@ namespace GLExt {
|
|||||||
extern PFNGLCOLORTABLEPARAMETERIVPROC glGetColorTableParameterivEXT;
|
extern PFNGLCOLORTABLEPARAMETERIVPROC glGetColorTableParameterivEXT;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if defined(DARWIN)
|
||||||
|
#include "archutils/Darwin/Vsync.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "RageDisplay.h"
|
#include "RageDisplay.h"
|
||||||
#include "RageDisplay_OGL.h"
|
#include "RageDisplay_OGL.h"
|
||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
@@ -447,7 +451,11 @@ void SetupExtensions()
|
|||||||
GetGLExtensions(g_glExts);
|
GetGLExtensions(g_glExts);
|
||||||
|
|
||||||
/* Find extension functions and reset broken flags */
|
/* Find extension functions and reset broken flags */
|
||||||
|
#if !defined(DARWIN)
|
||||||
GLExt::wglSwapIntervalEXT = (PWSWAPINTERVALEXTPROC) wind->GetProcAddress("wglSwapIntervalEXT");
|
GLExt::wglSwapIntervalEXT = (PWSWAPINTERVALEXTPROC) wind->GetProcAddress("wglSwapIntervalEXT");
|
||||||
|
#else
|
||||||
|
GLExt::wglSwapIntervalEXT = wglSwapIntervalEXT;
|
||||||
|
#endif
|
||||||
GLExt::glColorTableEXT = (PFNGLCOLORTABLEPROC) wind->GetProcAddress("glColorTableEXT");
|
GLExt::glColorTableEXT = (PFNGLCOLORTABLEPROC) wind->GetProcAddress("glColorTableEXT");
|
||||||
GLExt::glGetColorTableParameterivEXT = (PFNGLCOLORTABLEPARAMETERIVPROC) wind->GetProcAddress("glGetColorTableParameterivEXT");
|
GLExt::glGetColorTableParameterivEXT = (PFNGLCOLORTABLEPARAMETERIVPROC) wind->GetProcAddress("glGetColorTableParameterivEXT");
|
||||||
g_bEXT_texture_env_combine = HasExtension("GL_EXT_texture_env_combine");
|
g_bEXT_texture_env_combine = HasExtension("GL_EXT_texture_env_combine");
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Vsync.cpp
|
||||||
|
* stepmania
|
||||||
|
*
|
||||||
|
* Created by Steve Checkoway on Mon Sep 22 2003.
|
||||||
|
* Copyright (c) 2003 Steve Checkoway. All rights reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "Vsync.h"
|
||||||
|
#include <OpenGl/OpenGl.h>
|
||||||
|
|
||||||
|
|
||||||
|
bool wglSwapIntervalEXT(int swapInterval)
|
||||||
|
{
|
||||||
|
/* I really have no idea what the expected return value for success. If it was an int
|
||||||
|
* I would return 0, since it is a bool, I'm going to guess that true is success. */
|
||||||
|
return !CGLSetParameter(CGLGetCurrentContext(), kCGLCPSwapInterval, &long(swapInterval));
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
/*
|
||||||
|
* Vsync.h
|
||||||
|
* stepmania
|
||||||
|
*
|
||||||
|
* Created by Steve Checkoway on Mon Sep 22 2003.
|
||||||
|
* Copyright (c) 2003 Steve Checkoway. All rights reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
bool wglSwapIntervalEXT(int swapInterval);
|
||||||
Reference in New Issue
Block a user