From 9d522e77a9ac1f85c57236f00d5432e671f9169c Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 22 Apr 2012 05:12:16 +0200 Subject: Completing swap-interval implementation for OSX's CALayer usage. Closing Bug 555 - Based on Andres Colubri's initiative and commit 218d67fc0222d7709b21c45792d44501351939c4. - Reading real screen refresh rate ('stolen' from NEWT) - Properly handling swap-interval and vsync-to in native code - Increasing accuracy vsync-to to microseconds Tested manually w/ TestGearsES2AWT. --- make/stub_includes/opengl/macosx-window-system.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'make/stub_includes/opengl/macosx-window-system.h') diff --git a/make/stub_includes/opengl/macosx-window-system.h b/make/stub_includes/opengl/macosx-window-system.h index 347de6299..e7fe13553 100644 --- a/make/stub_includes/opengl/macosx-window-system.h +++ b/make/stub_includes/opengl/macosx-window-system.h @@ -55,7 +55,7 @@ void setContextTextureImageToPBuffer(NSOpenGLContext* ctx, NSOpenGLPixelBuffer* // NSOpenGLLayer* createNSOpenGLLayer(NSOpenGLContext* ctx, NSOpenGLPixelFormat* fmt, NSView* view, Bool opaque); NSOpenGLLayer* createNSOpenGLLayer(NSOpenGLContext* ctx, NSOpenGLPixelFormat* fmt, NSOpenGLPixelBuffer* pbuffer, Bool opaque, int texWidth, int texHeight); void setNSOpenGLLayerSwapInterval(NSOpenGLLayer* layer, int interval); -void waitUntilNSOpenGLLayerIsReady(NSOpenGLLayer* layer, long to_ms); +void waitUntilNSOpenGLLayerIsReady(NSOpenGLLayer* layer, long to_micros); void setNSOpenGLLayerNeedsDisplay(NSOpenGLLayer* glLayer); void releaseNSOpenGLLayer(NSOpenGLLayer *glLayer); @@ -67,3 +67,6 @@ void setSwapInterval(NSOpenGLContext* ctx, int interval); Bool setGammaRamp(int tableSize, float* redRamp, float* greenRamp, float* blueRamp); void resetGammaRamp(); +/* returns the screen refresh rate in Hz */ +int getScreenRefreshRate(int scrn_idx); + -- cgit v1.2.3