Színkorrekciók
This commit is contained in:
1 parent
34a6df5949
commit
a1ff3beb35
471 files changed
+63615
-6
No files matched your search
+17
@@ -0,0 +1,17 @@
|
||||
import { time } from '../../frameloop/sync-time.mjs';
|
||||
import { frame, cancelFrame, frameData } from '../../frameloop/frame.mjs';
|
||||
|
||||
const frameloopDriver = (update) => {
|
||||
const passTimestamp = ({ timestamp }) => update(timestamp);
|
||||
return {
|
||||
start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),
|
||||
stop: () => cancelFrame(passTimestamp),
|
||||
/**
|
||||
* If we're processing this frame we can use the
|
||||
* framelocked timestamp to keep things in sync.
|
||||
*/
|
||||
now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),
|
||||
};
|
||||
};
|
||||
|
||||
export { frameloopDriver };
|
||||
Reference in new issue
Block a user