diff options
author | Sven Gothel <[email protected]> | 2012-04-22 05:12:16 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-04-22 05:12:16 +0200 |
commit | 9d522e77a9ac1f85c57236f00d5432e671f9169c (patch) | |
tree | 79c86efc114560393c6e870f55365c2726307130 /make/stub_includes/opengl/macosx-window-system.h | |
parent | 218d67fc0222d7709b21c45792d44501351939c4 (diff) |
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.
Diffstat (limited to 'make/stub_includes/opengl/macosx-window-system.h')
-rw-r--r-- | make/stub_includes/opengl/macosx-window-system.h | 5 |
1 files changed, 4 insertions, 1 deletions
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); + |