Add vsync for OS X.

This commit is contained in:
Steve Checkoway
2003-09-22 11:14:31 +00:00
parent 9f5c43d8a6
commit 445c593b2a
3 changed files with 37 additions and 0 deletions
+8
View File
@@ -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");
+19
View File
@@ -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));
}
+10
View File
@@ -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);