Comments (6)
can you point me at the line I'll take a look whether it's stale code
from livecodelab.
https://github.com/davidedc/livecodelab/blob/master/coffee/core/animation-loop.coffee#L103-121
It's basically all that code. We have the global shim being pulled in, and we never really have a reason not to use requestAnimationFrame and force using timeouts instead.
just feels like code that isn't really needed and could be removed
from livecodelab.
it is possible that this was experimental code and it's now stale, let me check with a clear head tomorrow
from livecodelab.
no worries, it's been in there pretty much as long as I can remember heh
from livecodelab.
oh, yes, you found it, that piece of code "caps" the framerate then, which might be useful to do, as the requestAnimationFrame normally fires "as fast as possible".
There must be a better way to cap the framerate though: by using the timeout and then invoking requestAnimationFrame, rather than how it's done here (using timeouts only).
The advantage of using requestAnimationFrame also in the "capped fps" scenario is that requestAnimationFrame is more efficient and consolidates several repaints together (say, the ones from codemirror and the ones from the canvas(es))...
from livecodelab.
so just having a look at this again. found this
http://creativejs.com/resources/requestanimationframe/
shows almost exactly the technique you thought up @davidedc
if we still care about setting the framerate then it would be good to implement
from livecodelab.
Related Issues (20)
- backgroundViaCanvas in BackgroundPainter HOT 5
- Use a monospaced font HOT 2
- axes HOT 2
- Implementing thick lines (and renaming "stroke" to skeleton?) HOT 4
- labels HOT 5
- documentation HOT 14
- Syntax for inlining of function calls HOT 2
- bpm without arguments sends audio system in crazy spin
- Build problems... 'Local Npm module "grunt-contrib-copy" (and others) not found.' HOT 7
- comments in live lang V2
- Investigate Electron for building an LCL desktop app HOT 3
- Switch from coffee script to ES2015?
- Stroke Size broken on IE11 HOT 1
- offline version (at least for Chrome)
- Chrome app (for chromebooks)
- Syntax highlighting of trailing comments backtrack to first slash of line HOT 2
- Add audio beat detection
- Novation launchpad integration HOT 5
- Feature request: volume parameter for audio samples
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from livecodelab.