diff --git a/stepmania/src/RageDisplay_OGL.cpp b/stepmania/src/RageDisplay_OGL.cpp index 6fb0f9db29..b80914db2c 100644 --- a/stepmania/src/RageDisplay_OGL.cpp +++ b/stepmania/src/RageDisplay_OGL.cpp @@ -45,6 +45,10 @@ namespace GLExt { extern PFNGLCOLORTABLEPARAMETERIVPROC glGetColorTableParameterivEXT; }; +#if defined(DARWIN) +#include "archutils/Darwin/Vsync.h" +#endif + #include "RageDisplay.h" #include "RageDisplay_OGL.h" #include "RageUtil.h" @@ -447,7 +451,11 @@ void SetupExtensions() GetGLExtensions(g_glExts); /* Find extension functions and reset broken flags */ +#if !defined(DARWIN) GLExt::wglSwapIntervalEXT = (PWSWAPINTERVALEXTPROC) wind->GetProcAddress("wglSwapIntervalEXT"); +#else + GLExt::wglSwapIntervalEXT = wglSwapIntervalEXT; +#endif GLExt::glColorTableEXT = (PFNGLCOLORTABLEPROC) wind->GetProcAddress("glColorTableEXT"); GLExt::glGetColorTableParameterivEXT = (PFNGLCOLORTABLEPARAMETERIVPROC) wind->GetProcAddress("glGetColorTableParameterivEXT"); g_bEXT_texture_env_combine = HasExtension("GL_EXT_texture_env_combine"); diff --git a/stepmania/src/archutils/Darwin/Vsync.cpp b/stepmania/src/archutils/Darwin/Vsync.cpp new file mode 100644 index 0000000000..1e58341f3d --- /dev/null +++ b/stepmania/src/archutils/Darwin/Vsync.cpp @@ -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 + + +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)); +} diff --git a/stepmania/src/archutils/Darwin/Vsync.h b/stepmania/src/archutils/Darwin/Vsync.h new file mode 100644 index 0000000000..033b1b429e --- /dev/null +++ b/stepmania/src/archutils/Darwin/Vsync.h @@ -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);