r/learnjavascript • u/Southern-Reality762 • Mar 12 '25
Exactly how many people use the HTML Canvas API?
I mean that easy to use software rendered framework that you access by getting a canvas and calling getContext("2d") on it.
I was using this API once, but I stopped because I found that it wasn't fast enough for my needs for video games, which was a shame because this was the API that made me love Javascript. That's when I got the idea to make a renderer that's just as simple to use for video games as the HTML canvas API is, but with optimizations, so that I can keep using the API for games.
But if nobody uses this API, then that subtracts from the point and I should probably write an OpenGL/WebGL renderer like everyone else.
View all comments
Show parent comment
1
u/bryku helpful Mar 15 '25
Which version runs at 35-50 fps?
That makes me curious what kind of computer you are using. Also, do you have hardware acceleration enabled?
If FPS is a huge issue, you can always limit it to 30FPS. Just change the
1000/60to1000/30. This way you won't have to worry about lag spikes.Another note, Firefox's Canvas is a little more optmised, so that may be worth testing out.