implement GL screen sync for Cocoa canvases
This commit is contained in:
parent
8bfd1bb25e
commit
4daafb2357
|
@ -6,7 +6,7 @@
|
|||
"data-lib"
|
||||
["base" #:version "6.2.900.17"]
|
||||
"syntax-color-lib"
|
||||
["draw-lib" #:version "1.9"]
|
||||
["draw-lib" #:version "1.10"]
|
||||
"snip-lib"
|
||||
"wxme-lib"
|
||||
"pict-lib"
|
||||
|
|
|
@ -383,7 +383,9 @@
|
|||
(define/override (get-cocoa-content) content-cocoa)
|
||||
|
||||
(define is-gl? (and (not is-combo?) (memq 'gl style)))
|
||||
(define want-sync-gl? (and is-gl? gl-config (send gl-config get-sync-swap)))
|
||||
(define/public (can-gl?) is-gl?)
|
||||
(define/public (sync-gl?) want-sync-gl?)
|
||||
|
||||
(define dc #f)
|
||||
(define blits null)
|
||||
|
|
|
@ -51,14 +51,13 @@
|
|||
(define/override (do-swap-buffers)
|
||||
(tellv gl-ctx flushBuffer))
|
||||
(super-new)))])
|
||||
;; Disable screen sync for GL flushBuffer; otherwise,
|
||||
;; By default, disable screen sync for GL flushBuffer; otherwise,
|
||||
;; flushBuffer can take around 10 msec depending on the timing
|
||||
;; of event polling, and that can be bad for examples like gears.
|
||||
;; Maybe whether to sync with the screen should be a configuration
|
||||
;; option, but I can't tell the difference on my screen.
|
||||
(tellv gl-ctx setValues:
|
||||
#:type (_ptr i _long) 0
|
||||
forParameter: #:type _int NSOpenGLCPSwapInterval)
|
||||
(unless (send canvas sync-gl?)
|
||||
(tellv gl-ctx setValues:
|
||||
#:type (_ptr i _long) 0
|
||||
forParameter: #:type _int NSOpenGLCPSwapInterval))
|
||||
(set! gl g)
|
||||
g)))))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user