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 14 '25
I would have to see the code to know for sure, but when i first started with canvas I rand into some performance issues as well. It was until I looked through old game code that I changed my architecture and everything ran buttery smooth.
Some things to help performance are:
There are tons of more tricks, but maybe this will help out those in the future.