Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorErwin Coumans <blender@erwincoumans.com>2006-12-03 01:25:47 +0300
committerErwin Coumans <blender@erwincoumans.com>2006-12-03 01:25:47 +0300
commit438d114f1ac3c8eaa4c1d9d8ffa31271a51c85e6 (patch)
tree030c8c62a46ed0b3a527eb7cc25e277e303c59f5 /intern
parent08ef0d346653bbe746231fdd3c94b5b3313a84a5 (diff)
- GEadded VSYNC for Mac OS X swapbuffers (can be easily undone by commenting out the #define WAIT_FOR_VSYNC 1
- GEdon't crash when attempting to add constraint on game objects without physics controller - GEimproved some physics -> graphics synchronization issues - small experiment with game engine timing to smooth framerate/reduce tearing
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_WindowCarbon.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_WindowCarbon.cpp b/intern/ghost/intern/GHOST_WindowCarbon.cpp
index 4484ec54da6..2fe03fd6664 100644
--- a/intern/ghost/intern/GHOST_WindowCarbon.cpp
+++ b/intern/ghost/intern/GHOST_WindowCarbon.cpp
@@ -403,9 +403,19 @@ GHOST_TSuccess GHOST_WindowCarbon::setOrder(GHOST_TWindowOrder order)
return GHOST_kSuccess;
}
+#define WAIT_FOR_VSYNC 1
+#ifdef WAIT_FOR_VSYNC
+#include <OpenGL/OpenGL.h>
+#endif
GHOST_TSuccess GHOST_WindowCarbon::swapBuffers()
{
+#ifdef WAIT_FOR_VSYNC
+/* wait for vsync, to avoid tearing artifacts */
+long VBL = 1;
+CGLSetParameter(CGLGetCurrentContext(), kCGLCPSwapInterval, &VBL);
+#endif
+
GHOST_TSuccess succeeded = GHOST_kSuccess;
if (m_drawingContextType == GHOST_kDrawingContextTypeOpenGL) {
if (m_aglCtx) {